Compare commits

...

4 commits

8 changed files with 39 additions and 54 deletions

View file

@ -7,19 +7,19 @@
lib, 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 = packages =
"${self}/scripts" "${self}/scripts" |> lib.filesystem.listFilesRecursive |> lib.map mkScript |> lib.listToAttrs;
|> 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

@ -2,27 +2,25 @@
{ {
perSystem = perSystem =
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let
mkTest = dir: rec {
name = "${dir}-test";
value = pkgs.testers.runNixOSTest (
{
inherit name;
}
// import "${self}/tests/${dir}" {
inherit
inputs
self
pkgs
lib
;
}
);
};
in
{ {
checks = checks = "${self}/tests" |> builtins.readDir |> lib.attrNames |> lib.map mkTest |> lib.listToAttrs;
"${self}/tests"
|> builtins.readDir
|> lib.attrNames
|> lib.map (name: {
name = "${name}-test";
value = pkgs.testers.runNixOSTest (
{
name = "${name}-test";
}
// import "${self}/tests/${name}" {
inherit
inputs
self
pkgs
lib
;
}
);
})
|> lib.listToAttrs;
}; };
} }

View file

@ -70,6 +70,6 @@
./flake-parts ./flake-parts
|> builtins.readDir |> builtins.readDir
|> builtins.attrNames |> builtins.attrNames
|> builtins.map (name: ./flake-parts + "/${name}"); |> builtins.map (name: ./flake-parts/${name});
}; };
} }

View file

@ -11,7 +11,7 @@ in
options.custom.networking.overlay = { options.custom.networking.overlay = {
networkCidr = lib.mkOption { networkCidr = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
default = ""; default = "10.254.250.0/24";
}; };
networkAddress = lib.mkOption { networkAddress = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
@ -25,7 +25,7 @@ in
}; };
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
default = ""; default = "splitleaf.de";
}; };
fqdn = lib.mkOption { fqdn = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
@ -43,11 +43,11 @@ in
}; };
interface = lib.mkOption { interface = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
default = ""; default = "nebula";
}; };
systemdUnit = lib.mkOption { systemdUnit = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
default = ""; default = "nebula@mesh.service";
}; };
isLighthouse = lib.mkEnableOption ""; isLighthouse = lib.mkEnableOption "";

View file

@ -51,13 +51,6 @@ in
message = "`${netCfg.hostName}` is a Nebula lighthouse, but `underlay.isPublic` is not set. Lighthouses must be publicly reachable."; message = "`${netCfg.hostName}` is a Nebula lighthouse, but `underlay.isPublic` is not set. Lighthouses must be publicly reachable.";
}; };
custom.networking.overlay = {
networkCidr = "10.254.250.0/24";
domain = "splitleaf.de";
interface = "nebula";
systemdUnit = "nebula@mesh.service";
};
sops.secrets."nebula/host-key" = lib.mkIf (cfg.privateKeyPath == null) { sops.secrets."nebula/host-key" = lib.mkIf (cfg.privateKeyPath == null) {
owner = config.users.users.nebula-mesh.name; owner = config.users.users.nebula-mesh.name;
restartUnits = [ "nebula@mesh.service" ]; restartUnits = [ "nebula@mesh.service" ];

View file

@ -1,7 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
pkgs.writeShellApplication { {
name = "install-anywhere";
runtimeInputs = [ runtimeInputs = [
pkgs.sops pkgs.sops
pkgs.ssh-to-age pkgs.ssh-to-age

View file

@ -1,7 +1,5 @@
{ self', pkgs, ... }: { self', pkgs, ... }:
pkgs.writeShellApplication { {
name = "nebula-recert-all-hosts";
runtimeInputs = [ runtimeInputs = [
pkgs.bitwarden-cli pkgs.bitwarden-cli
pkgs.jq pkgs.jq

View file

@ -1,7 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
pkgs.writeShellApplication { {
name = "nebula-recert-host";
runtimeInputs = [ runtimeInputs = [
pkgs.nebula pkgs.nebula
pkgs.bitwarden-cli pkgs.bitwarden-cli