2023-09-11 23:20:34 +02:00
|
|
|
# Common users.
|
|
|
|
# Sources for this configuration:
|
|
|
|
# - a generated NixOS 23.05 configuration
|
|
|
|
# - https://nixos.org/manual/nixos/stable/#sec-user-management
|
2023-09-14 20:19:49 +02:00
|
|
|
# - https://git.grzb.de/yuri/nix-infra/-/blob/aa38daeea59f2ca12b7e591de6f8b61565780c48/configuration/common/default.nix#L19
|
|
|
|
# - https://git.grzb.de/yuri/nix-infra/-/blob/342a2f732da042d04e579d98e9f834418b7ebf25/users/colmena-deploy/default.nix
|
|
|
|
# - https://nixos.org/manual/nix/stable/command-ref/conf-file.html?highlight=nix.conf#available-settings
|
2023-09-11 23:20:34 +02:00
|
|
|
|
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
authorizedKeysRepo = builtins.fetchGit {
|
|
|
|
url = "ssh://git@gitlab.hamburg.ccc.de:4242/ccchh/infrastructure-authorized-keys.git";
|
|
|
|
ref = "trunk";
|
2024-01-14 21:04:03 +01:00
|
|
|
rev = "6dbf11113603a4f6c12f781c2dc7a8980e65a131";
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
2023-09-14 20:19:49 +02:00
|
|
|
authorizedKeys = builtins.filter (item: item != "") (lib.strings.splitString "\n" (builtins.readFile "${authorizedKeysRepo}/authorized_keys"));
|
2023-09-11 23:20:34 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
users.mutableUsers = false;
|
|
|
|
|
|
|
|
users.users.chaos = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "Chaos";
|
|
|
|
extraGroups = [ "wheel" ];
|
2023-09-14 20:19:49 +02:00
|
|
|
openssh.authorizedKeys.keys = authorizedKeys;
|
2023-09-11 23:20:34 +02:00
|
|
|
};
|
|
|
|
|
2023-09-14 20:19:49 +02:00
|
|
|
users.users.colmena-deploy = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
openssh.authorizedKeys.keys = authorizedKeys;
|
|
|
|
};
|
|
|
|
|
|
|
|
nix.settings.trusted-users = [ "colmena-deploy" ];
|
|
|
|
|
2023-09-11 23:20:34 +02:00
|
|
|
# Since our user doesn't have a password, allow passwordless sudo for wheel.
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
}
|