nixos-config/common/users.nix

296 lines
7.4 KiB
Nix
Raw Normal View History

2024-08-14 11:14:20 -07:00
{
config,
pkgs,
...
2024-08-31 21:13:43 -07:00
}:
with config.constants; let
usrPwdFile = "users/${userName}/password";
2024-08-14 11:14:20 -07:00
in {
2024-07-19 23:11:35 -07:00
console.enable = false;
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-08-14 11:14:20 -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
2024-10-23 19:42:59 -07:00
noto-fonts-cjk-sans
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-08-31 21:13:43 -07:00
users.${userName} = {
2024-08-14 11:14:20 -07:00
config,
osConfig,
pkgs,
...
}: {
home = {
file.kvantum = {
enable = config.programs.plasma.enable;
target = ".config/Kvantum/kvantum.kvconfig";
text = ''
[General]
theme=Sweet-Ambar-Blue
'';
};
packages = with pkgs;
[
alejandra
2024-03-03 21:12:38 -08:00
dua
fd
nil
rclone
sops
2024-08-14 11:14:20 -07:00
]
++ (
if config.programs.plasma.enable
2025-04-19 09:50:10 +08:00
then [
kdePackages.qtstyleplugin-kvantum
sweet-ambar-blue
yorha-sound-theme
]
2024-08-14 11:14:20 -07:00
else []
);
stateVersion = osConfig.system.stateVersion;
};
programs = {
bat.enable = true;
bottom.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
2023-10-09 10:44:07 -07:00
};
2024-08-14 11:14:20 -07:00
eza.enable = true;
firefox.enable = config.programs.plasma.enable;
fish.enable = true;
fzf.enable = true;
git = {
enable = true;
extraConfig = {
2025-02-27 12:48:44 +08:00
column.ui = "auto";
commit.verbose = true;
2024-08-14 11:14:20 -07:00
core.autocrlf = "input";
2025-02-27 12:48:44 +08:00
fetch = {
prune = true;
pruneTags = true;
all = true;
};
help.autocorrect = "prompt";
2024-08-14 11:14:20 -07:00
init.defaultBranch = "development";
pull.rebase = false;
2025-02-27 12:48:44 +08:00
push = {
autoSetupRemote = true;
default = "simple";
};
rebase = {
autoSquash = true;
autoStash = true;
};
2024-03-03 21:12:38 -08:00
};
2024-08-14 11:14:20 -07:00
ignores = [
".direnv"
".envrc"
];
2024-08-31 21:13:43 -07:00
userEmail = postMaster;
userName = userName;
2024-08-14 11:14:20 -07:00
};
helix = {
enable = true;
defaultEditor = true;
settings = {
editor = {
lsp.display-inlay-hints = true;
soft-wrap.enable = true;
2023-10-09 10:44:07 -07:00
};
2024-08-14 11:14:20 -07:00
theme = "base16_transparent";
2024-03-03 21:12:38 -08:00
};
2024-08-14 11:14:20 -07:00
};
kitty = {
enable = config.programs.plasma.enable;
settings = {
background_opacity = "0.96";
2025-02-24 02:22:49 +08:00
hide_window_decorations = "yes";
2024-08-14 11:14:20 -07:00
remember_window_size = "no";
2024-03-03 21:12:38 -08:00
};
2024-09-22 00:44:00 -07:00
themeFile = "tokyo_night_moon";
2024-08-14 11:14:20 -07:00
};
2025-06-22 23:35:23 -05:00
jujutsu = {
enable = true;
settings = {
signing = {
behaviour = "own";
backend = "gpg";
};
ui = {
editor = "hx";
pager = "bat";
};
user = {
email = postMaster;
name = userName;
};
};
};
2024-08-14 11:14:20 -07:00
plasma = {
2024-08-31 21:13:43 -07:00
enable = osConfig.services.desktopManager.plasma6.enable;
2024-08-14 11:14:20 -07:00
configFile = {
2024-08-14 22:52:07 -07:00
baloofilerc = {
"Basic Settings".Indexing-Enabled = true;
General."only basic indexing" = true;
};
2024-08-14 11:14:20 -07:00
kded5rc.Module-browserintegrationreminder.autoload = false;
kdeglobals.General = {
TerminalApplication = "kitty";
TerminalService = "kitty.desktop";
2024-08-13 14:09:56 -07:00
};
2024-08-14 11:14:20 -07:00
};
2024-08-31 21:13:43 -07:00
desktop.icons = {
alignment = "left";
arrangement = "leftToRight";
lockInPlace = true;
sorting = {
foldersFirst = true;
mode = "type";
};
};
immutableByDefault = true;
2024-08-14 11:14:20 -07:00
kscreenlocker = {
2024-09-08 13:41:07 -07:00
appearance.wallpaperPictureOfTheDay.provider = "bing";
2024-08-14 11:14:20 -07:00
autoLock = true;
lockOnResume = true;
passwordRequired = true;
2024-09-08 13:41:07 -07:00
timeout = 30;
2024-08-14 11:14:20 -07:00
};
kwin = {
2024-08-20 13:31:41 -07:00
borderlessMaximizedWindows = true;
2024-08-14 11:14:20 -07:00
effects = {
blur.enable = true;
desktopSwitching.animation = "slide";
dimAdminMode.enable = true;
windowOpenClose.animation = "glide";
2024-08-13 14:09:56 -07:00
};
2024-08-14 11:14:20 -07:00
virtualDesktops = {
number = 4;
rows = 1;
2024-06-15 17:37:25 -07:00
};
};
2024-08-14 11:14:20 -07:00
overrideConfig = true;
panels = [
{
floating = false;
height = 36;
widgets = [
{
kickoff = {
icon = "nix-snowflake-white";
sortAlphabetically = true;
};
}
"org.kde.plasma.pager"
{
iconTasks.launchers = [];
}
"org.kde.plasma.marginsseparator"
2025-06-23 23:46:32 -05:00
"org.kde.plasma.systemtray"
2024-08-14 11:14:20 -07:00
"org.kde.plasma.digitalclock"
];
}
];
powerdevil.AC = {
autoSuspend.action = "nothing";
dimDisplay.enable = true;
powerButtonAction = "showLogoutScreen";
whenLaptopLidClosed = "turnOffScreen";
whenSleepingEnter = "standby";
2024-03-03 21:12:38 -08:00
};
2024-08-14 11:14:20 -07:00
spectacle.shortcuts.captureRectangularRegion = "Meta+Shift+S";
workspace = {
colorScheme = "SweetAmbarBlue";
iconTheme = "Sweet-Rainbow";
lookAndFeel = "Sweet-Ambar-Blue";
soundTheme = "yorha";
2024-12-15 21:16:43 -08:00
wallpaperPictureOfTheDay.provider = "bing";
2023-10-09 10:44:07 -07:00
};
};
2024-08-14 11:14:20 -07: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-08-14 11:14:20 -07:00
};
2023-10-09 10:44:07 -07:00
};
2024-06-28 17:42:21 -07:00
i18n = {
defaultLocale = "zh_CN.UTF-8";
2024-08-14 11:14:20 -07:00
supportedLocales = ["all"];
2024-06-28 17:42:21 -07:00
};
2024-06-28 17:14:24 -07:00
2024-04-16 21:53:55 -07:00
programs = {
2025-04-19 09:50:10 +08:00
command-not-found.enable = false;
2024-04-16 21:53:55 -07:00
fish.enable = true;
nh.enable = true;
2025-04-19 09:50:10 +08:00
nix-index.enable = true;
2024-04-16 21:53:55 -07:00
};
2023-10-09 10:44:07 -07:00
2024-03-02 15:10:23 -08:00
services = {
openssh = {
2024-08-14 11:14:20 -07:00
hostKeys = [
{
comment = "host@${config.networking.hostName}";
path = "/etc/ssh/host";
rounds = 100;
type = "ed25519";
}
];
2024-03-02 15:10:23 -08:00
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
resolved.enable = true;
2024-03-03 00:11:51 -08:00
syncthing = {
2024-08-31 21:13:43 -07:00
configDir = "${homeDir}/.config/syncthing";
dataDir = "${homeDir}/.local/share/syncthing";
2024-03-03 00:11:51 -08:00
openDefaultPorts = true;
overrideDevices = true;
overrideFolders = true;
2024-08-31 21:13:43 -07:00
settings.devices = syncthingDevices;
user = userName;
2024-03-03 00:11:51 -08:00
};
2024-03-02 15:10:23 -08:00
};
2023-10-09 10:44:07 -07:00
sops.secrets.${usrPwdFile}.neededForUsers = true;
users = {
mutableUsers = false;
2024-08-31 21:13:43 -07:00
users.${userName} = {
2023-10-09 10:44:07 -07:00
description = "Sicheng Pan";
extraGroups = [
"audio"
2024-10-23 19:42:59 -07:00
"dialout"
2023-10-09 10:44:07 -07:00
"input"
"networkmanager"
"uinput"
"wheel"
];
hashedPasswordFile = config.sops.secrets.${usrPwdFile}.path;
2024-08-31 21:13:43 -07:00
home = homeDir;
2023-10-09 10:44:07 -07:00
isNormalUser = true;
2024-08-31 21:13:43 -07:00
openssh.authorizedKeys.keys = publicKeys;
2023-10-09 10:44:07 -07:00
shell = pkgs.fish;
};
};
}