Make modules list explit in one place

This commit is contained in:
Sridhar Ratnakumar 2022-12-03 17:54:05 -05:00
parent ea7bdbc18c
commit 2fdf57226a
3 changed files with 20 additions and 17 deletions

View file

@ -53,24 +53,31 @@
};
};
};
flake = {
# Configurations for Linux (NixOS) systems
nixosConfigurations = {
# My Linux development computer (on Hetzner)
pinch = self.lib.mkLinuxSystem [
./systems/hetzner/ax41.nix
./nixos/server/harden.nix
# I share my Hetzner server with other people who need it.
self.nixosModules.guests
];
pinch = self.lib.mkLinuxSystem {
imports = [
self.nixosModules.default # Defined in nixos/default.nix
./systems/hetzner/ax41.nix
./nixos/server/harden.nix
# I share my Hetzner server with other people who need it.
self.nixosModules.guests
];
};
};
# Configurations for my only[^1] macOS machine (using nix-darwin)
#
# [^1]: This is why attr key is 'default'.
darwinConfigurations = {
default = self.lib-darwin.mkMacosSystem [
./systems/darwin.nix
];
default = self.lib-darwin.mkMacosSystem {
imports = [
self.darwinModules.default # Defined in nix-darwin/default.nix
./systems/darwin.nix
];
};
};
};

View file

@ -18,16 +18,14 @@
../nixos/caches
];
};
lib-darwin.mkMacosSystem = extraModules: inputs.darwin.lib.darwinSystem rec {
lib-darwin.mkMacosSystem = mod: inputs.darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
specialArgs = {
inherit inputs system;
flake = { inherit config; };
rosettaPkgs = import inputs.nixpkgs { system = "x86_64-darwin"; };
};
modules = [
self.darwinModules.default
] ++ extraModules;
modules = [ mod ];
};
};
}

View file

@ -31,16 +31,14 @@ in
];
};
lib.mkLinuxSystem = extraModules: inputs.nixpkgs.lib.nixosSystem rec {
lib.mkLinuxSystem = mod: inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
# Arguments to pass to all modules.
specialArgs = {
inherit system inputs;
flake = { inherit config; };
};
modules = [
self.nixosModules.default
] ++ extraModules;
modules = [ mod ];
};
};
}