summaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorseraphim <18ycm9tx@anonaddy.me>2026-07-24 23:36:49 +0700
committerseraphim <18ycm9tx@anonaddy.me>2026-07-24 23:36:49 +0700
commit9f9921e9d32128f93b7237d51ce0af821120fc11 (patch)
tree58a46923be8859d21fa662d60f1e4991da0a4b0f /nixos
parent395c08d0a334cdffbcc370384bee67f19f964399 (diff)
frst
Diffstat (limited to 'nixos')
-rw-r--r--nixos/configuration.nix365
-rw-r--r--nixos/flake.lock80
-rw-r--r--nixos/flake.nix26
-rw-r--r--nixos/hardware-configuration.nix33
-rw-r--r--nixos/mi_edid.binbin0 -> 384 bytes
5 files changed, 504 insertions, 0 deletions
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
new file mode 100644
index 0000000..ef7adc9
--- /dev/null
+++ b/nixos/configuration.nix
@@ -0,0 +1,365 @@
+{ config, pkgs, inputs, ... }:
+
+{
+ imports = [
+ ./hardware-configuration.nix
+ inputs.noctalia-greeter.nixosModules.default
+ ];
+
+ # 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
+ '')
+ ];
+
+ fileSystems."/mnt/giga" = {
+ device = "/dev/disk/by-uuid/bfed3a37-05e1-465b-a4b7-d74cd31bf937";
+ fsType = "ext4";
+ options = [ "defaults" "user" "rw" ];
+ };
+
+ # --- Mullvad VPN daemon ---
+ services.mullvad-vpn = {
+ enable = true;
+ package = pkgs.mullvad-vpn;
+ };
+
+ services.resolved = {
+ enable = true;
+ dnssec = "true";
+ dnsovertls = "true";
+ domains = [ "~." ];
+ settings = {
+ Resolve = {
+ DNS = "194.242.2.4#base.dns.mullvad.net 2a07:e340::4#base.dns.mullvad.net";
+ FallbackDNS = "";
+ };
+ };
+ };
+
+ # Restrict systemd log size and retention
+ services.journald.extraConfig = ''
+ SystemMaxUse=50M
+ MaxRetentionSec=1month
+ '';
+
+ # --- AUTOSTART 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";
+ # --- Systemd Hardening Options ---
+ NoNewPrivileges = true;
+ PrivateTmp = true;
+ ProtectSystem = "strict";
+ ProtectHome = "false";
+ RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
+ };
+ };
+
+ # --- MPD-MPRIS (Для работы Waybar) ---
+ 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;
+ qt = {
+ enable = true;
+ platformTheme = "qt5ct";
+ style = "breeze";
+ };
+
+ boot.kernelParams = [
+ "drm.edid_firmware=DP-1:edid/mi_edid.bin"
+ "video=DP-1:2560x1440@180"
+ ];
+
+ # Bootloader configuration (systemd-boot)
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ # --- NETWORK AND ENCRYPTED DNS ---
+ networking.hostName = "opus";
+ networking.networkmanager.enable = true;
+
+ # --- TIMEZONE AND LOCALIZATION ---
+ time.timeZone = "Etc/GMT-7";
+ i18n.defaultLocale = "en_US.UTF-8";
+
+ # Forcing all extra locales to English to clear the Perl warnings
+ 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";
+ };
+
+ # Allow unfree packages (NVIDIA, Steam, etc.)
+ nixpkgs.config.allowUnfree = true;
+
+ # Experimental Nix features
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
+
+ # Dynamic binary execution & FHS environment compatibility
+ programs.nix-ld.enable = true;
+ services.envfs.enable = true;
+
+ # Shell and CLI enhancements
+ programs.starship.enable = true;
+
+ # Throne configuration
+ programs.throne = {
+ enable = true;
+ tunMode.enable = true;
+ };
+
+ # Privilege elevation (doas)
+ security.doas.enable = true;
+ security.doas.extraRules = [
+ {
+ users = [ "seraphim" ];
+ keepEnv = true;
+ persist = true;
+ }
+ ];
+
+ # --- GRAPHICS AND NVIDIA ---
+ hardware.graphics.enable = true;
+ hardware.graphics.enable32Bit = true;
+ services.xserver.videoDrivers = [ "nvidia" ];
+ hardware.nvidia = {
+ modesetting.enable = true;
+ powerManagement.enable = false;
+ open = false;
+ nvidiaSettings = true;
+ package = config.boot.kernelPackages.nvidiaPackages.latest;
+ };
+
+ # --- NIRI WAYLAND COMPOSITOR ---
+ programs.niri.enable = true;
+
+ # --- NOCTALIA GREETER ---
+ programs.noctalia-greeter = {
+ enable = true;
+ settings = {
+ cursor = {
+ theme = "Bibata-Modern-Ice";
+ size = 24;
+ path = "${pkgs.bibata-cursors}/share/icons";
+ };
+ };
+ };
+
+ # --- SYSTEM SERVICES FOR FILE MANAGEMENT ---
+ services.gvfs.enable = true;
+ services.tumbler.enable = true;
+ services.gnome.gnome-keyring.enable = true;
+ programs.dconf.enable = true;
+
+ # --- XDG DESKTOP PORTALS (NIRI / WAYLAND) ---
+ xdg.portal = {
+ enable = true;
+ extraPortals = [
+ pkgs.xdg-desktop-portal-gnome
+ pkgs.xdg-desktop-portal-gtk
+ ];
+ };
+
+ # --- AUDIO (PIPEWIRE) ---
+ security.rtkit.enable = true;
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ };
+ fonts.fontconfig.enable = true;
+
+ environment.variables = {
+ SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt";
+ NIX_SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt";
+ };
+
+ # --- GAMING (STEAM) ---
+ programs.steam = {
+ enable = true;
+ remotePlay.openFirewall = true;
+ dedicatedServer.openFirewall = true;
+ };
+
+ # --- ENVIRONMENT VARIABLES FOR WAYLAND + NVIDIA ---
+ environment.sessionVariables = {
+ LIBVA_DRIVER_NAME = "nvidia";
+ XCURSOR_THEME = "Bibata-Modern-Ice";
+ XCURSOR_SIZE = "20";
+ # GBM_BACKEND = "nvidia-drm";
+ __GLX_VENDOR_LIBRARY_NAME = "nvidia";
+ NIXOS_OZONE_WL = "1";
+ CC = "gcc";
+ 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 ---
+ fonts.packages = with pkgs;
+ [
+ font-awesome
+ nerd-fonts.jetbrains-mono
+ nerd-fonts.symbols-only
+ jetbrains-mono
+ ];
+
+ # --- USER CONFIGURATION ---
+ users.users."seraphim" = {
+ isNormalUser = true;
+ description = "seraphim";
+ extraGroups = [ "networkmanager" "wheel" ];
+ packages = with pkgs; [];
+ };
+
+ programs.fish = {
+ enable = true;
+ shellAliases = {
+ ls = "eza -al --icons=auto";
+ ll = "eza -al --icons=auto";
+ };
+ };
+
+# --- MPD SERVER ---
+ services.mpd = {
+ enable = true;
+ user = "seraphim";
+ musicDirectory = "/mnt/giga/music";
+ network.listenAddress = "any";
+ network.port = 6600;
+
+ settings = {
+ auto_update = "yes";
+
+ audio_output = [
+ {
+ type = "pulse"; # Возвращаем pulse
+ name = "PipeWire Output";
+ mixer_type = "hardware"; # Моментальная регулировка потока!
+ }
+ ];
+ };
+ };
+
+ # Разрешаем системному MPD видеть звук пользователя seraphim
+ systemd.services.mpd.environment = {
+ XDG_RUNTIME_DIR = "/run/user/1000"; # 1000 — это ID твоего пользователя
+ };
+
+ # --- SYSTEM PACKAGES ---
+ environment.systemPackages = with pkgs;
+ [
+ inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default
+ (pkgs.btop.override { cudaSupport = true; })
+
+ # Terminals & Shell Utilities
+ fastfetch
+ fzf
+ ghostty
+ kitty
+ ghfetch
+ cacert
+
+ # Music
+ pkgs.mpd
+ pkgs.rmpc
+ mpc
+ playerctl
+ pkgs.mpd-mpris # <-- ДОБАВЛЕНО СЮДА
+
+ # Text Editors
+ micro
+ neovim
+ (pkgs.emacs-pgtk.override {
+ withNativeCompilation = true;
+ })
+ # File Managers & Archiving
+ nautilus
+ loupe
+ sushi
+ file-roller
+ yazi
+ kdePackages.ark
+ kdePackages.qt6ct
+ stow
+ # Utils
+ cryptsetup
+ util-linux
+ eza
+ pkgs.yt-dlp
+ pkgs.caligula
+
+ # GStreamer codecs
+ gst_all_1.gst-plugins-base
+ gst_all_1.gst-plugins-good
+ gst_all_1.gst-plugins-bad
+ gst_all_1.gst-plugins-ugly
+
+ # Wayland & Niri Desktop Tools
+ cliphist
+ bibata-cursors
+ fuzzel
+ grim
+ hyprpolkitagent
+ noctalia-shell
+ slurp
+ wl-clipboard
+ wtype
+ xwayland-satellite
+
+ # Audio & Brightness Controls
+ brightnessctl
+ pamixer
+ pavucontrol
+
+ # Desktop Applications
+ keepassxc
+ telegram-desktop
+ vesktop
+ nvidia-vaapi-driver
+ pkgs.opencode
+ pkgs.claude-code
+
+ # Software Development & Toolchains
+ black
+ cargo
+ clang
+ clippy
+ git
+ pyright
+ python3
+ rust-analyzer
+ rustc
+ gnumake
+ tree-sitter
+ nodejs
+ ];
+
+ system.stateVersion = "26.05";
+}
diff --git a/nixos/flake.lock b/nixos/flake.lock
new file mode 100644
index 0000000..263ea44
--- /dev/null
+++ b/nixos/flake.lock
@@ -0,0 +1,80 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1784497964,
+ "narHash": "sha256-vlHUuqAcbcH2RKmHbPiuQzbv1pnzzavXnI62RD0bqCU=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "241313f4e8e508cb9b13278c2b0fa25b9ca27163",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1784356753,
+ "narHash": "sha256-zupdTm41be2fY8cexroEOGjopl3F2Gqs3gk7ieqaM3s=",
+ "rev": "61b7c44c4073f0b827768aff0049561b5110ea5a",
+ "type": "tarball",
+ "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1036777.61b7c44c4073/nixexprs.tar.xz"
+ },
+ "original": {
+ "type": "tarball",
+ "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
+ }
+ },
+ "noctalia": {
+ "inputs": {
+ "nixpkgs": "nixpkgs_2"
+ },
+ "locked": {
+ "lastModified": 1784728386,
+ "narHash": "sha256-orPjHk70i59VTH6ey9H0lFC2GC+r8LkY52HkzLwstio=",
+ "owner": "noctalia-dev",
+ "repo": "noctalia",
+ "rev": "44778c92d0d1676500dbbbd762f76519769e9458",
+ "type": "github"
+ },
+ "original": {
+ "owner": "noctalia-dev",
+ "repo": "noctalia",
+ "type": "github"
+ }
+ },
+ "noctalia-greeter": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1784707224,
+ "narHash": "sha256-K8yyxX/sShhVznU/3ejZgriayg8Fyac+bR4dCTB1864=",
+ "owner": "noctalia-dev",
+ "repo": "noctalia-greeter",
+ "rev": "8e53bb30f1d1179c0bd2275b02915258827d62eb",
+ "type": "github"
+ },
+ "original": {
+ "owner": "noctalia-dev",
+ "repo": "noctalia-greeter",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs",
+ "noctalia": "noctalia",
+ "noctalia-greeter": "noctalia-greeter"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/nixos/flake.nix b/nixos/flake.nix
new file mode 100644
index 0000000..f5f5b35
--- /dev/null
+++ b/nixos/flake.nix
@@ -0,0 +1,26 @@
+{
+ description = "Noctalia shell conf";
+
+ inputs = {
+ # Main tree
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+
+ # Noctalia v5
+ noctalia.url = "github:noctalia-dev/noctalia";
+ noctalia-greeter = {
+ url = "github:noctalia-dev/noctalia-greeter";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ };
+
+ outputs = { self, nixpkgs, noctalia, ... }@inputs: {
+ nixosConfigurations.opus = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ specialArgs = { inherit inputs; };
+ modules = [
+ ./configuration.nix
+ ];
+ };
+ };
+}
diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix
new file mode 100644
index 0000000..5163270
--- /dev/null
+++ b/nixos/hardware-configuration.nix
@@ -0,0 +1,33 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations. Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-amd" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/363e0f04-0494-4bf5-96e7-33326d8b8a5c";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/DD1F-3DEF";
+ fsType = "vfat";
+ options = [ "fmask=0077" "dmask=0077" ];
+ };
+
+ swapDevices =
+ [ { device = "/dev/disk/by-uuid/75ef05e5-75fb-4c5c-9a4d-e5e50f4b6438"; }
+ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/nixos/mi_edid.bin b/nixos/mi_edid.bin
new file mode 100644
index 0000000..98a9522
--- /dev/null
+++ b/nixos/mi_edid.bin
Binary files differ