flake: refactor handling of shared modules

This commit is contained in:
Bruno BELANYI 2021-04-02 11:49:07 +00:00
parent dc052386d1
commit f634f1b2ed
3 changed files with 15 additions and 24 deletions

View file

@ -58,12 +58,18 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
} }
# Include generic settings
./modules
# Include my secrets
./secrets
# Include my services
./services
]; ];
buildHost = name: system: lib.nixosSystem { buildHost = name: system: lib.nixosSystem {
inherit system; inherit system;
modules = defaultModules ++ [ modules = defaultModules ++ [
(./. + "/${name}.nix") (./. + "/machines/${name}")
]; ];
specialArgs = { specialArgs = {
# Use my extended lib in NixOS configuration # Use my extended lib in NixOS configuration

View file

@ -9,4 +9,12 @@
./services.nix ./services.nix
./users.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. Its 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?
} }

View file

@ -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. Its 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?
}