{ config, pkgs, inputs, ... }: { # ========================================================================= # IMPORTS & NIX CONFIGURATION # ========================================================================= imports = [ ./hardware-configuration.nix inputs.noctalia-greeter.nixosModules.default ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; nixpkgs.config.allowUnfree = true; nix.gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 7d"; }; # Dynamic binary execution & FHS compatibility programs.nix-ld.enable = true; services.envfs.enable = true; security.polkit.enable = true; # ========================================================================= # BOOT & KERNEL CONFIGURATION # ========================================================================= boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.kernelParams = [ "drm.edid_firmware=DP-1:edid/mi_edid.bin" "video=DP-1:2560x1440@180" ]; # Custom EDID firmware loading for monitor hardware.firmware = [ (pkgs.runCommand "custom-edid" {} '' mkdir -p $out/lib/firmware/edid cp ${./mi_edid.bin} $out/lib/firmware/edid/mi_edid.bin '') ]; # ========================================================================= # HARDWARE, FILESYSTEMS & GRAPHICS # ========================================================================= fileSystems."/mnt/giga" = { device = "/dev/disk/by-uuid/bfed3a37-05e1-465b-a4b7-d74cd31bf937"; fsType = "ext4"; options = [ "defaults" "user" "rw" ]; }; hardware.graphics = { enable = true; enable32Bit = true; }; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { modesetting.enable = true; powerManagement.enable = false; open = false; nvidiaSettings = true; package = config.boot.kernelPackages.nvidiaPackages.latest; }; # ========================================================================= # NETWORKING, DNS & VPN # ========================================================================= networking.hostName = "opus"; networking.networkmanager.enable = true; # Systemd-Resolved (Encrypted DNS) services.resolved = { enable = true; settings = { Resolve = { DNSOverTLS = "true"; DNSSEC = "true"; Domains = [ "~." ]; DNS = "76.76.2.2#p2.freedns.controld.com"; FallbackDNS = "1.1.1.1"; }; }; }; # Mullvad VPN Daemon services.mullvad-vpn = { enable = true; package = pkgs.mullvad-vpn; }; # Avahi (Printer / Network Discovery) services.avahi = { enable = true; nssmdns4 = true; openFirewall = true; }; # ========================================================================= # LOCALIZATION & TIMEZONE # ========================================================================= time.timeZone = "Etc/GMT-7"; i18n.defaultLocale = "en_US.UTF-8"; i18n.extraLocaleSettings = { LC_ADDRESS = "en_US.UTF-8"; LC_IDENTIFICATION = "en_US.UTF-8"; LC_MEASUREMENT = "en_US.UTF-8"; LC_MONETARY = "en_US.UTF-8"; LC_NAME = "en_US.UTF-8"; LC_NUMERIC = "en_US.UTF-8"; LC_PAPER = "en_US.UTF-8"; LC_TELEPHONE = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8"; }; # ========================================================================= # USER ACCOUNTS & PRIVILEGES # ========================================================================= users.users."seraphim" = { isNormalUser = true; description = "seraphim"; shell = pkgs.fish; # Sets Fish as your default user shell extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; []; }; security.doas = { enable = true; extraRules = [ { users = [ "seraphim" ]; keepEnv = true; persist = true; } ]; }; # ========================================================================= # SHELLS & ENHANCEMENTS # ========================================================================= programs.fish = { enable = true; interactiveShellInit = '' set -g fish_greeting "" # Disables the welcome message fzf --fish | source ''; shellAliases = { ls = "eza -al --icons=auto"; ll = "eza -al --icons=auto"; }; }; programs.starship.enable = true; # ========================================================================= # DISPLAY, WAYLAND & DESKTOP ENVIRONMENT # ========================================================================= programs.niri.enable = true; programs.noctalia-greeter = { enable = true; settings = { cursor = { theme = "Bibata-Modern-Ice"; size = 24; path = "${pkgs.bibata-cursors}/share/icons"; }; }; }; qt = { enable = true; platformTheme = "qt5ct"; style = "breeze"; }; xdg.portal = { enable = true; extraPortals = [ pkgs.xdg-desktop-portal-gnome pkgs.xdg-desktop-portal-gtk ]; }; # Environment Variables environment.variables = { SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; NIX_SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; }; environment.sessionVariables = { SHELL = "${pkgs.fish}/bin/fish"; LIBVA_DRIVER_NAME = "nvidia"; XCURSOR_THEME = "Bibata-Modern-Ice"; XCURSOR_SIZE = "20"; __GLX_VENDOR_LIBRARY_NAME = "nvidia"; NIXOS_OZONE_WL = "1"; CC = "clang"; ELECTRON_OZONE_PLATFORM_HINT = "auto"; GSK_RENDERER = "ngl"; QT_QPA_PLATFORM = "wayland;xcb"; QT_ENABLE_HIGHDPI_SCALING = "1"; QT_AUTO_SCREEN_SCALE_FACTOR = "1"; QT_SCREEN_SCALE_FACTORS = "1.5"; }; # Fonts Configuration fonts.fontconfig.enable = true; fonts.packages = with pkgs; [ font-awesome nerd-fonts.jetbrains-mono nerd-fonts.symbols-only jetbrains-mono noto-fonts-color-emoji ]; # ========================================================================= # AUDIO & SERVICES # ========================================================================= security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; }; # Printing (CUPS) services.printing = { enable = true; drivers = with pkgs; [ brlaser gutenprint cups-filters ]; }; # MPD Music Server services.mpd = { enable = true; user = "seraphim"; openFirewall = false; settings = { music_directory = "/mnt/giga/music"; bind_to_address = "any"; port = 6600; auto_update = "yes"; audio_output = [ { type = "pulse"; name = "PipeWire Output"; mixer_type = "hardware"; } ]; }; }; systemd.services.mpd.environment = { XDG_RUNTIME_DIR = "/run/user/1000"; }; # System Utilities & Gaming services.gvfs.enable = true; services.tumbler.enable = true; services.gnome.gnome-keyring.enable = true; programs.dconf.enable = true; services.journald.extraConfig = '' SystemMaxUse=50M MaxRetentionSec=1month ''; programs.steam = { enable = true; remotePlay.openFirewall = true; dedicatedServer.openFirewall = true; }; programs.throne = { enable = true; tunMode.enable = true; }; # ========================================================================= # USER SERVICES # ========================================================================= systemd.user.services.swingmusic = { description = "Swing Music Local Server"; wantedBy = [ "graphical-session.target" ]; after = [ "graphical-session.target" ]; serviceConfig = { ExecStart = "/home/seraphim/.swingmusic/swingmusic"; Restart = "on-failure"; WorkingDirectory = "/home/seraphim"; NoNewPrivileges = true; PrivateTmp = true; ProtectSystem = "strict"; ProtectHome = "false"; RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; }; }; systemd.user.services.mpd-mpris = { description = "MPD MPRIS Service for Waybar"; wantedBy = [ "default.target" ]; after = [ "graphical-session.target" ]; serviceConfig = { ExecStart = "${pkgs.mpd-mpris}/bin/mpd-mpris -network tcp -host 127.0.0.1 -port 6600"; Restart = "on-failure"; }; }; systemd.user.services.niri.enableDefaultPath = false; # ========================================================================= # SYSTEM PACKAGES # ========================================================================= environment.systemPackages = with pkgs; [ # Flake Inputs & Hardware Overrides inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default (btop.override { cudaSupport = true; }) # Terminals & CLI Utilities cacert tree pkgs.rsync duf eza fastfetch fd foot fzf ghfetch ghostty hyfetch stow util-linux pkgs.vimPlugins.im-select-nvim # Audio & Music Controls brightnessctl mpc mpd mpd-mpris mpv pamixer pavucontrol playerctl rmpc # Text Editors micro neovim (emacs-pgtk.override { withNativeCompilation = true; }) # File Managers & Archiving file-roller kdePackages.ark kdePackages.qt6ct loupe nautilus sushi yazi # Utilities & Disk Tools caligula cryptsetup yt-dlp # GStreamer Codecs gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good gst_all_1.gst-plugins-ugly # Wayland, Desktop UI & Utilities adwaita-icon-theme bibata-cursors cliphist fuzzel grim hicolor-icon-theme hyprpolkitagent noctalia-shell slurp wl-clipboard wtype xwayland-satellite # Desktop Applications & Office claude-code keepassxc libreoffice hunspellDicts.ru_RU nvidia-vaapi-driver opencode telegram-desktop vesktop obsidian pkgs.lutris pkgs.qbittorrent pkgs.prismlauncher # Software Development & Toolchains black cargo clang clippy gcc git gnumake nodejs pyright python3 rust-analyzer rustc tree-sitter ]; system.stateVersion = "26.05"; }