mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-25 06:19:10 +00:00
lib/flake-utils: refactor mkHost
Now that `system` top-level attribute in `configuration.nix` is documented and comes with additional options now, we'll have to move the system configuration into a new namespace. This is just the easy way out.
This commit is contained in:
parent
7ae53c1563
commit
99050bc806
@ -100,8 +100,7 @@
|
||||
lib = nixpkgs.lib.extend (final: prev: import ./lib { lib = prev; });
|
||||
};
|
||||
|
||||
# The default configuration for a NixOS system STARTS HERE.
|
||||
|
||||
config = {
|
||||
# I want to capture the usual flakes to its exact version so we're
|
||||
# making them available to our system. This will also prevent the
|
||||
# annoying downloads since it always get the latest revision.
|
||||
@ -158,6 +157,7 @@
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# The default config for our home-manager configurations.
|
||||
userDefaultConfig = let system = "x86_64-linux";
|
||||
|
@ -26,7 +26,7 @@ in rec {
|
||||
=> { ... } # NixOS configuration attrset
|
||||
*/
|
||||
mkHost = file:
|
||||
attrs@{ system ? sys, specialArgs ? { inherit lib system inputs; }, ... }:
|
||||
{ system ? sys, specialArgs ? { inherit lib system inputs; }, config ? { } }:
|
||||
(lib.makeOverridable inputs.nixpkgs.lib.nixosSystem) {
|
||||
# The system of the NixOS system.
|
||||
inherit system specialArgs;
|
||||
@ -40,7 +40,7 @@ in rec {
|
||||
}
|
||||
|
||||
# Put the given attribute set (except for the system).
|
||||
(lib.filterAttrs (n: v: !lib.elem n [ "system" "specialArgs" ]) attrs)
|
||||
config
|
||||
|
||||
# The entry point of the module.
|
||||
file
|
||||
|
Loading…
Reference in New Issue
Block a user