modules/options: define shortcuts to primary user
The primary user gets defined in the user files through `user.name`, which is reused elsewhere.
This commit is contained in:
parent
19ecc15b59
commit
1e3547c2c2
2 changed files with 20 additions and 3 deletions
15
modules/options.nix
Normal file
15
modules/options.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Heavily inspired by hlissner: https://github.com/hlissner/dotfiles/blob/master/modules/options.nix
|
||||||
|
{ config, options, lib, home-manager, ... }:
|
||||||
|
with lib;
|
||||||
|
with lib.hlissner;
|
||||||
|
{
|
||||||
|
options = with types; {
|
||||||
|
user = mkOpt attrs { };
|
||||||
|
home = mkOpt attrs { };
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
||||||
|
home-manager.users.${config.user.name} = mkAliasDefinitions options.home;
|
||||||
|
};
|
||||||
|
}
|
|
@ -10,7 +10,7 @@ in
|
||||||
(with profiles; [ virtualization ])
|
(with profiles; [ virtualization ])
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.infinidoge = { config, main, suites, profiles, ... }: {
|
home = { config, main, suites, profiles, ... }: {
|
||||||
imports = lib.flatten [
|
imports = lib.flatten [
|
||||||
(with suites; [
|
(with suites; [
|
||||||
base
|
base
|
||||||
|
@ -104,11 +104,13 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.infinidoge = {
|
user = {
|
||||||
|
name = "infinidoge";
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
hashedPassword =
|
hashedPassword =
|
||||||
"PASSWORD SET IN THE FUTURE";
|
"PASSWORD SET IN THE FUTURE";
|
||||||
description = "Infinidoge";
|
description = "Infinidoge, primary user of the system";
|
||||||
|
group = "users";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" "minecraft" "libvirtd" "bluetooth" ];
|
extraGroups = [ "wheel" "minecraft" "libvirtd" "bluetooth" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue