fix(samba): accounts

This commit is contained in:
arcnmx 2024-02-09 13:55:44 -08:00
parent 5dcd5a5be0
commit 8335b8f3a0
12 changed files with 164 additions and 37 deletions

View file

@ -8,10 +8,13 @@
name,
attr ? name,
subdir ? null,
}:
pkgs.writeShellScriptBin name ''
exe ? null,
}: let
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 run ''${FLAKE_OPTS-} "$NF_CONFIG_ROOT#${attr}" -- "$@"
exec nix ${subcommand} ''${FLAKE_OPTS-} "$NF_CONFIG_ROOT#${attr}" ${exeArg} "$@"
'';
nf-actions = pkgs.writeShellScriptBin "nf-actions" ''
NF_CONFIG_FILES=($NF_CONFIG_ROOT/ci/{nodes,flake-cron}.nix)
@ -84,6 +87,11 @@
name = "deploy";
attr = "deploy-rs";
})
(mkWrapper rec {
name = "smbencrypt";
attr = "pkgs.freeradius";
exe = name;
})
];
shellHook = ''
export NIX_BIN_DIR=$(dirname $(readlink -f $(type -P nix)))