diff --git a/STRUCTURE.md b/STRUCTURE.md index 8f0af21..8f8b309 100644 --- a/STRUCTURE.md +++ b/STRUCTURE.md @@ -4,8 +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 - - `support/` configuration for supporting specific hardware - - `optional/` optionally includable configuration + - `support/` configuration for supporting specific hardware or use cases on a system level - `services/` configuration for independent services - `hosts/` contain nixos configuration for hosts - `/` configuration for hosts @@ -17,9 +16,8 @@ This file contains a small overview over the contents and structure of this repo - `secrets.nix.age` local secrets usable while evaluating - `host.pub` host public key, needed for rekeying agenix secrets - `keys/` public keys needed for evaluating the system -- `lib/` extra library functions - `modules/` extra nixos modules -- `modules-hm/` extra home-manager modules +- `modules-hm/` extra home-manager or home management modules - `nix/` additional nix functions - `devshell.nix` Development shell - `extra-builtins.nix` Extra builtin plugin file to enable repository secrets @@ -29,10 +27,8 @@ This file contains a small overview over the contents and structure of this repo - currently containing all yubikeys and a rage backup key - `secrets.nix.age` global secrets available at deploy - `users/` home manager user configuration - - `common/` shared home-manager modules + - `patrick` personal configuration for myself + - `programs/` configuration for miscellaneous programs - `wayland/` configuration for wayland windowmanagers and basic utilities - `xorg/` configuration for xorg windowmanagers and basic utilities - - `programs/` configuration for miscellaneous programs - - `default.nix` minimal setup for all users - - `/` configuration for users - - `impermanence.nix` users persistence configuration + - `root` minimal configuration for root diff --git a/users/common/programs/firefox.nix b/users/common/programs/firefox.nix deleted file mode 100644 index eaffde2..0000000 --- a/users/common/programs/firefox.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib, pkgs, ... }: -let - inherit (lib) concatStringsSep escapeShellArg mapAttrsToList; - env = { - MOZ_WEBRENDER = 1; - # For a better scrolling implementation and touch support. - # Be sure to also disable "Use smooth scrolling" in about:preferences - MOZ_USE_XINPUT2 = 1; - # Required for hardware video decoding. - # See https://github.com/elFarto/nvidia-vaapi-driver?tab=readme-ov-file#firefox - MOZ_DISABLE_RDD_SANDBOX = 1; - LIBVA_DRIVER_NAME = "nvidia"; - NVD_BACKEND = "direct"; - }; - envStr = concatStringsSep " " (mapAttrsToList (n: v: "${n}=${escapeShellArg v}") env); -in -{ - hm.programs.firefox = { - enable = true; - package = pkgs.firefox.overrideAttrs (old: { - buildCommand = - old.buildCommand - + '' - substituteInPlace $out/bin/firefox \ - --replace "exec -a" ${escapeShellArg envStr}" exec -a" - ''; - }); - }; - hm.home.persistence."/state".directories = [ - ".cache/mozilla" - ".mozilla" - ]; - hm.xdg.mimeApps.enable = true; - hm.xdg.mimeApps.defaultApplications = { - "text/html" = [ "firefox.desktop" ]; - "text/xml" = [ "firefox.desktop" ]; - "x-scheme-handler/http" = [ "firefox.desktop" ]; - "x-scheme-handler/https" = [ "firefox.desktop" ]; - }; -} diff --git a/users/common/Xorg/default.nix b/users/patrick/Xorg/default.nix similarity index 100% rename from users/common/Xorg/default.nix rename to users/patrick/Xorg/default.nix diff --git a/users/common/Xorg/herbst-keys.nix b/users/patrick/Xorg/herbst-keys.nix similarity index 100% rename from users/common/Xorg/herbst-keys.nix rename to users/patrick/Xorg/herbst-keys.nix diff --git a/users/common/Xorg/herbstluft.nix b/users/patrick/Xorg/herbstluft.nix similarity index 100% rename from users/common/Xorg/herbstluft.nix rename to users/patrick/Xorg/herbstluft.nix diff --git a/users/common/Xorg/i3.nix b/users/patrick/Xorg/i3.nix similarity index 100% rename from users/common/Xorg/i3.nix rename to users/patrick/Xorg/i3.nix diff --git a/users/common/Xorg/polybar.nix b/users/patrick/Xorg/polybar.nix similarity index 100% rename from users/common/Xorg/polybar.nix rename to users/patrick/Xorg/polybar.nix diff --git a/users/common/Xorg/rofi.nix b/users/patrick/Xorg/rofi.nix similarity index 100% rename from users/common/Xorg/rofi.nix rename to users/patrick/Xorg/rofi.nix diff --git a/users/common/Xorg/sway3.nix b/users/patrick/Xorg/sway3.nix similarity index 100% rename from users/common/Xorg/sway3.nix rename to users/patrick/Xorg/sway3.nix diff --git a/users/common/Xorg/xinitrc b/users/patrick/Xorg/xinitrc similarity index 100% rename from users/common/Xorg/xinitrc rename to users/patrick/Xorg/xinitrc diff --git a/users/common/Xorg/xserver.nix b/users/patrick/Xorg/xserver.nix similarity index 100% rename from users/common/Xorg/xserver.nix rename to users/patrick/Xorg/xserver.nix diff --git a/users/common/alias.nix b/users/patrick/alias.nix similarity index 100% rename from users/common/alias.nix rename to users/patrick/alias.nix diff --git a/users/patrick/default.nix b/users/patrick/default.nix index e73391f..1142c44 100644 --- a/users/patrick/default.nix +++ b/users/patrick/default.nix @@ -51,36 +51,34 @@ lib.optionalAttrs (!minimal) { imports = [ - ./firefox.nix - ./gpg + ./alias.nix + ./dev.nix ./impermanence.nix - ./minion.nix ./patrick.nix ./smb.nix ./ssh.nix ./theme.nix - ../common/alias.nix - ../common/dev.nix - ../common/wayland + ./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 + ./programs/bottles.nix + ./programs/direnv.nix + ./programs/firefox.nix + ./programs/gdb.nix + ./programs/git.nix + ./programs/gpg + ./programs/gpu-screen-recorder.nix + ./programs/kitty.nix + ./programs/minecraft.nix + ./programs/minion.nix + ./programs/nvim + ./programs/obs.nix + ./programs/pager.nix + ./programs/poe.nix + ./programs/spicetify.nix + ./programs/steam.nix + ./programs/thunderbird.nix + ./programs/zsh ]; } diff --git a/users/common/dev.nix b/users/patrick/dev.nix similarity index 100% rename from users/common/dev.nix rename to users/patrick/dev.nix diff --git a/users/patrick/gpg/default.nix b/users/patrick/gpg/default.nix deleted file mode 100644 index 3a78e53..0000000 --- a/users/patrick/gpg/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - hm.programs.gpg.publicKeys = [ - { - source = ./pubkey.gpg; - trust = 5; - } - { - source = ./newpubkey.gpg; - 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/common/programs/bottles.nix b/users/patrick/programs/bottles.nix similarity index 100% rename from users/common/programs/bottles.nix rename to users/patrick/programs/bottles.nix diff --git a/users/common/programs/direnv.nix b/users/patrick/programs/direnv.nix similarity index 100% rename from users/common/programs/direnv.nix rename to users/patrick/programs/direnv.nix diff --git a/users/patrick/firefox.nix b/users/patrick/programs/firefox.nix similarity index 79% rename from users/patrick/firefox.nix rename to users/patrick/programs/firefox.nix index a3d9978..e970835 100644 --- a/users/patrick/firefox.nix +++ b/users/patrick/programs/firefox.nix @@ -1,5 +1,31 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: +let + inherit (lib) concatStringsSep escapeShellArg mapAttrsToList; + env = { + MOZ_WEBRENDER = 1; + # For a better scrolling implementation and touch support. + # Be sure to also disable "Use smooth scrolling" in about:preferences + MOZ_USE_XINPUT2 = 1; + # Required for hardware video decoding. + # See https://github.com/elFarto/nvidia-vaapi-driver?tab=readme-ov-file#firefox + MOZ_DISABLE_RDD_SANDBOX = 1; + LIBVA_DRIVER_NAME = "nvidia"; + NVD_BACKEND = "direct"; + }; + envStr = concatStringsSep " " (mapAttrsToList (n: v: "${n}=${escapeShellArg v}") env); +in { + hm.home.persistence."/state".directories = [ + ".cache/mozilla" + ".mozilla" + ]; + hm.xdg.mimeApps.enable = true; + hm.xdg.mimeApps.defaultApplications = { + "text/html" = [ "firefox.desktop" ]; + "text/xml" = [ "firefox.desktop" ]; + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + }; hm.programs.firefox = let betterfox = pkgs.fetchFromGitHub { @@ -10,6 +36,15 @@ }; in { + enable = true; + package = pkgs.firefox.overrideAttrs (old: { + buildCommand = + old.buildCommand + + '' + substituteInPlace $out/bin/firefox \ + --replace "exec -a" ${escapeShellArg envStr}" exec -a" + ''; + }); profiles.patrick = { userChrome = '' #TabsToolbar { diff --git a/users/common/programs/gdb.nix b/users/patrick/programs/gdb.nix similarity index 100% rename from users/common/programs/gdb.nix rename to users/patrick/programs/gdb.nix diff --git a/users/common/programs/git.nix b/users/patrick/programs/git.nix similarity index 100% rename from users/common/programs/git.nix rename to users/patrick/programs/git.nix diff --git a/users/common/programs/gpg.nix b/users/patrick/programs/gpg/default.nix similarity index 80% rename from users/common/programs/gpg.nix rename to users/patrick/programs/gpg/default.nix index 900abdd..f2e2f31 100644 --- a/users/common/programs/gpg.nix +++ b/users/patrick/programs/gpg/default.nix @@ -1,5 +1,30 @@ -{ pkgs, ... }: { + config, + lib, + pkgs, + ... +}: +{ + hm.programs.gpg.publicKeys = [ + { + source = ./pubkey.gpg; + trust = 5; + } + { + source = ./newpubkey.gpg; + 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/" + ''; hm.services.gpg-agent = { enable = true; enableSshSupport = true; diff --git a/users/patrick/gpg/newpubkey.gpg b/users/patrick/programs/gpg/newpubkey.gpg similarity index 100% rename from users/patrick/gpg/newpubkey.gpg rename to users/patrick/programs/gpg/newpubkey.gpg diff --git a/users/patrick/gpg/pubkey.gpg b/users/patrick/programs/gpg/pubkey.gpg similarity index 100% rename from users/patrick/gpg/pubkey.gpg rename to users/patrick/programs/gpg/pubkey.gpg diff --git a/users/common/programs/gpu-screen-recorder.nix b/users/patrick/programs/gpu-screen-recorder.nix similarity index 100% rename from users/common/programs/gpu-screen-recorder.nix rename to users/patrick/programs/gpu-screen-recorder.nix diff --git a/users/common/programs/htop.nix b/users/patrick/programs/htop.nix similarity index 100% rename from users/common/programs/htop.nix rename to users/patrick/programs/htop.nix diff --git a/users/common/programs/kitty.nix b/users/patrick/programs/kitty.nix similarity index 100% rename from users/common/programs/kitty.nix rename to users/patrick/programs/kitty.nix diff --git a/users/common/programs/minecraft.nix b/users/patrick/programs/minecraft.nix similarity index 100% rename from users/common/programs/minecraft.nix rename to users/patrick/programs/minecraft.nix diff --git a/users/patrick/minion.nix b/users/patrick/programs/minion.nix similarity index 100% rename from users/patrick/minion.nix rename to users/patrick/programs/minion.nix diff --git a/users/common/programs/nu/config.nu b/users/patrick/programs/nu/config.nu similarity index 100% rename from users/common/programs/nu/config.nu rename to users/patrick/programs/nu/config.nu diff --git a/users/common/programs/nu/default.nix b/users/patrick/programs/nu/default.nix similarity index 100% rename from users/common/programs/nu/default.nix rename to users/patrick/programs/nu/default.nix diff --git a/users/common/programs/nu/env.nu b/users/patrick/programs/nu/env.nu similarity index 100% rename from users/common/programs/nu/env.nu rename to users/patrick/programs/nu/env.nu diff --git a/users/common/programs/nvim/default.nix b/users/patrick/programs/nvim/default.nix similarity index 100% rename from users/common/programs/nvim/default.nix rename to users/patrick/programs/nvim/default.nix diff --git a/users/common/programs/nvim/keybinds.nix b/users/patrick/programs/nvim/keybinds.nix similarity index 100% rename from users/common/programs/nvim/keybinds.nix rename to users/patrick/programs/nvim/keybinds.nix diff --git a/users/common/programs/nvim/options.nix b/users/patrick/programs/nvim/options.nix similarity index 100% rename from users/common/programs/nvim/options.nix rename to users/patrick/programs/nvim/options.nix diff --git a/users/common/programs/nvim/plugins.nix b/users/patrick/programs/nvim/plugins.nix similarity index 100% rename from users/common/programs/nvim/plugins.nix rename to users/patrick/programs/nvim/plugins.nix diff --git a/users/common/programs/nvim/plugins/alpha.nix b/users/patrick/programs/nvim/plugins/alpha.nix similarity index 100% rename from users/common/programs/nvim/plugins/alpha.nix rename to users/patrick/programs/nvim/plugins/alpha.nix diff --git a/users/common/programs/nvim/plugins/cmp.nix b/users/patrick/programs/nvim/plugins/cmp.nix similarity index 100% rename from users/common/programs/nvim/plugins/cmp.nix rename to users/patrick/programs/nvim/plugins/cmp.nix diff --git a/users/common/programs/nvim/plugins/lsp.nix b/users/patrick/programs/nvim/plugins/lsp.nix similarity index 100% rename from users/common/programs/nvim/plugins/lsp.nix rename to users/patrick/programs/nvim/plugins/lsp.nix diff --git a/users/common/programs/nvim/plugins/neo-tree.nix b/users/patrick/programs/nvim/plugins/neo-tree.nix similarity index 100% rename from users/common/programs/nvim/plugins/neo-tree.nix rename to users/patrick/programs/nvim/plugins/neo-tree.nix diff --git a/users/common/programs/obs.nix b/users/patrick/programs/obs.nix similarity index 100% rename from users/common/programs/obs.nix rename to users/patrick/programs/obs.nix diff --git a/users/common/programs/pager.nix b/users/patrick/programs/pager.nix similarity index 100% rename from users/common/programs/pager.nix rename to users/patrick/programs/pager.nix diff --git a/users/common/programs/poe.nix b/users/patrick/programs/poe.nix similarity index 100% rename from users/common/programs/poe.nix rename to users/patrick/programs/poe.nix diff --git a/users/common/programs/spicetify.nix b/users/patrick/programs/spicetify.nix similarity index 100% rename from users/common/programs/spicetify.nix rename to users/patrick/programs/spicetify.nix diff --git a/users/common/programs/steam.nix b/users/patrick/programs/steam.nix similarity index 100% rename from users/common/programs/steam.nix rename to users/patrick/programs/steam.nix diff --git a/users/common/programs/thunderbird.nix b/users/patrick/programs/thunderbird.nix similarity index 100% rename from users/common/programs/thunderbird.nix rename to users/patrick/programs/thunderbird.nix diff --git a/users/common/programs/zsh/default.nix b/users/patrick/programs/zsh/default.nix similarity index 100% rename from users/common/programs/zsh/default.nix rename to users/patrick/programs/zsh/default.nix diff --git a/users/common/programs/zsh/starfish.nix b/users/patrick/programs/zsh/starfish.nix similarity index 100% rename from users/common/programs/zsh/starfish.nix rename to users/patrick/programs/zsh/starfish.nix diff --git a/users/common/programs/zsh/zshrc b/users/patrick/programs/zsh/zshrc similarity index 100% rename from users/common/programs/zsh/zshrc rename to users/patrick/programs/zsh/zshrc diff --git a/users/common/wayland/default.nix b/users/patrick/wayland/default.nix similarity index 100% rename from users/common/wayland/default.nix rename to users/patrick/wayland/default.nix diff --git a/users/common/wayland/fuzzel.nix b/users/patrick/wayland/fuzzel.nix similarity index 100% rename from users/common/wayland/fuzzel.nix rename to users/patrick/wayland/fuzzel.nix diff --git a/users/common/wayland/hyprland.nix b/users/patrick/wayland/hyprland.nix similarity index 100% rename from users/common/wayland/hyprland.nix rename to users/patrick/wayland/hyprland.nix diff --git a/users/common/wayland/sway.nix b/users/patrick/wayland/sway.nix similarity index 100% rename from users/common/wayland/sway.nix rename to users/patrick/wayland/sway.nix diff --git a/users/common/wayland/swaync/default.nix b/users/patrick/wayland/swaync/default.nix similarity index 100% rename from users/common/wayland/swaync/default.nix rename to users/patrick/wayland/swaync/default.nix diff --git a/users/common/wayland/swaync/swaync.css b/users/patrick/wayland/swaync/swaync.css similarity index 100% rename from users/common/wayland/swaync/swaync.css rename to users/patrick/wayland/swaync/swaync.css diff --git a/users/common/wayland/swww.nix b/users/patrick/wayland/swww.nix similarity index 100% rename from users/common/wayland/swww.nix rename to users/patrick/wayland/swww.nix diff --git a/users/common/wayland/waybar/default.nix b/users/patrick/wayland/waybar/default.nix similarity index 100% rename from users/common/wayland/waybar/default.nix rename to users/patrick/wayland/waybar/default.nix diff --git a/users/common/wayland/waybar/waybar.css b/users/patrick/wayland/waybar/waybar.css similarity index 100% rename from users/common/wayland/waybar/waybar.css rename to users/patrick/wayland/waybar/waybar.css