From 3ac81e8aef68db05f201b60ccd3c0f54689ba809 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sat, 28 Sep 2024 20:37:10 +0300 Subject: [PATCH] Add configuration for Shire --- flake.nix | 31 ++++++++++++++++--------------- home-manager.nix | 12 ++++++++++++ hosts/Shire/configuration.nix | 12 ++++++++++++ nixos_common.nix | 4 +++- 4 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 home-manager.nix create mode 100644 hosts/Shire/configuration.nix diff --git a/flake.nix b/flake.nix index 9551e79d..ed7dc53c 100644 --- a/flake.nix +++ b/flake.nix @@ -17,26 +17,27 @@ }; outputs = { nixpkgs, home-manager, nur, ... } @inputs: - { - nixosConfigurations.Mirkwood = nixpkgs.lib.nixosSystem { + let + configureNixSystem = hostname: nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./hosts/Mirkwood/configuration.nix - ./nixos_common.nix - { nixpkgs.overlays = [ nur.overlay ]; } + # Host specific configuration + ./hosts/${hostname}/configuration.nix + # Common settings for all hosts + ({ pkgs, ... }: import ./nixos_common.nix + { inherit inputs; inherit pkgs; }) + + # home-manager home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = { inherit inputs; }; - backupFileExtension = "bak"; - users.functionalhacker = - import ./users/functionalhacker/home.nix; - }; - } + ({ ... }: import ./home-manager.nix { inherit inputs; }) ]; }; + in + { + nixosConfigurations = { + Mirkwood = configureNixSystem "Mirkwood"; + Shire = configureNixSystem "Shire"; + }; }; } diff --git a/home-manager.nix b/home-manager.nix new file mode 100644 index 00000000..c91a09d1 --- /dev/null +++ b/home-manager.nix @@ -0,0 +1,12 @@ +{ inputs, ... }: + +{ + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs; }; + backupFileExtension = "bak"; + users.functionalhacker = + import ./users/functionalhacker/home.nix; + }; +} diff --git a/hosts/Shire/configuration.nix b/hosts/Shire/configuration.nix new file mode 100644 index 00000000..c784ec4d --- /dev/null +++ b/hosts/Shire/configuration.nix @@ -0,0 +1,12 @@ +{ ... }: + +{ + imports = [ + ./hardware-configuration.nix + ../../wifi.nix + ]; + + networking.hostName = "Shire"; + + # TODO +} diff --git a/nixos_common.nix b/nixos_common.nix index 76a50d95..2759087d 100644 --- a/nixos_common.nix +++ b/nixos_common.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, inputs, ... }: { imports = [ @@ -7,6 +7,8 @@ ./users/som/configuration.nix ]; + nixpkgs.overlays = [ inputs.nur.overlay ]; + system.stateVersion = "24.05"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; time.timeZone = "Europe/Helsinki";