From 2e12a1202f63b2555ad2f8304acd3450947fa089 Mon Sep 17 00:00:00 2001 From: "Simon R. - fantomitechno" Date: Thu, 28 May 2026 10:51:40 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20of=20entire=20c?= =?UTF-8?q?onfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 37 +------------- flake.nix | 62 ++++++++++++++---------- home/default.nix | 47 ++++++++++-------- home/git.nix | 6 ++- hosts/common/configuration.nix | 30 +++++++----- hosts/common/packages.nix | 7 +-- hosts/desktop/configuration.nix | 44 ++++------------- hosts/desktop/hardware-configuration.nix | 27 ++++++----- hosts/laptop/configuration.nix | 21 +++----- hosts/laptop/hardware-configuration.nix | 52 +++++++++++++------- hosts/msi/configuration.nix | 20 +++----- hosts/msi/hardware-configuration.nix | 24 +++++---- 12 files changed, 181 insertions(+), 196 deletions(-) diff --git a/flake.lock b/flake.lock index a894bbb..d3ea112 100644 --- a/flake.lock +++ b/flake.lock @@ -244,24 +244,6 @@ "type": "github" } }, - "minegrub-theme": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1775570192, - "narHash": "sha256-wTLOBy3l/FaIGJWRGFTVYsITkou0lmDU3uAMxvOCCN8=", - "owner": "Lxtharia", - "repo": "minegrub-theme", - "rev": "8ba52f8402ed642abf0f6eee32c407412a3ceae6", - "type": "github" - }, - "original": { - "owner": "Lxtharia", - "repo": "minegrub-theme", - "type": "github" - } - }, "minhook-src": { "flake": false, "locked": { @@ -351,22 +333,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1689850295, - "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5df4d78d54f7a34e9ea1f84a22b4fd9baebc68d0", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1776877367, "narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=", @@ -403,9 +369,8 @@ "inputs": { "home-manager": "home-manager", "millennium": "millennium", - "minegrub-theme": "minegrub-theme", "niri-float-sticky": "niri-float-sticky", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" } }, "systems": { diff --git a/flake.nix b/flake.nix index 21a605e..89351d3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,21 +1,26 @@ { - description = "NixOS configuration for the Fox"; + description = "fantomitechno's Nix config"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + millennium.url = "github:SteamClientHomebrew/Millennium?dir=packages/nix"; - minegrub-theme.url = "github:Lxtharia/minegrub-theme"; - niri-float-sticky.url = "github:probeldev/niri-float-sticky"; - niri-float-sticky.inputs.nixpkgs.follows = "nixpkgs"; + + niri-float-sticky = { + url = "github:probeldev/niri-float-sticky"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { nixpkgs, home-manager, - minegrub-theme, millennium, niri-float-sticky, ... @@ -36,15 +41,16 @@ ./hosts/common home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - inherit niri-float-sticky; - hostname = "laptop"; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit niri-float-sticky; + hostname = "laptop"; + }; + users."fantomitechno" = import ./home; }; - home-manager.users."fantomitechno" = import ./home; } - minegrub-theme.nixosModules.default ]; }; fantomitechno-desktop = nixpkgs.lib.nixosSystem { @@ -57,13 +63,15 @@ ./hosts/common home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - inherit niri-float-sticky; - hostname = "desktop"; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit niri-float-sticky; + hostname = "desktop"; + }; + users."fantomitechno" = import ./home; }; - home-manager.users."fantomitechno" = import ./home; } ]; }; @@ -77,13 +85,15 @@ ./hosts/common home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - inherit niri-float-sticky; - hostname = "msi"; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit niri-float-sticky; + hostname = "msi"; + }; + users."fantomitechno" = import ./home; }; - home-manager.users."fantomitechno" = import ./home; } ]; }; diff --git a/home/default.nix b/home/default.nix index 11bcf2d..44014c8 100644 --- a/home/default.nix +++ b/home/default.nix @@ -41,16 +41,23 @@ gtk4.theme = null; }; + qt = { enable = true; style.name = "adwaita"; }; - home.pointerCursor = { - enable = true; - gtk.enable = true; - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Amber"; - size = 12; + + home = { + pointerCursor = { + enable = true; + gtk.enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Amber"; + size = 12; + }; + packages = [ + niri-float-sticky.packages.${pkgs.system}.default + ]; }; programs = { @@ -58,20 +65,20 @@ go.enable = true; zsh.enable = true; zoxide.enable = true; - obs-studio.enable = true; - obs-studio.plugins = with pkgs.obs-studio-plugins; [ - wlrobs - obs-backgroundremoval - obs-pipewire-audio-capture - obs-vkcapture - obs-multi-rtmp - ]; + obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + obs-vkcapture + obs-multi-rtmp + ]; + }; }; - home.packages = [ - niri-float-sticky.packages.${pkgs.system}.default - ]; - - services.awww.enable = true; - services.swaync.enable = true; + services = { + awww.enable = true; + swaync.enable = true; + }; } diff --git a/home/git.nix b/home/git.nix index 40c5884..b4d4cfe 100644 --- a/home/git.nix +++ b/home/git.nix @@ -4,8 +4,10 @@ programs.git = { enable = true; settings = { - user.name = "Simon R. - fantomitechno"; - user.email = "me@fantomitechno.dev"; + user = { + name = "Simon R. - fantomitechno"; + email = "me@fantomitechno.dev"; + }; init.defaultBranch = "main"; pull.rebase = true; color.ui = "auto"; diff --git a/hosts/common/configuration.nix b/hosts/common/configuration.nix index fb2ea9d..11515e1 100644 --- a/hosts/common/configuration.nix +++ b/hosts/common/configuration.nix @@ -21,8 +21,12 @@ }; }; - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; + hardware = { + bluetooth = { + enable = true; + powerOnBoot = true; + }; + }; time.timeZone = "Europe/Paris"; i18n.defaultLocale = "en_US.UTF-8"; @@ -42,15 +46,19 @@ security.polkit.enable = true; virtualisation.docker.enable = true; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; + nixpkgs.config.allowUnfree = true; - nix.optimise.automatic = true; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 14d"; + nix = { + settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + optimise.automatic = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; }; } diff --git a/hosts/common/packages.nix b/hosts/common/packages.nix index 00ec742..041b859 100644 --- a/hosts/common/packages.nix +++ b/hosts/common/packages.nix @@ -111,9 +111,10 @@ services = { # DM - displayManager.enable = true; - displayManager.ly.enable = true; - # services.openssh.enable = true; + displayManager = { + enable = true; + ly.enable = true; + }; # Network tailscale.enable = true; diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 3409950..4dba71f 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -10,62 +10,41 @@ ./packages.nix ]; - nixpkgs.config.allowUnfree = true; - # Bootloader - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + kernelPackages = pkgs.linuxPackages; }; - boot.kernelPackages = pkgs.linuxPackages; services.xserver.xkb = { layout = "fr"; variant = ""; }; - # Enable OpenGL hardware.graphics = { enable = true; }; - # Load nvidia driver for Xorg and Wayland services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { - - # Modesetting is required. modesetting.enable = true; - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. - powerManagement.enable = true; - - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). - powerManagement.finegrained = false; + powerManagement = { + enable = true; + finegrained = false; + }; - # Use the NVidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 515.43.04+ open = true; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. nvidiaSettings = true; - - # Optionally, you may need to select the appropriate driver version for your specific GPU. package = config.boot.kernelPackages.nvidiaPackages.stable; }; networking.hostName = "fantomitechno-desktop"; - # Configure console keymap console.keyMap = "fr"; environment.variables = { @@ -75,8 +54,5 @@ GDK_BACKEND = "wayland"; }; - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # networking.firewall.enable = false; system.stateVersion = "25.11"; } diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix index 3b6f2f5..6aed103 100644 --- a/hosts/desktop/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -13,18 +13,21 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usbhid" - "usb_storage" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - + boot = { + initrd = { + availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + kernelModules = [ ]; + }; + kernelModules = [ ]; + extraModulePackages = [ ]; + }; fileSystems."/" = { device = "/dev/disk/by-uuid/21ce8b4a-6e21-4bc0-91b0-83834d4cfdff"; fsType = "ext4"; diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 349c8b7..40a2fbb 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -9,14 +9,14 @@ ./packages.nix ]; - nixpkgs.config.allowUnfree = true; - # Bootloader - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + kernelPackages = pkgs.linuxPackages; }; - boot.kernelPackages = pkgs.linuxPackages; services.xserver.xkb = { layout = "us"; @@ -25,7 +25,6 @@ networking.hostName = "fantomitechno-laptop"; - # Configure console keymap console.keyMap = "us"; environment.variables = { @@ -49,14 +48,10 @@ CPU_MIN_PERF_ON_BAT = 0; CPU_MAX_PERF_ON_BAT = 20; - # Optional helps save long term battery health - START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge - STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging + START_CHARGE_THRESH_BAT0 = 40; + STOP_CHARGE_THRESH_BAT0 = 80; }; }; - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # networking.firewall.enable = false; system.stateVersion = "25.11"; } diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix index 0cdf391..b69c4ae 100644 --- a/hosts/laptop/hardware-configuration.nix +++ b/hosts/laptop/hardware-configuration.nix @@ -1,28 +1,46 @@ # 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") - ]; + config, + lib, + modulesPath, + ... +}: - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/b3eaa7e8-812e-4a8b-b491-5a9d3fe50b08"; - fsType = "ext4"; + boot = { + initrd = { + availableKernelModules = [ + "nvme" + "xhci_pci" + "thunderbolt" + "usb_storage" + "sd_mod" + ]; + kernelModules = [ ]; }; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/9CC2-23D1"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/b3eaa7e8-812e-4a8b-b491-5a9d3fe50b08"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/9CC2-23D1"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; swapDevices = [ ]; diff --git a/hosts/msi/configuration.nix b/hosts/msi/configuration.nix index a21e275..bc88466 100644 --- a/hosts/msi/configuration.nix +++ b/hosts/msi/configuration.nix @@ -9,14 +9,14 @@ ./packages.nix ]; - nixpkgs.config.allowUnfree = true; - # Bootloader - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + kernelPackages = pkgs.linuxPackages; }; - boot.kernelPackages = pkgs.linuxPackages; services.xserver.xkb = { layout = "fr"; @@ -49,14 +49,10 @@ CPU_MIN_PERF_ON_BAT = 0; CPU_MAX_PERF_ON_BAT = 20; - # Optional helps save long term battery health - START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge - STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging + START_CHARGE_THRESH_BAT0 = 40; + STOP_CHARGE_THRESH_BAT0 = 80; }; }; - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # networking.firewall.enable = false; system.stateVersion = "25.11"; } diff --git a/hosts/msi/hardware-configuration.nix b/hosts/msi/hardware-configuration.nix index 7610cc4..061e8a9 100644 --- a/hosts/msi/hardware-configuration.nix +++ b/hosts/msi/hardware-configuration.nix @@ -13,16 +13,20 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "nvme" - "usbhid" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "sd_mod" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; fileSystems."/" = { device = "/dev/disk/by-uuid/a4f432d7-0e18-4462-98f4-415740de8a71"; -- 2.54.0