diff --git a/cluster/default.nix b/cluster/default.nix index 97ab73c..54a8969 100644 --- a/cluster/default.nix +++ b/cluster/default.nix @@ -16,6 +16,8 @@ lib.evalModules { ./lib/port-magic-multi.nix ./lib/mesh.nix ./lib/secrets.nix + ./lib/testing.nix + ./lib/lib.nix ./import-services.nix ]; diff --git a/cluster/lib/inject-nixos-config.nix b/cluster/lib/inject-nixos-config.nix index 6e5add1..4523b96 100644 --- a/cluster/lib/inject-nixos-config.nix +++ b/cluster/lib/inject-nixos-config.nix @@ -2,9 +2,9 @@ with lib; { - options.out.injectNixosConfig = mkOption { - description = "NixOS configuration to inject into the given host."; - type = with types; functionTo raw; + options.out = mkOption { + description = "Output functions."; + type = with types; lazyAttrsOf (functionTo raw); default = const []; }; } diff --git a/cluster/lib/lib.nix b/cluster/lib/lib.nix new file mode 100644 index 0000000..1aedf13 --- /dev/null +++ b/cluster/lib/lib.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: + +{ + options.lib = { + forService = lib.mkOption { + description = "Enable these definitions for a particular service only."; + type = lib.types.functionTo lib.types.raw; + readOnly = true; + default = service: lib.mkIf (!config.simulacrum || lib.any (s: s == service) config.testConfig.activeServices); + }; + }; +} diff --git a/cluster/lib/service-module.nix b/cluster/lib/service-module.nix index 3ef8c98..2fb07e7 100644 --- a/cluster/lib/service-module.nix +++ b/cluster/lib/service-module.nix @@ -52,6 +52,24 @@ in })); default = {}; }; + simulacrum = { + enable = mkEnableOption "testing this service in the Simulacrum"; + deps = mkOption { + description = "Other services to include."; + type = with types; listOf str; + default = []; + }; + settings = mkOption { + description = "NixOS test configuration."; + type = types.deferredModule; + default = {}; + }; + augments = mkOption { + description = "Cluster augments (will be propagated)."; + type = types.deferredModule; + default = {}; + }; + }; }; config.otherNodes = builtins.mapAttrs (const filterGroup) config.nodes; } diff --git a/cluster/lib/services.nix b/cluster/lib/services.nix index b500f1b..4e9f8bc 100644 --- a/cluster/lib/services.nix +++ b/cluster/lib/services.nix @@ -39,7 +39,11 @@ in default = {}; }; - config.out.injectNixosConfig = hostName: (lib.flatten (lib.mapAttrsToList (getHostConfigurations hostName) config.services)) ++ [ - introspectionModule - ]; + config.out = { + injectNixosConfigForServices = services: hostName: (lib.flatten (lib.mapAttrsToList (getHostConfigurations hostName) (lib.getAttrs services config.services))) ++ [ + introspectionModule + ]; + + injectNixosConfig = config.out.injectNixosConfigForServices (lib.attrNames config.services); + }; } diff --git a/cluster/lib/testing.nix b/cluster/lib/testing.nix new file mode 100644 index 0000000..90c9106 --- /dev/null +++ b/cluster/lib/testing.nix @@ -0,0 +1,15 @@ +{ lib, ... }: + +{ + options = { + simulacrum = lib.mkOption { + description = "Whether we are in the Simulacrum."; + type = lib.types.bool; + default = false; + }; + testConfig = lib.mkOption { + type = lib.types.attrs; + readOnly = true; + }; + }; +} diff --git a/cluster/part.nix b/cluster/part.nix index eae3222..58e93b3 100644 --- a/cluster/part.nix +++ b/cluster/part.nix @@ -3,6 +3,7 @@ { imports = [ ./catalog + ./simulacrum/checks.nix ]; options.cluster = lib.mkOption { diff --git a/cluster/services/wireguard/default.nix b/cluster/services/wireguard/default.nix index a1f25eb..b3ba747 100644 --- a/cluster/services/wireguard/default.nix +++ b/cluster/services/wireguard/default.nix @@ -10,6 +10,19 @@ let }; getExtAddr = host: host.interfaces.primary.addrPublic; + + snakeoilPublicKeys = { + checkmate = "TESTtbFybW5YREwtd18a1A4StS4YAIUS5/M1Lv0jHjA="; + grail = "TEsTh7bthkaDh9A1CpqDi/F121ao5lRZqIJznLH8mB4="; + thunderskin = "tEST6afFmVN18o+EiWNFx+ax3MJwdQIeNfJSGEpffXw="; + VEGAS = "tEsT6s7VtM5C20eJBaq6UlQydAha8ATlmrTRe9T5jnM="; + prophet = "TEstYyb5IoqSL53HbSQwMhTaR16sxcWcMmXIBPd+1gE="; + }; + + grease = hourName: realPublicKey: if config.simulacrum then + snakeoilPublicKeys.${hourName} + else + realPublicKey; in { vars = { @@ -22,7 +35,7 @@ in extra = { meshIp = "10.1.1.32"; inherit meshNet; - pubKey = "fZMB9CDCWyBxPnsugo3Uxm/TIDP3VX54uFoaoC0bP3U="; + pubKey = grease "checkmate" "fZMB9CDCWyBxPnsugo3Uxm/TIDP3VX54uFoaoC0bP3U="; extraRoutes = []; }; }; @@ -31,7 +44,7 @@ in extra = { meshIp = "10.1.1.6"; inherit meshNet; - pubKey = "0WAiQGdWySsGWFUk+a9e0I+BDTKwTyWQdFT2d7BMfDQ="; + pubKey = grease "grail" "0WAiQGdWySsGWFUk+a9e0I+BDTKwTyWQdFT2d7BMfDQ="; extraRoutes = []; }; }; @@ -40,7 +53,7 @@ in extra = { meshIp = "10.1.1.4"; inherit meshNet; - pubKey = "xvSsFvCVK8h2wThZJ7E5K0fniTBIEIYOblkKIf3Cwy0="; + pubKey = grease "thunderskin" "xvSsFvCVK8h2wThZJ7E5K0fniTBIEIYOblkKIf3Cwy0="; extraRoutes = []; }; }; @@ -49,7 +62,7 @@ in extra = { meshIp = "10.1.1.5"; inherit meshNet; - pubKey = "NpeB8O4erGTas1pz6Pt7qtY9k45YV6tcZmvvA4qXoFk="; + pubKey = grease "VEGAS" "NpeB8O4erGTas1pz6Pt7qtY9k45YV6tcZmvvA4qXoFk="; extraRoutes = [ "${hours.VEGAS.interfaces.vstub.addr}/32" "10.10.0.0/16" ]; }; }; @@ -58,7 +71,7 @@ in extra = { meshIp = "10.1.1.9"; inherit meshNet; - pubKey = "MMZAbRtNE+gsLm6DJy9VN/Y39E69oAZnvOcFZPUAVDc="; + pubKey = grease "prophet" "MMZAbRtNE+gsLm6DJy9VN/Y39E69oAZnvOcFZPUAVDc="; extraRoutes = []; }; }; @@ -69,12 +82,20 @@ in storm = [ "VEGAS" ]; }; nixos = { - mesh = ./mesh.nix; - storm = ./storm.nix; + mesh = [ + ./mesh.nix + ] ++ lib.optionals config.simulacrum [ + ./simulacrum/snakeoil-keys.nix + ]; + storm = [ ./storm.nix ]; }; secrets.meshPrivateKey = { nodes = config.services.wireguard.nodes.mesh; shared = false; }; + simulacrum = { + enable = true; + settings = ./test.nix; + }; }; } diff --git a/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-VEGAS b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-VEGAS new file mode 100644 index 0000000..e15616d --- /dev/null +++ b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-VEGAS @@ -0,0 +1 @@ +MNvWpMluuzQvPyGTp7jtyPSyz6n9lIly/WX1gW2NAHg= diff --git a/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-checkmate b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-checkmate new file mode 100644 index 0000000..f498b5b --- /dev/null +++ b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-checkmate @@ -0,0 +1 @@ +YHzP8rBP6qiXs6ZdnvHop9KnCYRADIEejwZzAzvj8m4= diff --git a/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-grail b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-grail new file mode 100644 index 0000000..7496093 --- /dev/null +++ b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-grail @@ -0,0 +1 @@ +uD7X5E6N9d0sN+xPr/bWnehSa3bAok741GO7Z4I+Z3I= diff --git a/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-prophet b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-prophet new file mode 100644 index 0000000..d46aa5e --- /dev/null +++ b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-prophet @@ -0,0 +1 @@ +QHyIJ3HoKGGFN28qOrQP4UyoQMP5bM7Idn2MzayKzEM= diff --git a/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-thunderskin b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-thunderskin new file mode 100644 index 0000000..6088510 --- /dev/null +++ b/cluster/services/wireguard/simulacrum/keys/snakeoilPrivateKey-thunderskin @@ -0,0 +1 @@ +YLl+hkWaCWx/5PpWs3cQ+bKqYdJef/qZ+FMTsM9ammM= diff --git a/cluster/services/wireguard/simulacrum/snakeoil-keys.nix b/cluster/services/wireguard/simulacrum/snakeoil-keys.nix new file mode 100644 index 0000000..d3dd500 --- /dev/null +++ b/cluster/services/wireguard/simulacrum/snakeoil-keys.nix @@ -0,0 +1,6 @@ +{ lib, config, ... }: { + config.environment.etc = { + "dummy-secrets/cluster-wireguard-meshPrivateKey".source = lib.mkForce ./keys/snakeoilPrivateKey-${config.networking.hostName}; + "dummy-secrets/wireguard-key-storm".source = lib.mkForce ./keys/snakeoilPrivateKey-${config.networking.hostName}; + }; +} diff --git a/cluster/services/wireguard/test.nix b/cluster/services/wireguard/test.nix new file mode 100644 index 0000000..dfa7e92 --- /dev/null +++ b/cluster/services/wireguard/test.nix @@ -0,0 +1,26 @@ +{ cluster, lib, ... }: + +{ + testScript = '' + start_all() + ${lib.pipe cluster.config.services.wireguard.nodes.mesh [ + (map (node: /*python*/ '' + ${node}.wait_for_unit("wireguard-wgmesh.target") + '')) + (lib.concatStringsSep "\n") + ]} + + ${lib.pipe cluster.config.services.wireguard.nodes.mesh [ + (map (node: /*python*/ '' + with subtest("${node} can reach all other nodes"): + ${lib.pipe (cluster.config.services.wireguard.otherNodes.mesh node) [ + (map (peer: /*python*/ '' + ${node}.succeed("ping -c3 ${cluster.config.hostLinks.${peer}.mesh.extra.meshIp}") + '')) + (lib.concatStringsSep "\n ") + ]} + '')) + (lib.concatStringsSep "\n") + ]} + ''; +} diff --git a/cluster/simulacrum/checks.nix b/cluster/simulacrum/checks.nix new file mode 100644 index 0000000..bf3e918 --- /dev/null +++ b/cluster/simulacrum/checks.nix @@ -0,0 +1,16 @@ +{ config, extendModules, lib, ... }: + +{ + perSystem = { pkgs, system, ... }: { + checks = lib.mkIf (system == "x86_64-linux") (lib.mapAttrs' (name: svc: let + runSimulacrum = pkgs.callPackage ./. { + inherit config extendModules; + }; + in { + name = "simulacrum-${name}"; + value = runSimulacrum { + service = name; + }; + }) (lib.filterAttrs (_: svc: svc.simulacrum.enable) config.cluster.config.services)); + }; +} diff --git a/cluster/simulacrum/default.nix b/cluster/simulacrum/default.nix new file mode 100644 index 0000000..26eca7e --- /dev/null +++ b/cluster/simulacrum/default.nix @@ -0,0 +1,134 @@ +{ testers, config, extendModules, lib, system }: + +{ service }: + +let + serviceConfig = config.cluster.config.services.${service}; + serviceList = getDepsRecursive [] service; + allAugments = map (svc: config.cluster.config.services.${svc}.simulacrum.augments) serviceList; + + getDepsRecursive = acc: service: let + deps = lib.subtractLists acc config.cluster.config.services.${service}.simulacrum.deps; + acc' = acc ++ [ service ]; + recurse = getDepsRecursive acc'; + in lib.unique (lib.flatten ([ service ] ++ map recurse deps)); + + lift = config; + + snakeoil = { + ssh = { + public = lib.fileContents ../../packages/checks/snakeoil/ssh/snakeoil-key.pub; + private = ../../packages/checks/snakeoil/ssh/snakeoil-key; + }; + }; + + nodes = lib.attrNames config.gods.fromLight; + nodes' = lib.attrNames (config.gods.fromLight // { nowhere = null; }); + digits = lib.attrsets.listToAttrs (lib.zipListsWith lib.nameValuePair nodes' (lib.range 1 255)); + depot' = extendModules { + modules = [ + ({ config, ... }: { + gods.fromLight = lib.mapAttrs (name: cfg: { + interfaces.primary = { + link = lib.mkForce "vprimary"; + }; + ssh.id.publicKey = lib.mkForce snakeoil.ssh.public; + }) lift.gods.fromLight; + + cluster = lib.mkForce (lift.cluster.extendModules { + specialArgs.depot = config; + modules = [ + { + simulacrum = true; + testConfig = { + subject = service; + activeServices = serviceList; + }; + } + ]; + }); + }) + ]; + }; + specialArgs = depot'.config.lib.summon system lib.id; +in + +testers.runNixOSTest { + name = "simulacrum-${service}"; + + imports = [ + serviceConfig.simulacrum.settings + ./nowhere + { + nodes.nowhere.imports = [ + config.flake.nixosModules.port-magic + ]; + } + ] ++ allAugments; + + _module.args = { + inherit (depot'.config) cluster; + }; + + node = { inherit specialArgs; }; + nodes = lib.genAttrs nodes (node: let + hour = depot'.config.hours.${node}; + in { + imports = [ + specialArgs.depot.hours.${node}.nixos + ../../packages/checks/modules/nixos/age-dummy-secrets + ../../packages/checks/modules/nixos/external-storage.nix + ] ++ depot'.config.cluster.config.out.injectNixosConfigForServices serviceList node; + + boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; + networking = { + interfaces = { + ${hour.interfaces.primary.link} = { + useDHCP = lib.mkForce false; + virtual = true; + ipv4.addresses = lib.mkForce ([ + { + address = hour.interfaces.primary.addr; + prefixLength = 32; + } + ] ++ lib.optional hour.interfaces.primary.isNat { + address = hour.interfaces.primary.addrPublic; + prefixLength = 32; + }); + }; + eth1.ipv4.routes = lib.pipe nodes [ + (lib.filter (n: n != node)) + (map (n: let + hour = depot'.config.hours.${n}; + in { + address = hour.interfaces.primary.addrPublic; + prefixLength = 32; + via = "192.168.1.${toString digits.${n}}"; + })) + ]; + }; + + firewall.extraCommands = lib.mkAfter (lib.optionalString (hour.interfaces.primary.isNat) '' + # self-nat + iptables -t nat -A PREROUTING -d ${hour.interfaces.primary.addrPublic} -j DNAT --to-destination ${hour.interfaces.primary.addr} + iptables -t nat -A OUTPUT -d ${hour.interfaces.primary.addrPublic} -j DNAT --to-destination ${hour.interfaces.primary.addr} + iptables -t nat -A POSTROUTING -s ${hour.interfaces.primary.addr} -j SNAT --to-source ${hour.interfaces.primary.addrPublic} + ''); + }; + + systemd.services = { + hyprspace.enable = false; + }; + + environment.etc = { + "ssh/ssh_host_ed25519_key" = { + source = snakeoil.ssh.private; + mode = "0400"; + }; + }; + virtualisation = { + cores = 2; + memorySize = 4096; + }; + }); +} diff --git a/cluster/simulacrum/nowhere/default.nix b/cluster/simulacrum/nowhere/default.nix new file mode 100644 index 0000000..4e3aaaf --- /dev/null +++ b/cluster/simulacrum/nowhere/default.nix @@ -0,0 +1,101 @@ +{ cluster, config, lib, pkgs, ... }: + +let + lift = config; + + cfsslConfigIntermediateCA = pkgs.writeText "simulacrum-cfssl-config.json" (builtins.toJSON { + signing = { + default.expiry = "8760h"; + profiles.intermediate = { + expiry = "8760h"; + usages = [ + "cert sign" + "crl sign" + ]; + ca_constraint = { + is_ca = true; + max_path_len = 1; + }; + }; + }; + }); + + caCsr = pkgs.writeText "simulacrum-ca-csr.json" (builtins.toJSON { + CN = "Simulacrum Root CA"; + }); + + ca = pkgs.runCommand "simulacrum-snakeoil-ca" { + nativeBuildInputs = [ + pkgs.cfssl + ]; + } '' + mkdir $out + cfssl gencert --initca ${caCsr} | cfssljson --bare $out/ca + ''; + + genCert = extraFlags: csrData: let + csr = pkgs.writeText "simulacrum-csr.json" (builtins.toJSON csrData); + in pkgs.runCommand "simulacrum-snakeoil-cert" { + nativeBuildInputs = [ + pkgs.cfssl + ]; + } '' + mkdir $out + cfssl gencert ${lib.escapeShellArgs ([ + "--ca=file:${ca}/ca.pem" + "--ca-key=file:${ca}/ca-key.pem" + ] ++ extraFlags ++ [ + csr + ])} | cfssljson --bare $out/cert + ''; + + genHostCert = hostname: genCert [ "--hostname=${hostname}" ] { CN = hostname; }; + + getNodeAddr = node: (builtins.head config.nodes.${node}.networking.interfaces.eth1.ipv4.addresses).address; +in + +{ + imports = [ + ./options.nix + ]; + defaults = { + networking.hosts."${getNodeAddr "nowhere"}" = lib.attrNames config.nowhere.names; + security.pki.certificateFiles = [ + "${ca}/ca.pem" + ]; + }; + + nowhere.certs = { + inherit ca; + intermediate = genCert [ "--config=${cfsslConfigIntermediateCA}" "--profile=intermediate" ] { + CN = "Simulacrum Intermediate CA"; + }; + }; + + nodes.nowhere = { config, depot, ... }: { + networking = { + firewall.allowedTCPPorts = [ 443 ]; + interfaces.eth1.ipv4.routes = lib.mapAttrsToList (name: hour: { + address = hour.interfaces.primary.addrPublic; + prefixLength = 32; + via = getNodeAddr name; + }) depot.gods.fromLight; + nameservers = map (name: depot.hours.${name}.interfaces.primary.addrPublic) cluster.config.services.dns.nodes.authoritative; + }; + services.nginx = { + enable = true; + recommendedProxySettings = true; + virtualHosts = lib.mapAttrs (name: link: let + cert = genHostCert name; + in { + forceSSL = true; + sslCertificate = "${cert}/cert.pem"; + sslCertificateKey = "${cert}/cert-key.pem"; + locations."/" = { + proxyPass = config.links.${link}.url; + extraConfig = "proxy_ssl_verify off;"; + }; + }) lift.nowhere.names; + }; + }; +} diff --git a/cluster/simulacrum/nowhere/options.nix b/cluster/simulacrum/nowhere/options.nix new file mode 100644 index 0000000..b0420b6 --- /dev/null +++ b/cluster/simulacrum/nowhere/options.nix @@ -0,0 +1,16 @@ +{ lib, ... }: + +{ + options.nowhere = { + names = lib.mkOption { + description = "Hostnames that point Nowhere."; + type = with lib.types; attrsOf str; + default = {}; + }; + certs = lib.mkOption { + description = "Snakeoil certificate packages."; + type = with lib.types; attrsOf package; + default = {}; + }; + }; +} diff --git a/modules/motd/default.nix b/modules/motd/default.nix index be403a6..91417e1 100644 --- a/modules/motd/default.nix +++ b/modules/motd/default.nix @@ -1,4 +1,4 @@ -{ config, depot, pkgs, ... }: +{ cluster, config, depot, pkgs, ... }: { users.motd = builtins.readFile ./motd.txt; environment.interactiveShellInit = let @@ -8,6 +8,11 @@ grep = exec pkgs.gnugrep "grep"; countUsers = '' ${util "who"} -q | ${util "head"} -n1 | ${util "tr"} ' ' \\n | ${util "uniq"} | ${util "wc"} -l''; countSessions = '' ${util "who"} -q | ${util "head"} -n1 | ${util "wc"} -w''; + + rev = if cluster.config.simulacrum then + "simulacrum" + else + depot.rev or "\${BRED}(✘)\${CO}\${BWHITE} Dirty"; in '' ( # Reset colors @@ -40,7 +45,7 @@ echo -e " █ ''${BGREEN}(✓)''${CO} ''${BWHITE}You are using a genuine Private Void™ system.''${CO}" echo " █" echo -e " █ ''${BWHITE}OS Version....:''${CO} NixOS ''${CAB}${config.system.nixos.version}''${CO}" - echo -e " █ ''${BWHITE}Configuration.:''${CO} ''${CAB}${depot.rev or "\${BRED}(✘)\${CO}\${BWHITE} Dirty"}''${CO}" + echo -e " █ ''${BWHITE}Configuration.:''${CO} ''${CAB}${rev}''${CO}" echo -e " █ ''${BWHITE}Uptime........:''${CO} $(${uptime} -p | ${util "cut"} -d ' ' -f2- | GREP_COLORS='mt=01;35' ${grep} --color=always '[0-9]*')" echo -e " █ ''${BWHITE}SSH Logins....:''${CO} There are currently ''${CAB}$(${countUsers})''${CO} users logged in on ''${CAB}$(${countSessions})''${CO} sessions" ) diff --git a/packages/catalog/checks.nix b/packages/catalog/checks.nix index 1dab997..d8c2c72 100644 --- a/packages/catalog/checks.nix +++ b/packages/catalog/checks.nix @@ -1,21 +1,32 @@ { lib, ... }: { - perSystem = { config, ... }: { - catalog.depot = { - checks = lib.mapAttrs (name: check: { - description = "NixOS Test: ${name}"; - actions = { - build = { - description = "Build this check."; - command = "nix build -L --no-link '${builtins.unsafeDiscardStringContext check.drvPath}^*'"; - }; - runInteractive = { - description = "Run interactive driver."; - command = lib.getExe check.driverInteractive; - }; + perSystem = { config, pkgs, ... }: { + catalog = lib.mkMerge (lib.mapAttrsToList (name': check: let + simulacrum = lib.hasPrefix "simulacrum-" name'; + name = lib.removePrefix "simulacrum-" name'; + baseAttrPath = if simulacrum then + [ "cluster" "simulacrum" ] + else + [ "depot" "checks" ]; + in lib.setAttrByPath (baseAttrPath ++ [ name ]) { + description = if simulacrum then + "Simulacrum Test: ${name}" + else + "NixOS Test: ${name}"; + actions = { + build = { + description = "Build this check."; + command = "nix build -L --no-link '${builtins.unsafeDiscardStringContext check.drvPath}^*'"; }; - }) config.checks; - }; + runInteractive = { + description = "Run interactive driver."; + command = if simulacrum then + "${pkgs.bubblewrap}/bin/bwrap --unshare-all --bind / / --dev-bind /dev /dev ${lib.getExe check.driverInteractive}" + else + lib.getExe check.driverInteractive; + }; + }; + }) config.checks); }; } diff --git a/packages/checks/modules/nixos/external-storage.nix b/packages/checks/modules/nixos/external-storage.nix new file mode 100644 index 0000000..d89f9df --- /dev/null +++ b/packages/checks/modules/nixos/external-storage.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: + +{ + systemd.tmpfiles.settings."00-testing-external-storage-underlays" = lib.mapAttrs' (name: cfg: { + name = cfg.mountpoint; + value.d = { + user = toString cfg.uid; + group = toString cfg.gid; + mode = "0700"; + }; + }) config.services.external-storage.underlays; +} diff --git a/packages/checks/snakeoil/ssh/snakeoil-key b/packages/checks/snakeoil/ssh/snakeoil-key new file mode 100644 index 0000000..6faabb2 --- /dev/null +++ b/packages/checks/snakeoil/ssh/snakeoil-key @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACAOx03X+LtW0aN8ejdN4IJgDPrTZgVwe7WbXhhBvqVwgwAAAJAS78fWEu/H +1gAAAAtzc2gtZWQyNTUxOQAAACAOx03X+LtW0aN8ejdN4IJgDPrTZgVwe7WbXhhBvqVwgw +AAAEAUtGOZZIZdzGP6g85JuXBjDtciNQ9bLHNxSN5Gbwvb2Q7HTdf4u1bRo3x6N03ggmAM ++tNmBXB7tZteGEG+pXCDAAAACW1heEBUSVRBTgECAwQ= +-----END OPENSSH PRIVATE KEY----- diff --git a/packages/checks/snakeoil/ssh/snakeoil-key.pub b/packages/checks/snakeoil/ssh/snakeoil-key.pub new file mode 100644 index 0000000..66d752d --- /dev/null +++ b/packages/checks/snakeoil/ssh/snakeoil-key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA7HTdf4u1bRo3x6N03ggmAM+tNmBXB7tZteGEG+pXCD