From b23046ea5d09432294e9181e5b47c3286e03dbdd Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Fri, 29 Aug 2025 11:21:06 +0800 Subject: [PATCH 1/3] Add ornithologist LXC --- flake.nix | 5 +++++ hosts/muskduck/default.nix | 3 +++ hosts/ornithologist/default.nix | 7 +++++++ suites/desktop/default.nix | 3 --- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 hosts/ornithologist/default.nix diff --git a/flake.nix b/flake.nix index 3a17913..72cf4ef 100755 --- a/flake.nix +++ b/flake.nix @@ -103,5 +103,10 @@ (mkHost "nextcloud" { suite = "server/lxc"; }) + + # Container for managing server flock. + (mkHost "ornithologist" { + suite = "server/lxc"; + }) ]; } diff --git a/hosts/muskduck/default.nix b/hosts/muskduck/default.nix index 3b9b514..aef03cb 100644 --- a/hosts/muskduck/default.nix +++ b/hosts/muskduck/default.nix @@ -39,6 +39,9 @@ with lib; { ]; }; + # Allow emulating aarch64 to build for Raspberry Pi. + boot.binfmt.emulatedSystems = ["aarch64-linux"]; + # Share Music dir. services.samba = { enable = true; diff --git a/hosts/ornithologist/default.nix b/hosts/ornithologist/default.nix new file mode 100644 index 0000000..82597c4 --- /dev/null +++ b/hosts/ornithologist/default.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + # Allow emulating aarch64 to build for Raspberry Pi. + boot.binfmt.emulatedSystems = ["aarch64-linux"]; + + # Install some packages. + environment.systemPackages = with pkgs; [deploy-rs]; +} diff --git a/suites/desktop/default.nix b/suites/desktop/default.nix index e117819..f50e77c 100755 --- a/suites/desktop/default.nix +++ b/suites/desktop/default.nix @@ -26,9 +26,6 @@ with lib; { "udev.log_priority=3" "rd.systemd.show_status=auto" ]; - - # Allow emulating aarch64 to build for Raspberry Pi. - binfmt.emulatedSystems = ["aarch64-linux"]; }; # Enable smart card support (for YubiKey). From a4fb022930e50fe93c631373323c1f1e50111a36 Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Fri, 29 Aug 2025 11:54:27 +0800 Subject: [PATCH 2/3] Fix deploy-rs --- helpers.nix | 94 +++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/helpers.nix b/helpers.nix index 747dd8c..65206b9 100644 --- a/helpers.nix +++ b/helpers.nix @@ -53,60 +53,62 @@ with inputs.nixpkgs.lib; { }) ]; }; - in { - nixosConfigurations.${hostname} = nixosSystem { - inherit system pkgs; + in + { + nixosConfigurations.${hostname} = nixosSystem { + inherit system pkgs; - specialArgs = { - # Pass variables to config. - inherit inputs secrets hostname; - }; + specialArgs = { + # Pass variables to config. + inherit inputs secrets hostname; + }; - modules = - [ - nixvim.nixosModules.nixvim # Neovim. - lanzaboote.nixosModules.lanzaboote # Secure boot. - sops-nix.nixosModules.sops # Secrets management. + modules = + [ + nixvim.nixosModules.nixvim # Neovim. + lanzaboote.nixosModules.lanzaboote # Secure boot. + sops-nix.nixosModules.sops # Secrets management. - ./suites/${suite} # Collection of configuration options for different types of systems. - ./hosts/${hostname} # Host-specific config. + ./suites/${suite} # Collection of configuration options for different types of systems. + ./hosts/${hostname} # Host-specific config. - # Home manager. - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - users.fern = { - # Me! - home.username = "fern"; - home.homeDirectory = "/home/fern"; + # Home manager. + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + users.fern = { + # Me! + home.username = "fern"; + home.homeDirectory = "/home/fern"; - # Home manager version. - home.stateVersion = "25.05"; + # Home manager version. + home.stateVersion = "25.05"; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; - # Import config. - imports = [./suites/${suite}/home.nix]; + # Import config. + imports = [./suites/${suite}/home.nix]; + }; }; - }; - } - ] - ++ hostModules # Host-specific modules. - ++ optionals (docker == true) [./suites/server/docker] # Enable docker if required. - ++ (filesystem.listFilesRecursive ./modules); # Custom modules. - }; - - deploy.nodes.${hostname} = mkIf (strings.hasPrefix "server" suite) { - hostname = "${hostname}.local"; - profiles.system = { - user = "root"; - sshuser = "fern"; - path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname}; + } + ] + ++ hostModules # Host-specific modules. + ++ optionals (docker == true) [./suites/server/docker] # Enable docker if required. + ++ (filesystem.listFilesRecursive ./modules); # Custom modules. + }; + } + // optionalAttrs (strings.hasPrefix "server" suite) { + deploy.nodes.${hostname} = { + hostname = "${hostname}.local"; + profiles.system = { + user = "root"; + sshuser = "fern"; + path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname}; + }; }; }; - }; } From 6d51aa26050842c651d07489a2de6b44e5be8420 Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Fri, 29 Aug 2025 13:06:26 +0800 Subject: [PATCH 3/3] Change ornithologist to a VM --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 72cf4ef..714672e 100755 --- a/flake.nix +++ b/flake.nix @@ -104,9 +104,9 @@ suite = "server/lxc"; }) - # Container for managing server flock. + # VM for managing server flock. (mkHost "ornithologist" { - suite = "server/lxc"; + suite = "server/vm"; }) ]; }