From eb54ade22602adba0b310c06a80cdc9fc5b5c67b Mon Sep 17 00:00:00 2001 From: hektor Date: Sun, 1 Feb 2026 23:40:32 +0100 Subject: [PATCH] refactor: clean up 'flake.nix' and 'deploy/colmena.nix' --- deploy/colmena.nix | 47 +++++++++++++++++++------------------ flake.nix | 27 ++++++--------------- hosts/andromache/system.nix | 1 + hosts/astyanax/system.nix | 1 + hosts/eetion/system.nix | 1 + hosts/hecuba/system.nix | 1 + hosts/vm/system.nix | 1 + 7 files changed, 36 insertions(+), 43 deletions(-) create mode 100644 hosts/andromache/system.nix create mode 100644 hosts/astyanax/system.nix create mode 100644 hosts/eetion/system.nix create mode 100644 hosts/hecuba/system.nix create mode 100644 hosts/vm/system.nix diff --git a/deploy/colmena.nix b/deploy/colmena.nix index 85d893c..173b9b9 100644 --- a/deploy/colmena.nix +++ b/deploy/colmena.nix @@ -13,33 +13,34 @@ inputs.colmena.lib.makeHive { nodeSpecialArgs = builtins.mapAttrs (_: v: v._module.specialArgs or { }) self.nixosConfigurations; }; - astyanax.deployment.tags = [ "local" ]; + astyanax = { + imports = [ ../hosts/astyanax ]; + deployment.tags = [ "local" ]; + }; - andromache.deployment.tags = [ "local" ]; + andromache = { + imports = [ ../hosts/andromache ]; + deployment.tags = [ "local" ]; + }; - vm.deployment.tags = [ "local" ]; + vm = { + imports = [ ../hosts/vm ]; + deployment.tags = [ "local" ]; + }; - hecuba = - { ... }: - { - imports = [ ../hosts/hecuba ]; - deployment = { - targetHost = "hecuba"; - targetUser = "username"; - targetPort = 22; - tags = [ "cloud" ]; - }; + hecuba = { + imports = [ ../hosts/hecuba ]; + deployment = { + targetUser = "username"; + tags = [ "cloud" ]; }; + }; - eetion = - { ... }: - { - imports = [ ../hosts/eetion ]; - deployment = { - targetHost = "eetion"; - targetUser = "h"; - targetPort = 22; - tags = [ "arm" ]; - }; + eetion = { + imports = [ ../hosts/eetion ]; + deployment = { + targetUser = "h"; + tags = [ "arm" ]; }; + }; } diff --git a/flake.nix b/flake.nix index df961fb..2ee8b53 100644 --- a/flake.nix +++ b/flake.nix @@ -49,16 +49,10 @@ { self, nixpkgs, - nixos-hardware, - disko, - sops-nix, - nix-secrets, home-manager, nix-on-droid, nixgl, - firefox-addons, - nvim, - colmena, + ... }@inputs: let inherit (self) outputs; @@ -66,10 +60,6 @@ utils = import ./utils { inherit lib; }; hostDirNames = utils.dirNames ./hosts; system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - overlays = [ nixgl.overlay ]; - }; dotsPath = ./dots; in { @@ -77,9 +67,10 @@ "nixpkgs=${inputs.nixpkgs}" ]; # nixosConfigurations = - (lib.genAttrs (lib.filter (h: h != "eetion") hostDirNames) ( + (lib.genAttrs hostDirNames ( host: nixpkgs.lib.nixosSystem { + system = import ./hosts/${host}/system.nix; modules = [ ./hosts/${host} ]; specialArgs = { inherit inputs outputs dotsPath; @@ -87,13 +78,6 @@ } )) // { - eetion = nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = [ ./hosts/eetion ]; - specialArgs = { - inherit inputs outputs dotsPath; - }; - }; sd-image-aarch64 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -112,7 +96,10 @@ }; homeConfigurations = { work = home-manager.lib.homeManagerConfiguration { - inherit pkgs; + pkgs = import nixpkgs { + inherit system; + overlays = [ nixgl.overlay ]; + }; modules = [ ./home/hosts/work ]; extraSpecialArgs = { inherit inputs outputs dotsPath; diff --git a/hosts/andromache/system.nix b/hosts/andromache/system.nix new file mode 100644 index 0000000..132026a --- /dev/null +++ b/hosts/andromache/system.nix @@ -0,0 +1 @@ +"x86_64-linux" diff --git a/hosts/astyanax/system.nix b/hosts/astyanax/system.nix new file mode 100644 index 0000000..132026a --- /dev/null +++ b/hosts/astyanax/system.nix @@ -0,0 +1 @@ +"x86_64-linux" diff --git a/hosts/eetion/system.nix b/hosts/eetion/system.nix new file mode 100644 index 0000000..9487bcc --- /dev/null +++ b/hosts/eetion/system.nix @@ -0,0 +1 @@ +"aarch64-linux" diff --git a/hosts/hecuba/system.nix b/hosts/hecuba/system.nix new file mode 100644 index 0000000..132026a --- /dev/null +++ b/hosts/hecuba/system.nix @@ -0,0 +1 @@ +"x86_64-linux" diff --git a/hosts/vm/system.nix b/hosts/vm/system.nix new file mode 100644 index 0000000..132026a --- /dev/null +++ b/hosts/vm/system.nix @@ -0,0 +1 @@ +"x86_64-linux"