modules: change username configuration option

It makes more sense to have a `my.user` option.
This commit is contained in:
Bruno BELANYI 2021-06-25 20:40:34 +02:00
parent 0ff730bf44
commit 76cac9af51
4 changed files with 11 additions and 9 deletions

View file

@ -72,7 +72,7 @@
}
home-manager.nixosModules.home-manager
({ config, ... }: {
home-manager.users.${config.my.username} = import ./home;
home-manager.users.${config.my.user.name} = import ./home;
# Nix Flakes compatibility
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;

View file

@ -10,11 +10,13 @@
];
options.my = with lib; {
username = mkOption {
type = types.str;
default = "ambroisie";
example = "alice";
description = "my username";
user = {
name = mkOption {
type = types.str;
default = "ambroisie";
example = "alice";
description = "my username";
};
};
};
}

View file

@ -1,7 +1,7 @@
# Simplify setting home options
{ config, lib, ... }:
let
actualPath = [ "home-manager" "users" config.my.username "my" "home" ];
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
aliasPath = [ "my" "home" ];
in
{

View file

@ -20,8 +20,8 @@ in
inherit (secrets.users.root) hashedPassword;
};
${config.my.username} = {
inherit (secrets.users.${config.my.username}) hashedPassword;
${config.my.user.name} = {
inherit (secrets.users.${config.my.user.name}) hashedPassword;
description = "Bruno BELANYI";
isNormalUser = true;
shell = pkgs.zsh;