Compare commits

..

No commits in common. "050d607cd3ce6e22e9502db68c1431eea263f073" and "68be1140177555f6b0a62ca1dda534f46f8979df" have entirely different histories.

8 changed files with 54 additions and 39 deletions

View file

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

View file

@ -2,14 +2,18 @@
{ {
perSystem = perSystem =
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let {
mkTest = dir: rec { checks =
name = "${dir}-test"; "${self}/tests"
|> builtins.readDir
|> lib.attrNames
|> lib.map (name: {
name = "${name}-test";
value = pkgs.testers.runNixOSTest ( value = pkgs.testers.runNixOSTest (
{ {
inherit name; name = "${name}-test";
} }
// import "${self}/tests/${dir}" { // import "${self}/tests/${name}" {
inherit inherit
inputs inputs
self self
@ -18,9 +22,7 @@
; ;
} }
); );
}; })
in |> lib.listToAttrs;
{
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 = "10.254.250.0/24"; default = "";
}; };
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 = "splitleaf.de"; default = "";
}; };
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 = "nebula"; default = "";
}; };
systemdUnit = lib.mkOption { systemdUnit = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
default = "nebula@mesh.service"; default = "";
}; };
isLighthouse = lib.mkEnableOption ""; isLighthouse = lib.mkEnableOption "";

View file

@ -51,6 +51,13 @@ 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,5 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ pkgs.writeShellApplication {
name = "install-anywhere";
runtimeInputs = [ runtimeInputs = [
pkgs.sops pkgs.sops
pkgs.ssh-to-age pkgs.ssh-to-age

View file

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