Compare commits

...

2 commits

4 changed files with 17 additions and 10 deletions

View file

@ -29,8 +29,8 @@ _: {
packages = [
pkgs.nebula
pkgs.bitwarden-cli
self'.packages.nebula-regen-host-cert
self'.packages.nebula-regen-all-host-certs
self'.packages.nebula-recert-host
self'.packages.nebula-recert-all-hosts
];
shellHook = ''

View file

@ -10,9 +10,16 @@
{
packages =
"${self}/scripts"
|> builtins.readDir
|> lib.attrNames
|> lib.map (name: name |> lib.removeSuffix ".nix")
|> self.lib.genAttrs (name: import "${self}/scripts/${name}.nix" { inherit self' pkgs lib; });
|> 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;
};
}

View file

@ -1,11 +1,11 @@
{ self', pkgs, ... }:
pkgs.writeShellApplication {
name = "nebula-regen-all-host-certs";
name = "nebula-recert-all-hosts";
runtimeInputs = [
pkgs.bitwarden-cli
pkgs.jq
self'.packages.nebula-regen-host-cert
self'.packages.nebula-recert-host
];
text = ''
@ -23,7 +23,7 @@ pkgs.writeShellApplication {
for host in $hosts; do
echo "Regenerating certificate for $host..."
nebula-regen-host-cert "$host" "$ca_key"
nebula-recert-host "$host" "$ca_key"
done
echo "Done!"

View file

@ -1,6 +1,6 @@
{ pkgs, ... }:
pkgs.writeShellApplication {
name = "nebula-regen-host-cert";
name = "nebula-recert-host";
runtimeInputs = [
pkgs.nebula