summaryrefslogtreecommitdiff
path: root/backup-nix/configuration.nix
diff options
context:
space:
mode:
Diffstat (limited to 'backup-nix/configuration.nix')
-rw-r--r--backup-nix/configuration.nix453
1 files changed, 453 insertions, 0 deletions
diff --git a/backup-nix/configuration.nix b/backup-nix/configuration.nix
new file mode 100644
index 0000000..760c077
--- /dev/null
+++ b/backup-nix/configuration.nix
@@ -0,0 +1,453 @@
+{ 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;
+ };
+
+ # Appimage settings
+ programs.appimage = {
+ enable = true;
+ binfmt = true;
+ package = pkgs.appimage-run.override {
+ extraPkgs = pkgs: [
+ pkgs.webkitgtk_4_1
+ ];
+ };
+ };
+
+ # =========================================================================
+ # NETWORKING, DNS & VPN
+ # =========================================================================
+ networking.hostName = "opus";
+ networking.networkmanager.enable = true;
+ programs.amnezia-vpn.enable = true;
+ # Primary DNS Server: Mullvad DoT (Base Mode)
+ networking.nameservers = [
+ "194.242.2.4#base.dns.mullvad.net"
+ "194.242.2.2#dns.mullvad.net"
+ ];
+
+ # systemd-resolved Configuration (Mullvad Base Primary -> Quad9 Fallback)
+ services.resolved = {
+ enable = true;
+ dnsovertls = "opportunistic"; # Encrypts DNS via DoT, falls back if port 853 is blocked
+ dnssec = "false"; # Disables DNSSEC validation drops
+ domains = [ "~." ]; # Forces systemd-resolved to use global DNS, ignoring DHCP DNS
+ fallbackDns = [
+ "9.9.9.9#dns.quad9.net"
+ "149.112.112.112#dns.quad9.net"
+ ];
+ };
+
+
+ # 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;
+ };
+ # printer service
+ services.printing = {
+ enable = true;
+ drivers = with pkgs; [
+ brlaser
+ cups-filters
+ gutenprint
+ ];
+ };
+
+ # 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.libsixel
+ libGL
+ nss
+ cups
+ libdrm
+ glib
+ pango
+ gtk3
+ zlib
+ expat
+ alsa-lib
+ libxkbcommon
+ atk
+ pkg-config
+ cmake
+
+ nftables
+ 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.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
+ pkgs.ayugram-desktop
+ pkgs.legcord
+ pkgs.amnezia-vpn
+ obsidian
+ pkgs.lutris
+ pkgs.qbittorrent
+ pkgs.prismlauncher
+ pkgs.wireshark
+ # Software Development & Toolchains
+ black
+ cargo
+ clang
+ clippy
+ gcc
+ git
+ gnumake
+ nodejs
+ pyright
+ python3
+ rust-analyzer
+ rustc
+ tree-sitter
+ ];
+
+ system.stateVersion = "26.05";
+}