From 4523650d389b4d83c5bad737cff56d941ea9252d Mon Sep 17 00:00:00 2001 From: catvayor Date: Thu, 14 Nov 2024 15:30:17 +0100 Subject: [PATCH] feat(lint): applied statix and deadnix --- hive.nix | 8 +- kat/proxies/default.nix | 11 +-- kat/users/default.nix | 2 +- .../kat-betamail/hardware-configuration.nix | 26 ++--- .../kat-degette/hardware-configuration.nix | 58 +++++------ machines/kat-kexec.nix | 3 +- machines/kat-manah/hardware-configuration.nix | 98 +++++++++---------- machines/kat-orchid/default.nix | 1 - .../kat-orchid/hardware-configuration.nix | 26 ++--- .../kat-probook/hardware-configuration.nix | 66 ++++++------- machines/kat-probook/router.nix | 6 -- machines/kat-son/default.nix | 2 - machines/kat-son/hardware-configuration.nix | 26 ++--- .../kat-watcher/hardware-configuration.nix | 31 +++--- machines/kat-www/hardware-configuration.nix | 26 ++--- modules/mail.nix | 1 - 16 files changed, 187 insertions(+), 204 deletions(-) diff --git a/hive.nix b/hive.nix index 709cb4d..06fdb8a 100644 --- a/hive.nix +++ b/hive.nix @@ -2,12 +2,14 @@ let mods = import ./modules; users = import ./users; sources = import ./npins; - mkNixpkgsSrc = (import sources.nix-patches { patchFile = ./patches; }).mkNixpkgsSrc; - lib = + inherit (import sources.nix-patches { patchFile = ./patches; }) mkNixpkgsSrc; + inherit (import (mkNixpkgsSrc { src = sources.nixpkgs; version = "unstable"; - }) { }).lib; + }) { }) + lib + ; in { meta = { diff --git a/kat/proxies/default.nix b/kat/proxies/default.nix index fddef9e..65c002e 100644 --- a/kat/proxies/default.nix +++ b/kat/proxies/default.nix @@ -21,7 +21,7 @@ let internal = port; }) (types.submodule redirected-ports-mod); - fqdn = config.kat.fqdn; + inherit (config.kat) fqdn; hostname = config.networking.hostName; cfg = config.kat.proxies; @@ -51,7 +51,7 @@ let map ( host: let - fqdn = nodes.${host}.config.kat.fqdn; + inherit (nodes.${host}.config.kat) fqdn; host-cfg = nodes.${host}.config.kat.proxies; in { @@ -60,7 +60,7 @@ let { external, internal }: { input = external; - ip = host-cfg.ip; + inherit (host-cfg) ip; out = internal; } ) host-cfg.open-tcp; @@ -68,13 +68,12 @@ let { external, internal }: { input = external; - ip = host-cfg.ip; + inherit (host-cfg) ip; out = internal; } ) host-cfg.open-udp; vhosts.${fqdn} = { - ip = host-cfg.ip; - aliases = host-cfg.aliases; + inherit (host-cfg) ip aliases; }; } ) cfg.redirects diff --git a/kat/users/default.nix b/kat/users/default.nix index 5039333..ea85066 100644 --- a/kat/users/default.nix +++ b/kat/users/default.nix @@ -9,7 +9,7 @@ in imports = [ zsh.user ./neovim.nix - ((import sources.nixvim).homeManagerModules.nixvim) + (import sources.nixvim).homeManagerModules.nixvim ]; # options.kat = { # ssh = mkEnableOption "ssh configuration"; diff --git a/machines/kat-betamail/hardware-configuration.nix b/machines/kat-betamail/hardware-configuration.nix index e8da702..a8ceb20 100644 --- a/machines/kat-betamail/hardware-configuration.nix +++ b/machines/kat-betamail/hardware-configuration.nix @@ -1,7 +1,5 @@ { - config, lib, - pkgs, modulesPath, ... }: @@ -9,16 +7,20 @@ { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ - "ahci" - "xhci_pci" - "virtio_pci" - "sr_mod" - "virtio_blk" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/machines/kat-degette/hardware-configuration.nix b/machines/kat-degette/hardware-configuration.nix index 7fe8d25..0ee058f 100644 --- a/machines/kat-degette/hardware-configuration.nix +++ b/machines/kat-degette/hardware-configuration.nix @@ -1,10 +1,5 @@ -# 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, ... }: @@ -12,39 +7,40 @@ { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ - "ahci" - "xhci_pci" - "virtio_pci" - "sr_mod" - "virtio_blk" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "UUID=301a23cf-1aa3-4c53-a174-1a97592da5fa"; - fsType = "bcachefs"; - options = [ - "fsck" - "fix_errors" - ]; + boot = { + initrd = { + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/F594-E8DB"; - fsType = "vfat"; + fileSystems = { + "/" = { + device = "UUID=301a23cf-1aa3-4c53-a174-1a97592da5fa"; + fsType = "bcachefs"; + options = [ + "fsck" + "fix_errors" + ]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/F594-E8DB"; + fsType = "vfat"; + }; }; 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.enp1s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/machines/kat-kexec.nix b/machines/kat-kexec.nix index 55016c4..502ef20 100644 --- a/machines/kat-kexec.nix +++ b/machines/kat-kexec.nix @@ -1,6 +1,5 @@ { pkgs, - modulesPath, lib, sources, ... @@ -12,7 +11,7 @@ }; imports = [ - ("${sources.nixos-images}/nix/kexec-installer/module.nix") + "${sources.nixos-images}/nix/kexec-installer/module.nix" ]; boot = { diff --git a/machines/kat-manah/hardware-configuration.nix b/machines/kat-manah/hardware-configuration.nix index e33e332..2419b5c 100644 --- a/machines/kat-manah/hardware-configuration.nix +++ b/machines/kat-manah/hardware-configuration.nix @@ -1,10 +1,6 @@ -# 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, ... }: @@ -12,64 +8,62 @@ { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "usbhid" - "usb_storage" - "sd_mod" - "sdhci_pci" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "UUID=2d6f7d3a-936d-457c-86c7-f49d816ff5b7"; - fsType = "bcachefs"; - options = [ - "fsck" - "fix_errors" - ]; + boot = { + initrd = { + availableKernelModules = [ + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/DD9A-3823"; - fsType = "vfat"; - }; + fileSystems = { + "/" = { + device = "UUID=2d6f7d3a-936d-457c-86c7-f49d816ff5b7"; + fsType = "bcachefs"; + options = [ + "fsck" + "fix_errors" + ]; + }; - fileSystems."/.ssd" = { - device = "UUID=b4fc22f8-aecd-4cde-b77d-79825fae65eb"; - fsType = "bcachefs"; - options = [ - "fsck" - "fix_errors" - ]; - neededForBoot = true; - }; + "/boot" = { + device = "/dev/disk/by-uuid/DD9A-3823"; + fsType = "vfat"; + }; - fileSystems."/nix/store" = { - device = "/.ssd/nix-store"; - options = [ "bind" ]; - depends = [ "/.ssd" ]; - }; + "/.ssd" = { + device = "UUID=b4fc22f8-aecd-4cde-b77d-79825fae65eb"; + fsType = "bcachefs"; + options = [ + "fsck" + "fix_errors" + ]; + neededForBoot = true; + }; - fileSystems."/var/lib/libvirt" = { - device = "/.ssd/libvirt"; - options = [ "bind" ]; - depends = [ "/.ssd" ]; + "/nix/store" = { + device = "/.ssd/nix-store"; + options = [ "bind" ]; + depends = [ "/.ssd" ]; + }; + + "/var/lib/libvirt" = { + device = "/.ssd/libvirt"; + options = [ "bind" ]; + depends = [ "/.ssd" ]; + }; }; 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.enp1s0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.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/machines/kat-orchid/default.nix b/machines/kat-orchid/default.nix index 197f9fe..31d04a5 100644 --- a/machines/kat-orchid/default.nix +++ b/machines/kat-orchid/default.nix @@ -2,7 +2,6 @@ config, lib, pkgs, - mods, kat-path, ssh-keys, sources, diff --git a/machines/kat-orchid/hardware-configuration.nix b/machines/kat-orchid/hardware-configuration.nix index e8da702..a8ceb20 100644 --- a/machines/kat-orchid/hardware-configuration.nix +++ b/machines/kat-orchid/hardware-configuration.nix @@ -1,7 +1,5 @@ { - config, lib, - pkgs, modulesPath, ... }: @@ -9,16 +7,20 @@ { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ - "ahci" - "xhci_pci" - "virtio_pci" - "sr_mod" - "virtio_blk" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/machines/kat-probook/hardware-configuration.nix b/machines/kat-probook/hardware-configuration.nix index c6686d6..096d77d 100644 --- a/machines/kat-probook/hardware-configuration.nix +++ b/machines/kat-probook/hardware-configuration.nix @@ -1,10 +1,6 @@ -# 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, ... }: @@ -12,44 +8,46 @@ { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "vmd" - "nvme" - "usb_storage" - "sd_mod" - "rtsx_pci_sdmmc" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/4c1f76c6-5ce6-4987-b15e-9419627b7f19"; - fsType = "bcachefs"; - # options = [ "fsck" "fix_errors" ]; + boot = { + initrd = { + availableKernelModules = [ + "xhci_pci" + "vmd" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + kernelModules = [ ]; + luks.devices."dec-lin" = { + device = "/dev/disk/by-uuid/bba45bff-2356-4ec7-a20c-9cbf9d992822"; + preLVM = true; + allowDiscards = true; + }; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; }; - boot.initrd.luks.devices."dec-lin" = { - device = "/dev/disk/by-uuid/bba45bff-2356-4ec7-a20c-9cbf9d992822"; - preLVM = true; - allowDiscards = true; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/4c1f76c6-5ce6-4987-b15e-9419627b7f19"; + fsType = "bcachefs"; + options = [ + "fsck" + "fix_errors" + ]; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/4F30-BEC7"; - fsType = "vfat"; + "/boot" = { + device = "/dev/disk/by-uuid/4F30-BEC7"; + fsType = "vfat"; + }; }; swapDevices = [ { device = "/dev/disk/by-uuid/5edcb909-6109-4198-84c7-703cbd471b44"; } ]; - # 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.wlp0s20f3.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/machines/kat-probook/router.nix b/machines/kat-probook/router.nix index 683aa5a..c9644b6 100644 --- a/machines/kat-probook/router.nix +++ b/machines/kat-probook/router.nix @@ -1,9 +1,3 @@ -{ - config, - lib, - pkgs, - ... -}: { boot.kernel.sysctl."net.ipv4.ip_forward" = true; diff --git a/machines/kat-son/default.nix b/machines/kat-son/default.nix index fb45a37..9653739 100644 --- a/machines/kat-son/default.nix +++ b/machines/kat-son/default.nix @@ -1,7 +1,5 @@ { - config, lib, - pkgs, ... }: { diff --git a/machines/kat-son/hardware-configuration.nix b/machines/kat-son/hardware-configuration.nix index e8da702..a8ceb20 100644 --- a/machines/kat-son/hardware-configuration.nix +++ b/machines/kat-son/hardware-configuration.nix @@ -1,7 +1,5 @@ { - config, lib, - pkgs, modulesPath, ... }: @@ -9,16 +7,20 @@ { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ - "ahci" - "xhci_pci" - "virtio_pci" - "sr_mod" - "virtio_blk" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/machines/kat-watcher/hardware-configuration.nix b/machines/kat-watcher/hardware-configuration.nix index b3c9ce2..946237c 100644 --- a/machines/kat-watcher/hardware-configuration.nix +++ b/machines/kat-watcher/hardware-configuration.nix @@ -1,7 +1,5 @@ { - config, lib, - pkgs, modulesPath, ... }: @@ -9,23 +7,22 @@ { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ - "ata_piix" - "uhci_hcd" - "virtio_pci" - "virtio_scsi" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; - # 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.ens3.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/machines/kat-www/hardware-configuration.nix b/machines/kat-www/hardware-configuration.nix index e8da702..a8ceb20 100644 --- a/machines/kat-www/hardware-configuration.nix +++ b/machines/kat-www/hardware-configuration.nix @@ -1,7 +1,5 @@ { - config, lib, - pkgs, modulesPath, ... }: @@ -9,16 +7,20 @@ { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ - "ahci" - "xhci_pci" - "virtio_pci" - "sr_mod" - "virtio_blk" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/modules/mail.nix b/modules/mail.nix index bd221c6..2cd2a6e 100644 --- a/modules/mail.nix +++ b/modules/mail.nix @@ -1,4 +1,3 @@ -{ pkgs, config, ... }: { programs.aerc = { extraConfig.general.unsafe-accounts-conf = true;