forcing root user name
This commit is contained in:
30
flake.nix
30
flake.nix
@@ -21,6 +21,18 @@
|
|||||||
extraGroups = lib.optionals config.root [ "wheel" ];
|
extraGroups = lib.optionals config.root [ "wheel" ];
|
||||||
shell = lib.mkIf config.shell pkgs.zsh;
|
shell = lib.mkIf config.shell pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
homeManagerModules = config: [
|
||||||
|
self.homeManagerModules.default {
|
||||||
|
user = config.user;
|
||||||
|
stateVersion = config.stateVersion;
|
||||||
|
profile = config.profile;
|
||||||
|
shell = config.shell;
|
||||||
|
ssh = config.ssh;
|
||||||
|
_1password = config._1password;
|
||||||
|
}
|
||||||
|
] ++ config.extraImports;
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeManagerModules.default = { ... }: {
|
homeManagerModules.default = { ... }: {
|
||||||
@@ -67,24 +79,12 @@
|
|||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
users = {
|
users = {
|
||||||
${config.user} = {
|
${config.user} = {
|
||||||
imports = [
|
imports = homeManagerModules config;
|
||||||
self.homeManagerModules.default {
|
|
||||||
user = config.user;
|
|
||||||
stateVersion = config.stateVersion;
|
|
||||||
profile = config.profile;
|
|
||||||
shell = config.shell;
|
|
||||||
ssh = config.ssh;
|
|
||||||
_1password = config._1password;
|
|
||||||
}
|
|
||||||
] ++ config.extraImports;
|
|
||||||
};
|
};
|
||||||
} // lib.optionalAttrs config.root {
|
} // lib.optionalAttrs config.root {
|
||||||
root = {
|
root = {
|
||||||
home.stateVersion = config.stateVersion;
|
# home.stateVersion = config.stateVersion;
|
||||||
imports = [
|
imports = homeManagerModules (config // { user = "root"; });
|
||||||
./nixosModules/options.nix
|
|
||||||
./homeManagerModules/git.nix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
2
home.nix
2
home.nix
@@ -10,7 +10,7 @@
|
|||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
home.username = config.user;
|
home.username = config.user;
|
||||||
home.homeDirectory = "/home/${config.user}";
|
home.homeDirectory = lib.mkIf (config.user != "root") "/home/${config.user}";
|
||||||
home.stateVersion = config.stateVersion;
|
home.stateVersion = config.stateVersion;
|
||||||
|
|
||||||
# The home.packages option allows you to install Nix packages into your
|
# The home.packages option allows you to install Nix packages into your
|
||||||
|
|||||||
Reference in New Issue
Block a user