From 13cb1c6223eafa1d6bf23418c4d40d2d4ba89605 Mon Sep 17 00:00:00 2001 From: Nettika Date: Thu, 11 Jul 2024 19:42:29 -0700 Subject: [PATCH] Remove mkHost helper --- modules/nixos/default.nix => common.nix | 7 ++++-- flake.nix | 32 +++++++++++++++---------- hosts/marauder/default.nix | 3 +++ hosts/monolith/default.nix | 5 +++- lib/default.nix | 17 ------------- 5 files changed, 31 insertions(+), 33 deletions(-) rename modules/nixos/default.nix => common.nix (67%) delete mode 100644 lib/default.nix diff --git a/modules/nixos/default.nix b/common.nix similarity index 67% rename from modules/nixos/default.nix rename to common.nix index 2d2b1d2..8cfd6a4 100644 --- a/modules/nixos/default.nix +++ b/common.nix @@ -1,6 +1,9 @@ -{ options, config, lib, ... }: +{ hostName, ... }: { - networking.networkmanager.enable = true; + networking = { + inherit hostName; + networkmanager.enable = true; + }; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/flake.nix b/flake.nix index 6047114..46d8ae3 100644 --- a/flake.nix +++ b/flake.nix @@ -6,23 +6,29 @@ nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; }; - outputs = { nixpkgs, ... }@inputs: - let - utils = import ./lib { inherit inputs; }; - inherit (utils) mkHost; - in { + outputs = { nixpkgs, ... }@inputs: { nixosConfigurations = { - marauder = mkHost { - hostName = "marauder"; + marauder = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - timeZone = "America/Los_Angeles"; - stateVersion = "24.05"; + modules = [ + ./hosts/marauder + ./common.nix + ]; + specialArgs = { + hostName = "marauder"; + inherit inputs; + }; }; - monolith = mkHost { - hostName = "monolith"; + monolith = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - timeZone = "America/Los_Angeles"; - stateVersion = "24.05"; + modules = [ + ./hosts/monolith + ./common.nix + ]; + specialArgs = { + hostName = "monolith"; + inherit inputs; + }; }; }; }; diff --git a/hosts/marauder/default.nix b/hosts/marauder/default.nix index c97e4f3..a3071cd 100644 --- a/hosts/marauder/default.nix +++ b/hosts/marauder/default.nix @@ -19,4 +19,7 @@ }; displayManager.defaultSession = "cinnamon"; }; + + time.timeZone = "America/Los_Angeles"; + system.stateVersion = "24.05"; } diff --git a/hosts/monolith/default.nix b/hosts/monolith/default.nix index c157af7..8aae1f1 100644 --- a/hosts/monolith/default.nix +++ b/hosts/monolith/default.nix @@ -1 +1,4 @@ -{ ... }: {} +{ ... }: { + time.timeZone = "America/Los_Angeles"; + system.stateVersion = "24.05"; +} diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index dc07a21..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ inputs }: { - mkHost = { hostName, system, timeZone, stateVersion }: inputs.nixpkgs.lib.nixosSystem { - inherit system; - modules = [ - { - networking.hostName = hostName; - system.stateVersion = stateVersion; - time.timeZone = timeZone; - } - ../modules/nixos - ../hosts/${hostName} - ]; - specialArgs = { - inherit inputs; - }; - }; -} \ No newline at end of file