nixos/modules/base/users.nix

37 lines
889 B
Nix
Raw Normal View History

2024-03-05 22:57:41 +01:00
{
config,
pkgs,
2024-03-28 16:35:03 +01:00
secrets,
2024-03-05 22:57:41 +01:00
...
}: {
2023-08-01 15:35:09 +02:00
users = {
# Don't allow imperative modifications to users (incompatible with impermanence)
mutableUsers = false;
2023-08-25 00:57:42 +02:00
2023-08-01 15:35:09 +02:00
users = {
root = {
2024-02-24 02:11:59 +01:00
hashedPasswordFile = config.age.secrets.users-hashed-password-file.path;
2023-08-01 15:35:09 +02:00
};
caspervk = {
isNormalUser = true;
description = "Casper V. Kristensen";
2024-02-24 02:11:59 +01:00
hashedPasswordFile = config.age.secrets.users-hashed-password-file.path;
2023-08-01 15:35:09 +02:00
extraGroups = [
2023-08-01 16:55:53 +02:00
"wheel" # allows sudo
"video" # allows controlling brightness
2023-08-25 00:52:14 +02:00
# todo: systemd-journal, audio, input, power, nix ?
2023-08-01 15:35:09 +02:00
];
uid = 1000;
2024-03-05 22:57:41 +01:00
packages = with pkgs; [];
2023-08-01 15:35:09 +02:00
};
};
};
2024-02-24 02:11:59 +01:00
age.secrets.users-hashed-password-file = {
2024-03-28 16:35:03 +01:00
file = "${secrets}/secrets/users-hashed-password-file.age";
2024-02-24 02:11:59 +01:00
mode = "400";
owner = "root";
group = "root";
};
2023-08-01 15:35:09 +02:00
}