From 391f8fcf4f175871b4504434a55bfb9e58c2b6cc Mon Sep 17 00:00:00 2001 From: Konstantin Nazarov Date: Sat, 23 Nov 2024 23:27:47 +0000 Subject: [PATCH] Switch to a slightly better modularized config --- configuration.nix | 8 ++++---- flake.nix | 11 +++-------- nodes/framework/{configuration.nix => default.nix} | 5 +++++ nodes/knazarovcom/{configuration.nix => default.nix} | 0 nodes/mira/{configuration.nix => default.nix} | 5 +++++ nodes/videos/{configuration.nix => default.nix} | 0 secrets.yaml | 12 +++++++----- 7 files changed, 24 insertions(+), 17 deletions(-) rename nodes/framework/{configuration.nix => default.nix} (88%) rename nodes/knazarovcom/{configuration.nix => default.nix} (100%) rename nodes/mira/{configuration.nix => default.nix} (91%) rename nodes/videos/{configuration.nix => default.nix} (100%) diff --git a/configuration.nix b/configuration.nix index d841680..5318e59 100644 --- a/configuration.nix +++ b/configuration.nix @@ -51,11 +51,11 @@ in { owner = config.users.users.knazarov.name; group = config.users.users.knazarov.group; }; - syncthing_key = { + "${config.networking.hostName}_syncthing_key" = { owner = config.users.users.knazarov.name; group = config.users.users.knazarov.group; }; - syncthing_cert = { + "${config.networking.hostName}_syncthing_cert" = { owner = config.users.users.knazarov.name; group = config.users.users.knazarov.group; }; @@ -451,8 +451,8 @@ in { enable = true; user = "knazarov"; configDir = "/home/knazarov/.config/syncthing"; - key = config.sops.secrets.syncthing_key.path; - cert = config.sops.secrets.syncthing_cert.path; + key = config.sops.secrets."${config.networking.hostName}_syncthing_key".path; + cert = config.sops.secrets."${config.networking.hostName}_syncthing_cert".path; }; home-manager.users.knazarov = { diff --git a/flake.nix b/flake.nix index 4620400..576a615 100755 --- a/flake.nix +++ b/flake.nix @@ -41,8 +41,7 @@ hostAttrs = dir: { settings = import "${dir}/host-metadata.nix"; - config = import "${dir}/configuration.nix"; - hw-config = import "${dir}/hardware-configuration.nix"; + #config = import "${dir}/configuration.nix"; }; node = dir: @@ -58,9 +57,7 @@ }) sops-nix.nixosModules.sops home-manager.nixosModule - config - hw-config - ./configuration.nix + dir ] settings.system; server = dir: @@ -76,9 +73,7 @@ }) sops-nix.nixosModules.sops home-manager.nixosModule - config - hw-config - #(dir + "/configuration.nix") + dir ] settings.system; in { nixosConfigurations = { diff --git a/nodes/framework/configuration.nix b/nodes/framework/default.nix similarity index 88% rename from nodes/framework/configuration.nix rename to nodes/framework/default.nix index aa74e3c..8fb5541 100644 --- a/nodes/framework/configuration.nix +++ b/nodes/framework/default.nix @@ -4,6 +4,11 @@ let in { + imports = [ + ./hardware-configuration.nix + ./../../configuration.nix + ]; + # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/nodes/knazarovcom/configuration.nix b/nodes/knazarovcom/default.nix similarity index 100% rename from nodes/knazarovcom/configuration.nix rename to nodes/knazarovcom/default.nix diff --git a/nodes/mira/configuration.nix b/nodes/mira/default.nix similarity index 91% rename from nodes/mira/configuration.nix rename to nodes/mira/default.nix index 2af85ad..b460056 100644 --- a/nodes/mira/configuration.nix +++ b/nodes/mira/default.nix @@ -4,6 +4,11 @@ let in { + imports = [ + ./hardware-configuration.nix + ./../../configuration.nix + ]; + # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/nodes/videos/configuration.nix b/nodes/videos/default.nix similarity index 100% rename from nodes/videos/configuration.nix rename to nodes/videos/default.nix diff --git a/secrets.yaml b/secrets.yaml index 368dc63..2dc88ce 100644 --- a/secrets.yaml +++ b/secrets.yaml @@ -4,8 +4,10 @@ github_token: ENC[AES256_GCM,data:efFL5w0dAqHM0L35bfr4PMF/0Uys3Pe9s/pqDJUA0rBdRS mullvad_account: ENC[AES256_GCM,data:CO4wl2vNAMEC9oy37nIrpw==,iv:a3w64u8XQ/tihIDxIPPtdZ6F7dldLPvRzGUs1MpVe4M=,tag:HQxJVuGEvI0fVj8yGptbdA==,type:str] git_plan_config: ENC[AES256_GCM,data:7K4R9OcFq+hWPKwkng6huppcInASpjUSgRpYX++voP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RNXCnxEvg+g5UKVN9X9RN4rIQhfedPMQrNbv8UrDKMygA5HaECJwO5KBz42VTCmnIqTysle09y8hW3zL9Lxaw6DZFNvoALCo7Wj4jLhDZY8DWvjCONIdjpYv0pElOjhyY9oBEonF0ZBpzGFr8zHMcCdt7o+o192Ho357NzBDHMo+3RkTU4GiPpdlZN71Pk902IFHa9hYuYDePPur7TGiyGITYP/EA8b+Rb6AfhLDzv6PzDfjiOpllOX50R3pw5tEEWdJsQx5nwUUFLJOWcKkzTDBOW1WDiWQv+yicWox1e2KXROBdHHiorIvTU0/nM8YVwH9eyOf6rUyrW7wQArBXz,iv:zMmYiA1xlykeTHu16idG2uQ76KBsC8c2a4JfGVwdp9I=,tag:nmqagNRnuBWOJ1p9FdE85g==,type:str] +framework_syncthing_cert: ENC[AES256_GCM,data:ctuJCImoIaRkbJt7CFuew66uOvI9tWBIzw+WsgtKbq757wZke7Eqiy1TOoKmaEhWRzw5pD71y4Uk9rgcsdmRr0+2w9iC6o3joii5KU/dIextbiTYzqBpB88CjESKITzAj57bGWP22RSM156OaGgL7UDpZAyRt8Ys2LlfmnbU6rQ3hpwgHKWkegqluIGjMdl+LW0ShxzEIqSxwkxhyYHW0GVLBAK2jTYtqar8MgPogZ16YRtwmDlK1Me712qvap39RMsB1xMsXvfduKhWjjtY3Ajhq2RF3dLKffCpMFhomMnCuPx62aVJEvnGUb/h99F4d0bLpThvF7hldkuDbiln3n8WehqhoM3A5q/42P0XoSrafvCH43WT6SSpvOASMdTxn7qSlCNB3uXiKNh3X4rgvCEmsdjVEXhBwLi7SZ5k73iVa8oEpaYP+60l9XFd4PEd844Y/wBRXN4Ch+imuCZwNlYMiN7uCyd3/lqr2t7xgIc1E9DqcJloohfJMfTXhl/88GITVqL+3IfwPabTMbYLFwxjr3gBPyPtyEUpgAANSVJNj5h25WnrN2q+muoTiGdk1Z6wk2z/2Obo1LSde1daNVGi+i/CmFyIYFJhmpP53faXi48MqLtF1ix7YP6q/rjyTH26mDPg5Z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:lIMEe0u6ZE62SPWjpbwL3QJot5g2lbjuoxVcFPg51Go=,tag:WB05eEi6Lx1A3gyu1M9x4Q==,type:str] sops: kms: [] @@ -31,8 +33,8 @@ sops: U3loV2xDMkM5SWNXRDJobDloL0FVUUkK3OP7KvcKkE8mJ880dm6LMFZUxELjl8/P 6+q8qAYiAvl0Cbd4GzkNpUuBbLlFFWfFmC0vbgg8gyZ6xI5AFhHAPw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-10-30T20:16:29Z" - mac: ENC[AES256_GCM,data:f3dHbjLgqJmjTpKObGlrzUh2HwbaaJrKoitQuBvL1gwg7byD7lkzFk48NaO79tBm8mzFM0qNR6ZuMCezWIi/MqeKtTKhsf4e89///uSVB2EVbBDR/SDvfiZYwg1l0WEoUt5bjJIQyvmP8wRTVKBCMWNlbona/FGUlngswNXT1DM=,iv:IyUTsfYvIYh6X0RTB+yHlFRCwL0D+MF9A+HOQUjbJLY=,tag:YHaeO9iYM8Ze6koG8tjvOw==,type:str] + lastmodified: "2024-11-23T22:23:34Z" + mac: ENC[AES256_GCM,data:tQjqm7UFbJtGVM8viWdqwwpP15su8LQbk/eIKEES09QovXQYioB3AMeDUxNltP5d/whRBqXGdng4e/PeddBHKl/FunpjnhaN1FUvYfmQPHDjte6pBaJLnJwtnxMh7oyUn0Bab74GDYHOxTUSOR5zIkLOrUQqB0xrcvSSyuF8lwA=,iv:Q7jEKUFIdXY4nq38VzKyrVpHXBt3sCKMotTJLnNLhoQ=,tag:du3BwNT8lim5P9NwO3Dqqg==,type:str] pgp: - created_at: "2023-06-10T01:03:11Z" enc: |- @@ -55,4 +57,4 @@ sops: -----END PGP MESSAGE----- fp: DDB4423999505236CF585F9B0560020C9C577C1B unencrypted_suffix: _unencrypted - version: 3.9.0 + version: 3.9.1