From 825e09f59e82fd0ef4c30d022a24d2efd7c6cabf Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 2 Apr 2021 11:49:07 +0000 Subject: [PATCH] flake: refactor handling of shared modules --- flake.nix | 8 +++++++- machines/porthos/default.nix | 8 ++++++++ porthos.nix | 23 ----------------------- 3 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 porthos.nix diff --git a/flake.nix b/flake.nix index f582719..9f072c5 100644 --- a/flake.nix +++ b/flake.nix @@ -58,12 +58,18 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; } + # Include generic settings + ./modules + # Include my secrets + ./secrets + # Include my services + ./services ]; buildHost = name: system: lib.nixosSystem { inherit system; modules = defaultModules ++ [ - (./. + "/${name}.nix") + (./. + "/machines/${name}") ]; specialArgs = { # Use my extended lib in NixOS configuration diff --git a/machines/porthos/default.nix b/machines/porthos/default.nix index d8726f2..ec29917 100644 --- a/machines/porthos/default.nix +++ b/machines/porthos/default.nix @@ -9,4 +9,12 @@ ./services.nix ./users.nix ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "20.09"; # Did you read the comment? } diff --git a/porthos.nix b/porthos.nix deleted file mode 100644 index ce3a200..0000000 --- a/porthos.nix +++ /dev/null @@ -1,23 +0,0 @@ -# Porthos self-hosted server -{ ... }: - -{ - imports = [ - # Include generic settings - ./modules - # Include porthos-specific modules - ./machines/porthos - # Include my secrets - ./secrets - # Include my services - ./services - ]; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "20.09"; # Did you read the comment? -}