From b0a83e2ad5aee372a99ea540e3d38eb5d9441fd4 Mon Sep 17 00:00:00 2001 From: Weckyy702 Date: Thu, 30 Jul 2026 15:03:14 +0200 Subject: [PATCH] Misc: Add nixfmt-tree and run `nix fmt` --- modules/factory/mount-cifs.nix | 17 +++--- modules/factory/user.nix | 10 ++-- modules/fmt.nix | 5 ++ modules/hosts/keith/configuration.nix | 6 +- modules/hosts/keith/devtools.nix | 6 +- modules/hosts/keith/hardware.nix | 9 ++- modules/hosts/keith/ups.nix | 10 ++-- .../hosts/keith/users/weckyy702/weckyy702.nix | 6 +- modules/hosts/tux/devtools.nix | 6 +- modules/hosts/tux/filesystems.nix | 5 +- modules/hosts/tux/flake-parts.nix | 4 +- modules/hosts/tux/hardware.nix | 14 ++++- modules/hosts/tux/tux.nix | 6 +- .../hosts/tux/users/weckyy702/weckyy702.nix | 6 +- modules/nix/flake-parts/lib.nix | 10 ++-- modules/nix/tools/home-manager.nix | 10 ++-- modules/programs/appimage.nix | 10 ++-- modules/programs/ashell.nix | 32 +++++++--- modules/programs/browser.nix | 59 +++++++++---------- modules/programs/catppuccin.nix | 6 +- modules/programs/docker.nix | 9 +-- modules/programs/funny-wallpaper.nix | 3 +- modules/services/backlight.nix | 3 +- modules/services/borgmatic.nix | 11 ++-- modules/services/networkmanager.nix | 10 ++-- modules/system-settings/intel-gpu.nix | 22 +++---- modules/system-settings/systemd-boot.nix | 8 +-- modules/users/weckyy702/weckyy702.nix | 24 +++++--- secrets/secrets.nix | 5 +- 29 files changed, 200 insertions(+), 132 deletions(-) create mode 100644 modules/fmt.nix diff --git a/modules/factory/mount-cifs.nix b/modules/factory/mount-cifs.nix index 3016325..9ef6c54 100644 --- a/modules/factory/mount-cifs.nix +++ b/modules/factory/mount-cifs.nix @@ -1,13 +1,14 @@ { config.flake.factory.mount-cifs = - { host - , resource - , destination - , credentials_path - , UID - , GID - , - }: { pkgs, ... }: { + { + host, + resource, + destination, + credentials_path, + UID, + GID, + }: + { pkgs, ... }: { environment.systemPackages = with pkgs; [ cifs-utils ]; diff --git a/modules/factory/user.nix b/modules/factory/user.nix index 7e74bf6..f7eb015 100644 --- a/modules/factory/user.nix +++ b/modules/factory/user.nix @@ -1,10 +1,12 @@ { self, ... }: { config.flake.factory.user = username: isAdmin: { nixos."${username}" = - { lib - , pkgs - , ... - }: { + { + lib, + pkgs, + ... + }: + { users.users."${username}" = { isNormalUser = true; home = "/home/${username}"; diff --git a/modules/fmt.nix b/modules/fmt.nix new file mode 100644 index 0000000..602664c --- /dev/null +++ b/modules/fmt.nix @@ -0,0 +1,5 @@ +{ + perSystem = { pkgs, ... }: { + formatter = pkgs.nixfmt-tree; + }; +} diff --git a/modules/hosts/keith/configuration.nix b/modules/hosts/keith/configuration.nix index 89fb7c8..6d5db0b 100644 --- a/modules/hosts/keith/configuration.nix +++ b/modules/hosts/keith/configuration.nix @@ -1,7 +1,9 @@ { inputs, ... }: { flake.modules.nixos.keith = { - imports = with inputs.self.modules.nixos; - with inputs.self.factory; [ + imports = + with inputs.self.modules.nixos; + with inputs.self.factory; + [ system-desktop (autologin "weckyy702") (grub-boot "/dev/nvme0n1") diff --git a/modules/hosts/keith/devtools.nix b/modules/hosts/keith/devtools.nix index 5c86148..1df5054 100644 --- a/modules/hosts/keith/devtools.nix +++ b/modules/hosts/keith/devtools.nix @@ -1,7 +1,9 @@ { inputs, ... }: { flake.modules.nixos.keith-devtools = { - imports = with inputs.self.modules.nixos; - with inputs.self.factory; [ + imports = + with inputs.self.modules.nixos; + with inputs.self.factory; + [ development-tools rust-dev ]; diff --git a/modules/hosts/keith/hardware.nix b/modules/hosts/keith/hardware.nix index b654f43..c452edd 100644 --- a/modules/hosts/keith/hardware.nix +++ b/modules/hosts/keith/hardware.nix @@ -5,7 +5,14 @@ amd-gpu ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; nixpkgs.hostPlatform = "x86_64-linux"; hardware.cpu.amd.updateMicrocode = true; diff --git a/modules/hosts/keith/ups.nix b/modules/hosts/keith/ups.nix index 05a5c04..972a5af 100644 --- a/modules/hosts/keith/ups.nix +++ b/modules/hosts/keith/ups.nix @@ -1,7 +1,9 @@ -{ self -, inputs -, ... -}: { +{ + self, + inputs, + ... +}: +{ flake.modules.nixos.keith = { config, ... }: { age.secrets.upsmon.file = "${inputs.secrets}/upsmon.age"; diff --git a/modules/hosts/keith/users/weckyy702/weckyy702.nix b/modules/hosts/keith/users/weckyy702/weckyy702.nix index 62076e2..0ebfe3b 100644 --- a/modules/hosts/keith/users/weckyy702/weckyy702.nix +++ b/modules/hosts/keith/users/weckyy702/weckyy702.nix @@ -7,8 +7,10 @@ ]; home-manager.users.weckyy702 = { config, ... }: { - imports = with inputs.self.modules.homeManager; - with inputs.self.factory; [ + imports = + with inputs.self.modules.homeManager; + with inputs.self.factory; + [ (wpaperd { default = { path = "${inputs.assets}/horizontal_16x9.png"; diff --git a/modules/hosts/tux/devtools.nix b/modules/hosts/tux/devtools.nix index 590f07f..1e976df 100644 --- a/modules/hosts/tux/devtools.nix +++ b/modules/hosts/tux/devtools.nix @@ -1,7 +1,9 @@ { inputs, ... }: { flake.modules.nixos.tux-devtools = { - imports = with inputs.self.modules.nixos; - with inputs.self.factory; [ + imports = + with inputs.self.modules.nixos; + with inputs.self.factory; + [ development-tools rust-dev diff --git a/modules/hosts/tux/filesystems.nix b/modules/hosts/tux/filesystems.nix index d7bd959..e321ce2 100644 --- a/modules/hosts/tux/filesystems.nix +++ b/modules/hosts/tux/filesystems.nix @@ -8,7 +8,10 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/15FA-55CF"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; swapDevices = [ diff --git a/modules/hosts/tux/flake-parts.nix b/modules/hosts/tux/flake-parts.nix index a19b4ef..2cdf036 100644 --- a/modules/hosts/tux/flake-parts.nix +++ b/modules/hosts/tux/flake-parts.nix @@ -1,3 +1,3 @@ -{ inputs, ...}: { - flake.nixosConfigurations = inputs.self.lib.mkNixos "x86_64-linux" "tux"; +{ inputs, ... }: { + flake.nixosConfigurations = inputs.self.lib.mkNixos "x86_64-linux" "tux"; } diff --git a/modules/hosts/tux/hardware.nix b/modules/hosts/tux/hardware.nix index 9abeca0..b5b7503 100644 --- a/modules/hosts/tux/hardware.nix +++ b/modules/hosts/tux/hardware.nix @@ -4,9 +4,17 @@ intel-gpu ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.luks.devices."luks-9d836ef1-a7f9-430f-8fb8-f202f6336e5a".device = "/dev/disk/by-uuid/9d836ef1-a7f9-430f-8fb8-f202f6336e5a"; - boot.initrd.luks.devices."luks-46e78828-ab23-48b8-8e2a-de7a21adbe24".device = "/dev/disk/by-uuid/46e78828-ab23-48b8-8e2a-de7a21adbe24"; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.luks.devices."luks-9d836ef1-a7f9-430f-8fb8-f202f6336e5a".device = + "/dev/disk/by-uuid/9d836ef1-a7f9-430f-8fb8-f202f6336e5a"; + boot.initrd.luks.devices."luks-46e78828-ab23-48b8-8e2a-de7a21adbe24".device = + "/dev/disk/by-uuid/46e78828-ab23-48b8-8e2a-de7a21adbe24"; nixpkgs.hostPlatform = "x86_64-linux"; diff --git a/modules/hosts/tux/tux.nix b/modules/hosts/tux/tux.nix index ed1377d..8a873c4 100644 --- a/modules/hosts/tux/tux.nix +++ b/modules/hosts/tux/tux.nix @@ -1,7 +1,9 @@ { inputs, ... }: { flake.modules.nixos.tux = { - imports = with inputs.self.modules.nixos; - with inputs.self.factory; [ + imports = + with inputs.self.modules.nixos; + with inputs.self.factory; + [ system-desktop systemd-boot bluetooth diff --git a/modules/hosts/tux/users/weckyy702/weckyy702.nix b/modules/hosts/tux/users/weckyy702/weckyy702.nix index c94aa7c..502fb8f 100644 --- a/modules/hosts/tux/users/weckyy702/weckyy702.nix +++ b/modules/hosts/tux/users/weckyy702/weckyy702.nix @@ -7,8 +7,10 @@ ]; home-manager.users.weckyy702 = { - imports = with inputs.self.modules.homeManager; - with inputs.self.factory; [ + imports = + with inputs.self.modules.homeManager; + with inputs.self.factory; + [ borgmatic obsidian vesktop diff --git a/modules/nix/flake-parts/lib.nix b/modules/nix/flake-parts/lib.nix index 7b858fd..ef629d2 100644 --- a/modules/nix/flake-parts/lib.nix +++ b/modules/nix/flake-parts/lib.nix @@ -1,7 +1,9 @@ -{ inputs -, lib -, ... -}: { +{ + inputs, + lib, + ... +}: +{ # Helper functions for creating system / home-manager configurations options.flake.lib = lib.mkOption { diff --git a/modules/nix/tools/home-manager.nix b/modules/nix/tools/home-manager.nix index f42491e..14629af 100644 --- a/modules/nix/tools/home-manager.nix +++ b/modules/nix/tools/home-manager.nix @@ -1,7 +1,9 @@ -{ inputs -, config -, ... -}: { +{ + inputs, + config, + ... +}: +{ # Add home-manager input flake-file.inputs = { home-manager.url = "github:nix-community/home-manager/release-26.05"; diff --git a/modules/programs/appimage.nix b/modules/programs/appimage.nix index 7807aa1..0a64244 100644 --- a/modules/programs/appimage.nix +++ b/modules/programs/appimage.nix @@ -1,8 +1,8 @@ { - flake.modules.nixos.appimage = { pkgs, ...}: { - programs.appimage = { - enable = true; - binfmt = true; - }; + flake.modules.nixos.appimage = { pkgs, ... }: { + programs.appimage = { + enable = true; + binfmt = true; }; + }; } diff --git a/modules/programs/ashell.nix b/modules/programs/ashell.nix index b386559..a2c62ab 100644 --- a/modules/programs/ashell.nix +++ b/modules/programs/ashell.nix @@ -1,9 +1,11 @@ { flake.modules.homeManager.ashell = - { config - , lib - , ... - }: { + { + config, + lib, + ... + }: + { programs.ashell = { enable = true; systemd.enable = true; @@ -12,17 +14,33 @@ modules = { left = [ "Workspaces" ]; center = [ "Clock" ]; - right = [ "Tray" [ "SystemInfo" "Settings" ] ]; + right = [ + "Tray" + [ + "SystemInfo" + "Settings" + ] + ]; }; - system_info.indicators = [ "Cpu" "Memory" "Temperature" "DownloadSpeed" "UploadSpeed" ]; + system_info.indicators = [ + "Cpu" + "Memory" + "Temperature" + "DownloadSpeed" + "UploadSpeed" + ]; settings.indicators = [ "Battery" ]; appearance = lib.mkIf config.catppuccin.enable { success_color = "#a6e3a1"; text_color = "#cdd6f4"; - workspace_colors = [ "#fab387" "#b4befe" "#cba6f7" ]; + workspace_colors = [ + "#fab387" + "#b4befe" + "#cba6f7" + ]; primary_color = { base = "#fab387"; diff --git a/modules/programs/browser.nix b/modules/programs/browser.nix index c7f8b05..ce9f937 100644 --- a/modules/programs/browser.nix +++ b/modules/programs/browser.nix @@ -7,9 +7,10 @@ }; flake.modules.homeManager.browser = - { pkgs - , lib - , ... + { + pkgs, + lib, + ... }: let mkExtension = shortId: guid: { @@ -19,8 +20,7 @@ installation_mode = "normal_installed"; }; }; - zen-pkg = - inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.zen-browser-unwrapped; + zen-pkg = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.zen-browser-unwrapped; prefs = { "zen.tabs.vertical.right-side" = true; @@ -55,35 +55,30 @@ in { home.packages = [ - ( - pkgs.wrapFirefox zen-pkg - { - extraPrefs = lib.concatLines ( - lib.mapAttrsToList - ( - name: value: ''lockPref(${lib.strings.toJSON name}, ${lib.strings.toJSON value});'' - ) - prefs - ); + (pkgs.wrapFirefox zen-pkg { + extraPrefs = lib.concatLines ( + lib.mapAttrsToList ( + name: value: "lockPref(${lib.strings.toJSON name}, ${lib.strings.toJSON value});" + ) prefs + ); - extraPolicies = { - DisableTelemetry = true; - ExtensionSettings = builtins.listToAttrs extensions; + extraPolicies = { + DisableTelemetry = true; + ExtensionSettings = builtins.listToAttrs extensions; - SearchEngines = { - Default = "ddg"; - Add = [ - { - Name = "nixpkgs packages"; - URLTemplate = "https://search.nixos.org/packages?query={searchTerms}"; - IconURL = "https://wiki.nixos.org/favicon.ico"; - Alias = "@np"; - } - ]; - }; - }; - } - ) + SearchEngines = { + Default = "ddg"; + Add = [ + { + Name = "nixpkgs packages"; + URLTemplate = "https://search.nixos.org/packages?query={searchTerms}"; + IconURL = "https://wiki.nixos.org/favicon.ico"; + Alias = "@np"; + } + ]; + }; + }; + }) ]; }; } diff --git a/modules/programs/catppuccin.nix b/modules/programs/catppuccin.nix index f2e3825..c828c7b 100644 --- a/modules/programs/catppuccin.nix +++ b/modules/programs/catppuccin.nix @@ -38,9 +38,9 @@ hyprcursor.size = size; }; -# wayland.windowManager.hyprland.settings.exec-once = [ -# "hyprctl setcursor catppuccin-mocha-mauve-cursors 24" -# ]; + # wayland.windowManager.hyprland.settings.exec-once = [ + # "hyprctl setcursor catppuccin-mocha-mauve-cursors 24" + # ]; catppuccin.enable = true; # Required for QT apps to use the catppuccin colors diff --git a/modules/programs/docker.nix b/modules/programs/docker.nix index 8eb8b85..e39930e 100644 --- a/modules/programs/docker.nix +++ b/modules/programs/docker.nix @@ -4,11 +4,8 @@ enable = true; autoPrune.enable = true; }; - users.users = - lib.genAttrs - users - (_: { - extraGroups = [ "docker" ]; - }); + users.users = lib.genAttrs users (_: { + extraGroups = [ "docker" ]; + }); }; } diff --git a/modules/programs/funny-wallpaper.nix b/modules/programs/funny-wallpaper.nix index 8b08b68..7dbad0b 100644 --- a/modules/programs/funny-wallpaper.nix +++ b/modules/programs/funny-wallpaper.nix @@ -10,7 +10,8 @@ }; }; - flake.modules.homeManager.randomized-aghpb-wallpaper = { pkgs, ... }: + flake.modules.homeManager.randomized-aghpb-wallpaper = + { pkgs, ... }: let combined_wallpapers = pkgs.symlinkJoin { name = "joined-wallpapers"; diff --git a/modules/services/backlight.nix b/modules/services/backlight.nix index c89e57a..5952fb8 100644 --- a/modules/services/backlight.nix +++ b/modules/services/backlight.nix @@ -1,5 +1,6 @@ { inputs, ... }: { - flake.modules.homeManager.backlight = { pkgs, ... }: + flake.modules.homeManager.backlight = + { pkgs, ... }: let brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; in diff --git a/modules/services/borgmatic.nix b/modules/services/borgmatic.nix index 7f7923f..193f3fb 100644 --- a/modules/services/borgmatic.nix +++ b/modules/services/borgmatic.nix @@ -1,10 +1,11 @@ { flake.modules.homeManager.borgmatic = - { config - , osConfig - , pkgs - , lib - , ... + { + config, + osConfig, + pkgs, + lib, + ... }: let hostname = osConfig.networking.hostName; diff --git a/modules/services/networkmanager.nix b/modules/services/networkmanager.nix index c070894..8dc1bf8 100644 --- a/modules/services/networkmanager.nix +++ b/modules/services/networkmanager.nix @@ -1,7 +1,7 @@ { - flake.modules.nixos.networkmanager = { - networking.networkmanager = { - enable = true; - }; - }; + flake.modules.nixos.networkmanager = { + networking.networkmanager = { + enable = true; + }; + }; } diff --git a/modules/system-settings/intel-gpu.nix b/modules/system-settings/intel-gpu.nix index 420b3f1..eea1475 100644 --- a/modules/system-settings/intel-gpu.nix +++ b/modules/system-settings/intel-gpu.nix @@ -1,15 +1,15 @@ { - flake.modules.nixos.intel-gpu = {pkgs, ...}: { - boot.kernelModules = [ "kvm-intel" ]; + flake.modules.nixos.intel-gpu = { pkgs, ... }: { + boot.kernelModules = [ "kvm-intel" ]; - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver - intel-compute-runtime - ]; - }; + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver + intel-compute-runtime + ]; + }; - environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD"; - }; + environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD"; + }; } diff --git a/modules/system-settings/systemd-boot.nix b/modules/system-settings/systemd-boot.nix index 4712752..ac26255 100644 --- a/modules/system-settings/systemd-boot.nix +++ b/modules/system-settings/systemd-boot.nix @@ -1,6 +1,6 @@ { - flake.modules.nixos.systemd-boot = { - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - }; + flake.modules.nixos.systemd-boot = { + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + }; } diff --git a/modules/users/weckyy702/weckyy702.nix b/modules/users/weckyy702/weckyy702.nix index 4c9513e..3a5355d 100644 --- a/modules/users/weckyy702/weckyy702.nix +++ b/modules/users/weckyy702/weckyy702.nix @@ -1,22 +1,30 @@ -{ inputs -, self -, lib -, ... -}: { +{ + inputs, + self, + lib, + ... +}: +{ flake.homeConfigurations = inputs.self.lib.mkHomeManager "x86_64-linux" "weckyy702"; flake.modules = lib.mkMerge [ (self.factory.user "weckyy702" true) { nixos.weckyy702 = { - imports = with self.modules.nixos; - with self.factory; [ + imports = + with self.modules.nixos; + with self.factory; + [ kanata catppuccin (zsa-moonlander "weckyy702") ]; - users.users.weckyy702.extraGroups = [ "networkmanager" "dialout" "scanner" ]; + users.users.weckyy702.extraGroups = [ + "networkmanager" + "dialout" + "scanner" + ]; }; homeManager.weckyy702 = { pkgs, ... }: { diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 94bffb3..297f564 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -4,7 +4,10 @@ let keith = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKrauXP79zUm2FlVj3HRm+C8ufYAABiIoe68OCGbIm+2"; tux = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFB7bh6ioZrTSR0AkKvJ1qxVWX0kwcM8yeHghTYFGpqZ"; - systems = [ keith tux ]; + systems = [ + keith + tux + ]; in { "nas-creds.age" = {