Compare commits

..

2 Commits

Author SHA1 Message Date
277ba48671 sync sops
Signed-off-by: unexplrd <unexplrd@linerds.us>
2025-03-29 23:15:49 +02:00
0826503309 hosts/sarien/networking.nix: something
Signed-off-by: unexplrd <unexplrd@linerds.us>
2025-03-29 23:15:49 +02:00
3 changed files with 37 additions and 15 deletions

View File

@ -1,5 +1,11 @@
{inputs, ...}: let {
secretsPath = builtins.toString inputs.mysecrets; config,
inputs,
...
}: let
s = inputs.mysecrets;
hostname = config.networking.hostName;
sopsFile = "${s}/hosts/${hostname}.yaml";
in { in {
imports = with inputs; [ imports = with inputs; [
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
@ -11,7 +17,7 @@ in {
keyFile = "/var/lib/sops-nix/key.txt"; keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true; generateKey = true;
}; };
defaultSopsFile = "${secretsPath}/secrets.yaml"; defaultSopsFile = "${s}/common.yaml";
secrets = { secrets = {
"user-password-hashed".neededForUsers = true; "user-password-hashed".neededForUsers = true;
"ssh-config" = { "ssh-config" = {
@ -19,12 +25,14 @@ in {
mode = "0400"; mode = "0400";
owner = "user"; owner = "user";
}; };
"ssh-eldrid-user" = { "ssh-${hostname}-user" = {
inherit sopsFile;
path = "/home/user/.ssh/id_ed25519"; path = "/home/user/.ssh/id_ed25519";
mode = "0400"; mode = "0400";
owner = "user"; owner = "user";
}; };
"ssh-eldrid-user.pub" = { "ssh-${hostname}-user.pub" = {
inherit sopsFile;
path = "/home/user/.ssh/id_ed25519.pub"; path = "/home/user/.ssh/id_ed25519.pub";
mode = "0400"; mode = "0400";
owner = "user"; owner = "user";

View File

@ -1,7 +1,12 @@
{ let
networking = { hosts.sarien = {
networkmanager.enable = true; hostId = "31150fae";
hostName = "vylxae"; hostName = "vylxae";
};
in {
networking = {
inherit (hosts.sarien) hostId hostName;
networkmanager.enable = true;
hosts = { hosts = {
"192.168.1.42" = ["dunamis"]; "192.168.1.42" = ["dunamis"];
}; };

View File

@ -1,8 +1,15 @@
{inputs, ...}: let {
secretsPath = builtins.toString inputs.mysecrets; config,
inputs,
...
}: let
s = inputs.mysecrets;
# TODO: stop relying on networking.hostName
hostname = "sarien";
sopsFile = "${s}/hosts/${hostname}.yaml";
in { in {
imports = [ imports = with inputs; [
inputs.sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];
sops = { sops = {
@ -11,7 +18,7 @@ in {
keyFile = "/var/lib/sops-nix/key.txt"; keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true; generateKey = true;
}; };
defaultSopsFile = "${secretsPath}/secrets.yaml"; defaultSopsFile = "${s}/common.yaml";
secrets = { secrets = {
"user-password-hashed".neededForUsers = true; "user-password-hashed".neededForUsers = true;
"ssh-config" = { "ssh-config" = {
@ -19,12 +26,14 @@ in {
mode = "0400"; mode = "0400";
owner = "user"; owner = "user";
}; };
"ssh-sarien-user" = { "ssh-${hostname}-user" = {
inherit sopsFile;
path = "/home/user/.ssh/id_ed25519"; path = "/home/user/.ssh/id_ed25519";
mode = "0400"; mode = "0400";
owner = "user"; owner = "user";
}; };
"ssh-sarien-user.pub" = { "ssh-${hostname}-user.pub" = {
inherit sopsFile;
path = "/home/user/.ssh/id_ed25519.pub"; path = "/home/user/.ssh/id_ed25519.pub";
mode = "0400"; mode = "0400";
owner = "user"; owner = "user";