more refactoring of home manager
This commit is contained in:
1 parent
afaacd003d
commit
8f8d23fb62
3 files changed
+11
-7
No files matched your search
@@ -1,8 +1,8 @@
|
||||
{ stateVersion }:
|
||||
let
|
||||
makeCommonGitConfigs = (import ./git).makeCommonGitConfigs;
|
||||
programsModule = (import ./programs);
|
||||
servicesModule = (import ./services);
|
||||
makeCommonGitConfigs = (import ./git.nix).makeCommonGitConfigs;
|
||||
programsModule = (import ./programs.nix);
|
||||
servicesModule = (import ./services.nix);
|
||||
homeModule = {
|
||||
stateVersion = stateVersion;
|
||||
shellAliases = {
|
||||
@@ -24,13 +24,16 @@ in
|
||||
};
|
||||
|
||||
makeCommonUser =
|
||||
{ enableDevelopmentKit
|
||||
{ enableDevelopmentKit ? false
|
||||
, fullName
|
||||
, email
|
||||
, extraGitConfigs ? [ ]
|
||||
, name
|
||||
, ...
|
||||
}: { pkgs, ... }: {
|
||||
home = homeModule // {
|
||||
username = name;
|
||||
homeDirectory = "/home/${name}";
|
||||
packages = with pkgs;
|
||||
[ jq nixpkgs-fmt ipfetch nixd ]
|
||||
++ (if enableDevelopmentKit then [
|
||||
|
||||
@@ -17,7 +17,6 @@ in
|
||||
|
||||
config = {
|
||||
users.users.root.shell = pkgs.zsh;
|
||||
home-manager.users.root.programs.git.userEmail = "root@${cfg.hostName}";
|
||||
networking.hostName = cfg.hostName;
|
||||
};
|
||||
}
|
||||
@@ -45,7 +45,9 @@ in
|
||||
mkIf cfg.user.enabled
|
||||
{
|
||||
programs.zsh.enable = true;
|
||||
home-manager.users.root = hm.makeRootUser { pkgs = pkgs; };
|
||||
home-manager.users.${cfg.user.name} = (hm.makeCommonUser cfg.user) { pkgs = pkgs; };
|
||||
home-manager.users.root =
|
||||
(hm.makeRootUser { hostName = config.skyg.core.hostName; }) { pkgs = pkgs; };
|
||||
home-manager.users.${cfg.user.name} =
|
||||
(hm.makeCommonUser cfg.user) { pkgs = pkgs; };
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user