mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
home-environment: style cleanup
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
# For OS-specific configuration, please edit nixos/default.nix or nix-darwin/default.nix instead.
|
||||
|
||||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
@@ -48,23 +47,29 @@ let
|
||||
++ cfg.sharedModules;
|
||||
|
||||
config = {
|
||||
submoduleSupport.enable = true;
|
||||
submoduleSupport.externalPackageInstall = cfg.useUserPackages;
|
||||
submoduleSupport = {
|
||||
enable = true;
|
||||
externalPackageInstall = cfg.useUserPackages;
|
||||
};
|
||||
|
||||
home.username = config.users.users.${name}.name;
|
||||
home.homeDirectory = config.users.users.${name}.home;
|
||||
home.uid = mkIf (options.users.users.${name}.uid.isDefined or false) config.users.users.${name}.uid;
|
||||
home = {
|
||||
username = config.users.users.${name}.name;
|
||||
homeDirectory = config.users.users.${name}.home;
|
||||
uid = mkIf (options.users.users.${name}.uid.isDefined or false) config.users.users.${name}.uid;
|
||||
};
|
||||
|
||||
nix = {
|
||||
# Forward `nix.enable` from the OS configuration. The
|
||||
# conditional is to check whether nix-darwin is new enough
|
||||
# to have the `nix.enable` option; it was previously a
|
||||
# `mkRemovedOptionModule` error, which we can crudely detect
|
||||
# by `visible` being set to `false`.
|
||||
nix.enable = mkIf (options.nix.enable.visible or true) config.nix.enable;
|
||||
enable = mkIf (options.nix.enable.visible or true) config.nix.enable;
|
||||
|
||||
# Make activation script use same version of Nix as system as a whole.
|
||||
# This avoids problems with Nix not being in PATH.
|
||||
nix.package = config.nix.package;
|
||||
inherit (config.nix) package;
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
@@ -161,11 +166,10 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = (
|
||||
lib.mkMerge [
|
||||
config = lib.mkMerge [
|
||||
# Fix potential recursion when configuring home-manager users based on values in users.users #594
|
||||
(mkIf (cfg.useUserPackages && cfg.users != { }) {
|
||||
users.users = (lib.mapAttrs (_username: usercfg: { packages = [ usercfg.home.path ]; }) cfg.users);
|
||||
users.users = lib.mapAttrs (_username: usercfg: { packages = [ usercfg.home.path ]; }) cfg.users;
|
||||
environment.pathsToLink = [ "/etc/profile.d" ];
|
||||
})
|
||||
(mkIf (cfg.users != { }) {
|
||||
@@ -185,6 +189,5 @@ in
|
||||
)
|
||||
);
|
||||
})
|
||||
]
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user