From 00092b2face76ca802120473e42c456c960d6b49 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 30 Oct 2024 19:24:16 +0100 Subject: [PATCH] refactor: Unify Structure --- STRUCTURE.md | 6 +- config/basic/default.nix | 1 + config/basic/home-manager.nix | 8 +- config/basic/nix.nix | 3 + config/optional/graphical.nix | 224 ------------- config/optional/steam.nix | 20 -- config/optional/vr.nix | 11 - config/{hardware => support}/bluetooth.nix | 0 config/{optional => support}/initrd-ssh.nix | 0 config/{hardware => support}/laptop.nix | 0 config/{hardware => support}/nintendo.nix | 0 config/{hardware => support}/nvidia.nix | 0 config/{hardware => support}/physical.nix | 0 config/{hardware => support}/pipewire.nix | 0 .../{hardware => support}/prime-offload.nix | 0 config/{optional => support}/printing.nix | 0 config/{optional => support}/secureboot.nix | 0 config/support/vr.nix | 46 +++ config/{hardware => support}/yubikey.nix | 0 config/{optional => support}/zfs.nix | 0 hosts/desktopnix/default.nix | 26 +- hosts/elisabeth/default.nix | 9 +- hosts/maddy/default.nix | 4 +- hosts/patricknix/default.nix | 28 +- hosts/testienix/default.nix | 6 +- modules-hm/hm-all.nix | 40 +++ modules/secrets.nix | 20 -- pkgs/actual.nix | 77 ----- pkgs/default.nix | 1 - pkgs/ollama-webui.nix | 62 ---- secrets/secrets.nix.age | Bin 5958 -> 7851 bytes users/common/{graphical => }/Xorg/default.nix | 0 .../{graphical => }/Xorg/herbst-keys.nix | 0 .../{graphical => }/Xorg/herbstluft.nix | 0 users/common/{graphical => }/Xorg/i3.nix | 0 users/common/{graphical => }/Xorg/polybar.nix | 0 users/common/{graphical => }/Xorg/rofi.nix | 3 + users/common/Xorg/sway3.nix | 246 ++++++++++++++ users/common/{graphical => }/Xorg/xinitrc | 0 .../common/Xorg}/xserver.nix | 0 users/common/{shells => }/alias.nix | 2 +- users/common/default.nix | 14 - {config/optional => users/common}/dev.nix | 0 users/common/graphical/default.nix | 23 -- users/common/graphical/sway3.nix | 240 -------------- users/common/graphical/wayland/default.nix | 16 - users/common/graphical/wayland/fuzzel.nix | 11 - users/common/graphical/wayland/hyprland.nix | 306 ----------------- users/common/graphical/wayland/sway.nix | 101 ------ users/common/impermanence.nix | 26 -- users/common/programs/bottles.nix | 7 +- users/common/programs/direnv.nix | 5 +- users/common/programs/firefox.nix | 8 +- users/common/programs/gdb.nix | 30 +- users/common/programs/git.nix | 72 ++-- users/common/programs/gpg.nix | 4 +- users/common/programs/gpu-screen-recorder.nix | 11 +- users/common/programs/htop.nix | 2 +- users/common/programs/kitty.nix | 4 +- users/common/programs/minecraft.nix | 4 +- .../common/{shells => programs}/nu/config.nu | 0 .../{shells => programs}/nu/default.nix | 3 + users/common/{shells => programs}/nu/env.nu | 0 users/common/programs/nvim/default.nix | 104 +++--- .../programs/nvim/{nixvim => }/keybinds.nix | 2 +- .../programs/nvim/{nixvim => }/options.nix | 2 +- .../programs/nvim/{nixvim => }/plugins.nix | 2 +- .../nvim/{nixvim => }/plugins/alpha.nix | 2 +- .../nvim/{nixvim => }/plugins/cmp.nix | 2 +- .../nvim/{nixvim => }/plugins/lsp.nix | 2 +- .../nvim/{nixvim => }/plugins/neo-tree.nix | 2 +- users/common/programs/obs.nix | 5 +- users/common/{shells => programs}/pager.nix | 2 +- users/common/programs/poe.nix | 6 +- users/common/programs/spicetify.nix | 7 +- users/common/programs/steam.nix | 35 ++ users/common/programs/thunderbird.nix | 138 ++++---- users/common/programs/zsh/default.nix | 68 ++++ .../{shells => programs/zsh}/starfish.nix | 2 +- users/common/{shells => programs}/zsh/zshrc | 0 users/common/shells/zsh/default.nix | 65 ---- .../common/wayland/default.nix | 27 +- users/common/wayland/fuzzel.nix | 14 + users/common/wayland/hyprland.nix | 308 ++++++++++++++++++ users/common/wayland/sway.nix | 108 ++++++ .../wayland/swaync/default.nix | 5 +- .../{graphical => }/wayland/swaync/swaync.css | 0 users/common/{graphical => }/wayland/swww.nix | 2 +- .../wayland/waybar/default.nix | 10 +- .../{graphical => }/wayland/waybar/waybar.css | 0 users/patrick/default.nix | 76 ++--- users/patrick/firefox.nix | 2 +- users/patrick/gpg/default.nix | 18 +- users/patrick/impermanence.nix | 29 +- users/patrick/minion.nix | 16 +- users/patrick/patrick.nix | 97 +++--- users/patrick/secrets.nix.age | Bin 2560 -> 0 bytes users/patrick/smb.nix | 12 +- users/patrick/ssh.nix | 18 +- users/patrick/theme.nix | 199 +++++++++++ users/patrick/vr.nix | 33 -- users/root/default.nix | 3 - 102 files changed, 1494 insertions(+), 1659 deletions(-) delete mode 100644 config/optional/graphical.nix delete mode 100644 config/optional/steam.nix delete mode 100644 config/optional/vr.nix rename config/{hardware => support}/bluetooth.nix (100%) rename config/{optional => support}/initrd-ssh.nix (100%) rename config/{hardware => support}/laptop.nix (100%) rename config/{hardware => support}/nintendo.nix (100%) rename config/{hardware => support}/nvidia.nix (100%) rename config/{hardware => support}/physical.nix (100%) rename config/{hardware => support}/pipewire.nix (100%) rename config/{hardware => support}/prime-offload.nix (100%) rename config/{optional => support}/printing.nix (100%) rename config/{optional => support}/secureboot.nix (100%) create mode 100644 config/support/vr.nix rename config/{hardware => support}/yubikey.nix (100%) rename config/{optional => support}/zfs.nix (100%) create mode 100644 modules-hm/hm-all.nix delete mode 100644 pkgs/actual.nix delete mode 100644 pkgs/ollama-webui.nix rename users/common/{graphical => }/Xorg/default.nix (100%) rename users/common/{graphical => }/Xorg/herbst-keys.nix (100%) rename users/common/{graphical => }/Xorg/herbstluft.nix (100%) rename users/common/{graphical => }/Xorg/i3.nix (100%) rename users/common/{graphical => }/Xorg/polybar.nix (100%) rename users/common/{graphical => }/Xorg/rofi.nix (67%) create mode 100644 users/common/Xorg/sway3.nix rename users/common/{graphical => }/Xorg/xinitrc (100%) rename {config/optional => users/common/Xorg}/xserver.nix (100%) rename users/common/{shells => }/alias.nix (95%) delete mode 100644 users/common/default.nix rename {config/optional => users/common}/dev.nix (100%) delete mode 100644 users/common/graphical/default.nix delete mode 100644 users/common/graphical/sway3.nix delete mode 100644 users/common/graphical/wayland/default.nix delete mode 100644 users/common/graphical/wayland/fuzzel.nix delete mode 100644 users/common/graphical/wayland/hyprland.nix delete mode 100644 users/common/graphical/wayland/sway.nix delete mode 100644 users/common/impermanence.nix rename users/common/{shells => programs}/nu/config.nu (100%) rename users/common/{shells => programs}/nu/default.nix (81%) rename users/common/{shells => programs}/nu/env.nu (100%) rename users/common/programs/nvim/{nixvim => }/keybinds.nix (98%) rename users/common/programs/nvim/{nixvim => }/options.nix (98%) rename users/common/programs/nvim/{nixvim => }/plugins.nix (98%) rename users/common/programs/nvim/{nixvim => }/plugins/alpha.nix (98%) rename users/common/programs/nvim/{nixvim => }/plugins/cmp.nix (99%) rename users/common/programs/nvim/{nixvim => }/plugins/lsp.nix (97%) rename users/common/programs/nvim/{nixvim => }/plugins/neo-tree.nix (97%) rename users/common/{shells => programs}/pager.nix (96%) create mode 100644 users/common/programs/steam.nix create mode 100644 users/common/programs/zsh/default.nix rename users/common/{shells => programs/zsh}/starfish.nix (98%) rename users/common/{shells => programs}/zsh/zshrc (100%) delete mode 100644 users/common/shells/zsh/default.nix rename config/optional/wayland.nix => users/common/wayland/default.nix (72%) create mode 100644 users/common/wayland/fuzzel.nix create mode 100644 users/common/wayland/hyprland.nix create mode 100644 users/common/wayland/sway.nix rename users/common/{graphical => }/wayland/swaync/default.nix (92%) rename users/common/{graphical => }/wayland/swaync/swaync.css (100%) rename users/common/{graphical => }/wayland/swww.nix (98%) rename users/common/{graphical => }/wayland/waybar/default.nix (97%) rename users/common/{graphical => }/wayland/waybar/waybar.css (100%) delete mode 100644 users/patrick/secrets.nix.age create mode 100644 users/patrick/theme.nix delete mode 100644 users/patrick/vr.nix diff --git a/STRUCTURE.md b/STRUCTURE.md index c786868..8f0af21 100644 --- a/STRUCTURE.md +++ b/STRUCTURE.md @@ -4,7 +4,7 @@ This file contains a small overview over the contents and structure of this repo - `basic/` the basic system configuration, this should be applied for all systems - `system.nix` a far descendant of the original `configuration.nix` any global configuration should be done here first and later moved to their own file if necessary - - `hardware/` configuration for specific hardware + - `support/` configuration for supporting specific hardware - `optional/` optionally includable configuration - `services/` configuration for independent services - `hosts/` contain nixos configuration for hosts @@ -30,9 +30,9 @@ This file contains a small overview over the contents and structure of this repo - `secrets.nix.age` global secrets available at deploy - `users/` home manager user configuration - `common/` shared home-manager modules - - `graphical/` configuration for graphical programs + - `wayland/` configuration for wayland windowmanagers and basic utilities + - `xorg/` configuration for xorg windowmanagers and basic utilities - `programs/` configuration for miscellaneous programs - - `shells/` configuration for shells - `default.nix` minimal setup for all users - `/` configuration for users - `impermanence.nix` users persistence configuration diff --git a/config/basic/default.nix b/config/basic/default.nix index b68000f..4116fcd 100644 --- a/config/basic/default.nix +++ b/config/basic/default.nix @@ -34,6 +34,7 @@ inputs.nixos-extra-modules.nixosModules.default inputs.nixos-nftables-firewall.nixosModules.default inputs.nixvim.nixosModules.nixvim + inputs.stylix.nixosModules.stylix ]; age.identityPaths = [ "/state/etc/ssh/ssh_host_ed25519_key" ]; boot.mode = lib.mkDefault "efi"; diff --git a/config/basic/home-manager.nix b/config/basic/home-manager.nix index 3df616d..0b05988 100644 --- a/config/basic/home-manager.nix +++ b/config/basic/home-manager.nix @@ -1,7 +1,6 @@ { stateVersion, inputs, - pkgs, nodes, minimal, ... @@ -9,6 +8,7 @@ { imports = [ ../../modules-hm/impermanence.nix + ../../modules-hm/hm-all.nix ]; home-manager = { useGlobalPkgs = true; @@ -16,10 +16,12 @@ verbose = true; extraSpecialArgs = { inherit nodes minimal; - spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; }; sharedModules = [ - { home.stateVersion = stateVersion; } + { + home.stateVersion = stateVersion; + systemd.user.startServices = "sd-switch"; + } inputs.nix-index-database.hmModules.nix-index inputs.nixos-extra-modules.homeManagerModules.default inputs.nixvim.homeManagerModules.nixvim diff --git a/config/basic/nix.nix b/config/basic/nix.nix index f86ac9f..76bf159 100644 --- a/config/basic/nix.nix +++ b/config/basic/nix.nix @@ -59,4 +59,7 @@ }; programs.nix-ld.enable = true; system.stateVersion = stateVersion; + hm-all.nixpkgs.config = { + allowUnfree = true; + }; } diff --git a/config/optional/graphical.nix b/config/optional/graphical.nix deleted file mode 100644 index 3c54ff4..0000000 --- a/config/optional/graphical.nix +++ /dev/null @@ -1,224 +0,0 @@ -{ - config, - inputs, - pkgs, - lib, - ... -}: -let - inherit (lib) mkOption types; -in -{ - options.hidpi = mkOption { - default = false; - type = types.bool; - description = "Enable HighDPI configuration for this host and all installed users"; - }; - - # stylix acceses stylix options on import meaning you can only import this module when you're actually setting stylix options - imports = [ inputs.stylix.nixosModules.stylix ]; - - config = { - environment.systemPackages = with pkgs; [ xdg-utils ]; - xdg.portal = { - xdgOpenUsePortal = true; - enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-wlr - xdg-desktop-portal-gtk - ]; - config = { - common.default = [ - "gtk" - "hyprland" - ]; - sway.default = [ "wlr" ]; - }; - }; - # needed for gnome pinentry - services.dbus.packages = [ pkgs.gcr ]; - fonts = { - enableGhostscriptFonts = false; - fontDir.enable = false; - fontconfig = { - localConf = '' - - - - - monospace - - emoji - - - - sans-serif - - emoji - - - - serif - - emoji - - - - ''; - }; - packages = with pkgs; [ - (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) - ibm-plex - dejavu_fonts - unifont - freefont_ttf - gyre-fonts # TrueType substitutes for standard PostScript fonts - liberation_ttf - noto-fonts - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-emoji - noto-fonts-extra - ]; - }; - stylix.fonts = { - serif = { - package = pkgs.dejavu_fonts; - name = "IBM Plex Serif"; - }; - - sansSerif = { - package = pkgs.dejavu_fonts; - name = "IBM Plex Sans"; - }; - - monospace = { - # No need for patched nerd fonts, kitty can pick up on them automatically, - # and ideally every program should do that: https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font - package = pkgs.jetbrains-mono; - name = "JetBrains Mono"; - }; - - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; - }; - stylix = { - enable = true; - autoEnable = false; - polarity = "dark"; - image = config.lib.stylix.pixel "base00"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/vice.yaml"; - # Has to be green - override.base0B = "#00CC99"; - #base16Scheme = { - # base00 = "#101419"; - # base01 = "#171B20"; - # base02 = "#21262e"; - # base03 = "#242931"; - # base04 = "#485263"; - # base05 = "#b6beca"; - # base06 = "#dee1e6"; - # base07 = "#e3e6eb"; - # base08 = "#e05f65"; - # base09 = "#f9a872"; - # base0A = "#f1cf8a"; - # base0B = "#78dba9"; - # base0C = "#74bee9"; - # base0D = "#70a5eb"; - # base0E = "#c68aee"; - # base0F = "#9378de"; - #}; - ## based on decaycs-dark, bright variant - #base16Scheme = { - # base00 = "#101419"; - # base01 = "#171B20"; - # base02 = "#21262e"; - # base03 = "#242931"; - # base04 = "#485263"; - # base05 = "#b6beca"; - # base06 = "#dee1e6"; - # base07 = "#e3e6eb"; - # base08 = "#e5646a"; - # base09 = "#f7b77c"; - # base0A = "#f6d48f"; - # base0B = "#94F7C5"; - # base0C = "#79c3ee"; - # base0D = "#75aaf0"; - # base0E = "#cb8ff3"; - # base0F = "#9d85e1"; - #}; - }; - - home-manager.sharedModules = [ - ( - { - pkgs, - config, - nixosConfig, - ... - }: - { - stylix = { - cursor = { - package = pkgs.openzone-cursors; - name = "OpenZone_White_Slim"; - size = if nixosConfig.hidpi then 48 else 18; - }; - inherit (nixosConfig.stylix) polarity; - targets = { - gtk.enable = true; - bat.enable = true; - dunst.enable = true; - zathura.enable = true; - xresources.enable = true; - }; - }; - - xresources.properties = { - "Xft.hinting" = true; - "Xft.antialias" = true; - "Xft.autohint" = false; - "Xft.lcdfilter" = "lcddefault"; - "Xft.hintstyle" = "hintfull"; - "Xft.rgba" = "rgb"; - }; - - gtk = - let - gtk34extraConfig = { - gtk-application-prefer-dark-theme = 1; - gtk-cursor-theme-size = 18; - gtk-enable-animations = true; - gtk-xft-antialias = 1; - gtk-xft-dpi = 96; # XXX: delete for wayland? - gtk-xft-hinting = 1; - gtk-xft-hintstyle = "hintfull"; - gtk-xft-rgba = "rgb"; - }; - in - { - enable = true; - iconTheme = { - name = "Vimix-Doder"; - package = pkgs.vimix-icon-theme; - }; - - gtk2.extraConfig = "gtk-application-prefer-dark-theme = true"; - gtk3.extraConfig = gtk34extraConfig; - gtk4.extraConfig = gtk34extraConfig; - }; - - home.sessionVariables.GTK_THEME = config.gtk.theme.name; - - qt = { - enable = true; - platformTheme.name = "adwaita"; - style.name = "Adwaita-Dark"; - }; - } - ) - ]; - }; -} diff --git a/config/optional/steam.nix b/config/optional/steam.nix deleted file mode 100644 index 23a455b..0000000 --- a/config/optional/steam.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - minimal, - pkgs, - ... -}: -lib.optionalAttrs (!minimal) { - programs.gpu-screen-recorder.enable = true; - programs.steam = { - enable = true; - package = pkgs.steam.override { - extraPkgs = - pkgs: with pkgs; [ - # vampir überlebende braucht diese pkgs - libgdiplus - cups - ]; - }; - }; -} diff --git a/config/optional/vr.nix b/config/optional/vr.nix deleted file mode 100644 index fb53ae1..0000000 --- a/config/optional/vr.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - # can't play VR until https://github.com/hyprwm/Hyprland/pull/8116 is merged - services.monado = { - enable = true; - defaultRuntime = true; - }; - systemd.user.services.monado.environment = { - STEAMVR_LH_ENABLE = "1"; - XRT_COMPOSITOR_COMPUTE = "1"; - }; -} diff --git a/config/hardware/bluetooth.nix b/config/support/bluetooth.nix similarity index 100% rename from config/hardware/bluetooth.nix rename to config/support/bluetooth.nix diff --git a/config/optional/initrd-ssh.nix b/config/support/initrd-ssh.nix similarity index 100% rename from config/optional/initrd-ssh.nix rename to config/support/initrd-ssh.nix diff --git a/config/hardware/laptop.nix b/config/support/laptop.nix similarity index 100% rename from config/hardware/laptop.nix rename to config/support/laptop.nix diff --git a/config/hardware/nintendo.nix b/config/support/nintendo.nix similarity index 100% rename from config/hardware/nintendo.nix rename to config/support/nintendo.nix diff --git a/config/hardware/nvidia.nix b/config/support/nvidia.nix similarity index 100% rename from config/hardware/nvidia.nix rename to config/support/nvidia.nix diff --git a/config/hardware/physical.nix b/config/support/physical.nix similarity index 100% rename from config/hardware/physical.nix rename to config/support/physical.nix diff --git a/config/hardware/pipewire.nix b/config/support/pipewire.nix similarity index 100% rename from config/hardware/pipewire.nix rename to config/support/pipewire.nix diff --git a/config/hardware/prime-offload.nix b/config/support/prime-offload.nix similarity index 100% rename from config/hardware/prime-offload.nix rename to config/support/prime-offload.nix diff --git a/config/optional/printing.nix b/config/support/printing.nix similarity index 100% rename from config/optional/printing.nix rename to config/support/printing.nix diff --git a/config/optional/secureboot.nix b/config/support/secureboot.nix similarity index 100% rename from config/optional/secureboot.nix rename to config/support/secureboot.nix diff --git a/config/support/vr.nix b/config/support/vr.nix new file mode 100644 index 0000000..df6a5c1 --- /dev/null +++ b/config/support/vr.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: +{ + # can't play VR until https://github.com/hyprwm/Hyprland/pull/8116 is merged + services.monado = { + enable = true; + defaultRuntime = true; + }; + systemd.user.services.monado.environment = { + STEAMVR_LH_ENABLE = "1"; + XRT_COMPOSITOR_COMPUTE = "1"; + }; + hm = + { config, ... }: + { + home.packages = [ pkgs.wlx-overlay-s ]; + xdg.configFile."openxr/1/active_runtime.json".text = '' + { + "file_format_version": "1.0.0", + "runtime": { + "name": "Monado", + "library_path": "${pkgs.monado}/lib/libopenxr_monado.so" + } + } + ''; + + xdg.configFile."openvr/openvrpaths.vrpath".text = '' + { + "config" : + [ + "${config.xdg.dataHome}/Steam/config" + ], + "external_drivers" : null, + "jsonid" : "vrpathreg", + "log" : + [ + "${config.xdg.dataHome}/Steam/logs" + ], + "runtime" : + [ + "${pkgs.opencomposite}/lib/opencomposite" + ], + "version" : 1 + } + ''; + }; +} diff --git a/config/hardware/yubikey.nix b/config/support/yubikey.nix similarity index 100% rename from config/hardware/yubikey.nix rename to config/support/yubikey.nix diff --git a/config/optional/zfs.nix b/config/support/zfs.nix similarity index 100% rename from config/optional/zfs.nix rename to config/support/zfs.nix diff --git a/hosts/desktopnix/default.nix b/hosts/desktopnix/default.nix index f0728c2..5a85e7c 100644 --- a/hosts/desktopnix/default.nix +++ b/hosts/desktopnix/default.nix @@ -13,22 +13,16 @@ ../../config/basic - ../../config/hardware/bluetooth.nix - ../../config/hardware/nintendo.nix - ../../config/hardware/nvidia.nix - ../../config/hardware/physical.nix - ../../config/hardware/pipewire.nix - ../../config/hardware/yubikey.nix - - ../../config/optional/dev.nix - ../../config/optional/graphical.nix - ../../config/optional/printing.nix - ../../config/optional/secureboot.nix - ../../config/optional/steam.nix - ../../config/optional/xserver.nix - ../../config/optional/wayland.nix - ../../config/optional/vr.nix - ../../config/optional/zfs.nix + ../../config/support/bluetooth.nix + ../../config/support/nintendo.nix + ../../config/support/nvidia.nix + ../../config/support/physical.nix + ../../config/support/pipewire.nix + ../../config/support/printing.nix + ../../config/support/secureboot.nix + ../../config/support/vr.nix + ../../config/support/yubikey.nix + ../../config/support/zfs.nix ./net.nix ./fs.nix diff --git a/hosts/elisabeth/default.nix b/hosts/elisabeth/default.nix index 2e7e17e..1e41cf9 100644 --- a/hosts/elisabeth/default.nix +++ b/hosts/elisabeth/default.nix @@ -13,11 +13,10 @@ ../../config/basic - ../../config/optional/initrd-ssh.nix - ../../config/optional/secureboot.nix - ../../config/optional/zfs.nix - - ../../config/hardware/physical.nix + ../../config/support/initrd-ssh.nix + ../../config/support/physical.nix + ../../config/support/secureboot.nix + ../../config/support/zfs.nix ./net.nix ./fs.nix diff --git a/hosts/maddy/default.nix b/hosts/maddy/default.nix index a345ced..01e0014 100644 --- a/hosts/maddy/default.nix +++ b/hosts/maddy/default.nix @@ -1,9 +1,9 @@ { imports = [ ../../config/basic - ../../config/optional/initrd-ssh.nix + ../../config/support/initrd-ssh.nix ../../config/services/maddy.nix - ../../config/optional/zfs.nix + ../../config/support/zfs.nix ./net.nix ./fs.nix diff --git a/hosts/patricknix/default.nix b/hosts/patricknix/default.nix index 0aea02d..35a494f 100644 --- a/hosts/patricknix/default.nix +++ b/hosts/patricknix/default.nix @@ -10,33 +10,27 @@ ../../config/basic - ../../config/hardware/bluetooth.nix - ../../config/hardware/laptop.nix - ../../config/hardware/nvidia.nix - ../../config/hardware/physical.nix - ../../config/hardware/pipewire.nix - ../../config/hardware/prime-offload.nix - ../../config/hardware/yubikey.nix - - ../../config/optional/dev.nix - ../../config/optional/graphical.nix - ../../config/optional/printing.nix - ../../config/optional/secureboot.nix - ../../config/optional/steam.nix - ../../config/optional/wayland.nix - ../../config/optional/zfs.nix + ../../config/support/bluetooth.nix + ../../config/support/laptop.nix + ../../config/support/nvidia.nix + ../../config/support/physical.nix + ../../config/support/pipewire.nix + ../../config/support/prime-offload.nix + ../../config/support/printing.nix + ../../config/support/secureboot.nix + ../../config/support/yubikey.nix + ../../config/support/zfs.nix ./net.nix ./fs.nix - ../../users/patrick + #../../users/patrick ]; stylix.fonts.sizes = { terminal = 9; applications = 9; desktop = 8; }; - hidpi = true; services = { xserver.xkb = { layout = "de"; diff --git a/hosts/testienix/default.nix b/hosts/testienix/default.nix index 1d330dd..53fbdfe 100644 --- a/hosts/testienix/default.nix +++ b/hosts/testienix/default.nix @@ -10,10 +10,10 @@ inputs.nixos-hardware.nixosModules.common-pc-ssd ../../config/basic - ../../config/optional/initrd-ssh.nix - ../../config/hardware/physical.nix - ../../config/optional/zfs.nix + ../../config/support/initrd-ssh.nix + ../../config/support/physical.nix + ../../config/support/zfs.nix ./net.nix ./fs.nix diff --git a/modules-hm/hm-all.nix b/modules-hm/hm-all.nix new file mode 100644 index 0000000..cde9144 --- /dev/null +++ b/modules-hm/hm-all.nix @@ -0,0 +1,40 @@ +{ config, lib, ... }: +let + inherit (lib) + mkOption + mkOptionType + types + mkIf + ; +in +{ + options = { + primaryUser = mkOption { + description = "Home-manager primary Username"; + type = types.nullOr types.str; + default = null; + }; + hm = mkOption { + description = "Home-manager options for the main user"; + type = mkOptionType { + name = "Home-manager options for the main user"; + merge = _loc: defs: (map (x: x.value) defs); + }; + }; + hm-all = mkOption { + description = "Home-manager options for the primary User and root."; + type = mkOptionType { + name = "Home-manager options for the all users"; + merge = _loc: defs: (map (x: x.value) defs); + }; + }; + }; + config.home-manager.users = mkIf (config.primaryUser != null) { + ${config.primaryUser} = { + imports = config.hm ++ config.hm-all; + }; + root = { + imports = config.hm-all; + }; + }; +} diff --git a/modules/secrets.nix b/modules/secrets.nix index 93db425..3971052 100644 --- a/modules/secrets.nix +++ b/modules/secrets.nix @@ -65,24 +65,4 @@ in ''; }; }; - config.home-manager.sharedModules = [ - ( - { config, ... }: - { - options = { - userSecretsFile = mkOption { - default = ../users/${config._module.args.name}/secrets.nix.age; - type = types.path; - description = "The global secrets attribute that should be exposed to the user"; - }; - userSecrets = mkOption { - readOnly = true; - default = importEncrypted config.userSecretsFile inputs; - type = types.unspecified; - description = "User secrets"; - }; - }; - } - ) - ]; } diff --git a/pkgs/actual.nix b/pkgs/actual.nix deleted file mode 100644 index 56a8191..0000000 --- a/pkgs/actual.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - makeWrapper, - cacert, - gitMinimal, - nodejs, - yarn, -}: -stdenv.mkDerivation rec { - pname = "actual-server"; - version = "24.10.1"; - - src = fetchFromGitHub { - owner = "actualbudget"; - repo = "actual-server"; - rev = "v${version}"; - hash = "sha256-VJAD+lNamwuYmiPJLXkum6piGi5zLOHBp8cUeZagb4s="; - }; - # we cannot use fetchYarnDeps because that doesn't support yarn 2/berry lockfiles - offlineCache = stdenv.mkDerivation { - name = "actual-server-${version}-offline-cache"; - inherit src; - - nativeBuildInputs = [ - cacert # needed for git - gitMinimal # needed to download git dependencies - yarn - ]; - - buildPhase = '' - export HOME=$(mktemp -d) - yarn config set enableTelemetry 0 - yarn config set cacheFolder $out - yarn config set --json supportedArchitectures.os '[ "linux" ]' - yarn config set --json supportedArchitectures.cpu '[ "x64" ]' - yarn - ''; - - installPhase = '' - mkdir -p $out - cp -r ./node_modules $out/node_modules - ''; - dontFixup = true; - - outputHashMode = "recursive"; - outputHash = "sha256-siq3JnM0FFmXj5iX48E1A8X0lbdHM9NNCjOcg0Pwg5I="; - }; - - nativeBuildInputs = [ - makeWrapper - yarn - ]; - - installPhase = '' - runHook preInstall - mkdir -p $out - cp -r ${offlineCache}/node_modules/ $out/ - cp -r ./ $out - - mkdir -p $out/bin - makeWrapper ${lib.getExe nodejs} "$out/bin/actual-server" \ - --add-flags "$out/app.js" --set NODE_PATH "$out/node_modules" \ - - runHook postInstall - ''; - - meta = with lib; { - description = "A super fast privacy-focused app for managing your finances"; - homepage = "https://actualbudget.com/"; - license = licenses.mit; - mainProgram = "actual-server"; - maintainers = with maintainers; [ patrickdag ]; - platforms = [ "x86_64-linux" ]; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 7771d76..7c3fb61 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,7 +3,6 @@ _inputs: [ (_final: prev: { zsh-histdb-skim = prev.callPackage ./zsh-histdb-skim.nix { }; zsh-histdb = prev.callPackage ./zsh-histdb.nix { }; - actual = prev.callPackage ./actual.nix { }; pr-tracker = prev.callPackage ./pr-tracker.nix { }; deploy = prev.callPackage ./deploy.nix { }; signal-to-blog = prev.callPackage ./signal-to-blog.nix { }; diff --git a/pkgs/ollama-webui.nix b/pkgs/ollama-webui.nix deleted file mode 100644 index 1e188c9..0000000 --- a/pkgs/ollama-webui.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - lib, - buildNpmPackage, - nodePackages, - fetchFromGitHub, - runtimeShell, -}: -# We just package the JS frontend part, not the Python reverse-proxy backend. -# NixOS can provide any another reverse proxy such as nginx. -buildNpmPackage rec { - pname = "ollama-webui"; - # ollama-webui doesn't tag versions yet. - version = "0.0.0-unstable-2023-12-22"; - - src = fetchFromGitHub { - owner = "ollama-webui"; - repo = "ollama-webui"; - rev = "77c1a77fccb04337ff95440030cd051fd16c2cd8"; - hash = "sha256-u7h2tpHgtQwYXornslY3CZjKjigqBK2mHmaiK1EoEgk="; - }; - # dependencies are downloaded into a separate node_modules Nix package - npmDepsHash = "sha256-SI2dPn1SwbGwl8093VBtcDsA2eHSxr3UUC+ta68w2t8="; - - # We have to bake in the default URL it will use for ollama webserver here, - # but it can be overriden in the UI later. - PUBLIC_API_BASE_URL = "http://localhost:11434/api"; - - # The path '/ollama/api' will be redirected to the specified backend URL - OLLAMA_API_BASE_URL = PUBLIC_API_BASE_URL; - # "npm run build" creates a static page in the "build" folder. - installPhase = '' - mkdir -p $out/lib - cp -R ./build/. $out/lib - - mkdir -p $out/bin - cat <>$out/bin/${pname} - #!${runtimeShell} - ${nodePackages.http-server}/bin/http-server $out/lib "\$@" - EOF - chmod +x $out/bin/${pname} - ''; - - meta = with lib; { - description = "ChatGPT-Style Web Interface for Ollama"; - longDescription = '' - Tools like Ollama make open-source large langue models (LLM) accessible and almost - trivial to download and run them locally on a consumer computer. - However, Ollama only runs in a terminal and doesn't store any chat history. - Ollama-WebUI is a web frontend on top of Ollama that looks and behaves similar to ChatGPT's web frontend. - You can have separate chats with different LLMs that are saved in your browser, - automatic Markdown and Latex rendering, upload files etc. - This package contains two parts: - - `/lib` The WebUI as a compiled, static html folder to bundle in your web server - - `/bin/${pname}` A runnable webserver the serves the WebUI for convenience. - ''; - homepage = "https://github.com/ollama-webui/ollama-webui"; - license = licenses.mit; - mainProgram = pname; - maintainers = with maintainers; [ malteneuss ]; - platforms = platforms.all; - }; -} diff --git a/secrets/secrets.nix.age b/secrets/secrets.nix.age index 77e20035fa1736aa232e8663c59c2bf8afb42ede..92a34079caef0405c769bcacbe85d9426914e929 100644 GIT binary patch literal 7851 zcmV;c9#r9BXJsvAZewzJaCB*JZZ2Wn*MAR#P-Kc4$*MPg62eWNu|*S8EDrT1!(eaYZ&%QDQMORC;$wNkAuXi!&hNJ&~zb6I#YOjQakJ|J*ub}eu+H8vnxMrUbB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7N^!-@^eFc)z*J$wtJr#V%p|exvL57f>b!a^`tKyMKM{-ikTl=7rJ&Y$ zqKo(bmRofe42k%9Rg z-<7@!55r(Lrh8J{=<}g#2-N^4O=F%3att{VGOBg5F2_@-laupi>znA*?pwG>$z-y? z^Bk`%9>uj#`2|7^KGg~}aeH>3dHn&wiC3R{+0La^7)Zj_Cn(|BLC9DL;#*_a5j*IgIg!Z@kwL zJNopKWDd0%7uI6>+alHP+M2v8I&od`EU$mVN4$r{?zMMBO4}39OPVzWS~^_=zMg6a zv|5*u27UV!==LkOWfR!3$|F)nh~}~Z=y!U7CiVr#K*{;FQah3a8+6Wb+C+CsLqPn5 zYNN`}s*)+GfJ0<+$|PLg;c4no&iREdAx zY_OIEJ%>d9lWQ}xAgy1G5s4aL!k6#SE_z3B5w8O-K79$_2?1JCKLINI7pfDX^y_Te zK!|w(0PyI|RLocpKoFIkv>i zQj(<*oAfCT zluI{M71ZkJTFg#tK?fc6IHHqjc8Ap5E#w_>wUM%{{VE_1uK#vZ>N^`S*r@k$LZe|k zG7`WM=g=j@Pnp!e*IE-%G#SONk8I1WKn0(}K7B>46ie^xI$s?r*@IHIY^(yW?vfg! zYU4le26y4=-QZhbVK;xIwabt7{_5#(3)NDp&P+WpVuq*cvv;9(178iR_d zs8}O=YDI;3ooC*&4fsrFy}wGVzR_ewyiuxtC^Xz=z?)UrV1R#*bq)H03tQcFT6GpM z@&tU5V}FVKd|u!wefZS>_85) zMC@#e)7K8Uk#`en?NWG2B;g>>ed3zCj>JQs9J1~OrDFtuGpsS5_0N`)>c&{28O?2ZIni@hQ);pm;e9( diff --git a/users/common/graphical/Xorg/default.nix b/users/common/Xorg/default.nix similarity index 100% rename from users/common/graphical/Xorg/default.nix rename to users/common/Xorg/default.nix diff --git a/users/common/graphical/Xorg/herbst-keys.nix b/users/common/Xorg/herbst-keys.nix similarity index 100% rename from users/common/graphical/Xorg/herbst-keys.nix rename to users/common/Xorg/herbst-keys.nix diff --git a/users/common/graphical/Xorg/herbstluft.nix b/users/common/Xorg/herbstluft.nix similarity index 100% rename from users/common/graphical/Xorg/herbstluft.nix rename to users/common/Xorg/herbstluft.nix diff --git a/users/common/graphical/Xorg/i3.nix b/users/common/Xorg/i3.nix similarity index 100% rename from users/common/graphical/Xorg/i3.nix rename to users/common/Xorg/i3.nix diff --git a/users/common/graphical/Xorg/polybar.nix b/users/common/Xorg/polybar.nix similarity index 100% rename from users/common/graphical/Xorg/polybar.nix rename to users/common/Xorg/polybar.nix diff --git a/users/common/graphical/Xorg/rofi.nix b/users/common/Xorg/rofi.nix similarity index 67% rename from users/common/graphical/Xorg/rofi.nix rename to users/common/Xorg/rofi.nix index c960f53..abdd4fc 100644 --- a/users/common/graphical/Xorg/rofi.nix +++ b/users/common/Xorg/rofi.nix @@ -7,4 +7,7 @@ dpi = 1; }; }; + hm.home.persistence."/state".files = [ + ".cache/rofi3.druncache" + ]; } diff --git a/users/common/Xorg/sway3.nix b/users/common/Xorg/sway3.nix new file mode 100644 index 0000000..1d646b0 --- /dev/null +++ b/users/common/Xorg/sway3.nix @@ -0,0 +1,246 @@ +{ + config, + lib, + pkgs, + ... +}: +# shared sway/i3 config +let + nixConfig = config; +in +{ + hm = + { config, ... }: + let + modifier = "Mod4"; + down = "r"; + left = "n"; + right = "s"; + up = "l"; + terminal = "kitty"; + cfg = { + inherit modifier terminal; + focus = { + followMouse = false; + mouseWarping = false; + }; + #bindkeysToCode = true; + window.titlebar = false; + floating.titlebar = false; + workspaceLayout = "stacking"; + bars = map (x: x // config.lib.stylix.i3.bar) [ + { + mode = "dock"; + workspaceButtons = true; + workspaceNumbers = false; + statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs config-main.toml"; + trayOutput = "primary"; + } + ]; + floating.criteria = [ { class = "Pavucontrol"; } ]; + + assigns = { + "2:d" = [ { class = "^firefox$"; } ]; + "2:2" = [ { class = "^spotify$"; } ]; + "3:u" = [ { class = "^thunderbird$"; } ]; + "4:a" = [ + { class = "^bottles$"; } + { class = "^steam$"; } + { class = "^prismlauncher$"; } + ]; + "1:F1" = [ { class = "^discord$"; } ]; + "2:F2" = [ + { class = "^Signal$"; } + { class = "^TelegramDesktop$"; } + ]; + }; + + workspaceOutputAssign = + let + output = + out: + lib.lists.imap1 ( + i: x: { + workspace = "${toString i}:${x}"; + output = out; + } + ); + in + { + "desktopnix" = + output "HDMI-0" [ + "1" + "2" + "3" + "4" + "5" + "6" + "7" + "8" + "9" + ] + ++ output "DP-4" [ + "j" + "d" + "u" + "a" + "x" + "p" + ] + ++ output "DVI-D-0" [ + "F1" + "F2" + "F3" + "F4" + ]; + "patricknix" = + output "eDP-1" [ + "1" + "2" + "3" + "4" + "5" + "6" + "7" + "8" + "9" + ] + ++ output "DP-1" [ + "j" + "d" + "u" + "a" + "x" + "p" + ]; + "gojo" = output "eDP-1" [ + "1" + "2" + "3" + "4" + "5" + "6" + ]; + } + .${nixConfig.node.name} or [ ]; + + keybindings = + (lib.attrsets.mergeAttrsList ( + map ( + x: + ( + let + key = lib.elemAt (lib.strings.splitString ":" x.workspace) 1; + in + { + "${modifier}+${key}" = "workspace ${x.workspace}"; + "${modifier}+Shift+${key}" = "move container to workspace ${x.workspace}"; + } + ) + ) cfg.workspaceOutputAssign + )) + // { + "${modifier}+t" = "exec ${terminal}"; + "${modifier}+b" = "exec firefox"; + "${modifier}+m" = "exec thunderbird"; + "${modifier}+q" = "kill"; + "${modifier}+c" = "exec ${lib.getExe pkgs.scripts.clone-term}"; + "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; + "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl next"; + "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl previous"; + "XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t"; + "XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5"; + "XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5"; + + "${modifier}+${left}" = "focus left"; + "${modifier}+${down}" = "focus down"; + "${modifier}+${up}" = "focus up"; + "${modifier}+${right}" = "focus right"; + + "${modifier}+Left" = "focus left"; + "${modifier}+Down" = "focus down"; + "${modifier}+Up" = "focus up"; + "${modifier}+Right" = "focus right"; + + "${modifier}+Shift+${left}" = "move left"; + "${modifier}+Shift+${down}" = "move down"; + "${modifier}+Shift+${up}" = "move up"; + "${modifier}+Shift+${right}" = "move right"; + + "${modifier}+Shift+Left" = "move left"; + "${modifier}+Shift+Down" = "move down"; + "${modifier}+Shift+Up" = "move up"; + "${modifier}+Shift+Right" = "move right"; + + "${modifier}+v" = "splith"; + "${modifier}+udiaeresis" = "splitv"; + "${modifier}+Return" = "fullscreen toggle"; + + "${modifier}+odiaeresis" = "layout stacking"; + "${modifier}+y" = "layout tabbed"; + "${modifier}+z" = "layout toggle split"; + + "${modifier}+f" = "floating toggle"; + "${modifier}+space" = "focus mode_toggle"; + + "${modifier}+comma" = "workspace prev_on_output"; + "${modifier}+period" = "workspace next_on_output"; + }; + }; + in + { + wayland.windowManager.sway.config = cfg; + xsession.windowManager.i3.config = cfg; + + programs.i3status-rust = { + enable = true; + bars.main = { + blocks = + [ + { block = "net"; } + { + block = "cpu"; + format = " $icon $utilization "; + } + { + block = "nvidia_gpu"; + format = " $icon $utilization $memory $temperature "; + } + ] + ++ { + "patricknix" = [ { block = "battery"; } ]; + } + .${nixConfig.node.name} or [ ] + ++ [ + { + block = "sound"; + click = [ + { + button = "left"; + action = "toggle_mute"; + } + ]; + } + { + block = "backlight"; + missing_format = ""; + } + { + block = "time"; + format = "$icon $timestamp.datetime(f:'%a %d.%m.%y %H:%M:%S') "; + interval = 1; + } + ]; + theme = "native"; + # currently nixpgs-wayland breaks this + # icons = "material-nf"; + settings = { + icons.icons = "material-nf"; + icons.overrides = { + cpu = " "; + }; + }; + }; + }; + }; +} diff --git a/users/common/graphical/Xorg/xinitrc b/users/common/Xorg/xinitrc similarity index 100% rename from users/common/graphical/Xorg/xinitrc rename to users/common/Xorg/xinitrc diff --git a/config/optional/xserver.nix b/users/common/Xorg/xserver.nix similarity index 100% rename from config/optional/xserver.nix rename to users/common/Xorg/xserver.nix diff --git a/users/common/shells/alias.nix b/users/common/alias.nix similarity index 95% rename from users/common/shells/alias.nix rename to users/common/alias.nix index b8df91f..5c25aca 100644 --- a/users/common/shells/alias.nix +++ b/users/common/alias.nix @@ -1,5 +1,5 @@ { - home.shellAliases = { + hm-all.home.shellAliases = { # Aliases l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto"; ll = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto"; diff --git a/users/common/default.nix b/users/common/default.nix deleted file mode 100644 index 7e23a2e..0000000 --- a/users/common/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ minimal, lib, ... }: -{ - imports = [ - ./shells/alias.nix - ./shells/zsh - - ./programs/gpg.nix - ] ++ lib.optional (!minimal) ./programs/htop.nix; - - programs.bat.enable = true; - nixpkgs.config = { - allowUnfree = true; - }; -} diff --git a/config/optional/dev.nix b/users/common/dev.nix similarity index 100% rename from config/optional/dev.nix rename to users/common/dev.nix diff --git a/users/common/graphical/default.nix b/users/common/graphical/default.nix deleted file mode 100644 index f5e2be7..0000000 --- a/users/common/graphical/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, config, ... }: -{ - home = { - packages = with pkgs; [ - zathura - feh - mpv - pinentry-gnome3 # for yubikey pinentry - ]; - }; - - # notification are nice to have - services.dunst = { - enable = true; - settings.global = { - monitor = 1; - frame_width = 0; - highlight = config.lib.stylix.colors.withHashtag.base0C; - progress_bar_frame_width = 0; - progress_bar_corner_radius = 0; - }; - }; -} diff --git a/users/common/graphical/sway3.nix b/users/common/graphical/sway3.nix deleted file mode 100644 index d3cfd10..0000000 --- a/users/common/graphical/sway3.nix +++ /dev/null @@ -1,240 +0,0 @@ -{ - config, - nixosConfig, - lib, - pkgs, - ... -}: -# shared sway/i3 config -let - modifier = "Mod4"; - down = "r"; - left = "n"; - right = "s"; - up = "l"; - terminal = "kitty"; - cfg = { - inherit modifier terminal; - focus = { - followMouse = false; - mouseWarping = false; - }; - #bindkeysToCode = true; - window.titlebar = false; - floating.titlebar = false; - workspaceLayout = "stacking"; - bars = map (x: x // config.lib.stylix.i3.bar) [ - { - mode = "dock"; - workspaceButtons = true; - workspaceNumbers = false; - statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs config-main.toml"; - trayOutput = "primary"; - } - ]; - floating.criteria = [ { class = "Pavucontrol"; } ]; - - assigns = { - "2:d" = [ { class = "^firefox$"; } ]; - "2:2" = [ { class = "^spotify$"; } ]; - "3:u" = [ { class = "^thunderbird$"; } ]; - "4:a" = [ - { class = "^bottles$"; } - { class = "^steam$"; } - { class = "^prismlauncher$"; } - ]; - "1:F1" = [ { class = "^discord$"; } ]; - "2:F2" = [ - { class = "^Signal$"; } - { class = "^TelegramDesktop$"; } - ]; - }; - - workspaceOutputAssign = - let - output = - out: - lib.lists.imap1 ( - i: x: { - workspace = "${toString i}:${x}"; - output = out; - } - ); - in - { - "desktopnix" = - output "HDMI-0" [ - "1" - "2" - "3" - "4" - "5" - "6" - "7" - "8" - "9" - ] - ++ output "DP-4" [ - "j" - "d" - "u" - "a" - "x" - "p" - ] - ++ output "DVI-D-0" [ - "F1" - "F2" - "F3" - "F4" - ]; - "patricknix" = - output "eDP-1" [ - "1" - "2" - "3" - "4" - "5" - "6" - "7" - "8" - "9" - ] - ++ output "DP-1" [ - "j" - "d" - "u" - "a" - "x" - "p" - ]; - "gojo" = output "eDP-1" [ - "1" - "2" - "3" - "4" - "5" - "6" - ]; - } - .${nixosConfig.node.name} or [ ]; - - keybindings = - (lib.attrsets.mergeAttrsList ( - map ( - x: - ( - let - key = lib.elemAt (lib.strings.splitString ":" x.workspace) 1; - in - { - "${modifier}+${key}" = "workspace ${x.workspace}"; - "${modifier}+Shift+${key}" = "move container to workspace ${x.workspace}"; - } - ) - ) cfg.workspaceOutputAssign - )) - // { - "${modifier}+t" = "exec ${terminal}"; - "${modifier}+b" = "exec firefox"; - "${modifier}+m" = "exec thunderbird"; - "${modifier}+q" = "kill"; - "${modifier}+c" = "exec ${lib.getExe pkgs.scripts.clone-term}"; - "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; - "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl next"; - "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl previous"; - "XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t"; - "XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5"; - "XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5"; - - "${modifier}+${left}" = "focus left"; - "${modifier}+${down}" = "focus down"; - "${modifier}+${up}" = "focus up"; - "${modifier}+${right}" = "focus right"; - - "${modifier}+Left" = "focus left"; - "${modifier}+Down" = "focus down"; - "${modifier}+Up" = "focus up"; - "${modifier}+Right" = "focus right"; - - "${modifier}+Shift+${left}" = "move left"; - "${modifier}+Shift+${down}" = "move down"; - "${modifier}+Shift+${up}" = "move up"; - "${modifier}+Shift+${right}" = "move right"; - - "${modifier}+Shift+Left" = "move left"; - "${modifier}+Shift+Down" = "move down"; - "${modifier}+Shift+Up" = "move up"; - "${modifier}+Shift+Right" = "move right"; - - "${modifier}+v" = "splith"; - "${modifier}+udiaeresis" = "splitv"; - "${modifier}+Return" = "fullscreen toggle"; - - "${modifier}+odiaeresis" = "layout stacking"; - "${modifier}+y" = "layout tabbed"; - "${modifier}+z" = "layout toggle split"; - - "${modifier}+f" = "floating toggle"; - "${modifier}+space" = "focus mode_toggle"; - - "${modifier}+comma" = "workspace prev_on_output"; - "${modifier}+period" = "workspace next_on_output"; - }; - }; -in -{ - wayland.windowManager.sway.config = cfg; - xsession.windowManager.i3.config = cfg; - - programs.i3status-rust = { - enable = true; - bars.main = { - blocks = - [ - { block = "net"; } - { - block = "cpu"; - format = " $icon $utilization "; - } - { - block = "nvidia_gpu"; - format = " $icon $utilization $memory $temperature "; - } - ] - ++ { - "patricknix" = [ { block = "battery"; } ]; - } - .${nixosConfig.node.name} or [ ] - ++ [ - { - block = "sound"; - click = [ - { - button = "left"; - action = "toggle_mute"; - } - ]; - } - { - block = "backlight"; - missing_format = ""; - } - { - block = "time"; - format = "$icon $timestamp.datetime(f:'%a %d.%m.%y %H:%M:%S') "; - interval = 1; - } - ]; - theme = "native"; - # currently nixpgs-wayland breaks this - # icons = "material-nf"; - settings = { - icons.icons = "material-nf"; - icons.overrides = { - cpu = " "; - }; - }; - }; - }; -} diff --git a/users/common/graphical/wayland/default.nix b/users/common/graphical/wayland/default.nix deleted file mode 100644 index 5918afc..0000000 --- a/users/common/graphical/wayland/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ../. - ./fuzzel.nix - ./sway.nix - ./hyprland.nix - ./waybar - ./swaync - ./swww.nix - ]; - home.packages = with pkgs; [ - wdisplays - wl-clipboard - ]; -} diff --git a/users/common/graphical/wayland/fuzzel.nix b/users/common/graphical/wayland/fuzzel.nix deleted file mode 100644 index ba2a294..0000000 --- a/users/common/graphical/wayland/fuzzel.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - stylix.targets.fuzzel.enable = true; - programs.fuzzel = { - enable = true; - settings = { - main = { - launch-prefix = "uwsm app --"; - }; - }; - }; -} diff --git a/users/common/graphical/wayland/hyprland.nix b/users/common/graphical/wayland/hyprland.nix deleted file mode 100644 index 0458edf..0000000 --- a/users/common/graphical/wayland/hyprland.nix +++ /dev/null @@ -1,306 +0,0 @@ -{ - pkgs, - lib, - nixosConfig, - ... -}: -let - inherit (lib) - mkMerge - optionals - elem - mkIf - flip - concatMap - ; - #from https://github.com/hyprwm/Hyprland/issues/3835 - float_script = pkgs.writeShellScript "hyprland-bitwarden-float" '' - handle() { - case $1 in - windowtitle*) - # Extract the window ID from the line - window_id=''${1#*>>} - - # Fetch the list of windows and parse it using jq to find the window by its decimal ID - window_info=$(hyprctl clients -j | ${pkgs.jq}/bin/jq --arg id "0x$window_id" '.[] | select(.address == ($id))') - - # Extract the title from the window info - window_title=$(echo "$window_info" | ${pkgs.jq}/bin/jq '.title') - - # Check if the title matches the characteristics of the Bitwarden popup window - if [[ "$window_title" == '"Extension: (Bitwarden Password Manager) - Bitwarden — Mozilla Firefox"' ]]; then - - # echo $window_id, $window_title - # hyprctl dispatch togglefloating address:0x$window_id - # hyprctl dispatch resizewindowpixel exact 20% 40%,address:0x$window_id - # hyprctl dispatch movewindowpixel exact 40% 30%,address:0x$window_id - - hyprctl dispatch togglefloating address:0x$window_id - hyprctl dispatch resizewindowpixel exact "512 768",address:0x$window_id - hyprctl dispatch movewindowpixel exact "$HYPRLAND_FLOAT_LOCATION",address:0x$window_id - fi - ;; - esac - } - - # Listen to the Hyprland socket for events and process each line with the handle function - ${pkgs.socat}/bin/socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done - ''; -in -{ - # UWSM starts a SH to read env variables - # this ensures all home.sessionVars are exported - programs.bash.enable = true; - wayland.windowManager.hyprland = { - enable = true; - settings = mkMerge [ - { - input = { - kb_layout = "de"; - kb_variant = "nodeadkeys"; - follow_mouse = 2; - numlock_by_default = true; - repeat_rate = 60; - repeat_delay = 235; - # Only change focus on mouse click - float_switch_override_focus = 0; - accel_profile = "flat"; - - touchpad = { - natural_scroll = true; - disable_while_typing = true; - scroll_factor = 0.7; - }; - }; - device = { - name = "xp-pen-g430s-pen"; - active_area_size = "48 27"; - }; - gestures = { - workspace_swipe = true; - }; - - general = { - gaps_in = 0; - gaps_out = 0; - allow_tearing = true; - }; - #render = { - # explicit_sync = 0; - # direct_scanout = false; - #}; - binds = { - focus_preferred_method = 1; - workspace_center_on = 1; - }; - bind = - let - monitor_binds = { - "1" = "j"; - "2" = "d"; - "3" = "u"; - "4" = "a"; - "5" = "x"; - "6" = "F1"; - "7" = "F2"; - "8" = "F3"; - "9" = "F4"; - }; - in - [ - "SUPER,q,killactive," - "SUPER,return,fullscreen," - "SUPER + SHIFT,return,fullscreenstate,2,0," - "SUPER,f,togglefloating" - "SUPER,g,togglegroup" - "SUPER,tab,cyclenext," - "ALT,tab,cyclenext," - "SUPER+CTRL,r,submap,resize" - - "SUPER,left,movefocus,l" - "SUPER,right,movefocus,r" - "SUPER,up,movefocus,u" - "SUPER,down,movefocus,d" - - "SUPER,n,movefocus,l" - "SUPER,s,movefocus,r" - "SUPER,l,movefocus,u" - "SUPER,r,movefocus,d" - - "SUPER,h,changegroupactive,b" - "SUPER,m,changegroupactive,f" - - "SUPER + SHIFT,left,movewindoworgroup,l" - "SUPER + SHIFT,right,movewindoworgroup,r" - "SUPER + SHIFT,up,movewindoworgroup,u" - "SUPER + SHIFT,down,movewindoworgroup,d" - - "SUPER + SHIFT,n,movewindoworgroup,l" - "SUPER + SHIFT,s,movewindoworgroup,r" - "SUPER + SHIFT,l,movewindoworgroup,u" - "SUPER + SHIFT,r,movewindoworgroup,d" - - "SUPER,comma,workspace,-1" - "SUPER,period,workspace,+1" - "SUPER + SHIFT,comma,movetoworkspace,-1" - "SUPER + SHIFT,period,movetoworkspace,+1" - - "SUPER,b,exec,uwsm app -- firefox" - "SUPER,t,exec,uwsm app -- kitty" - ",Menu,exec,fuzzel" - "SUPER,c,exec,${lib.getExe pkgs.scripts.clone-term}" - - "CTRL,F7,pass,class:^(discord)$" - "CTRL,F8,pass,class:^(discord)$" - "CTRL,F7,pass,class:^(TeamSpeak 3)$" - "CTRL,F8,pass,class:^(TeamSpeak 3)$" - "CTRL,F9,exec,systemctl --user start swww-update-wallpaper" - - "SUPER + SHIFT,q,exec,uwsm stop" - ] - ++ flip concatMap (map toString (lib.lists.range 1 9)) (x: [ - "SUPER,${monitor_binds."${x}"},workspace,${x}" - "SUPER + SHIFT,${monitor_binds."${x}"},movetoworkspacesilent,${x}" - ]); - - cursor.no_warps = true; - debug.disable_logs = false; - env = - [ - "NIXOS_OZONE_WL,1" - "MOZ_ENABLE_WAYLAND,1" - "_JAVA_AWT_WM_NONREPARENTING,1" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - "QT_QPA_PLATFORM,wayland;xcb" - "GDK_BACKEND,wayland" - "WLR_DRM_NO_ATOMIC,1" # retest on newest nvidia driver - "XDG_SESSION_TYPE,wayland" - "TERMINAL,uwsm app -- kitty" - ] - ++ optionals (elem "nvidia" nixosConfig.services.xserver.videoDrivers) [ - # See https://wiki.hyprland.org/Nvidia/ - "LIBVA_DRIVER_NAME,nvidia" - "GBM_BACKEND,nvidia-drm" - ]; - bindm = [ - # mouse movements - "SUPER, mouse:272, movewindow" - "SUPER, mouse:273, resizewindow" - "SUPER ALT, mouse:272, resizewindow" - ]; - animations = { - enabled = true; - animation = [ - "windows, 1, 4, default, slide" - "windowsOut, 1, 4, default, slide" - "windowsMove, 1, 4, default" - "border, 1, 2, default" - "fade, 1, 4, default" - "fadeDim, 1, 4, default" - "workspaces, 1, 4, default" - ]; - }; - decoration.rounding = 4; - exec-once = [ - "${pkgs.swaynotificationcenter}/bin/swaync" - ]; - misc = { - vrr = 1; - disable_hyprland_logo = true; - mouse_move_focuses_monitor = false; - }; - xwayland.force_zero_scaling = true; - windowrulev2 = [ - # fix these once nvidia gets their shit together - #"immediate, class:^(cs2)$" - # apex legends - "immediate, class:^(steam_app_1172470)$" - #??? - "immediate, class:^(steam_app_238960)$" - #baldur - #"immediate, class:^(steam_app_1086940)$" - "float, class:^(steam)$, title:^(Friends List)" - "float, class:^(steam)$, title:(Chat)" - - "float, class:^(streamlink-twitch-gui)$" - - "workspace 2,class:^(firefox)$" - "workspace 3,class:^(thunderbird)$" - "workspace 4,class:^(bottles)$" - "workspace 4,class:^(steam)$, title:^(Steam)" - "workspace 4,class:^(prismlauncher)$" - "workspace 6,class:^(discord)$" - "workspace 6,class:^(WebCord)$" - "workspace 6,class:^(TeamSpeak 3)$" - "workspace 7,class:^(signal)$" - "workspace 7,class:^(TelegramDesktop)$" - ]; - } - (mkIf (nixosConfig.node.name == "desktopnix") { - input.tablet = { - output = "DP-3"; - }; - monitor = [ - "DVI-D-1,preferred,0x0,1" - "HDMI-A-1,preferred,0x1080,1" - "DP-3,2560x1440@144.00Hz,1920x540,1" - # Thank you NVIDIA for this generous, free-of-charge, extra monitor that - # doesn't exist and crashes yoru session sometimes when moving a window to it. - "Unknown-1, disable" - ]; - workspace = [ - "1, monitor:DP-3, default:true" - "2, monitor:DP-3" - "3, monitor:DP-3" - "4, monitor:DP-3" - "5, monitor:DP-3" - "6, monitor:DVI-D-1, default:true" - "7, monitor:DVI-D-1" - "8, monitor:HDMI-A-1, default: true" - "9, monitor:HDMI-A-1" - ]; - env = [ "HYPRLAND_FLOAT_LOCATION,3800 680" ]; - }) - (mkIf (nixosConfig.node.name == "patricknix") { - monitor = [ - "eDP-1,preferred,0x0,2" - # Thank you NVIDIA for this generous, free-of-charge, extra monitor that - # doesn't exist and crashes yoru session sometimes when moving a window to it. - "Unknown-1, disable" - ]; - workspace = [ - "1, monitor:eDP-1, default:true" - "2, monitor:eDP-1" - "3, monitor:eDP-1" - "4, monitor:eDP-1" - "5, monitor:eDP-1" - "6, monitor:eDP-1" - "7, monitor:eDP-1" - "8, monitor:eDP-1" - "9, monitor:eDP-1" - ]; - env = [ "HYPRLAND_FLOAT_LOCATION,1400 200" ]; - }) - ]; - extraConfig = '' - submap=resize - binde=,right,resizeactive,80 0 - binde=,left,resizeactive,-80 0 - binde=,up,resizeactive,0 -80 - binde=,down,resizeactive,0 80 - binde=SHIFT,right,resizeactive,10 0 - binde=SHIFT,left,resizeactive,-10 0 - binde=SHIFT,up,resizeactive,0 -10 - binde=SHIFT,down,resizeactive,0 10 - bind=,return,submap,reset - bind=,escape,submap,reset - submap=reset - - exec-once = ${pkgs.xorg.xprop}/bin/xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 - exec-once = ${float_script} - env = XCURSOR_SIZE,48 - exec-once = uwsm finalize - - ''; - }; -} diff --git a/users/common/graphical/wayland/sway.nix b/users/common/graphical/wayland/sway.nix deleted file mode 100644 index 5f8cce2..0000000 --- a/users/common/graphical/wayland/sway.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ config, nixosConfig, ... }: -{ - # import shared i3 config - imports = [ ../sway3.nix ]; - stylix.targets.sway.enable = true; - wayland.windowManager.sway = { - enable = true; - config = - { - menu = "fuzzel"; - startup = [ - # for games to work input 1 has to be qwerts - # but i would like to have bone as my layout - { - command = "swaymsg input \"*\" xkb_switch_layout 1"; - always = true; - } - { command = "uwsm finalize"; } - ]; - input = { - "*" = { - xkb_layout = "de,de,de"; - # games are stupid so the main ui has to be de() without bone - xkb_variant = ",bone,neo"; - xkb_options = "grp:win_space_toggle"; - repeat_delay = "235"; - repeat_rate = "60"; - accel_profile = "flat"; - pointer_accel = "0.3"; - tap = "enabled"; - }; - "type:touchpad" = { - pointer_accel = "0.5"; - natural_scroll = "enabled"; - }; - "type:touch" = { - map_to_output = "eDP-1"; - }; - "type:tablet_tool" = { - map_to_output = "eDP-1"; - }; - }; - keybindings = - let - cfg = config.wayland.windowManager.sway.config; - in - { - "Menu" = "exec ${cfg.menu}"; - }; - } - // { - desktopnix = { - output = { - DVI-D-1 = { - mode = "1920x1080@60Hz"; - pos = "0,0"; - }; - HDMI-A-1 = { - mode = "1920x1080@60Hz"; - pos = "0,1080"; - }; - DP-3 = { - mode = "2560x1440@143.998Hz"; - pos = "1920,720"; - adaptive_sync = "on"; - }; - }; - }; - patricknix = { - output = { - "Acer Technologies XB271HU #ASP7ytE/6A7d" = { - mode = "2560x1440@59.951Hz"; - pos = "0,0"; - }; - "AU Optronics 0x30EB Unknown" = { - mode = "3840x2160@60.002Hz"; - pos = "2560,0"; - scale = "2"; - }; - }; - }; - } - .${nixosConfig.node.name} or { }; - extraConfig = - let - cfg = config.wayland.windowManager.sway.config; - in - '' - bindgesture swipe:3:left workpace next - bindgesture swipe:3:right workpace prev - bindgesture pinch:4:outward exec ${cfg.menu} - ''; - }; - # Cursor invisible - home.sessionVariables = { - WLR_NO_HARDWARE_CURSORS = 1; - NIXOS_OZONE_WL = 1; - # opengl backend flickers, also vulkan is love. - #WLR_RENDERER = "vulkan"; - }; -} diff --git a/users/common/impermanence.nix b/users/common/impermanence.nix deleted file mode 100644 index 614b906..0000000 --- a/users/common/impermanence.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - config, - lib, - nixosConfig, - ... -}: -{ - home.persistence."/state" = { - files = - with lib.lists; - [ - ".ssh/known_hosts" - ".cache/fuzzel" - ] - ++ optionals config.programs.rofi.enable [ ".cache/rofi3.druncache" ]; - directories = - with lib.lists; - [ ".config/dconf" ] - ++ optionals config.programs.direnv.enable [ ".local/share/direnv" ] - ++ optionals config.programs.nushell.enable [ ".config/nushell" ] - ++ optionals nixosConfig.services.pipewire.enable [ - # persist sound config - ".local/state/wireplumber" - ]; - }; -} diff --git a/users/common/programs/bottles.nix b/users/common/programs/bottles.nix index 72c2f35..4b0edee 100644 --- a/users/common/programs/bottles.nix +++ b/users/common/programs/bottles.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - home.packages = with pkgs; [ + hm.home.packages = with pkgs; [ bottles winetricks wineWowPackages.fonts @@ -8,4 +8,9 @@ ]; # To enable dark mode use the command: # dconf write /com/usebottles/bottles/dark-theme true + hm.home.persistence."/state".directories = [ + # bottles state games + ".local/share/bottles" + + ]; } diff --git a/users/common/programs/direnv.nix b/users/common/programs/direnv.nix index 2b51c9d..d447526 100644 --- a/users/common/programs/direnv.nix +++ b/users/common/programs/direnv.nix @@ -1,6 +1,9 @@ { - programs.direnv = { + hm.programs.direnv = { enable = true; nix-direnv.enable = true; }; + hm.home.persistence."/state".directories = [ + ".local/share/direnv" + ]; } diff --git a/users/common/programs/firefox.nix b/users/common/programs/firefox.nix index 3d3cb1b..eaffde2 100644 --- a/users/common/programs/firefox.nix +++ b/users/common/programs/firefox.nix @@ -15,7 +15,7 @@ let envStr = concatStringsSep " " (mapAttrsToList (n: v: "${n}=${escapeShellArg v}") env); in { - programs.firefox = { + hm.programs.firefox = { enable = true; package = pkgs.firefox.overrideAttrs (old: { buildCommand = @@ -26,12 +26,12 @@ in ''; }); }; - home.persistence."/state".directories = [ + hm.home.persistence."/state".directories = [ ".cache/mozilla" ".mozilla" ]; - xdg.mimeApps.enable = true; - xdg.mimeApps.defaultApplications = { + hm.xdg.mimeApps.enable = true; + hm.xdg.mimeApps.defaultApplications = { "text/html" = [ "firefox.desktop" ]; "text/xml" = [ "firefox.desktop" ]; "x-scheme-handler/http" = [ "firefox.desktop" ]; diff --git a/users/common/programs/gdb.nix b/users/common/programs/gdb.nix index 899485e..984731f 100644 --- a/users/common/programs/gdb.nix +++ b/users/common/programs/gdb.nix @@ -13,21 +13,23 @@ let ); in { - home.packages = [ pwndbgWithDebuginfod ]; - home.enableDebugInfo = true; - xdg.configFile.gdbinit = { - target = "gdb/gdbinit"; - text = '' - set debuginfod enabled on - set auto-load safe-path / + hm = { + home.packages = [ pwndbgWithDebuginfod ]; + home.enableDebugInfo = true; + xdg.configFile.gdbinit = { + target = "gdb/gdbinit"; + text = '' + set debuginfod enabled on + set auto-load safe-path / - set history save on - set history filename ~/.local/share/gdb/history + set history save on + set history filename ~/.local/share/gdb/history - set disassembly-flavor intel - set print pretty on - ''; + set disassembly-flavor intel + set print pretty on + ''; + }; + + home.persistence."/state".directories = [ ".local/share/gdb" ]; }; - - home.persistence."/state".directories = [ ".local/share/gdb" ]; } diff --git a/users/common/programs/git.nix b/users/common/programs/git.nix index 759f85c..2a12dd0 100644 --- a/users/common/programs/git.nix +++ b/users/common/programs/git.nix @@ -26,42 +26,44 @@ let ); in { - programs.gitui.enable = true; - programs.git = { - enable = true; - difftastic.enable = true; - lfs.enable = true; - aliases = { - cs = "commit -v -S"; - s = "status"; - a = "add"; - p = "push"; - rebase = "rebase --gpg-sign"; - fixup = ''!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ''${@:2} && EDITOR=true git rebase -i --gpg-sign --autostash --autosquash $TARGET^; }; f''; - f = "!${gf}"; - crm = ''!git commit -v -S --edit --file "$(git rev-parse --git-dir)"/COMMIT_EDITMSG''; - }; - extraConfig = { - core.pager = "${pkgs.delta}/bin/delta"; - delta = { - hyperlinks = true; - keep-plus-minus-markers = true; - line-numbers = true; - navigate = true; - side-by-side = true; - syntax-theme = "TwoDark"; - tabs = 4; + hm = { + programs.gitui.enable = true; + programs.git = { + enable = true; + difftastic.enable = true; + lfs.enable = true; + aliases = { + cs = "commit -v -S"; + s = "status"; + a = "add"; + p = "push"; + rebase = "rebase --gpg-sign"; + fixup = ''!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ''${@:2} && EDITOR=true git rebase -i --gpg-sign --autostash --autosquash $TARGET^; }; f''; + f = "!${gf}"; + crm = ''!git commit -v -S --edit --file "$(git rev-parse --git-dir)"/COMMIT_EDITMSG''; + }; + extraConfig = { + core.pager = "${pkgs.delta}/bin/delta"; + delta = { + hyperlinks = true; + keep-plus-minus-markers = true; + line-numbers = true; + navigate = true; + side-by-side = true; + syntax-theme = "TwoDark"; + tabs = 4; + }; + mergetool.prompt = true; + merge.conflictstyle = "diff3"; + init.defaultBranch = "main"; + pull.ff = "only"; + pull.rebase = true; + push.autoSetupRemote = true; + }; + signing = { + key = null; + signByDefault = true; }; - mergetool.prompt = true; - merge.conflictstyle = "diff3"; - init.defaultBranch = "main"; - pull.ff = "only"; - pull.rebase = true; - push.autoSetupRemote = true; - }; - signing = { - key = null; - signByDefault = true; }; }; } diff --git a/users/common/programs/gpg.nix b/users/common/programs/gpg.nix index 62fc697..900abdd 100644 --- a/users/common/programs/gpg.nix +++ b/users/common/programs/gpg.nix @@ -1,12 +1,12 @@ { pkgs, ... }: { - services.gpg-agent = { + hm.services.gpg-agent = { enable = true; enableSshSupport = true; pinentryPackage = pkgs.pinentry-gnome3; }; - programs.gpg = { + hm.programs.gpg = { enable = true; scdaemonSettings.disable-ccid = true; settings = { diff --git a/users/common/programs/gpu-screen-recorder.nix b/users/common/programs/gpu-screen-recorder.nix index 3413e30..6015dab 100644 --- a/users/common/programs/gpu-screen-recorder.nix +++ b/users/common/programs/gpu-screen-recorder.nix @@ -1,7 +1,7 @@ { lib, pkgs, - nixosConfig, + config, ... }: let @@ -88,11 +88,12 @@ let }; in { - lib.gpu-screen-recorder = { + programs.gpu-screen-recorder.enable = true; + hm.lib.gpu-screen-recorder = { inherit save-replay; }; - systemd.user.services.gpu-screen-recorder = { + hm.systemd.user.services.gpu-screen-recorder = { #Install.WantedBy = ["graphical-session.target"]; Unit = { Description = "GPU Screen Recorder Service"; @@ -113,8 +114,8 @@ in "GSR_COLOR_RANGE=full" "GSR_FPSPPS=no" ] - ++ lib.optionals (nixosConfig.node.name == "kroma") [ - "GSR_WINDOW=DP-2" # Primary monitor + ++ lib.optionals (config.node.name == "desktopnix") [ + "GSR_WINDOW=DP-3" # Primary monitor ]; ExecStart = lib.getExe start-service; diff --git a/users/common/programs/htop.nix b/users/common/programs/htop.nix index 9bab773..5ded83f 100644 --- a/users/common/programs/htop.nix +++ b/users/common/programs/htop.nix @@ -1,6 +1,6 @@ { config, ... }: { - programs.htop = { + hm-all.programs.htop = { enable = true; settings = { diff --git a/users/common/programs/kitty.nix b/users/common/programs/kitty.nix index da096d9..86d95e4 100644 --- a/users/common/programs/kitty.nix +++ b/users/common/programs/kitty.nix @@ -1,7 +1,7 @@ { pkgs, lib, ... }: { - stylix.targets.kitty.enable = true; - programs.kitty = { + hm.stylix.targets.kitty.enable = true; + hm.programs.kitty = { enable = true; package = pkgs.kitty.overrideAttrs (_finalAttrs: _prevAttrs: { doCheck = false; }); settings = { diff --git a/users/common/programs/minecraft.nix b/users/common/programs/minecraft.nix index 1029fd6..5012823 100644 --- a/users/common/programs/minecraft.nix +++ b/users/common/programs/minecraft.nix @@ -1,5 +1,5 @@ { pkgs, ... }: { - home.persistence."/persist".directories = [ ".local/share/PrismLauncher" ]; - home.packages = [ pkgs.prismlauncher ]; + hm.home.persistence."/persist".directories = [ ".local/share/PrismLauncher" ]; + hm.home.packages = [ pkgs.prismlauncher ]; } diff --git a/users/common/shells/nu/config.nu b/users/common/programs/nu/config.nu similarity index 100% rename from users/common/shells/nu/config.nu rename to users/common/programs/nu/config.nu diff --git a/users/common/shells/nu/default.nix b/users/common/programs/nu/default.nix similarity index 81% rename from users/common/shells/nu/default.nix rename to users/common/programs/nu/default.nix index d1c35f9..64606aa 100644 --- a/users/common/shells/nu/default.nix +++ b/users/common/programs/nu/default.nix @@ -8,4 +8,7 @@ configFile.source = ./config.nu; envFile.source = ./env.nu; }; + home.persistence."/state" = { + directories = [ ".config/nushell" ]; + }; } diff --git a/users/common/shells/nu/env.nu b/users/common/programs/nu/env.nu similarity index 100% rename from users/common/shells/nu/env.nu rename to users/common/programs/nu/env.nu diff --git a/users/common/programs/nvim/default.nix b/users/common/programs/nvim/default.nix index 5ff4b49..b17cae8 100644 --- a/users/common/programs/nvim/default.nix +++ b/users/common/programs/nvim/default.nix @@ -1,58 +1,60 @@ { pkgs, ... }: { imports = [ - ./nixvim/keybinds.nix - ./nixvim/options.nix - ./nixvim/plugins.nix + ./keybinds.nix + ./options.nix + ./plugins.nix ]; - programs.nixvim = { - enable = true; - luaLoader.enable = true; - files."ftplugin/nix.lua".extraConfigLua = '' - vim.opt_local.expandtab = true - vim.opt_local.tabstop = 2 - vim.opt_local.shiftwidth = 2 - vim.opt_local.softtabstop = 2 - ''; - globals.mapleader = " "; - extraPlugins = with pkgs.vimPlugins; [ - vim-better-whitespace - dressing-nvim - nvim-window-picker - nabla-nvim - vim-gnupg - onedark-nvim - ]; - extraConfigLuaPre = '' - require("onedark").load() - ''; - extraConfigLuaPost = - # lua - '' - vim.notify = require("notify") - require("window-picker").setup { - hint = "floating-big-letter", - filter_rules = { - bo = { - filetype = { "neo-tree", "neo-tree-popup", "notify", "quickfix" }, - buftype = { "terminal", "quickfix", "prompt" }, - }, - }, - floating_big_letter = { - font = "ansi-shadow", - }, - selection_chars = "EITCAUDJÄÜVF", - show_prompt = false, - } + hm = { + programs.nixvim = { + enable = true; + luaLoader.enable = true; + files."ftplugin/nix.lua".extraConfigLua = '' + vim.opt_local.expandtab = true + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 ''; + globals.mapleader = " "; + extraPlugins = with pkgs.vimPlugins; [ + vim-better-whitespace + dressing-nvim + nvim-window-picker + nabla-nvim + vim-gnupg + onedark-nvim + ]; + extraConfigLuaPre = '' + require("onedark").load() + ''; + extraConfigLuaPost = + # lua + '' + vim.notify = require("notify") + require("window-picker").setup { + hint = "floating-big-letter", + filter_rules = { + bo = { + filetype = { "neo-tree", "neo-tree-popup", "notify", "quickfix" }, + buftype = { "terminal", "quickfix", "prompt" }, + }, + }, + floating_big_letter = { + font = "ansi-shadow", + }, + selection_chars = "EITCAUDJÄÜVF", + show_prompt = false, + } + ''; + }; + home.sessionVariables.EDITOR = "nvim"; + home.shellAliases.vim = "nvim"; + home.shellAliases.vi = "nvim"; + home.shellAliases.vimdiff = "nvim -d"; + home.persistence."/state".directories = [ + ".local/share/nvim" + ".local/state/nvim" + ".cache/nvim" + ]; }; - home.sessionVariables.EDITOR = "nvim"; - home.shellAliases.vim = "nvim"; - home.shellAliases.vi = "nvim"; - home.shellAliases.vimdiff = "nvim -d"; - home.persistence."/state".directories = [ - ".local/share/nvim" - ".local/state/nvim" - ".cache/nvim" - ]; } diff --git a/users/common/programs/nvim/nixvim/keybinds.nix b/users/common/programs/nvim/keybinds.nix similarity index 98% rename from users/common/programs/nvim/nixvim/keybinds.nix rename to users/common/programs/nvim/keybinds.nix index 589d04c..cc0f93b 100644 --- a/users/common/programs/nvim/nixvim/keybinds.nix +++ b/users/common/programs/nvim/keybinds.nix @@ -5,7 +5,7 @@ let }; in { - programs.nixvim.keymaps = [ + hm.programs.nixvim.keymaps = [ { key = ""; action = ""; diff --git a/users/common/programs/nvim/nixvim/options.nix b/users/common/programs/nvim/options.nix similarity index 98% rename from users/common/programs/nvim/nixvim/options.nix rename to users/common/programs/nvim/options.nix index 4f82df0..23f00ed 100644 --- a/users/common/programs/nvim/nixvim/options.nix +++ b/users/common/programs/nvim/options.nix @@ -1,5 +1,5 @@ { - programs.nixvim.opts = { + hm.programs.nixvim.opts = { # Set maximum undo levels undolevels = 1000000; # Persistent Undo diff --git a/users/common/programs/nvim/nixvim/plugins.nix b/users/common/programs/nvim/plugins.nix similarity index 98% rename from users/common/programs/nvim/nixvim/plugins.nix rename to users/common/programs/nvim/plugins.nix index 0cae44c..46862a6 100644 --- a/users/common/programs/nvim/nixvim/plugins.nix +++ b/users/common/programs/nvim/plugins.nix @@ -5,7 +5,7 @@ ./plugins/alpha.nix ./plugins/neo-tree.nix ]; - programs.nixvim.plugins = { + hm.programs.nixvim.plugins = { web-devicons.enable = true; which-key.enable = true; lualine = { diff --git a/users/common/programs/nvim/nixvim/plugins/alpha.nix b/users/common/programs/nvim/plugins/alpha.nix similarity index 98% rename from users/common/programs/nvim/nixvim/plugins/alpha.nix rename to users/common/programs/nvim/plugins/alpha.nix index aff2877..9edf9a2 100644 --- a/users/common/programs/nvim/nixvim/plugins/alpha.nix +++ b/users/common/programs/nvim/plugins/alpha.nix @@ -1,5 +1,5 @@ { - programs.nixvim.plugins.alpha = { + hm.programs.nixvim.plugins.alpha = { enable = true; layout = let diff --git a/users/common/programs/nvim/nixvim/plugins/cmp.nix b/users/common/programs/nvim/plugins/cmp.nix similarity index 99% rename from users/common/programs/nvim/nixvim/plugins/cmp.nix rename to users/common/programs/nvim/plugins/cmp.nix index d9b651f..965f6e9 100644 --- a/users/common/programs/nvim/nixvim/plugins/cmp.nix +++ b/users/common/programs/nvim/plugins/cmp.nix @@ -1,5 +1,5 @@ { - programs.nixvim.plugins = { + hm.programs.nixvim.plugins = { luasnip = { enable = true; settings = { diff --git a/users/common/programs/nvim/nixvim/plugins/lsp.nix b/users/common/programs/nvim/plugins/lsp.nix similarity index 97% rename from users/common/programs/nvim/nixvim/plugins/lsp.nix rename to users/common/programs/nvim/plugins/lsp.nix index cfc4db2..e151d36 100644 --- a/users/common/programs/nvim/nixvim/plugins/lsp.nix +++ b/users/common/programs/nvim/plugins/lsp.nix @@ -1,6 +1,6 @@ { lib, pkgs, ... }: { - programs.nixvim.plugins = { + hm.programs.nixvim.plugins = { none-ls = { enable = true; sources = { diff --git a/users/common/programs/nvim/nixvim/plugins/neo-tree.nix b/users/common/programs/nvim/plugins/neo-tree.nix similarity index 97% rename from users/common/programs/nvim/nixvim/plugins/neo-tree.nix rename to users/common/programs/nvim/plugins/neo-tree.nix index 86e6a95..58960b1 100644 --- a/users/common/programs/nvim/nixvim/plugins/neo-tree.nix +++ b/users/common/programs/nvim/plugins/neo-tree.nix @@ -1,5 +1,5 @@ { - programs.nixvim.plugins.neo-tree = { + hm.programs.nixvim.plugins.neo-tree = { enable = true; sortCaseInsensitive = true; usePopupsForInput = false; diff --git a/users/common/programs/obs.nix b/users/common/programs/obs.nix index 1a2b8b4..922d116 100644 --- a/users/common/programs/obs.nix +++ b/users/common/programs/obs.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - programs.obs-studio = { + hm.programs.obs-studio = { enable = true; plugins = with pkgs.obs-studio-plugins; [ #obs-backgroundremoval @@ -9,4 +9,7 @@ obs-nvfbc ]; }; + hm.home.persistence."/state".directories = [ + ".config/obs-studio" + ]; } diff --git a/users/common/shells/pager.nix b/users/common/programs/pager.nix similarity index 96% rename from users/common/shells/pager.nix rename to users/common/programs/pager.nix index 59a61d9..2c9db11 100644 --- a/users/common/shells/pager.nix +++ b/users/common/programs/pager.nix @@ -66,5 +66,5 @@ let ); in { - home.sessionVariables.MANPAGER = "${exe} '+Man!'"; + hm.home.sessionVariables.MANPAGER = "${exe} '+Man!'"; } diff --git a/users/common/programs/poe.nix b/users/common/programs/poe.nix index a4a1522..5645699 100644 --- a/users/common/programs/poe.nix +++ b/users/common/programs/poe.nix @@ -1,10 +1,10 @@ { pkgs, ... }: { - home.persistence."/state".directories = [ ".config/awakened-poe-trade" ]; + hm.home.persistence."/state".directories = [ ".config/awakened-poe-trade" ]; - home.persistence."/persist".directories = [ ".local/share/pobfrontend" ]; + hm.home.persistence."/persist".directories = [ ".local/share/pobfrontend" ]; - home.packages = [ + hm.home.packages = [ #pkgs.awakened-poe-trade pkgs.path-of-building ]; diff --git a/users/common/programs/spicetify.nix b/users/common/programs/spicetify.nix index 8f0ac00..cdc4f13 100644 --- a/users/common/programs/spicetify.nix +++ b/users/common/programs/spicetify.nix @@ -1,6 +1,9 @@ -{ spicePkgs, ... }: +{ inputs, pkgs, ... }: +let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; +in { - programs.spicetify = { + hm.programs.spicetify = { enable = true; theme = spicePkgs.themes.retroBlur; colorScheme = "Purple"; diff --git a/users/common/programs/steam.nix b/users/common/programs/steam.nix new file mode 100644 index 0000000..7407dae --- /dev/null +++ b/users/common/programs/steam.nix @@ -0,0 +1,35 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + programs.steam = { + enable = true; + package = pkgs.steam.override { + extraPkgs = + pkgs: with pkgs; [ + # vampir überlebende braucht diese pkgs + libgdiplus + cups + ]; + }; + }; + hm.home.persistence = { + "/state".directories = [ + # Folders for steam + ".local/share/Steam" + ".steam" + # Ken follets pillars of earth + ".local/share//Daedalic Entertainment GmbH/" + # Nvidia shader cache + ".cache/nvidia" + # Vulkan shader cache + ".local/share/vulkan" + ]; + "/panzer/state".directories = lib.lists.optionals (config.disko.devices.zpool ? "panzer") [ + ".local/share/SteamPanzer" + ]; + }; +} diff --git a/users/common/programs/thunderbird.nix b/users/common/programs/thunderbird.nix index 21b6a81..2e5677c 100644 --- a/users/common/programs/thunderbird.nix +++ b/users/common/programs/thunderbird.nix @@ -1,81 +1,83 @@ { config, lib, ... }: { - accounts.email.accounts = lib.flip lib.mapAttrs' config.userSecrets.accounts.email ( - _: v: - lib.nameValuePair v.address ( - lib.recursiveUpdate v { - thunderbird.enable = true; - thunderbird.profiles = [ "personal" ]; - } - ) - ); - programs.thunderbird = { - enable = true; + hm = { + accounts.email.accounts = lib.flip lib.mapAttrs' config.secrets.secrets.global.user.accounts.email ( + _: v: + lib.nameValuePair v.address ( + lib.recursiveUpdate v { + thunderbird.enable = true; + thunderbird.profiles = [ "personal" ]; + } + ) + ); + programs.thunderbird = { + enable = true; - profiles.personal = { - isDefault = true; - withExternalGnupg = true; + profiles.personal = { + isDefault = true; + withExternalGnupg = true; + + settings = { + "mail.identity.default.archive_enabled" = true; + "mail.identity.default.archive_keep_folder_structure" = true; + "mail.identity.default.compose_html" = false; + "mail.identity.default.protectSubject" = true; + "mail.identity.default.reply_on_top" = 1; + "mail.identity.default.sig_on_reply" = false; + + "gfx.webrender.all" = true; + "gfx.webrender.enabled" = true; + + "browser.display.use_system_colors" = true; + "browser.theme.dark-toolbar-theme" = true; + }; + }; settings = { - "mail.identity.default.archive_enabled" = true; - "mail.identity.default.archive_keep_folder_structure" = true; - "mail.identity.default.compose_html" = false; - "mail.identity.default.protectSubject" = true; - "mail.identity.default.reply_on_top" = 1; - "mail.identity.default.sig_on_reply" = false; + # Some general settings. + "mail.server.default.allow_utf8_accept" = true; + "mail.server.default.max_articles" = 1000; + "mail.server.default.check_all_folders_for_new" = true; + "mail.show_headers" = 1; - "gfx.webrender.all" = true; - "gfx.webrender.enabled" = true; + # Show some metadata. + "mailnews.headers.showMessageId" = true; + "mailnews.headers.showOrganization" = true; + "mailnews.headers.showReferences" = true; + "mailnews.headers.showUserAgent" = true; - "browser.display.use_system_colors" = true; - "browser.theme.dark-toolbar-theme" = true; + # Sort mails and news in descending order. + "mailnews.default_sort_order" = 2; + "mailnews.default_news_sort_order" = 2; + # Sort mails and news by date. + "mailnews.default_sort_type" = 18; + "mailnews.default_news_sort_type" = 18; + + # Sort them by the newest reply in thread. + "mailnews.sort_threads_by_root" = true; + # Show time. + "mail.ui.display.dateformat.default" = 1; + # Sanitize it to UTC to prevent leaking local time. + "mail.sanitize_date_header" = true; + + # Email composing QoL. + "mail.identity.default.auto_quote" = true; + "mail.identity.default.attachPgpKey" = true; + + "app.update.auto" = false; + "privacy.donottrackheader.enabled" = true; }; }; - settings = { - # Some general settings. - "mail.server.default.allow_utf8_accept" = true; - "mail.server.default.max_articles" = 1000; - "mail.server.default.check_all_folders_for_new" = true; - "mail.show_headers" = 1; - - # Show some metadata. - "mailnews.headers.showMessageId" = true; - "mailnews.headers.showOrganization" = true; - "mailnews.headers.showReferences" = true; - "mailnews.headers.showUserAgent" = true; - - # Sort mails and news in descending order. - "mailnews.default_sort_order" = 2; - "mailnews.default_news_sort_order" = 2; - # Sort mails and news by date. - "mailnews.default_sort_type" = 18; - "mailnews.default_news_sort_type" = 18; - - # Sort them by the newest reply in thread. - "mailnews.sort_threads_by_root" = true; - # Show time. - "mail.ui.display.dateformat.default" = 1; - # Sanitize it to UTC to prevent leaking local time. - "mail.sanitize_date_header" = true; - - # Email composing QoL. - "mail.identity.default.auto_quote" = true; - "mail.identity.default.attachPgpKey" = true; - - "app.update.auto" = false; - "privacy.donottrackheader.enabled" = true; + home.persistence."/state".directories = [ + ".cache/thunderbird" + ".thunderbird" + ]; + xdg.mimeApps.enable = true; + xdg.mimeApps.defaultApplications = { + "x-scheme-handler/mailto" = [ "thunderbird.desktop" ]; + "x-scheme-handler/mid" = [ "thunderbird.desktop" ]; + "message/rfc822" = [ "thunderbird.desktop" ]; }; }; - - home.persistence."/state".directories = [ - ".cache/thunderbird" - ".thunderbird" - ]; - xdg.mimeApps.enable = true; - xdg.mimeApps.defaultApplications = { - "x-scheme-handler/mailto" = [ "thunderbird.desktop" ]; - "x-scheme-handler/mid" = [ "thunderbird.desktop" ]; - "message/rfc822" = [ "thunderbird.desktop" ]; - }; } diff --git a/users/common/programs/zsh/default.nix b/users/common/programs/zsh/default.nix new file mode 100644 index 0000000..771329b --- /dev/null +++ b/users/common/programs/zsh/default.nix @@ -0,0 +1,68 @@ +{ pkgs, ... }: +{ + imports = [ ./starfish.nix ]; + # save history in xdg data home + hm-all = + { config, ... }: + { + home.sessionVariables.HISTDB_FILE = "${config.xdg.dataHome}/zsh/history.db"; + + # has to be enabled to support zsh reverse search + programs.fzf.enable = true; + + programs.carapace = { + enable = false; + # this would source all completers sadly some are worse than the builtin completers + enableZshIntegration = false; + }; + + programs.zoxide.enable = true; + + programs.nix-index.enable = true; + programs.nix-index.enableZshIntegration = false; + programs.nix-index-database.comma.enable = true; + + programs.zsh = { + enable = true; + dotDir = ".config/zsh"; + history = { + extended = true; + path = "${config.xdg.dataHome}/zsh/zsh_history"; + save = 1000000; + share = false; + }; + initExtra = builtins.readFile ./zshrc; + # This needs to be loaded befor zsh-fast-syntax-highlighting + # is sourced as that overwrites all widgets to redraw with highlighting + initExtraFirst = '' + if autoload history-search-end; then + zle -N history-beginning-search-backward-end history-search-end + zle -N history-beginning-search-forward-end history-search-end + fi + + ''; + plugins = [ + { + name = "fzf-tab"; + src = "${pkgs.zsh-fzf-tab}/share/fzf-tab"; + } + { + name = "fast-syntax-highlighting"; + src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions"; + } + { + name = "zsh-histdb"; + src = pkgs.zsh-histdb; + } + { + name = "zsh-histdb-skim"; + src = pkgs.zsh-histdb-skim; + } + ]; + }; + home.persistence."/state".directories = [ + ".local/share/zsh" + ".local/share/zoxide" + ]; + }; +} diff --git a/users/common/shells/starfish.nix b/users/common/programs/zsh/starfish.nix similarity index 98% rename from users/common/shells/starfish.nix rename to users/common/programs/zsh/starfish.nix index a5610cf..a60935b 100644 --- a/users/common/shells/starfish.nix +++ b/users/common/programs/zsh/starfish.nix @@ -1,6 +1,6 @@ { lib, ... }: { - programs.starship = { + hm-all.programs.starship = { enable = true; settings = { add_newline = false; diff --git a/users/common/shells/zsh/zshrc b/users/common/programs/zsh/zshrc similarity index 100% rename from users/common/shells/zsh/zshrc rename to users/common/programs/zsh/zshrc diff --git a/users/common/shells/zsh/default.nix b/users/common/shells/zsh/default.nix deleted file mode 100644 index 613c7ac..0000000 --- a/users/common/shells/zsh/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ pkgs, config, ... }: -{ - imports = [ ../starfish.nix ]; - - # save history in xdg data home - home.sessionVariables.HISTDB_FILE = "${config.xdg.dataHome}/zsh/history.db"; - - # has to be enabled to support zsh reverse search - programs.fzf.enable = true; - - programs.carapace = { - enable = false; - # this would source all completers sadly some are worse than the builtin completers - enableZshIntegration = false; - }; - - programs.zoxide.enable = true; - - programs.nix-index.enable = true; - programs.nix-index.enableZshIntegration = false; - programs.nix-index-database.comma.enable = true; - - programs.zsh = { - enable = true; - dotDir = ".config/zsh"; - history = { - extended = true; - path = "${config.xdg.dataHome}/zsh/zsh_history"; - save = 1000000; - share = false; - }; - initExtra = builtins.readFile ./zshrc; - # This needs to be loaded befor zsh-fast-syntax-highlighting - # is sourced as that overwrites all widgets to redraw with highlighting - initExtraFirst = '' - if autoload history-search-end; then - zle -N history-beginning-search-backward-end history-search-end - zle -N history-beginning-search-forward-end history-search-end - fi - - ''; - plugins = [ - { - name = "fzf-tab"; - src = "${pkgs.zsh-fzf-tab}/share/fzf-tab"; - } - { - name = "fast-syntax-highlighting"; - src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions"; - } - { - name = "zsh-histdb"; - src = pkgs.zsh-histdb; - } - { - name = "zsh-histdb-skim"; - src = pkgs.zsh-histdb-skim; - } - ]; - }; - home.persistence."/state".directories = [ - ".local/share/zsh" - ".local/share/zoxide" - ]; -} diff --git a/config/optional/wayland.nix b/users/common/wayland/default.nix similarity index 72% rename from config/optional/wayland.nix rename to users/common/wayland/default.nix index 918a9d6..c2aef2c 100644 --- a/config/optional/wayland.nix +++ b/users/common/wayland/default.nix @@ -1,19 +1,13 @@ { lib, - minimal, pkgs, ... }: -lib.optionalAttrs (!minimal) { +{ services.dbus = { enable = true; implementation = "broker"; }; - environment.systemPackages = with pkgs; [ - wdisplays - wl-clipboard - wev - ]; xdg.portal = { enable = true; xdgOpenUsePortal = true; @@ -42,4 +36,23 @@ lib.optionalAttrs (!minimal) { }; }; }; + imports = [ + ./fuzzel.nix + ./sway.nix + ./hyprland.nix + ./waybar + ./swaync + ./swww.nix + ]; + hm.home.packages = with pkgs; [ + wdisplays + wl-clipboard + wev + ]; + # Autostart hyprland if on tty1 (once, don't restart after logout) + hm.programs.zsh.initExtra = lib.mkOrder 9999 '' + if uwsm check may-start ; then + exec systemd-cat -t uwsm_start uwsm start -S -F Hyprland + fi + ''; } diff --git a/users/common/wayland/fuzzel.nix b/users/common/wayland/fuzzel.nix new file mode 100644 index 0000000..974f576 --- /dev/null +++ b/users/common/wayland/fuzzel.nix @@ -0,0 +1,14 @@ +{ + hm.stylix.targets.fuzzel.enable = true; + hm.programs.fuzzel = { + enable = true; + settings = { + main = { + launch-prefix = "uwsm app --"; + }; + }; + }; + hm.home.persistence."/state".files = [ + ".cache/fuzzel" + ]; +} diff --git a/users/common/wayland/hyprland.nix b/users/common/wayland/hyprland.nix new file mode 100644 index 0000000..3d0f82c --- /dev/null +++ b/users/common/wayland/hyprland.nix @@ -0,0 +1,308 @@ +{ + pkgs, + lib, + config, + ... +}: +let + inherit (lib) + mkMerge + optionals + elem + mkIf + flip + concatMap + ; + #from https://github.com/hyprwm/Hyprland/issues/3835 + float_script = pkgs.writeShellScript "hyprland-bitwarden-float" '' + handle() { + case $1 in + windowtitle*) + # Extract the window ID from the line + window_id=''${1#*>>} + + # Fetch the list of windows and parse it using jq to find the window by its decimal ID + window_info=$(hyprctl clients -j | ${pkgs.jq}/bin/jq --arg id "0x$window_id" '.[] | select(.address == ($id))') + + # Extract the title from the window info + window_title=$(echo "$window_info" | ${pkgs.jq}/bin/jq '.title') + + # Check if the title matches the characteristics of the Bitwarden popup window + if [[ "$window_title" == '"Extension: (Bitwarden Password Manager) - Bitwarden — Mozilla Firefox"' ]]; then + + # echo $window_id, $window_title + # hyprctl dispatch togglefloating address:0x$window_id + # hyprctl dispatch resizewindowpixel exact 20% 40%,address:0x$window_id + # hyprctl dispatch movewindowpixel exact 40% 30%,address:0x$window_id + + hyprctl dispatch togglefloating address:0x$window_id + hyprctl dispatch resizewindowpixel exact "512 768",address:0x$window_id + hyprctl dispatch movewindowpixel exact "$HYPRLAND_FLOAT_LOCATION",address:0x$window_id + fi + ;; + esac + } + + # Listen to the Hyprland socket for events and process each line with the handle function + ${pkgs.socat}/bin/socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done + ''; +in +{ + hm = { + # UWSM starts a SH to read env variables + # this ensures all home.sessionVars are exported + programs.bash.enable = true; + wayland.windowManager.hyprland = { + enable = true; + settings = mkMerge [ + { + input = { + kb_layout = "de"; + kb_variant = "nodeadkeys"; + follow_mouse = 2; + numlock_by_default = true; + repeat_rate = 60; + repeat_delay = 235; + # Only change focus on mouse click + float_switch_override_focus = 0; + accel_profile = "flat"; + + touchpad = { + natural_scroll = true; + disable_while_typing = true; + scroll_factor = 0.7; + }; + }; + device = { + name = "xp-pen-g430s-pen"; + active_area_size = "48 27"; + }; + gestures = { + workspace_swipe = true; + }; + + general = { + gaps_in = 0; + gaps_out = 0; + allow_tearing = true; + }; + #render = { + # explicit_sync = 0; + # direct_scanout = false; + #}; + binds = { + focus_preferred_method = 1; + workspace_center_on = 1; + }; + bind = + let + monitor_binds = { + "1" = "j"; + "2" = "d"; + "3" = "u"; + "4" = "a"; + "5" = "x"; + "6" = "F1"; + "7" = "F2"; + "8" = "F3"; + "9" = "F4"; + }; + in + [ + "SUPER,q,killactive," + "SUPER,return,fullscreen," + "SUPER + SHIFT,return,fullscreenstate,2,0," + "SUPER,f,togglefloating" + "SUPER,g,togglegroup" + "SUPER,tab,cyclenext," + "ALT,tab,cyclenext," + "SUPER+CTRL,r,submap,resize" + + "SUPER,left,movefocus,l" + "SUPER,right,movefocus,r" + "SUPER,up,movefocus,u" + "SUPER,down,movefocus,d" + + "SUPER,n,movefocus,l" + "SUPER,s,movefocus,r" + "SUPER,l,movefocus,u" + "SUPER,r,movefocus,d" + + "SUPER,h,changegroupactive,b" + "SUPER,m,changegroupactive,f" + + "SUPER + SHIFT,left,movewindoworgroup,l" + "SUPER + SHIFT,right,movewindoworgroup,r" + "SUPER + SHIFT,up,movewindoworgroup,u" + "SUPER + SHIFT,down,movewindoworgroup,d" + + "SUPER + SHIFT,n,movewindoworgroup,l" + "SUPER + SHIFT,s,movewindoworgroup,r" + "SUPER + SHIFT,l,movewindoworgroup,u" + "SUPER + SHIFT,r,movewindoworgroup,d" + + "SUPER,comma,workspace,-1" + "SUPER,period,workspace,+1" + "SUPER + SHIFT,comma,movetoworkspace,-1" + "SUPER + SHIFT,period,movetoworkspace,+1" + + "SUPER,b,exec,uwsm app -- firefox" + "SUPER,t,exec,uwsm app -- kitty" + ",Menu,exec,fuzzel" + "SUPER,c,exec,${lib.getExe pkgs.scripts.clone-term}" + + "CTRL,F7,pass,class:^(discord)$" + "CTRL,F8,pass,class:^(discord)$" + "CTRL,F7,pass,class:^(TeamSpeak 3)$" + "CTRL,F8,pass,class:^(TeamSpeak 3)$" + "CTRL,F9,exec,systemctl --user start swww-update-wallpaper" + + "SUPER + SHIFT,q,exec,uwsm stop" + ] + ++ flip concatMap (map toString (lib.lists.range 1 9)) (x: [ + "SUPER,${monitor_binds."${x}"},workspace,${x}" + "SUPER + SHIFT,${monitor_binds."${x}"},movetoworkspacesilent,${x}" + ]); + + cursor.no_warps = true; + debug.disable_logs = false; + env = + [ + "NIXOS_OZONE_WL,1" + "MOZ_ENABLE_WAYLAND,1" + "_JAVA_AWT_WM_NONREPARENTING,1" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "QT_QPA_PLATFORM,wayland;xcb" + "GDK_BACKEND,wayland" + "WLR_DRM_NO_ATOMIC,1" # retest on newest nvidia driver + "XDG_SESSION_TYPE,wayland" + "TERMINAL,uwsm app -- kitty" + ] + ++ optionals (elem "nvidia" config.services.xserver.videoDrivers) [ + # See https://wiki.hyprland.org/Nvidia/ + "LIBVA_DRIVER_NAME,nvidia" + "GBM_BACKEND,nvidia-drm" + ]; + bindm = [ + # mouse movements + "SUPER, mouse:272, movewindow" + "SUPER, mouse:273, resizewindow" + "SUPER ALT, mouse:272, resizewindow" + ]; + animations = { + enabled = true; + animation = [ + "windows, 1, 4, default, slide" + "windowsOut, 1, 4, default, slide" + "windowsMove, 1, 4, default" + "border, 1, 2, default" + "fade, 1, 4, default" + "fadeDim, 1, 4, default" + "workspaces, 1, 4, default" + ]; + }; + decoration.rounding = 4; + exec-once = [ + "${pkgs.swaynotificationcenter}/bin/swaync" + ]; + misc = { + vrr = 1; + disable_hyprland_logo = true; + mouse_move_focuses_monitor = false; + }; + xwayland.force_zero_scaling = true; + windowrulev2 = [ + # fix these once nvidia gets their shit together + #"immediate, class:^(cs2)$" + # apex legends + "immediate, class:^(steam_app_1172470)$" + #??? + "immediate, class:^(steam_app_238960)$" + #baldur + #"immediate, class:^(steam_app_1086940)$" + "float, class:^(steam)$, title:^(Friends List)" + "float, class:^(steam)$, title:(Chat)" + + "float, class:^(streamlink-twitch-gui)$" + + "workspace 2,class:^(firefox)$" + "workspace 3,class:^(thunderbird)$" + "workspace 4,class:^(bottles)$" + "workspace 4,class:^(steam)$, title:^(Steam)" + "workspace 4,class:^(prismlauncher)$" + "workspace 6,class:^(discord)$" + "workspace 6,class:^(WebCord)$" + "workspace 6,class:^(TeamSpeak 3)$" + "workspace 7,class:^(signal)$" + "workspace 7,class:^(TelegramDesktop)$" + ]; + } + (mkIf (config.node.name == "desktopnix") { + input.tablet = { + output = "DP-3"; + }; + monitor = [ + "DVI-D-1,preferred,0x0,1" + "HDMI-A-1,preferred,0x1080,1" + "DP-3,2560x1440@144.00Hz,1920x540,1" + # Thank you NVIDIA for this generous, free-of-charge, extra monitor that + # doesn't exist and crashes yoru session sometimes when moving a window to it. + "Unknown-1, disable" + ]; + workspace = [ + "1, monitor:DP-3, default:true" + "2, monitor:DP-3" + "3, monitor:DP-3" + "4, monitor:DP-3" + "5, monitor:DP-3" + "6, monitor:DVI-D-1, default:true" + "7, monitor:DVI-D-1" + "8, monitor:HDMI-A-1, default: true" + "9, monitor:HDMI-A-1" + ]; + env = [ "HYPRLAND_FLOAT_LOCATION,3800 680" ]; + }) + (mkIf (config.node.name == "patricknix") { + monitor = [ + "eDP-1,preferred,0x0,2" + # Thank you NVIDIA for this generous, free-of-charge, extra monitor that + # doesn't exist and crashes yoru session sometimes when moving a window to it. + "Unknown-1, disable" + ]; + workspace = [ + "1, monitor:eDP-1, default:true" + "2, monitor:eDP-1" + "3, monitor:eDP-1" + "4, monitor:eDP-1" + "5, monitor:eDP-1" + "6, monitor:eDP-1" + "7, monitor:eDP-1" + "8, monitor:eDP-1" + "9, monitor:eDP-1" + ]; + env = [ "HYPRLAND_FLOAT_LOCATION,1400 200" ]; + }) + ]; + extraConfig = '' + submap=resize + binde=,right,resizeactive,80 0 + binde=,left,resizeactive,-80 0 + binde=,up,resizeactive,0 -80 + binde=,down,resizeactive,0 80 + binde=SHIFT,right,resizeactive,10 0 + binde=SHIFT,left,resizeactive,-10 0 + binde=SHIFT,up,resizeactive,0 -10 + binde=SHIFT,down,resizeactive,0 10 + bind=,return,submap,reset + bind=,escape,submap,reset + submap=reset + + exec-once = ${pkgs.xorg.xprop}/bin/xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 + exec-once = ${float_script} + env = XCURSOR_SIZE,48 + exec-once = uwsm finalize + + ''; + }; + }; +} diff --git a/users/common/wayland/sway.nix b/users/common/wayland/sway.nix new file mode 100644 index 0000000..bc0595a --- /dev/null +++ b/users/common/wayland/sway.nix @@ -0,0 +1,108 @@ +{ config, ... }: +let + nixConfig = config; +in +{ + # import shared i3 config + imports = [ ../Xorg/sway3.nix ]; + hm = + { config, ... }: + { + stylix.targets.sway.enable = true; + wayland.windowManager.sway = { + enable = true; + config = + { + menu = "fuzzel"; + startup = [ + # for games to work input 1 has to be qwerts + # but i would like to have bone as my layout + { + command = "swaymsg input \"*\" xkb_switch_layout 1"; + always = true; + } + { command = "uwsm finalize"; } + ]; + input = { + "*" = { + xkb_layout = "de,de,de"; + # games are stupid so the main ui has to be de() without bone + xkb_variant = ",bone,neo"; + xkb_options = "grp:win_space_toggle"; + repeat_delay = "235"; + repeat_rate = "60"; + accel_profile = "flat"; + pointer_accel = "0.3"; + tap = "enabled"; + }; + "type:touchpad" = { + pointer_accel = "0.5"; + natural_scroll = "enabled"; + }; + "type:touch" = { + map_to_output = "eDP-1"; + }; + "type:tablet_tool" = { + map_to_output = "eDP-1"; + }; + }; + keybindings = + let + cfg = config.wayland.windowManager.sway.config; + in + { + "Menu" = "exec ${cfg.menu}"; + }; + } + // { + desktopnix = { + output = { + DVI-D-1 = { + mode = "1920x1080@60Hz"; + pos = "0,0"; + }; + HDMI-A-1 = { + mode = "1920x1080@60Hz"; + pos = "0,1080"; + }; + DP-3 = { + mode = "2560x1440@143.998Hz"; + pos = "1920,720"; + adaptive_sync = "on"; + }; + }; + }; + patricknix = { + output = { + "Acer Technologies XB271HU #ASP7ytE/6A7d" = { + mode = "2560x1440@59.951Hz"; + pos = "0,0"; + }; + "AU Optronics 0x30EB Unknown" = { + mode = "3840x2160@60.002Hz"; + pos = "2560,0"; + scale = "2"; + }; + }; + }; + } + .${nixConfig.node.name} or { }; + extraConfig = + let + cfg = config.wayland.windowManager.sway.config; + in + '' + bindgesture swipe:3:left workpace next + bindgesture swipe:3:right workpace prev + bindgesture pinch:4:outward exec ${cfg.menu} + ''; + }; + # Cursor invisible + home.sessionVariables = { + WLR_NO_HARDWARE_CURSORS = 1; + NIXOS_OZONE_WL = 1; + # opengl backend flickers, also vulkan is love. + #WLR_RENDERER = "vulkan"; + }; + }; +} diff --git a/users/common/graphical/wayland/swaync/default.nix b/users/common/wayland/swaync/default.nix similarity index 92% rename from users/common/graphical/wayland/swaync/default.nix rename to users/common/wayland/swaync/default.nix index 7fea219..e9a8e0c 100644 --- a/users/common/graphical/wayland/swaync/default.nix +++ b/users/common/wayland/swaync/default.nix @@ -1,6 +1,6 @@ { config, lib, ... }: { - services.swaync = { + hm.services.swaync = { enable = true; settings = { positionX = "right"; @@ -83,7 +83,4 @@ ) + (builtins.readFile ./swaync.css); }; - - # Started via hyprland to ensure it restarts properly with hyprland - systemd.user.services.swaync.Install.WantedBy = lib.mkForce [ ]; } diff --git a/users/common/graphical/wayland/swaync/swaync.css b/users/common/wayland/swaync/swaync.css similarity index 100% rename from users/common/graphical/wayland/swaync/swaync.css rename to users/common/wayland/swaync/swaync.css diff --git a/users/common/graphical/wayland/swww.nix b/users/common/wayland/swww.nix similarity index 98% rename from users/common/graphical/wayland/swww.nix rename to users/common/wayland/swww.nix index e5cd761..897eca2 100644 --- a/users/common/graphical/wayland/swww.nix +++ b/users/common/wayland/swww.nix @@ -17,7 +17,7 @@ let }; in { - systemd.user = { + hm.systemd.user = { services = { swww = { Install.WantedBy = [ "graphical-session.target" ]; diff --git a/users/common/graphical/wayland/waybar/default.nix b/users/common/wayland/waybar/default.nix similarity index 97% rename from users/common/graphical/wayland/waybar/default.nix rename to users/common/wayland/waybar/default.nix index e4813ac..82d3fa9 100644 --- a/users/common/graphical/wayland/waybar/default.nix +++ b/users/common/wayland/waybar/default.nix @@ -1,15 +1,15 @@ { pkgs, lib, - nixosConfig, + config, ... }: { - systemd.user.services."waybar" = { + hm.systemd.user.services."waybar" = { Unit.After = [ "graphical-session.target" ]; Service.Slice = [ "app-graphical.slice" ]; }; - programs.waybar = { + hm.programs.waybar = { enable = true; systemd.enable = true; style = @@ -32,7 +32,7 @@ } ''; } - .${nixosConfig.node.name} or "" + .${config.node.name} or "" ) + builtins.readFile ./waybar.css; settings.main = { @@ -68,7 +68,7 @@ "tray" ]; } - .${nixosConfig.node.name} or [ ]; + .${config.node.name} or [ ]; battery = { interval = 1; diff --git a/users/common/graphical/wayland/waybar/waybar.css b/users/common/wayland/waybar/waybar.css similarity index 100% rename from users/common/graphical/wayland/waybar/waybar.css rename to users/common/wayland/waybar/waybar.css diff --git a/users/patrick/default.nix b/users/patrick/default.nix index 73d976f..e73391f 100644 --- a/users/patrick/default.nix +++ b/users/patrick/default.nix @@ -6,6 +6,7 @@ ... }: lib.optionalAttrs (!minimal) { + primaryUser = "patrick"; users.users.patrick = { shell = pkgs.zsh; isNormalUser = true; @@ -40,12 +41,6 @@ lib.optionalAttrs (!minimal) { # xournalpp needs this or else it will crash adwaita-icon-theme ]; - age.secrets = { - smb-creds = { - owner = "patrick"; - rekeyFile = ../../secrets/smb.cred.age; - }; - }; programs.dconf.enable = true; age.secrets."my-gpg-yubikey-keygrip.tar" = { @@ -54,43 +49,38 @@ lib.optionalAttrs (!minimal) { mode = "640"; }; - home-manager.users.patrick = { - imports = - [ - ./patrick.nix - ./ssh.nix - ./firefox.nix - ./gpg - ./impermanence.nix - ./minion.nix - ./vr.nix + imports = [ - ../common - ../common/impermanence.nix + ./firefox.nix + ./gpg + ./impermanence.nix + ./minion.nix + ./patrick.nix + ./smb.nix + ./ssh.nix + ./theme.nix - ../common/programs/bottles.nix - ../common/programs/direnv.nix - ../common/programs/firefox.nix - ../common/programs/gdb.nix - ../common/programs/git.nix - ../common/programs/kitty.nix - ../common/programs/minecraft.nix - ../common/programs/nvim - ../common/programs/poe.nix - ../common/programs/spicetify.nix - ../common/programs/thunderbird.nix - ../common/programs/gpu-screen-recorder.nix - ../common/shells/pager.nix - ] - ++ { - "desktopnix" = [ - ../common/graphical/Xorg - ../common/programs/obs.nix - ../common/graphical/wayland - ./smb.nix - ]; - "patricknix" = [ ../common/graphical/wayland ]; - } - .${config.node.name} or [ ]; - }; + ../common/alias.nix + ../common/dev.nix + ../common/wayland + + ../common/programs/bottles.nix + ../common/programs/direnv.nix + ../common/programs/firefox.nix + ../common/programs/gdb.nix + ../common/programs/git.nix + ../common/programs/gpg.nix + ../common/programs/gpu-screen-recorder.nix + ../common/programs/kitty.nix + ../common/programs/minecraft.nix + ../common/programs/nvim + ../common/programs/obs.nix + ../common/programs/pager.nix + ../common/programs/poe.nix + ../common/programs/spicetify.nix + ../common/programs/steam.nix + ../common/programs/thunderbird.nix + ../common/programs/zsh + + ]; } diff --git a/users/patrick/firefox.nix b/users/patrick/firefox.nix index d17f04a..a3d9978 100644 --- a/users/patrick/firefox.nix +++ b/users/patrick/firefox.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - programs.firefox = + hm.programs.firefox = let betterfox = pkgs.fetchFromGitHub { owner = "yokoffing"; diff --git a/users/patrick/gpg/default.nix b/users/patrick/gpg/default.nix index 8d673c5..3a78e53 100644 --- a/users/patrick/gpg/default.nix +++ b/users/patrick/gpg/default.nix @@ -1,5 +1,11 @@ { - programs.gpg.publicKeys = [ + config, + lib, + pkgs, + ... +}: +{ + hm.programs.gpg.publicKeys = [ { source = ./pubkey.gpg; trust = 5; @@ -9,4 +15,14 @@ trust = 5; } ]; + # Make sure the keygrips exist, otherwise we'd need to run `gpg --card-status` + # before being able to use the yubikey. + hm.home.activation.installKeygrips = + config.home-manager.users.root.lib.dag.entryAfter [ "writeBoundary" ] + '' + run mkdir -p "$HOME/.gnupg/private-keys-v1.d" + run ${lib.getExe pkgs.gnutar} xvf ${ + lib.escapeShellArg config.age.secrets."my-gpg-yubikey-keygrip.tar".path + } -C "$HOME/.gnupg/private-keys-v1.d/" + ''; } diff --git a/users/patrick/impermanence.nix b/users/patrick/impermanence.nix index 9a92389..d6363da 100644 --- a/users/patrick/impermanence.nix +++ b/users/patrick/impermanence.nix @@ -1,11 +1,13 @@ -{ nixosConfig, lib, ... }: +{ config, lib, ... }: { - home.persistence = { + hm.home.persistence = { "/state" = { + files = [ + ".ssh/known_hosts" + ]; directories = [ "repos" "Downloads" - "Zotero" ".config/ts3client" @@ -13,6 +15,8 @@ ".config/xournalpp" ".cache/xournalpp" + ".local/state/wireplumber" + ".config/OrcaSlicer" ".config/streamcontroller" @@ -28,13 +32,12 @@ ".local/share/osu" - ".config/obs-studio" - ".local/share/monado" # For nextcloud client install "Nextcloud" ".config/Nextcloud" + ".config/dconf" # for electron signal app state ".config/Signal" @@ -45,27 +48,13 @@ ".cache/mpv" - # Folders for steam - ".local/share/Steam" - ".steam" - # Ken follets pillars of earth - ".local/share//Daedalic Entertainment GmbH/" - # Nvidia shader cache - ".cache/nvidia" - # Vulkan shader cache - ".local/share/vulkan" - - # bottles state games - ".local/share/bottles" - ".config/spotify" ".cache/spotify" ".local/share/cargo" ".local/share/wallpapers" ]; }; - "/panzer/state".directories = lib.lists.optionals (nixosConfig.disko.devices.zpool ? "panzer") [ - ".local/share/SteamPanzer" + "/panzer/state".directories = lib.lists.optionals (config.disko.devices.zpool ? "panzer") [ "videos" ]; }; diff --git a/users/patrick/minion.nix b/users/patrick/minion.nix index c817de8..ada1478 100644 --- a/users/patrick/minion.nix +++ b/users/patrick/minion.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ config, pkgs, ... }: let # addon-path is base64 encode path cfgFile = pkgs.writeText "mimion.xml" '' @@ -26,12 +26,14 @@ let ''; in { - home.packages = [ pkgs.minion ]; + hm.home.packages = [ pkgs.minion ]; # yet another program that uses the config file as a live state file # Why? - home.activation.installMinionConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - run mkdir -p .minion - run cp -f ${cfgFile} .minion/minion.xml - run chmod 640 .minion/minion.xml - ''; + hm.home.activation.installMinionConfig = + config.home-manager.users.root.lib.dag.entryAfter [ "writeBoundary" ] + '' + run mkdir -p .minion + run cp -f ${cfgFile} .minion/minion.xml + run chmod 640 .minion/minion.xml + ''; } diff --git a/users/patrick/patrick.nix b/users/patrick/patrick.nix index 4fd984c..f18825b 100644 --- a/users/patrick/patrick.nix +++ b/users/patrick/patrick.nix @@ -1,70 +1,57 @@ { pkgs, - lib, - nixosConfig, ... }: { - home = { + hm.home = { packages = with pkgs; [ - nextcloud-client - discord - webcord - netflix - xournalpp - galaxy-buds-client - thunderbird - signal-desktop - telegram-desktop + chatterino2 chromium - osu-lazer-bin - teamspeak_client - zotero - timer - orca-slicer - hexyl + cmatrix + cowsay + discord + feh + figlet + galaxy-buds-client gh + hexyl + hyperfine + mpv + netflix + nextcloud-client nixpkgs-review - - via - + orca-slicer + osu-lazer-bin + pinentry-gnome3 # for yubikey pinentry + signal-desktop streamlink streamlink-twitch-gui-bin - chatterino2 - + teamspeak_client + telegram-desktop + timer + via + webcord + xournalpp yt-dlp - - hyperfine - - figlet - cowsay - cmatrix + zathura + zotero ]; }; - xdg.configFile."streamlink/config".text = '' - player=mpv - ''; - xdg.configFile."mpv/mpv.conf".text = '' - vo=gpu-next - hwdec=auto-safe - volume=50 - ''; - xdg.configFile."mpv/input.conf".text = '' - UP add volume 2 - DOWN add volume -2 - ''; - # Make sure the keygrips exist, otherwise we'd need to run `gpg --card-status` - # before being able to use the yubikey. - home.activation.installKeygrips = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - run mkdir -p "$HOME/.gnupg/private-keys-v1.d" - run ${lib.getExe pkgs.gnutar} xvf ${ - lib.escapeShellArg nixosConfig.age.secrets."my-gpg-yubikey-keygrip.tar".path - } -C "$HOME/.gnupg/private-keys-v1.d/" - ''; - # Autostart hyprland if on tty1 (once, don't restart after logout) - programs.zsh.initExtra = lib.mkOrder 9999 '' - if uwsm check may-start ; then - exec systemd-cat -t uwsm_start uwsm start -S -F Hyprland - fi - ''; + hm.programs.bat.enable = true; + # needed for gnome pinentry + services.dbus.packages = [ pkgs.gcr ]; + hm = { + xdg.configFile."streamlink/config".text = '' + player=mpv + ''; + xdg.configFile."mpv/mpv.conf".text = '' + vo=gpu-next + hwdec=auto-safe + volume=50 + ''; + xdg.configFile."mpv/input.conf".text = '' + UP add volume 2 + DOWN add volume -2 + ''; + }; } diff --git a/users/patrick/secrets.nix.age b/users/patrick/secrets.nix.age deleted file mode 100644 index c84892378550ac39e94f61448dabdffde537ac73..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jmV=ue)LI{shMYH+X zp=9dQnu4-+EWF-+F0)8)A-1F-?!4ua%PG|8ThBFk6SaHEH3M*-vP0dfEiI8natsY~L4A|yXZ@;DCHtd9qf$$Ju0gsPezIlof+M_*)--_RIQGQ z?-}qnq@E=9i5B)Tnr<=u47+uPk+42__Qm@&N4Upbl+6 zy|e~5V{Bjoaz^}p$n^M!qieo-PCU~()X2@He|S|ipg+BgHUo5*uA9}=JgZ`m-fDHr zlZ@z>J>PiCIxo#f9DYi}LU$1F_-C)pPFoPTREJ$9nccXTmC-!oD>D9js9WQ20o-aX z98lFSGuC)IzAJS0SihBdAhn+Ji?$ERcQKtF?!ErVM0SLwgO|KX6^8ea^(X%@v)Dv< zJBdL|8rfqSbIM!J8*oA@D}}~yHn^O;KcJqQA(RULV(9sva#-Q+lV)aL7aFH=Ft);7 z?G0LicA6=O^3pHhe3q?F&b5T=kDOdSczU$b;Jjn_B~XjcyW)=*g|I=Z62y=X6?#f9 zVDx87htl{`Z=Fu!`I+>*)|ppG;I1ZY>LCB1K{Zyun`=BReH + + + + monospace + + emoji + + + + sans-serif + + emoji + + + + serif + + emoji + + + + ''; + }; + packages = with pkgs; [ + (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) + ibm-plex + dejavu_fonts + unifont + freefont_ttf + gyre-fonts # TrueType substitutes for standard PostScript fonts + liberation_ttf + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-emoji + noto-fonts-extra + ]; + }; + stylix.fonts = { + serif = { + package = pkgs.dejavu_fonts; + name = "IBM Plex Serif"; + }; + + sansSerif = { + package = pkgs.dejavu_fonts; + name = "IBM Plex Sans"; + }; + + monospace = { + # No need for patched nerd fonts, kitty can pick up on them automatically, + # and ideally every program should do that: https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font + package = pkgs.jetbrains-mono; + name = "JetBrains Mono"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + }; + stylix = { + enable = true; + autoEnable = false; + polarity = "dark"; + image = config.lib.stylix.pixel "base00"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/vice.yaml"; + # Has to be green + override.base0B = "#00CC99"; + #base16Scheme = { + # base00 = "#101419"; + # base01 = "#171B20"; + # base02 = "#21262e"; + # base03 = "#242931"; + # base04 = "#485263"; + # base05 = "#b6beca"; + # base06 = "#dee1e6"; + # base07 = "#e3e6eb"; + # base08 = "#e05f65"; + # base09 = "#f9a872"; + # base0A = "#f1cf8a"; + # base0B = "#78dba9"; + # base0C = "#74bee9"; + # base0D = "#70a5eb"; + # base0E = "#c68aee"; + # base0F = "#9378de"; + #}; + ## based on decaycs-dark, bright variant + #base16Scheme = { + # base00 = "#101419"; + # base01 = "#171B20"; + # base02 = "#21262e"; + # base03 = "#242931"; + # base04 = "#485263"; + # base05 = "#b6beca"; + # base06 = "#dee1e6"; + # base07 = "#e3e6eb"; + # base08 = "#e5646a"; + # base09 = "#f7b77c"; + # base0A = "#f6d48f"; + # base0B = "#94F7C5"; + # base0C = "#79c3ee"; + # base0D = "#75aaf0"; + # base0E = "#cb8ff3"; + # base0F = "#9d85e1"; + #}; + }; + + hm = + { config, ... }: + { + stylix = { + cursor = { + package = pkgs.openzone-cursors; + name = "OpenZone_White_Slim"; + size = 18; + }; + inherit (config.stylix) polarity; + targets = { + gtk.enable = true; + bat.enable = true; + dunst.enable = true; + zathura.enable = true; + xresources.enable = true; + }; + }; + + xresources.properties = { + "Xft.hinting" = true; + "Xft.antialias" = true; + "Xft.autohint" = false; + "Xft.lcdfilter" = "lcddefault"; + "Xft.hintstyle" = "hintfull"; + "Xft.rgba" = "rgb"; + }; + + gtk = + let + gtk34extraConfig = { + gtk-application-prefer-dark-theme = 1; + gtk-cursor-theme-size = 18; + gtk-enable-animations = true; + gtk-xft-antialias = 1; + gtk-xft-dpi = 96; # XXX: delete for wayland? + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintfull"; + gtk-xft-rgba = "rgb"; + }; + in + { + enable = true; + iconTheme = { + name = "Vimix-Doder"; + package = pkgs.vimix-icon-theme; + }; + + gtk2.extraConfig = "gtk-application-prefer-dark-theme = true"; + gtk3.extraConfig = gtk34extraConfig; + gtk4.extraConfig = gtk34extraConfig; + }; + + home.sessionVariables.GTK_THEME = config.gtk.theme.name; + + qt = { + enable = true; + platformTheme.name = "adwaita"; + style.name = "Adwaita-Dark"; + }; + }; +} diff --git a/users/patrick/vr.nix b/users/patrick/vr.nix deleted file mode 100644 index 33981fd..0000000 --- a/users/patrick/vr.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, pkgs, ... }: -{ - home.packages = [ pkgs.wlx-overlay-s ]; - xdg.configFile."openxr/1/active_runtime.json".text = '' - { - "file_format_version": "1.0.0", - "runtime": { - "name": "Monado", - "library_path": "${pkgs.monado}/lib/libopenxr_monado.so" - } - } - ''; - - xdg.configFile."openvr/openvrpaths.vrpath".text = '' - { - "config" : - [ - "${config.xdg.dataHome}/Steam/config" - ], - "external_drivers" : null, - "jsonid" : "vrpathreg", - "log" : - [ - "${config.xdg.dataHome}/Steam/logs" - ], - "runtime" : - [ - "${pkgs.opencomposite}/lib/opencomposite" - ], - "version" : 1 - } - ''; -} diff --git a/users/root/default.nix b/users/root/default.nix index 79a7213..1312826 100644 --- a/users/root/default.nix +++ b/users/root/default.nix @@ -1,8 +1,6 @@ { pkgs, config, - lib, - minimal, ... }: { @@ -17,5 +15,4 @@ ]; hashedPassword = config.secrets.secrets.global.users.root.passwordHash; }; - home-manager.users.root.imports = lib.lists.optionals (!minimal) [ ../common ]; }