modules: change username configuration option
It makes more sense to have a `my.user` option.
This commit is contained in:
parent
0ff730bf44
commit
76cac9af51
|
@ -72,7 +72,7 @@
|
||||||
}
|
}
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
({ config, ... }: {
|
({ config, ... }: {
|
||||||
home-manager.users.${config.my.username} = import ./home;
|
home-manager.users.${config.my.user.name} = import ./home;
|
||||||
# Nix Flakes compatibility
|
# Nix Flakes compatibility
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
|
|
@ -10,11 +10,13 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
options.my = with lib; {
|
options.my = with lib; {
|
||||||
username = mkOption {
|
user = {
|
||||||
type = types.str;
|
name = mkOption {
|
||||||
default = "ambroisie";
|
type = types.str;
|
||||||
example = "alice";
|
default = "ambroisie";
|
||||||
description = "my username";
|
example = "alice";
|
||||||
|
description = "my username";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Simplify setting home options
|
# Simplify setting home options
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
actualPath = [ "home-manager" "users" config.my.username "my" "home" ];
|
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
|
||||||
aliasPath = [ "my" "home" ];
|
aliasPath = [ "my" "home" ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,8 +20,8 @@ in
|
||||||
inherit (secrets.users.root) hashedPassword;
|
inherit (secrets.users.root) hashedPassword;
|
||||||
};
|
};
|
||||||
|
|
||||||
${config.my.username} = {
|
${config.my.user.name} = {
|
||||||
inherit (secrets.users.${config.my.username}) hashedPassword;
|
inherit (secrets.users.${config.my.user.name}) hashedPassword;
|
||||||
description = "Bruno BELANYI";
|
description = "Bruno BELANYI";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
|
|
Loading…
Reference in a new issue