mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-14 12:19:00 +00:00
flake-parts/setups/nixos: refactor
This commit is contained in:
parent
42a24ada02
commit
7b77035949
@ -329,6 +329,9 @@ let
|
|||||||
inputs.${config.homeManagerBranch}.nixosModules.home-manager
|
inputs.${config.homeManagerBranch}.nixosModules.home-manager
|
||||||
../../../configs/nixos/${name}
|
../../../configs/nixos/${name}
|
||||||
|
|
||||||
|
# Mapping the declarative home-manager users (if it has one) into NixOS
|
||||||
|
# users.
|
||||||
|
(lib.mkIf (config.homeManagerUsers.users != { })
|
||||||
(
|
(
|
||||||
let
|
let
|
||||||
setupConfig = config;
|
setupConfig = config;
|
||||||
@ -336,17 +339,8 @@ let
|
|||||||
inherit (config.homeManagerUsers) nixpkgsInstance;
|
inherit (config.homeManagerUsers) nixpkgsInstance;
|
||||||
isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state;
|
isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state;
|
||||||
in
|
in
|
||||||
{ config, lib, ... }: {
|
{ config, lib, pkgs, ... }: {
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{
|
|
||||||
nixpkgs.overlays = setupConfig.overlays;
|
|
||||||
networking.hostName = lib.mkDefault setupConfig.hostname;
|
|
||||||
}
|
|
||||||
|
|
||||||
(lib.mkIf (setupConfig.domain != null) {
|
|
||||||
networking.domain = lib.mkDefault setupConfig.domain;
|
|
||||||
})
|
|
||||||
|
|
||||||
(lib.mkIf hasHomeManagerUsers {
|
(lib.mkIf hasHomeManagerUsers {
|
||||||
users.users =
|
users.users =
|
||||||
lib.mkMerge
|
lib.mkMerge
|
||||||
@ -419,6 +413,24 @@ let
|
|||||||
setupConfig.homeManagerUsers.users);
|
setupConfig.homeManagerUsers.users);
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
}))
|
||||||
|
|
||||||
|
# Setting up the typical configuration.
|
||||||
|
(
|
||||||
|
let
|
||||||
|
setupConfig = config;
|
||||||
|
in
|
||||||
|
{ config, lib, ... }: {
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = setupConfig.overlays;
|
||||||
|
networking.hostName = lib.mkDefault setupConfig.hostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
(lib.mkIf (setupConfig.domain != null) {
|
||||||
|
networking.domain = lib.mkDefault setupConfig.domain;
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user