feat(lint): applied statix and deadnix

This commit is contained in:
catvayor 2024-11-14 15:30:17 +01:00
parent 1f9a238985
commit 5f583ecdcb
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
15 changed files with 187 additions and 203 deletions

View file

@ -2,12 +2,14 @@ let
mods = import ./modules; mods = import ./modules;
users = import ./users; users = import ./users;
sources = import ./npins; sources = import ./npins;
mkNixpkgsSrc = (import sources.nix-patches { patchFile = ./patches; }).mkNixpkgsSrc; inherit (import sources.nix-patches { patchFile = ./patches; }) mkNixpkgsSrc;
lib = inherit
(import (mkNixpkgsSrc { (import (mkNixpkgsSrc {
src = sources.nixpkgs; src = sources.nixpkgs;
version = "unstable"; version = "unstable";
}) { }).lib; }) { })
lib
;
in in
{ {
meta = { meta = {

View file

@ -21,7 +21,7 @@ let
internal = port; internal = port;
}) (types.submodule redirected-ports-mod); }) (types.submodule redirected-ports-mod);
fqdn = config.kat.fqdn; inherit (config.kat) fqdn;
hostname = config.networking.hostName; hostname = config.networking.hostName;
cfg = config.kat.proxies; cfg = config.kat.proxies;
@ -51,7 +51,7 @@ let
map ( map (
host: host:
let let
fqdn = nodes.${host}.config.kat.fqdn; inherit (nodes.${host}.config.kat) fqdn;
host-cfg = nodes.${host}.config.kat.proxies; host-cfg = nodes.${host}.config.kat.proxies;
in in
{ {
@ -60,7 +60,7 @@ let
{ external, internal }: { external, internal }:
{ {
input = external; input = external;
ip = host-cfg.ip; inherit (host-cfg) ip;
out = internal; out = internal;
} }
) host-cfg.open-tcp; ) host-cfg.open-tcp;
@ -68,13 +68,12 @@ let
{ external, internal }: { external, internal }:
{ {
input = external; input = external;
ip = host-cfg.ip; inherit (host-cfg) ip;
out = internal; out = internal;
} }
) host-cfg.open-udp; ) host-cfg.open-udp;
vhosts.${fqdn} = { vhosts.${fqdn} = {
ip = host-cfg.ip; inherit (host-cfg) ip aliases;
aliases = host-cfg.aliases;
}; };
} }
) cfg.redirects ) cfg.redirects

View file

@ -9,7 +9,7 @@ in
imports = [ imports = [
zsh.user zsh.user
./neovim.nix ./neovim.nix
((import sources.nixvim).homeManagerModules.nixvim) (import sources.nixvim).homeManagerModules.nixvim
]; ];
# options.kat = { # options.kat = {
# ssh = mkEnableOption "ssh configuration"; # ssh = mkEnableOption "ssh configuration";

View file

@ -1,7 +1,5 @@
{ {
config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -9,16 +7,20 @@
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"ahci" "ahci"
"xhci_pci" "xhci_pci"
"virtio_pci" "virtio_pci"
"sr_mod" "sr_mod"
"virtio_blk" "virtio_blk"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; };
boot.extraModulePackages = [ ]; kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -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, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -12,18 +7,23 @@
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"ahci" "ahci"
"xhci_pci" "xhci_pci"
"virtio_pci" "virtio_pci"
"sr_mod" "sr_mod"
"virtio_blk" "virtio_blk"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; };
boot.extraModulePackages = [ ]; kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems."/" = { fileSystems = {
"/" = {
device = "UUID=301a23cf-1aa3-4c53-a174-1a97592da5fa"; device = "UUID=301a23cf-1aa3-4c53-a174-1a97592da5fa";
fsType = "bcachefs"; fsType = "bcachefs";
options = [ options = [
@ -32,19 +32,15 @@
]; ];
}; };
fileSystems."/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/F594-E8DB"; device = "/dev/disk/by-uuid/F594-E8DB";
fsType = "vfat"; fsType = "vfat";
}; };
};
swapDevices = [ ]; 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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }

View file

@ -1,6 +1,5 @@
{ {
pkgs, pkgs,
modulesPath,
lib, lib,
sources, sources,
... ...
@ -12,7 +11,7 @@
}; };
imports = [ imports = [
("${sources.nixos-images}/nix/kexec-installer/module.nix") "${sources.nixos-images}/nix/kexec-installer/module.nix"
]; ];
boot = { boot = {

View file

@ -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, config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -12,18 +8,23 @@
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"xhci_pci" "xhci_pci"
"usbhid" "usbhid"
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
"sdhci_pci" "sdhci_pci"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; };
boot.extraModulePackages = [ ]; kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems."/" = { fileSystems = {
"/" = {
device = "UUID=2d6f7d3a-936d-457c-86c7-f49d816ff5b7"; device = "UUID=2d6f7d3a-936d-457c-86c7-f49d816ff5b7";
fsType = "bcachefs"; fsType = "bcachefs";
options = [ options = [
@ -32,12 +33,12 @@
]; ];
}; };
fileSystems."/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/DD9A-3823"; device = "/dev/disk/by-uuid/DD9A-3823";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/.ssd" = { "/.ssd" = {
device = "UUID=b4fc22f8-aecd-4cde-b77d-79825fae65eb"; device = "UUID=b4fc22f8-aecd-4cde-b77d-79825fae65eb";
fsType = "bcachefs"; fsType = "bcachefs";
options = [ options = [
@ -47,29 +48,22 @@
neededForBoot = true; neededForBoot = true;
}; };
fileSystems."/nix/store" = { "/nix/store" = {
device = "/.ssd/nix-store"; device = "/.ssd/nix-store";
options = [ "bind" ]; options = [ "bind" ];
depends = [ "/.ssd" ]; depends = [ "/.ssd" ];
}; };
fileSystems."/var/lib/libvirt" = { "/var/lib/libvirt" = {
device = "/.ssd/libvirt"; device = "/.ssd/libvirt";
options = [ "bind" ]; options = [ "bind" ];
depends = [ "/.ssd" ]; depends = [ "/.ssd" ];
}; };
};
swapDevices = [ ]; 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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; 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"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
mods,
kat-path, kat-path,
ssh-keys, ssh-keys,
sources, sources,

View file

@ -1,7 +1,5 @@
{ {
config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -9,16 +7,20 @@
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"ahci" "ahci"
"xhci_pci" "xhci_pci"
"virtio_pci" "virtio_pci"
"sr_mod" "sr_mod"
"virtio_blk" "virtio_blk"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; };
boot.extraModulePackages = [ ]; kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -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, config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -12,7 +8,9 @@
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"xhci_pci" "xhci_pci"
"vmd" "vmd"
"nvme" "nvme"
@ -20,36 +18,36 @@
"sd_mod" "sd_mod"
"rtsx_pci_sdmmc" "rtsx_pci_sdmmc"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; luks.devices."dec-lin" = {
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/4c1f76c6-5ce6-4987-b15e-9419627b7f19";
fsType = "bcachefs";
# options = [ "fsck" "fix_errors" ];
};
boot.initrd.luks.devices."dec-lin" = {
device = "/dev/disk/by-uuid/bba45bff-2356-4ec7-a20c-9cbf9d992822"; device = "/dev/disk/by-uuid/bba45bff-2356-4ec7-a20c-9cbf9d992822";
preLVM = true; preLVM = true;
allowDiscards = true; allowDiscards = true;
}; };
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems."/boot" = { fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/4c1f76c6-5ce6-4987-b15e-9419627b7f19";
fsType = "bcachefs";
options = [
"fsck"
"fix_errors"
];
};
"/boot" = {
device = "/dev/disk/by-uuid/4F30-BEC7"; device = "/dev/disk/by-uuid/4F30-BEC7";
fsType = "vfat"; fsType = "vfat";
}; };
};
swapDevices = [ { device = "/dev/disk/by-uuid/5edcb909-6109-4198-84c7-703cbd471b44"; } ]; 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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; 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"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -1,9 +1,3 @@
{
config,
lib,
pkgs,
...
}:
{ {
boot.kernel.sysctl."net.ipv4.ip_forward" = true; boot.kernel.sysctl."net.ipv4.ip_forward" = true;

View file

@ -1,7 +1,5 @@
{ {
config,
lib, lib,
pkgs,
... ...
}: }:
{ {

View file

@ -1,7 +1,5 @@
{ {
config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -9,16 +7,20 @@
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"ahci" "ahci"
"xhci_pci" "xhci_pci"
"virtio_pci" "virtio_pci"
"sr_mod" "sr_mod"
"virtio_blk" "virtio_blk"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; };
boot.extraModulePackages = [ ]; kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -1,7 +1,5 @@
{ {
config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -9,23 +7,22 @@
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"ata_piix" "ata_piix"
"uhci_hcd" "uhci_hcd"
"virtio_pci" "virtio_pci"
"virtio_scsi" "virtio_scsi"
"sd_mod" "sd_mod"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; };
boot.extraModulePackages = [ ]; 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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }

View file

@ -1,7 +1,5 @@
{ {
config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:
@ -9,16 +7,20 @@
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"ahci" "ahci"
"xhci_pci" "xhci_pci"
"virtio_pci" "virtio_pci"
"sr_mod" "sr_mod"
"virtio_blk" "virtio_blk"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; };
boot.extraModulePackages = [ ]; kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";