nix/nixos/users/albert/default.nix

38 lines
1.1 KiB
Nix
Raw Normal View History

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