nixos-config/common/users.nix

181 lines
4.5 KiB
Nix
Raw Normal View History

2023-10-09 10:44:07 -07:00
{ config, pkgs, ... }:
let
2024-03-03 00:11:51 -08:00
home = config.constants.homeDir;
2023-10-09 10:44:07 -07:00
usr = config.constants.userName;
usrPwdFile = "users/${usr}/password";
in
{
2024-03-03 14:58:03 -08:00
fonts = {
2024-03-13 22:04:42 -07:00
fontDir.enable = true;
2024-03-03 14:58:03 -08:00
fontconfig.defaultFonts = {
2024-03-13 22:04:42 -07:00
sansSerif = [ "Inter" "Noto Sans CJK SC" ];
monospace = [ "Iosevka" "Noto Sans Mono CJK SC" ];
2024-03-03 14:58:03 -08:00
};
packages = with pkgs; [
2024-03-13 22:04:42 -07:00
inter
iosevka
noto-fonts-cjk
2024-03-03 14:58:03 -08:00
];
};
2023-10-09 10:44:07 -07:00
home-manager = {
useGlobalPkgs = true;
2024-06-15 17:37:25 -07:00
useUserPackages = true;
2024-03-03 21:12:38 -08:00
users.${usr} = { config, osConfig, pkgs, ... }:
{
home = {
2024-06-16 17:05:31 -07:00
file = {
kvantum = {
enable = config.programs.plasma.enable;
target = ".config/Kvantum/kvantum.kvconfig";
text = ''
[General]
theme=Sweet-Ambar-Blue
'';
};
};
2024-03-03 21:12:38 -08:00
packages = with pkgs; [
dua
fd
nil
nixpkgs-fmt
rclone
sops
2024-06-15 17:37:25 -07:00
] ++ (if config.programs.plasma.enable then [
sweet-ambar-blue
2024-06-16 00:05:42 -07:00
wallpaper-engine-plasma6-plugin
2024-06-15 17:37:25 -07:00
yorha-sound-theme
] ++ (with kdePackages; [
qtmultimedia
qtstyleplugin-kvantum
qtwebchannel
qtwebengine
qtwebsockets
]) else [ ]);
2024-03-03 21:12:38 -08:00
stateVersion = osConfig.system.stateVersion;
2023-10-09 10:44:07 -07:00
};
2024-03-03 21:12:38 -08:00
programs = {
bat.enable = true;
bottom.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
2024-03-13 22:04:42 -07:00
eza.enable = true;
2024-03-03 21:12:38 -08:00
fish.enable = true;
fzf.enable = true;
git = {
enable = true;
extraConfig = {
core.autocrlf = "input";
init.defaultBranch = "development";
pull.rebase = false;
push.autoSetupRemote = true;
2023-10-09 10:44:07 -07:00
};
2024-03-03 21:12:38 -08:00
ignores = [
".direnv"
".envrc"
];
userEmail = osConfig.constants.postMaster;
userName = osConfig.constants.userName;
};
helix = {
enable = true;
defaultEditor = true;
settings = {
editor = {
lsp.display-inlay-hints = true;
soft-wrap.enable = true;
};
theme = "base16_transparent";
};
};
2024-06-15 17:37:25 -07:00
plasma = {
configFile = {
2024-06-16 17:05:31 -07:00
kscreenlockerrc.Daemon.Autolock = false;
kscreenlockerrc.Greeter.WallpaperPlugin = "org.kde.potd";
2024-06-15 17:37:25 -07:00
};
spectacle.shortcuts.captureRectangularRegion = "Meta+Shift+S";
workspace = {
colorScheme = "SweetAmbarBlue";
cursor.theme = "Sweet-cursors";
iconTheme = "Sweet-Rainbow";
lookAndFeel = "Sweet-Ambar-Blue";
theme = "Sweet-Ambar-Blue";
};
};
2024-03-03 21:12:38 -08:00
ripgrep.enable = true;
starship = {
enable = true;
enableTransience = true;
};
tealdeer.enable = true;
zoxide = {
enable = true;
options = [ "--cmd cd" ];
2023-10-09 10:44:07 -07:00
};
};
2024-03-03 21:12:38 -08:00
xdg.enable = true;
2023-10-09 10:44:07 -07:00
};
};
2024-06-28 17:14:24 -07:00
i18n.supportedLocales = [
"C.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ja_JP.UTF-8/UTF-8"
"zh_CN.UTF-8/UTF-8"
];
2024-04-16 21:53:55 -07:00
programs = {
fish.enable = true;
nh.enable = true;
};
2023-10-09 10:44:07 -07:00
2024-03-02 15:10:23 -08:00
services = {
openssh = {
hostKeys = [{
comment = "host@${config.networking.hostName}";
path = "/etc/ssh/host";
rounds = 100;
type = "ed25519";
}];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
resolved.enable = true;
2024-03-03 00:11:51 -08:00
syncthing = {
configDir = "${home}/.config/syncthing";
dataDir = "${home}/.local/share/syncthing";
openDefaultPorts = true;
overrideDevices = true;
overrideFolders = true;
settings.devices = config.constants.syncthingDevices;
user = usr;
};
2024-03-02 15:10:23 -08:00
};
2023-10-09 10:44:07 -07:00
sops.secrets.${usrPwdFile}.neededForUsers = true;
users = {
mutableUsers = false;
users.${usr} = {
description = "Sicheng Pan";
extraGroups = [
"audio"
"input"
"networkmanager"
"uinput"
"wheel"
];
hashedPasswordFile = config.sops.secrets.${usrPwdFile}.path;
home = config.constants.homeDir;
isNormalUser = true;
openssh.authorizedKeys.keys = config.constants.publicKeys;
shell = pkgs.fish;
};
};
}