mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
chore(ci): formatting
This commit is contained in:
parent
ef5306904c
commit
6e882b5342
11 changed files with 30 additions and 44 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
exec nf-alejandra "${NF_NIX_WHITELIST_FILES[@]}" "$@"
|
||||
exec nf-alejandra "${NF_NIX_WHITELIST_DIRS[@]}" "${NF_NIX_WHITELIST_FILES[@]}" "$@"
|
||||
|
|
|
|||
18
ci/fmt.nix
18
ci/fmt.nix
|
|
@ -1,27 +1,17 @@
|
|||
{
|
||||
nix = {
|
||||
whitelist = [
|
||||
"systems/default.nix"
|
||||
"systems/ct/default.nix"
|
||||
"systems/ct/nixos.nix"
|
||||
"systems/hakurei/default.nix"
|
||||
"systems/kuwubernetes/default.nix"
|
||||
"systems/kuwubernetes/nixos.nix"
|
||||
"systems/mediabox/default.nix"
|
||||
"systems/mediabox/nixos.nix"
|
||||
"systems/reimu/default.nix"
|
||||
"systems/tei/default.nix"
|
||||
"systems/tei/nixos.nix"
|
||||
"systems/tei/cloudflared.nix"
|
||||
"systems/tewi/default.nix"
|
||||
"systems/tewi/nixos.nix"
|
||||
"overlays/default.nix"
|
||||
"ci/fmt.nix"
|
||||
"devShells.nix"
|
||||
"shell.nix"
|
||||
"lib.nix"
|
||||
"outputs.nix"
|
||||
"tree.nix"
|
||||
];
|
||||
whitelistDirs = [
|
||||
"systems"
|
||||
];
|
||||
blacklistDirs = [
|
||||
"overlays"
|
||||
"ci"
|
||||
|
|
|
|||
|
|
@ -10,9 +10,16 @@
|
|||
subdir ? null,
|
||||
exe ? null,
|
||||
}: let
|
||||
subcommand = if exe == null then "run" else "shell";
|
||||
exeArg = if exe == null then "--" else "-c ${exe}";
|
||||
in pkgs.writeShellScriptBin name ''
|
||||
subcommand =
|
||||
if exe == null
|
||||
then "run"
|
||||
else "shell";
|
||||
exeArg =
|
||||
if exe == null
|
||||
then "--"
|
||||
else "-c ${exe}";
|
||||
in
|
||||
pkgs.writeShellScriptBin name ''
|
||||
${optionalString (subdir != null) ''cd "$NF_CONFIG_ROOT${subdir}"''}
|
||||
exec nix ${subcommand} ''${FLAKE_OPTS-} "$NF_CONFIG_ROOT#${attr}" ${exeArg} "$@"
|
||||
'';
|
||||
|
|
|
|||
6
lib.nix
6
lib.nix
|
|
@ -29,9 +29,9 @@
|
|||
nibble0 + (fixedWidthString 1 "0" (toHexStringLower nibble1));
|
||||
in "${part0 (part 0)}${part 1}:${part 2}ff:fe${part 3}:${part 4}${part 5}";
|
||||
|
||||
userIs = group: user: builtins.elem group (user.extraGroups ++ [ user.group ]);
|
||||
userIs = group: user: builtins.elem group (user.extraGroups ++ [user.group]);
|
||||
|
||||
mkWinPath = replaceStrings [ "/" ] [ "\\" ];
|
||||
mkWinPath = replaceStrings ["/"] ["\\"];
|
||||
in {
|
||||
inherit tree nixlib inputs;
|
||||
std = inputs.self.lib.Std.Std.compat;
|
||||
|
|
@ -40,5 +40,5 @@ in {
|
|||
inherit mkWinPath userIs eui64 toHexStringLower hexCharToInt;
|
||||
inherit (inputs.arcexprs.lib) unmerged;
|
||||
};
|
||||
generate = import ./generate.nix { inherit inputs tree; };
|
||||
generate = import ./generate.nix {inherit inputs tree;};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
'';
|
||||
exportsFmtNix = ''
|
||||
NF_NIX_BLACKLIST_DIRS=(${string.concatMapSep " " string.escapeShellArg fmt.nix.blacklistDirs})
|
||||
NF_NIX_WHITELIST_DIRS=(${string.concatMapSep " " string.escapeShellArg fmt.nix.whitelistDirs})
|
||||
NF_NIX_WHITELIST_FILES=(${string.concatMapSep " " string.escapeShellArg fmt.nix.whitelist})
|
||||
'';
|
||||
output = {
|
||||
|
|
@ -110,6 +111,7 @@
|
|||
nf-alejandra = pkgs.writeShellScriptBin "nf-alejandra" ''
|
||||
${exports}
|
||||
${exportsFmtNix}
|
||||
export PATH="${makeBinPath [ packages.alejandra ]}:$PATH"
|
||||
source ${../ci/alejandra.sh}
|
||||
'';
|
||||
nf-lint-tf = pkgs.writeShellScriptBin "nf-lint-tf" ''
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
meta,
|
||||
...
|
||||
}: {
|
||||
{meta, ...}: {
|
||||
imports = let
|
||||
inherit (meta) nixos;
|
||||
in [
|
||||
|
|
@ -28,11 +25,11 @@
|
|||
enable = true;
|
||||
rejectLocaladdrs = true;
|
||||
serviceSettings = rec {
|
||||
wants = [ "localaddrs.service" ];
|
||||
wants = ["localaddrs.service"];
|
||||
after = wants;
|
||||
};
|
||||
};
|
||||
interfaces.eth1 = { };
|
||||
interfaces.eth1 = {};
|
||||
};
|
||||
systemd.network.networks.eth0 = {
|
||||
name = "eth0";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
meta,
|
||||
...
|
||||
}: {
|
||||
{meta, ...}: {
|
||||
imports = with meta; [
|
||||
nixos.reisen-ct
|
||||
];
|
||||
|
|
|
|||
|
|
@ -32,15 +32,15 @@ in {
|
|||
};
|
||||
|
||||
services.openssh = {
|
||||
ports = mkAfter [ sshPort ];
|
||||
ports = mkAfter [sshPort];
|
||||
};
|
||||
# required for kbd or password authentication
|
||||
security.pam.services.sshd.unixAuth = mkForce true;
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ sshPort ];
|
||||
networking.firewall.allowedTCPPorts = [sshPort];
|
||||
|
||||
sops.secrets = {
|
||||
tf-proxmox-passwd = { };
|
||||
tf-proxmox-passwd = {};
|
||||
tf-proxmox-identity = {
|
||||
owner = username;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
meta,
|
||||
...
|
||||
}: {
|
||||
{meta, ...}: {
|
||||
imports = let
|
||||
inherit (meta) nixos;
|
||||
in [
|
||||
|
|
|
|||
|
|
@ -62,8 +62,7 @@ in {
|
|||
"music/raw"
|
||||
];
|
||||
};
|
||||
in
|
||||
[libraryDir];
|
||||
in [libraryDir];
|
||||
};
|
||||
|
||||
hardware.opengl = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
meta,
|
||||
...
|
||||
}: {
|
||||
{meta, ...}: {
|
||||
imports = let
|
||||
inherit (meta) nixos;
|
||||
in [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue