From 05a6997b68755b7e8685cb4d5e77d03923b05a4b Mon Sep 17 00:00:00 2001 From: Jurn Wubben Date: Sat, 24 May 2025 14:42:31 +0200 Subject: [PATCH] Formatting and code cleanup --- flake.nix | 3 +- home/programs/firefox.nix | 2 +- home/shell/yazi.nix | 2 +- hosts/lapserv/hardware-configuration.nix | 37 ++++++++++-------------- hosts/laptop/hardware-configuration.nix | 29 ++++++++++--------- hosts/laptop/virt.nix | 8 +++-- hosts/minimal/hardware-configuration.nix | 31 ++++++++++---------- system/hardware/graphics.nix | 4 +-- 8 files changed, 59 insertions(+), 57 deletions(-) diff --git a/flake.nix b/flake.nix index 6b3243b..338cd99 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ pre-commit.settings.hooks = { alejandra.enable = true; flake-checker.enable = true; - nil.enable = true; + statix.enable = true; }; formatter = pkgs.alejandra; @@ -25,6 +25,7 @@ packages = [ pkgs.alejandra pkgs.git + pkgs.statix ]; name = "dots"; DIRENV_LOG_FORMAT = ""; diff --git a/home/programs/firefox.nix b/home/programs/firefox.nix index 60b9190..02fbd88 100644 --- a/home/programs/firefox.nix +++ b/home/programs/firefox.nix @@ -5,7 +5,7 @@ }: let profileName = "jsw.nixos-default"; in { - programs.irefox = { + programs.firefox = { enable = true; package = pkgs.wrapFirefox pkgs.firefox-unwrapped { extraPolicies = { diff --git a/home/shell/yazi.nix b/home/shell/yazi.nix index cba4c92..ccf07d8 100644 --- a/home/shell/yazi.nix +++ b/home/shell/yazi.nix @@ -11,7 +11,7 @@ in { programs.yazi = { enable = true; plugins = { - full-border = yPlugins.full-border; + inherit (yPlugins) full-border; mount = mkIf udisks2 yPlugins.mount; }; keymap.manager.prepend_keymap = diff --git a/hosts/lapserv/hardware-configuration.nix b/hosts/lapserv/hardware-configuration.nix index f5ae11a..5d3b114 100644 --- a/hosts/lapserv/hardware-configuration.nix +++ b/hosts/lapserv/hardware-configuration.nix @@ -12,33 +12,28 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/33b7e681-d92a-40db-a172-b797591a1e2e"; - fsType = "ext4"; + boot = { + initrd.availableKernelModules = ["xhci_pci" "ahci" "sd_mod"]; + initrd.kernelModules = []; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/0BEA-7525"; - fsType = "vfat"; - options = ["fmask=0022" "dmask=0022"]; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/33b7e681-d92a-40db-a172-b797591a1e2e"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/0BEA-7525"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; + }; swapDevices = []; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; - # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix index e7192b8..90ce2ea 100644 --- a/hosts/laptop/hardware-configuration.nix +++ b/hosts/laptop/hardware-configuration.nix @@ -12,22 +12,25 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/59540469-ecb9-4a68-829b-4cd3ad6e95c3"; - fsType = "ext4"; + boot = { + initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"]; + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/83C9-84B1"; - fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/59540469-ecb9-4a68-829b-4cd3ad6e95c3"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/83C9-84B1"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + }; swapDevices = [ {device = "/dev/disk/by-uuid/65190d84-4e34-4905-a317-d750591933e2";} ]; diff --git a/hosts/laptop/virt.nix b/hosts/laptop/virt.nix index cc9eaf0..6865159 100644 --- a/hosts/laptop/virt.nix +++ b/hosts/laptop/virt.nix @@ -1,8 +1,10 @@ { programs.virt-manager.enable = true; users.groups.libvirtd.members = ["jsw"]; - virtualisation.libvirtd.enable = true; - virtualisation.spiceUSBRedirection.enable = true; - virtualisation.podman.enable = true; + virtualisation = { + libvirtd.enable = true; + spiceUSBRedirection.enable = true; + podman.enable = true; + }; } diff --git a/hosts/minimal/hardware-configuration.nix b/hosts/minimal/hardware-configuration.nix index 9860c2d..fe5ee73 100644 --- a/hosts/minimal/hardware-configuration.nix +++ b/hosts/minimal/hardware-configuration.nix @@ -7,26 +7,27 @@ }: { imports = [(modulesPath + "/profiles/qemu-guest.nix")]; - boot.initrd.availableKernelModules = ["xhci_pci" "virtio_pci" "virtio_scsi" "usbhid"]; - - boot.initrd.kernelModules = []; - boot.kernelModules = []; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = ["noatime" "discard" "compress=zstd"]; + boot = { + initrd.availableKernelModules = ["xhci_pci" "virtio_pci" "virtio_scsi" "usbhid"]; + initrd.kernelModules = []; + kernelModules = []; + extraModulePackages = []; }; - fileSystems."/boot" = { - device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + options = ["noatime" "discard" "compress=zstd"]; + }; + "/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; + }; swapDevices = []; networking.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/system/hardware/graphics.nix b/system/hardware/graphics.nix index c9b79fe..ee1c34e 100644 --- a/system/hardware/graphics.nix +++ b/system/hardware/graphics.nix @@ -5,9 +5,9 @@ ... }: let inherit (lib) optionals mkEnableOption mkDefault; + inherit (config.niksos) graphics; + inherit (graphics) enable; - graphics = config.niksos.graphics; - enable = graphics.enable; nvidia = graphics.enable && graphics.nvidia; intel = graphics.enable && graphics.intel; in {