chore(ci): formatting

This commit is contained in:
arcnmx 2024-02-23 10:54:40 -08:00
parent ef5306904c
commit 6e882b5342
11 changed files with 30 additions and 44 deletions

View file

@ -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[@]}" "$@"

View file

@ -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"

View file

@ -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} "$@"
'';

View file

@ -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" ''

View file

@ -1,7 +1,4 @@
{
meta,
...
}: {
{meta, ...}: {
imports = let
inherit (meta) nixos;
in [

View file

@ -1,7 +1,4 @@
{
meta,
...
}: {
{meta, ...}: {
imports = with meta; [
nixos.reisen-ct
];

View file

@ -1,7 +1,4 @@
{
meta,
...
}: {
{meta, ...}: {
imports = let
inherit (meta) nixos;
in [

View file

@ -62,8 +62,7 @@ in {
"music/raw"
];
};
in
[libraryDir];
in [libraryDir];
};
hardware.opengl = {

View file

@ -1,7 +1,4 @@
{
meta,
...
}: {
{meta, ...}: {
imports = let
inherit (meta) nixos;
in [