dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 9a3823a9e5f9423cec058af827acb7405a3dcf3d parent 01ed9f63b7424e82acfad2370c4b6394ce9a9bb2 Author: maydayv7 <maydayv7@gmail.com> Date: Wed, 31 Dec 2025 02:38:13 +0530 feat: Use `stevenblack` blocklist - Try to fix Niri Screencast: The `gnome` portal doesn't work (I tried for wayyy too long), so use `wlr` instead - Fix boot errors
Diffstat:
| M | CHANGELOG.md | | | 2 | ++ |
| M | files/flake.nix | | | 3 | ++- |
| M | modules/apps/firefox.nix | | | 5 | ++++- |
| M | modules/base/security.nix | | | 32 | ++++++++++---------------------- |
| M | modules/gui/desktop/hyprland/default.nix | | | 9 | +++------ |
| M | modules/gui/desktop/niri/default.nix | | | 7 | +++++++ |
| M | modules/gui/desktop/niri/settings/apps.nix | | | 2 | ++ |
| M | modules/hardware/boot.nix | | | 1 | - |
| M | modules/hardware/filesystem.nix | | | 8 | ++++---- |
| M | modules/hardware/gpu.nix | | | 15 | ++++++++++++--- |
| M | scripts/install.nix | | | 2 | +- |
| M | site/content/blog/nix.md | | | 1 | + |
12 files changed, 48 insertions(+), 39 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,11 +2,13 @@ ### December +- Use `stevenblack` blocklist - Refactor `hardware.gpu` and add `hardware.cpu.model` - Use `swaync` instead of `dunst` - Niri Updates - Update to v25.11 - Use UWSM + - Use `wlr` instead of `gnome` XDG Portal - Use `pwvucontrol` instead of `pavucontrol` - Patch `nom` rendering - Add an AppImage manager diff --git a/files/flake.nix b/files/flake.nix @@ -17,6 +17,7 @@ system = "/etc/nixos"; # Configuration Directory persist = "/nix/state"; # Persisted Files + data = "/data"; # Data Directory gpg = "/etc/gpg"; # GPG Keys Directory sops = ../secrets/secrets.yaml; # Encrypted Secrets @@ -39,7 +40,7 @@ # Directory Bookmarks bookmarks = '' - file:///data/files Files + file://${path.data}/files Files file:/// Computer ''; diff --git a/modules/apps/firefox.nix b/modules/apps/firefox.nix @@ -7,12 +7,13 @@ }: let enable = builtins.elem "firefox" config.apps.list; + package = pkgs.firefox; in { ## Firefox Browser Configuration ## config = lib.mkIf enable { environment = { - systemPackages = [ pkgs.firefox ]; + systemPackages = [ package ]; sessionVariables.MOZ_USE_XINPUT2 = "1"; }; @@ -31,6 +32,7 @@ in # Profile programs.firefox = { enable = true; + inherit package; policies = { # Policies DisableTelemetry = true; @@ -65,6 +67,7 @@ in }; profiles.default = { + isDefault = true; containersForce = true; settings = { ## Flags diff --git a/modules/base/security.nix b/modules/base/security.nix @@ -6,10 +6,10 @@ { ## Security & Hardening Settings ## config = { - # Protocols - programs.firejail.enable = true; security = { protectKernelImage = false; # To enable Hibernation + + # Security Module apparmor = { enable = true; killUnconfinedConfinables = true; @@ -17,21 +17,26 @@ }; }; + # Block Junk Sites + networking.stevenblack.enable = true; + + # Sandbox + programs.firejail.enable = true; + boot = { - # Parameters + # Hardening kernelParams = [ "page_alloc.shuffle=1" "page_poison=1" "slub_debug=FZP" ]; - # Flags kernel.sysctl = { # Kernel "kernel.ftrace_enabled" = false; "kernel.kexec_load_disabled" = true; "kernel.kptr_restrict" = lib.mkOverride 500 2; - "kernel.sysrq" = 0; + "kernel.sysrq" = 176; "kernel.yama.ptrace_scope" = lib.mkOverride 500 1; # Network @@ -93,22 +98,5 @@ "ufs" ]; }; - - ## Block Junk Sites - networking.extraHosts = - builtins.readFile ( - pkgs.fetchurl { - # Shady Sites - url = "https://raw.githubusercontent.com/shreyasminocha/shady-hosts/a5647df22b0dc5ff6c866f21ee2d8b588682626a/hosts"; - sha256 = "sha256-f6xCphzFHFYfOhMv+488amAMy+rSyHxQs/21nyvBtiU="; - } - ) - + builtins.readFile ( - pkgs.fetchurl { - # Crypto Scams - url = "https://raw.githubusercontent.com/MetaMask/eth-phishing-detect/78e727318a77fd62521d220e25871cdb65b8f00d/src/hosts.txt"; - sha256 = "sha256-b3HvaLxnUJZOANUL/p+XPNvu9Aod9YLHYYtCZT5Lan0="; - } - ); }; } diff --git a/modules/gui/desktop/hyprland/default.nix b/modules/gui/desktop/hyprland/default.nix @@ -34,11 +34,9 @@ in portalPackage = pkgs.xdg-desktop-portal-hyprland; }; - services = { - xserver.desktopManager.runXdgAutostartIfNone = true; - - # Greeter - greetd.settings.default_session.command = mkForce "${getExe programs.hyprland.package} --config ${ + # Greeter + services.greetd.settings.default_session.command = + mkForce "${getExe programs.hyprland.package} --config ${ pkgs.writeText "greeter.conf" ( replaceStrings [ "@greeter" ] [ (getExe config.programs.regreet.package) ] ( util.build.theme { @@ -48,7 +46,6 @@ in ) ) } &> /dev/null"; - }; } { # App Environment diff --git a/modules/gui/desktop/niri/default.nix b/modules/gui/desktop/niri/default.nix @@ -21,6 +21,7 @@ niri = { enable = true; package = pkgs.niri-unstable; + useNautilus = false; }; # Session @@ -36,6 +37,12 @@ }; }; + # App Environment + xdg.portal.config.niri.default = [ + "gtk" + "wlr" + ]; + # Settings _shared.enable = true; user.homeConfig = { diff --git a/modules/gui/desktop/niri/settings/apps.nix b/modules/gui/desktop/niri/settings/apps.nix @@ -24,6 +24,8 @@ "uwsm" "finalize" "NIRI_SOCKET" + "XDG_CURRENT_DESKTOP" + "XDG_SESSION_TYPE" ]; } { command = exec "pcmanfm-qt" [ "--desktop" ]; } diff --git a/modules/hardware/boot.nix b/modules/hardware/boot.nix @@ -51,7 +51,6 @@ in "quiet" "splash" "boot.shell_on_fail" - "i915.fastboot=1" "rd.systemd.show_status=false" "rd.udev.log_level=3" "udev.log_priority=3" diff --git a/modules/hardware/filesystem.nix b/modules/hardware/filesystem.nix @@ -32,7 +32,7 @@ in ] ++ [ (mkAliasOptionModule [ "environment" "persist" ] [ "environment" "persistence" files.path.persist ]) - (mkAliasOptionModule [ "hardware" "fs" "persist" ] [ "environment" "persistence" "/data" ]) + (mkAliasOptionModule [ "hardware" "fs" "persist" ] [ "environment" "persistence" files.path.data ]) ]; options = with types; { @@ -132,7 +132,7 @@ in }; # PERSISTENT Partition - "/data" = { + "${files.path.data}" = { device = "fspool/data"; fsType = "zfs"; neededForBoot = true; @@ -193,7 +193,7 @@ in ]; }; - "/data" = { + "${files.path.data}" = { hideMounts = true; users = mapAttrs (_: _: { inherit (config.user.persist) files; @@ -243,7 +243,7 @@ in runtimeInputs = [ pkgs.coreutils ]; text = '' LOCAL="$HOME/.local/share/Trash" - PERSIST="/data/home/$USER/Trash" + PERSIST="${files.path.data}/home/$USER/Trash" mkdir -p "$LOCAL" ${script} ''; diff --git a/modules/hardware/gpu.nix b/modules/hardware/gpu.nix @@ -54,12 +54,21 @@ in blacklistedKernelModules = [ "nouveau" ]; kernelModules = [ "nvidia" + "nvidia_drm" "nvidia_modeset" "nvidia_uvm" - "nvidia_drm.fbdev=1" # Wayland Support - "NVreg_UsePageAttributeTable=1" # PAT Support - "NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100" # DDC/CI Support ]; + + # Wayland Support + kernelParams = [ "nvidia-drm.fbdev=1" ]; + + extraModprobeConfig = '' + # PAT Support + options nvidia NVreg_UsePageAttributeTable=1 + + # DDC/CI Support + options nvidia NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100 + ''; }; hardware.nvidia = { diff --git a/scripts/install.nix b/scripts/install.nix @@ -74,7 +74,7 @@ let mkdir -p /mnt/{nix,data} mount -t zfs fspool/system/nix /mnt/nix mkdir -p /mnt${persist} - mount -t zfs fspool/data /mnt/data + mount -t zfs fspool/data /mnt${data} } mount_other() { diff --git a/site/content/blog/nix.md b/site/content/blog/nix.md @@ -40,4 +40,5 @@ Below is a list of handy, helpful resources and documentation that can be used t # Footnotes [^1]: Provided that they are not **_garbage collected_** - Removing or modifying a package from the configuration doesn't exactly delete older versions from the system. All they do is create a new derivation that no longer contains symlinks to the older packages. Since disk space is limited, unused packages should be removed at some point, which can be done using `nix-collect-garbage -d` or `nix store --gc` + [^2]: Evaluation of expressions is delayed until their values are actually needed. For more information, see [this](https://en.wikipedia.org/wiki/Lazy_evaluation)