nixos-config/modules/users/alexander.nix
2023-07-19 14:01:24 +02:00

75 lines
2.1 KiB
Nix

{ pkgs, lib, config, ... }:
{
config = lib.mkIf (config.ptw.system.singleUser == "alexander") {
users.users.alexander = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" "scanner" "lp" "alexander" "cdrom" ];
hashedPassword = "$y$j9T$xhnK648hF0yzDnRy0rTT/.$HbDKvNetiGeY3Xjt6/YPIzoxSmdQ0SzhXengOT1Ga01";
shell = pkgs.zsh;
useDefaultShell = false;
uid = 1000;
isSystemUser = false;
};
users.groups.alexander = {};
# Activate gpg
programs.gnupg.agent.enable = true;
# No need to use users."${system.singleUser}" as we already know it
home-manager.users.alexander = {
programs.home-manager.enable = true;
home.stateVersion = "22.11";
programs.ssh = {
enable = true;
matchBlocks = let
sshPort = 1847;
in {
ayame = {
port = sshPort;
hostname = "78.46.184.48";
user = "alexander";
identityFile = "~/.ssh/polynom.me_ayame";
identitiesOnly = true;
};
taihou = {
port = sshPort;
hostname = "162.55.43.248";
user = "alexander";
identityFile = "~/.ssh/polynom.me_ayame";
identitiesOnly = true;
};
"git.polynom.me" = {
port = 2222;
user = "gitea";
hostname = "git.polynom.me";
identityFile = "~/.ssh/gitea_papatutuwawa";
};
"github.com" = {
user = "git";
hostname = "github.com";
identityFile = "~/.ssh/github_polynomdivision";
};
"codeberg.org" = {
user = "git";
hostname = "codeberg.org";
identityFile = "~/.ssh/codeberg_papatutuwawa";
};
"collaborating.tuhh.de" = {
user = "git";
hostname = "collaborating.tuhh.de";
identityFile = "~/.ssh/gitlab_tuhh";
};
};
};
# TODO: Maybe move this somewhere else
services.gpg-agent = {
enable = true;
pinentryFlavor = "qt";
};
};
};
}