ark/users/patriot/default.nix

272 lines
6.5 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 {
2022-11-27 01:04:43 +03:00
# imports = [../../modules/de/gnome];
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-10-04 02:08:44 +03:00
(l.optional nixosConfig.networking.networkmanager.enable "networkmanager")
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 [
2023-01-26 14:41:23 +03:00
# because steam will be fucked otherwise
2022-08-11 05:44:58 +03:00
(l.optional nixosConfig.programs.steam.enable "/home/patriot/.local/share/Steam")
2023-01-26 14:41:23 +03:00
# because cargo doesnt work otherwise
2022-07-30 03:04:32 +03:00
"/home/patriot/.cargo"
2023-01-26 14:41:23 +03:00
# same thing since i work with cargo and other shit
2022-07-30 03:04:32 +03:00
"/home/patriot/proj"
2023-01-26 14:41:23 +03:00
# same thing as steam
2022-07-30 03:04:32 +03:00
"/home/patriot/games"
2023-01-26 14:41:23 +03:00
# flatpak stuff
2022-08-23 08:18:37 +03:00
"/home/patriot/.var"
2023-01-26 14:41:23 +03:00
# libvirt stuff, dont think fuse mount would work here
2022-12-28 09:31:14 +03:00
"/home/patriot/.config/libvirt"
2022-07-30 03:04:32 +03:00
];
2022-10-04 02:08:44 +03:00
systemPackages = with 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;
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-12-28 09:31:14 +03:00
steam.enable = true;
2022-07-01 04:45:26 +03:00
# gnome stuffs
2022-05-21 14:17:48 +03:00
seahorse.enable = true;
2022-09-14 17:58:08 +03:00
dconf.enable = true;
2022-10-21 18:30:00 +03:00
weylus.users = ["patriot"];
2022-12-28 09:31:14 +03:00
java = {
enable = true;
package = pkgs.jre8;
};
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-09-17 17:17:54 +03:00
secrets,
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 [
2022-10-04 02:08:44 +03:00
# wm
2022-11-04 00:59:34 +03:00
# ["hyprland" "foot"]
2022-11-27 01:04:43 +03:00
["sway" "foot"]
2022-08-11 05:44:58 +03:00
# desktop stuff
2022-11-04 00:59:34 +03:00
["wayland"]
2022-12-28 09:31:14 +03:00
["chromium"]
2022-08-11 05:44:58 +03:00
# cli stuff
["zoxide" "zsh" "fzf" "starship" "direnv"]
# dev stuff
2023-02-09 08:39:50 +03:00
["helix" "git" "ssh"]
["lollypop"]
2022-08-11 05:44:58 +03:00
];
in
l.flatten [
2022-10-04 02:08:44 +03:00
./colors.nix
2022-08-11 05:44:58 +03:00
../../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-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"
]
++ mkPaths ".local/share" [
"direnv"
2022-06-16 21:38:12 +03:00
"zsh"
2022-06-21 23:31:28 +03:00
"keyrings"
2023-02-25 02:08:04 +03:00
# "lutris"
2022-08-23 08:18:37 +03:00
"Terraria"
2022-12-28 09:31:14 +03:00
"PrismLauncher"
2022-06-10 21:36:34 +03:00
]
++ mkPaths ".config" [
2023-02-25 02:08:04 +03:00
# "lutris"
2022-11-04 00:59:34 +03:00
"dconf"
2022-06-10 21:36:34 +03:00
];
2022-07-01 04:45:26 +03:00
files = l.flatten [
".config/wallpaper"
2022-10-21 18:30:00 +03:00
".config/wallpaper.mp4"
2022-11-04 00:59:34 +03:00
".config/gnome-initial-setup-done"
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-10-22 01:49:09 +03:00
settings.font.regular = {
2022-10-22 23:54:44 +03:00
name = "Comic Relief";
2022-10-22 01:49:09 +03:00
size = 13;
2022-10-22 23:54:44 +03:00
package = pkgs.comic-relief;
2022-10-22 01:49:09 +03:00
};
settings.font.monospace = {
2022-07-01 04:45:26 +03:00
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-09-14 17:58:08 +03:00
2022-10-04 02:08:44 +03:00
settings.iconTheme = {
2022-11-18 00:06:43 +03:00
name = "Yaru-dark";
2022-11-04 00:59:34 +03:00
package = pkgs.yaru-theme;
2022-10-04 02:08:44 +03:00
};
2022-09-14 17:58:08 +03:00
home.pointerCursor = {
2022-10-04 02:08:44 +03:00
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
2022-09-14 17:58:08 +03:00
size = 24;
gtk.enable = true;
x11.enable = true;
};
gtk = {
enable = true;
font = {
2022-10-22 01:49:09 +03:00
inherit (config.settings.font.regular) name package;
2022-09-14 17:58:08 +03:00
};
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
2022-10-04 02:08:44 +03:00
iconTheme = config.settings.iconTheme;
2022-09-14 17:58:08 +03:00
theme = {
2022-11-18 00:06:43 +03:00
name = "Yaru-dark";
2022-11-04 00:59:34 +03:00
package = pkgs.yaru-theme;
2022-09-14 17:58:08 +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
krita
gnupg
imv
mpv
ffmpeg
mupdf
2022-09-29 23:34:57 +03:00
xdg-utils
2023-02-25 02:08:04 +03:00
# lutris
2022-08-11 05:44:58 +03:00
protontricks
2022-09-17 17:50:16 +03:00
# fractal-next
2023-02-25 02:08:04 +03:00
# obs-studio
2022-10-25 17:44:39 +03:00
libreoffice-fresh
2023-02-25 02:08:04 +03:00
helvum
2022-10-29 04:13:39 +03:00
nix-output-monitor
2023-02-25 02:08:04 +03:00
# prismlauncher
2023-02-09 08:39:50 +03:00
godot_4
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-11-27 01:04:43 +03:00
zsh.loginExtra = ''
if [[ "$(tty)" == "/dev/tty1" ]]; then
export WLR_DRM_DEVICES=/dev/dri/card0
exec sway --unsupported-gpu
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-09-12 02:26:21 +03:00
pinentryFlavor = "gnome3";
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
}