mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06: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
|
||||
../../../configs/nixos/${name}
|
||||
|
||||
# Mapping the declarative home-manager users (if it has one) into NixOS
|
||||
# users.
|
||||
(lib.mkIf (config.homeManagerUsers.users != { })
|
||||
(
|
||||
let
|
||||
setupConfig = config;
|
||||
@ -336,17 +339,8 @@ let
|
||||
inherit (config.homeManagerUsers) nixpkgsInstance;
|
||||
isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state;
|
||||
in
|
||||
{ config, lib, ... }: {
|
||||
{ config, lib, pkgs, ... }: {
|
||||
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 {
|
||||
users.users =
|
||||
lib.mkMerge
|
||||
@ -419,6 +413,24 @@ let
|
||||
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