ark/users/patriot/default.nix

218 lines
5.2 KiB
Nix
Raw Normal View History

2022-02-18 20:31:01 +03:00
{
pkgs,
lib,
2022-04-09 22:01:44 +03:00
tlib,
2022-07-01 04:45:26 +03:00
config,
inputs,
2022-02-18 20:31:01 +03:00
...
2022-04-09 21:33:13 +03:00
} @ globalAttrs: let
2022-07-01 04:45:26 +03:00
l = lib // builtins;
2022-04-09 21:33:13 +03:00
nixosConfig = globalAttrs.config;
2022-02-18 20:31:01 +03:00
in {
2020-11-21 23:54:07 +03:00
users.users.patriot = {
isNormalUser = true;
createHome = true;
home = "/home/patriot";
2022-07-30 03:04:32 +03:00
extraGroups = l.flatten [
2022-02-18 20:31:01 +03:00
"wheel"
"adbusers"
"dialout"
2022-07-21 01:41:36 +03:00
"video"
2022-07-30 03:04:32 +03:00
(l.optional nixosConfig.virtualisation.docker.enable "docker")
2022-02-18 20:31:01 +03:00
];
2020-11-21 23:54:07 +03:00
shell = pkgs.zsh;
2022-03-09 23:55:02 +03:00
hashedPassword = "$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/";
2020-11-21 23:54:07 +03:00
};
2021-08-23 21:25:02 +03:00
environment = {
2022-07-30 03:04:32 +03:00
persistence.${config.system.persistDir}.directories = l.flatten [
2022-08-11 05:44:58 +03:00
(l.optional nixosConfig.programs.steam.enable "/home/patriot/.local/share/Steam")
2022-07-30 03:04:32 +03:00
"/home/patriot/.cargo"
"/home/patriot/proj"
"/home/patriot/games"
2022-08-23 08:18:37 +03:00
"/home/patriot/.var"
2022-07-30 03:04:32 +03:00
];
2022-07-01 04:45:26 +03:00
systemPackages = [pkgs.qt5.qtwayland];
2022-02-18 20:31:01 +03:00
shells = with pkgs; [bashInteractive zsh];
2021-08-23 21:25:02 +03:00
};
2020-11-21 23:54:07 +03:00
xdg.portal = {
enable = true;
2022-07-01 04:45:26 +03:00
wlr.enable = true;
2022-08-14 01:27:38 +03:00
wlr.settings.screencast = {
output_name = "eDP-1";
max_fps = 60;
exec_before = "pkill mako";
exec_after = "mako";
chooser_type = "default";
};
2020-11-21 23:54:07 +03:00
};
programs = {
2022-07-01 04:45:26 +03:00
# this is needed for impermanence
2022-06-10 21:36:34 +03:00
fuse.userAllowOther = true;
2020-11-21 23:54:07 +03:00
adb.enable = true;
2022-07-12 03:56:08 +03:00
steam.enable = true;
2022-07-12 01:22:30 +03:00
kdeconnect.enable = true;
2022-07-01 04:45:26 +03:00
# gnome stuffs
2022-05-21 14:17:48 +03:00
seahorse.enable = true;
2020-11-21 23:54:07 +03:00
};
2022-08-14 01:27:38 +03:00
services = {
2022-08-15 03:49:56 +03:00
syncthing.folders = {
notes = {
enable = true;
path = "${config.users.users.patriot.home}/notes";
devices = ["redmi-phone"];
ignorePerms = true;
};
};
2022-09-12 02:24:41 +03:00
gnome.gnome-keyring.enable = true;
2022-08-14 01:27:38 +03:00
};
2022-07-01 04:45:26 +03:00
# gnome keyring better fr fr
security.pam.services.patriot = {
enableGnomeKeyring = true;
enableKwallet = false;
};
2022-09-12 02:24:41 +03:00
security.pam.services.swaylock = {
text = ''
auth include login
'';
};
systemd = {
2022-04-10 05:48:34 +03:00
targets.network-online.enable = false;
services = {
systemd-networkd-wait-online.enable = false;
NetworkManager-wait-online.enable = false;
2021-01-17 17:25:54 +03:00
};
};
2022-03-09 23:55:02 +03:00
home-manager.users.patriot = {
config,
pkgs,
2022-06-10 21:36:34 +03:00
inputs,
2022-03-09 23:55:02 +03:00
...
}: let
personal = import ../../personal.nix;
name = personal.name;
email = personal.emails.primary;
in {
2022-08-11 05:44:58 +03:00
imports = let
modulesToEnable = l.flatten [
# desktop stuff
["firefox" "hyprland" "wezterm" "font" "rofi" "mako" "discord"]
# cli stuff
["zoxide" "zsh" "fzf" "starship" "direnv"]
# dev stuff
2022-08-15 03:49:56 +03:00
["helix" "git" "ssh" "obsidian"]
2022-08-11 05:44:58 +03:00
];
in
l.flatten [
../../modules/persist
inputs.nixos-persistence.nixosModules.home-manager.impermanence
(tlib.prefixStrings "${inputs.self}/users/modules/" modulesToEnable)
];
2022-06-10 21:36:34 +03:00
2022-07-01 04:45:26 +03:00
system.persistDir = nixosConfig.system.persistDir;
2022-06-30 03:53:13 +03:00
2022-07-01 04:45:26 +03:00
home.persistence."${config.system.persistDir}${config.home.homeDirectory}" = let
2022-08-11 05:44:58 +03:00
mkPaths = pfx: paths: tlib.prefixStrings "${pfx}/" (l.flatten paths);
2022-06-10 21:36:34 +03:00
in {
directories =
2022-07-12 03:56:08 +03:00
l.flatten [
2022-06-10 21:36:34 +03:00
"Downloads"
2022-06-16 21:38:12 +03:00
# "smos"
2022-06-21 23:31:28 +03:00
".wine"
2022-06-10 21:36:34 +03:00
# ssh / gpg / keys
".ssh"
".gnupg"
"keys"
# caches / history stuff
".directory_history"
".cache"
2022-08-15 03:49:56 +03:00
"notes"
2022-06-10 21:36:34 +03:00
]
++ mkPaths ".local/share" [
"direnv"
2022-06-16 21:38:12 +03:00
"zsh"
2022-06-21 23:31:28 +03:00
"keyrings"
"lutris"
2022-08-23 08:18:37 +03:00
"Terraria"
2022-06-10 21:36:34 +03:00
]
++ mkPaths ".config" [
2022-06-21 23:31:28 +03:00
"lutris"
2022-07-12 01:22:30 +03:00
"kdeconnect"
2022-06-10 21:36:34 +03:00
];
2022-07-01 04:45:26 +03:00
files = l.flatten [
".config/wallpaper"
2022-06-11 18:53:17 +03:00
(lib.removePrefix "~/" config.programs.ssh.userKnownHostsFile)
2022-06-10 21:36:34 +03:00
];
allowOther = true;
};
2022-08-11 05:44:58 +03:00
fonts.fontconfig.enable = l.mkForce true;
2022-07-01 04:45:26 +03:00
fonts.settings = {
enable = true;
name = "Comic Mono";
size = 13;
2022-08-11 05:44:58 +03:00
package = pkgs.comic-mono;
2022-07-01 04:45:26 +03:00
};
2022-03-09 23:55:02 +03:00
home = {
homeDirectory = nixosConfig.users.users.patriot.home;
2022-08-11 05:44:58 +03:00
packages = with pkgs; [
# Font stuff
noto-fonts-cjk
font-awesome
dejavu_fonts
# Programs
bitwarden
cargo-outdated
cargo-release
cargo-udeps
vulkan-tools
krita
cachix
gnupg
imv
mpv
ffmpeg
mupdf
xdg_utils
rust-analyzer
cloudflared
lutris
protontricks
2022-09-12 02:24:41 +03:00
fractal-next
2022-08-11 05:44:58 +03:00
];
2022-03-09 23:55:02 +03:00
};
programs = {
2022-06-16 21:38:12 +03:00
command-not-found.enable =
nixosConfig.programs.command-not-found.enable;
2022-03-09 23:55:02 +03:00
git = {
signing = {
key = "E1C119F91F4CAE53E8445CAFBB57FCE7E35984F6";
signByDefault = true;
2021-05-03 07:48:31 +03:00
};
2022-03-09 23:55:02 +03:00
userName = name;
userEmail = email;
};
2022-08-11 05:44:58 +03:00
zsh.loginExtra = ''
if [[ "$(tty)" == "/dev/tty1" ]]; then
exec Hyprland
fi
'';
2022-03-09 23:55:02 +03:00
};
services = {
gpg-agent = let
defaultCacheTtl = 3600 * 6;
maxCacheTtl = 3600 * 24;
in {
inherit defaultCacheTtl maxCacheTtl;
enable = true;
enableSshSupport = true;
sshKeys = ["8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965"];
defaultCacheTtlSsh = defaultCacheTtl;
maxCacheTtlSsh = maxCacheTtl;
grabKeyboardAndMouse = false;
2022-07-01 04:45:26 +03:00
pinentryFlavor = "gtk2";
2021-07-05 00:01:15 +03:00
};
2021-05-03 07:48:31 +03:00
};
2022-03-09 23:55:02 +03:00
};
2020-11-21 23:54:07 +03:00
}