Compare commits

..

4 commits

8 changed files with 39 additions and 54 deletions

View file

@ -7,19 +7,19 @@
lib, lib,
... ...
}: }:
{ let
packages = mkScript = file: rec {
"${self}/scripts"
|> lib.filesystem.listFilesRecursive
|> lib.map (file: {
name = name =
file file
|> lib.unsafeDiscardStringContext |> lib.unsafeDiscardStringContext
|> lib.removePrefix "${self}/scripts/" |> lib.removePrefix "${self}/scripts/"
|> lib.removeSuffix ".nix" |> lib.removeSuffix ".nix"
|> lib.replaceString "/" "-"; |> lib.replaceString "/" "-";
value = import file { inherit self' pkgs lib; }; value = pkgs.writeShellApplication ({ inherit name; } // import file { inherit self' pkgs lib; });
}) };
|> lib.listToAttrs; in
{
packages =
"${self}/scripts" |> lib.filesystem.listFilesRecursive |> lib.map mkScript |> lib.listToAttrs;
}; };
} }

View file

@ -2,18 +2,14 @@
{ {
perSystem = perSystem =
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ let
checks = mkTest = dir: rec {
"${self}/tests" name = "${dir}-test";
|> builtins.readDir
|> lib.attrNames
|> lib.map (name: {
name = "${name}-test";
value = pkgs.testers.runNixOSTest ( value = pkgs.testers.runNixOSTest (
{ {
name = "${name}-test"; inherit name;
} }
// import "${self}/tests/${name}" { // import "${self}/tests/${dir}" {
inherit inherit
inputs inputs
self self
@ -22,7 +18,9 @@
; ;
} }
); );
}) };
|> lib.listToAttrs; in
{
checks = "${self}/tests" |> builtins.readDir |> lib.attrNames |> lib.map mkTest |> 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