mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 16:16:50 +01:00
complete rework v3
This commit is contained in:
parent
7409e9ca10
commit
366a0e221a
131 changed files with 20171 additions and 585 deletions
|
|
@ -1,34 +1,46 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
username,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.user;
|
||||
inherit (config.age) secrets;
|
||||
in {
|
||||
options.user = {
|
||||
username = mkOption {
|
||||
type = types.str;
|
||||
options.fireproof = {
|
||||
username = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nickolaj";
|
||||
description = "The username of the user";
|
||||
};
|
||||
home-manager = mkOption {
|
||||
group = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "users";
|
||||
};
|
||||
|
||||
home-manager = lib.mkOption {
|
||||
type = options.home-manager.users.type.functor.wrapped;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.${cfg.username} = {
|
||||
age.secrets.hashed-user-password.rekeyFile = ../../../secrets/hashed-user-password.age;
|
||||
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel"];
|
||||
hashedPasswordFile = config.age.secrets.hashed-user-password.path;
|
||||
# initialPassword = "password";
|
||||
hashedPasswordFile = secrets.hashed-user-password.path;
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
};
|
||||
home-manager.users.${cfg.username} = mkAliasDefinitions options.user.home-manager;
|
||||
user.home-manager.home.stateVersion = config.system.stateVersion;
|
||||
home-manager.users.${username} = mkAliasDefinitions options.fireproof.home-manager;
|
||||
|
||||
# set the same version of home-manager as the system
|
||||
fireproof.home-manager.home.stateVersion = "24.11";
|
||||
system.stateVersion = "24.11";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue