diff --git a/flake-parts/scripts.nix b/flake-parts/scripts.nix index 7308cc4..37d9ead 100644 --- a/flake-parts/scripts.nix +++ b/flake-parts/scripts.nix @@ -7,19 +7,19 @@ lib, ... }: + let + mkScript = file: rec { + name = + file + |> lib.unsafeDiscardStringContext + |> lib.removePrefix "${self}/scripts/" + |> lib.removeSuffix ".nix" + |> lib.replaceString "/" "-"; + value = pkgs.writeShellApplication ({ inherit name; } // import file { inherit self' pkgs lib; }); + }; + in { packages = - "${self}/scripts" - |> lib.filesystem.listFilesRecursive - |> lib.map (file: { - name = - file - |> lib.unsafeDiscardStringContext - |> lib.removePrefix "${self}/scripts/" - |> lib.removeSuffix ".nix" - |> lib.replaceString "/" "-"; - value = import file { inherit self' pkgs lib; }; - }) - |> lib.listToAttrs; + "${self}/scripts" |> lib.filesystem.listFilesRecursive |> lib.map mkScript |> lib.listToAttrs; }; } diff --git a/scripts/install-anywhere.nix b/scripts/install-anywhere.nix index 17e5c0b..5fbd3b0 100644 --- a/scripts/install-anywhere.nix +++ b/scripts/install-anywhere.nix @@ -1,7 +1,5 @@ { pkgs, ... }: -pkgs.writeShellApplication { - name = "install-anywhere"; - +{ runtimeInputs = [ pkgs.sops pkgs.ssh-to-age diff --git a/scripts/nebula/recert-all-hosts.nix b/scripts/nebula/recert-all-hosts.nix index f7526b6..e70c09b 100644 --- a/scripts/nebula/recert-all-hosts.nix +++ b/scripts/nebula/recert-all-hosts.nix @@ -1,7 +1,5 @@ { self', pkgs, ... }: -pkgs.writeShellApplication { - name = "nebula-recert-all-hosts"; - +{ runtimeInputs = [ pkgs.bitwarden-cli pkgs.jq diff --git a/scripts/nebula/recert-host.nix b/scripts/nebula/recert-host.nix index 1aff425..50cf6f3 100644 --- a/scripts/nebula/recert-host.nix +++ b/scripts/nebula/recert-host.nix @@ -1,7 +1,5 @@ { pkgs, ... }: -pkgs.writeShellApplication { - name = "nebula-recert-host"; - +{ runtimeInputs = [ pkgs.nebula pkgs.bitwarden-cli