nix/nixos/users/albert/default.nix

30 lines
945 B
Nix
Raw Normal View History

2023-08-23 10:04:54 +02:00
{ config, desktop, lib, pkgs, ... }:
let
ifExists = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in {
2023-08-23 07:30:15 +02:00
# Define a user account.
2023-12-17 01:06:31 +01:00
imports = [ ] ++ lib.optional (builtins.isString desktop) ./desktop.nix;
2023-09-17 14:15:44 +02:00
users.mutableUsers = false;
2023-08-23 07:30:15 +02:00
users.users.albert = {
isNormalUser = true;
description = "Albert J. Copeland";
# video is required for the "light" command to work
2023-12-01 12:07:22 +01:00
extraGroups = [ "networkmanager" "wheel" ]
2023-12-01 12:33:50 +01:00
++ ifExists [ "video" ]
2023-12-01 12:07:22 +01:00
++ ifExists [ "docker" ];
2023-08-23 15:38:35 +02:00
# mkpasswd -m sha-512
2023-08-23 07:30:15 +02:00
hashedPassword = "$y$j9T$wKLsIWaA4Gf63RvjedwLJ0$EHKL6BBJV0CAxEKcHHjaBqW085KJ/MGvmbyWzmcWOy6";
packages = [ pkgs.home-manager ];
2023-09-18 07:03:57 +02:00
openssh.authorizedKeys.keyFiles = [ ../../../keys/ssh/keys.txt ];
2023-08-23 07:30:15 +02:00
};
2023-12-13 00:44:16 +01:00
2024-01-13 03:15:04 +01:00
users.groups.albert = {
gid = 1000;
name = "albert";
members = [ "albert" ];
};
2023-12-13 00:44:16 +01:00
# Make this user trusted
nix.settings.trusted-users = [ "albert" ];
2024-01-13 03:15:04 +01:00
}