refactor(statix): resolve 'statix check' issues

This commit is contained in:
2026-01-26 10:28:35 +01:00
parent 68eecd01c7
commit b827b518cd
24 changed files with 206 additions and 172 deletions

View File

@@ -174,7 +174,7 @@
packageDefinitions = { packageDefinitions = {
nvim = nvim =
{ ... }: _:
{ {
settings = { settings = {
suffix-path = true; suffix-path = true;

View File

@@ -56,7 +56,7 @@
}@inputs: }@inputs:
let let
inherit (self) outputs; inherit (self) outputs;
lib = inputs.nixpkgs.lib; inherit (inputs.nixpkgs) lib;
utils = import ./utils { inherit lib; }; utils = import ./utils { inherit lib; };
hostDirNames = utils.dirNames ./hosts; hostDirNames = utils.dirNames ./hosts;
system = "x86_64-linux"; system = "x86_64-linux";

View File

@@ -27,9 +27,11 @@ in
../../modules/shell ../../modules/shell
]; ];
home.stateVersion = "25.05"; home = {
home.username = username; stateVersion = "25.05";
home.homeDirectory = "/home/${username}"; inherit username;
homeDirectory = "/home/${username}";
};
xdg.userDirs.createDirectories = false; xdg.userDirs.createDirectories = false;
xdg.userDirs.download = "${config.home.homeDirectory}/dl"; xdg.userDirs.download = "${config.home.homeDirectory}/dl";

View File

@@ -23,9 +23,11 @@ in
../../modules/shell ../../modules/shell
]; ];
home.stateVersion = "25.05"; home = {
home.username = username; stateVersion = "25.05";
home.homeDirectory = "/home/${username}"; inherit username;
homeDirectory = "/home/${username}";
};
xdg.userDirs.createDirectories = false; xdg.userDirs.createDirectories = false;
xdg.userDirs.download = "${config.home.homeDirectory}/dl"; xdg.userDirs.download = "${config.home.homeDirectory}/dl";

View File

@@ -45,12 +45,14 @@ in
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
home.stateVersion = "25.05"; home = {
home.username = username; stateVersion = "25.05";
home.homeDirectory = "/home/${username}"; inherit username;
homeDirectory = "/home/${username}";
};
targets.genericLinux.nixGL = { targets.genericLinux.nixGL = {
packages = inputs.nixgl.packages; inherit (inputs.nixgl) packages;
defaultWrapper = "mesa"; defaultWrapper = "mesa";
}; };

View File

@@ -13,4 +13,4 @@ let
[ ]; [ ];
in in
[ ] ++ localPackages localPackages

View File

@@ -7,7 +7,7 @@
}: }:
let let
cfg = config.shell.bash; cfg = config.shell.bash;
username = config.home.username; inherit (config.home) username;
in in
{ {
options.shell.bash = { options.shell.bash = {

View File

@@ -27,7 +27,7 @@ in
../../modules/desktops/niri ../../modules/desktops/niri
../../modules/bluetooth ../../modules/bluetooth
../../modules/keyboard ../../modules/keyboard
(import ../../modules/networking { hostName = hostName; }) (import ../../modules/networking { inherit hostName; })
../../modules/users ../../modules/users
../../modules/audio ../../modules/audio
../../modules/localization ../../modules/localization
@@ -93,16 +93,17 @@ in
inputs.nvim.packages.x86_64-linux.nvim inputs.nvim.packages.x86_64-linux.nvim
]; ];
services.xserver = { services = {
xserver = {
videoDrivers = [ "nvidia" ]; videoDrivers = [ "nvidia" ];
}; };
services.openssh = { openssh = {
enable = true; enable = true;
harden = true; harden = true;
}; };
services.syncthing = { syncthing = {
enable = true; enable = true;
openDefaultPorts = true; openDefaultPorts = true;
settings = { settings = {
@@ -119,11 +120,11 @@ in
}; };
}; };
}; };
locate = {
services.locate = {
enable = true; enable = true;
package = pkgs.plocate; package = pkgs.plocate;
}; };
};
networking = { networking = {
# TODO: generate unique hostId on actual host with: head -c 8 /etc/machine-id # TODO: generate unique hostId on actual host with: head -c 8 /etc/machine-id
@@ -131,7 +132,7 @@ in
interfaces = { interfaces = {
eno1 = { eno1 = {
wakeOnLan.enable = true; wakeOnLan.enable = true;
macAddress = wolInterfaces.eno1.macAddress; inherit (wolInterfaces.eno1) macAddress;
}; };
}; };
firewall = { firewall = {

View File

@@ -14,7 +14,8 @@
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ boot = {
initrd.availableKernelModules = [
"vmd" "vmd"
"xhci_pci" "xhci_pci"
"ahci" "ahci"
@@ -24,9 +25,10 @@
"uas" "uas"
"sd_mod" "sd_mod"
]; ];
boot.initrd.kernelModules = [ ]; initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; extraModulePackages = [ ];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -27,7 +27,7 @@ in
../../modules/desktops/niri ../../modules/desktops/niri
../../modules/bluetooth ../../modules/bluetooth
../../modules/keyboard ../../modules/keyboard
(import ../../modules/networking { hostName = hostName; }) (import ../../modules/networking { inherit hostName; })
../../modules/users ../../modules/users
../../modules/audio ../../modules/audio
../../modules/localization ../../modules/localization

View File

@@ -14,16 +14,18 @@
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ boot = {
initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
"thunderbolt" "thunderbolt"
"nvme" "nvme"
"uas" "uas"
"sd_mod" "sd_mod"
]; ];
boot.initrd.kernelModules = [ ]; initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; extraModulePackages = [ ];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -14,7 +14,9 @@
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ boot = {
initrd = {
availableKernelModules = [
"ahci" "ahci"
"xhci_pci" "xhci_pci"
"virtio_pci" "virtio_pci"
@@ -22,9 +24,11 @@
"sd_mod" "sd_mod"
"sr_mod" "sr_mod"
]; ];
boot.initrd.kernelModules = [ ]; kernelModules = [ ];
boot.kernelModules = [ ]; };
boot.extraModulePackages = [ ]; kernelModules = [ ];
extraModulePackages = [ ];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -18,7 +18,7 @@ in
./disk.nix ./disk.nix
../../modules/boot/bootloader.nix ../../modules/boot/bootloader.nix
../../modules/keyboard ../../modules/keyboard
(import ../../modules/networking { hostName = hostName; }) (import ../../modules/networking { inherit hostName; })
../../modules/users ../../modules/users
../../modules/audio ../../modules/audio
../../modules/localization ../../modules/localization
@@ -42,9 +42,11 @@ in
environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ];
disko = { disko = {
devices.disk.main.device = "/dev/vda"; devices.disk.main = {
devices.disk.main.imageName = "nixos-vm"; device = "/dev/vda";
devices.disk.main.imageSize = "32G"; imageName = "nixos-vm";
imageSize = "32G";
};
}; };
virtualisation.vmVariantWithDisko = { virtualisation.vmVariantWithDisko = {
@@ -59,11 +61,12 @@ in
}; };
}; };
services.qemuGuest.enable = true; services = {
services.spice-vdagentd.enable = true; qemuGuest.enable = true;
spice-vdagentd.enable = true;
services.openssh = { openssh = {
enable = true; enable = true;
harden = true; harden = true;
}; };
};
} }

View File

@@ -14,16 +14,20 @@
(modulesPath + "/profiles/qemu-guest.nix") (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 = [ ];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -1,13 +1,15 @@
{ ... }: _:
{ {
services.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services = {
pulseaudio.enable = false;
pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
}; };
services.pulseaudio.extraConfig = "load-module module-switch-on-connect"; pulseaudio.extraConfig = "load-module module-switch-on-connect";
};
} }

View File

@@ -1,4 +1,4 @@
{ ... }: _:
{ {
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View File

@@ -1,4 +1,9 @@
{ inputs, outputs, dotsPath, ... }: {
inputs,
outputs,
dotsPath,
...
}:
{ {
imports = [ imports = [
@@ -23,16 +28,17 @@
}; };
}; };
nix.optimise = { nix = {
optimise = {
automatic = true; automatic = true;
dates = [ "05:00" ]; dates = [ "05:00" ];
}; };
gc = {
nix.gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };
};
system.autoUpgrade = { system.autoUpgrade = {
enable = true; enable = true;

View File

@@ -1,14 +1,16 @@
{ {
programs.niri.enable = true; programs.niri.enable = true;
services.dbus.enable = true; services = {
services.logind.settings.Login = { dbus.enable = true;
logind.settings.Login = {
HandleLidSwitch = "suspend"; HandleLidSwitch = "suspend";
IdleAction = "suspend"; IdleAction = "suspend";
IdleActionSec = 1800; IdleActionSec = 1800;
}; };
services.displayManager.ly = { displayManager.ly = {
enable = true; enable = true;
}; };
};
} }

View File

@@ -11,7 +11,7 @@
disk = { disk = {
root = { root = {
type = "disk"; type = "disk";
device = config.device; inherit (config) device;
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {

View File

@@ -1,4 +1,4 @@
{ ... }: _:
{ {
time.timeZone = "Europe/Brussels"; time.timeZone = "Europe/Brussels";

View File

@@ -5,7 +5,7 @@
{ {
networking = { networking = {
hostName = hostName; inherit hostName;
wireless.iwd.enable = true; wireless.iwd.enable = true;
networkmanager.wifi.backend = "iwd"; networkmanager.wifi.backend = "iwd";
nftables.enable = true; nftables.enable = true;

View File

@@ -34,7 +34,8 @@ in
"opencode_api_key".owner = config.users.users.${cfg.username}.name; "opencode_api_key".owner = config.users.users.${cfg.username}.name;
}; };
templates."taskrc.d/sync" = { templates = {
"taskrc.d/sync" = {
owner = config.users.users.${cfg.username}.name; owner = config.users.users.${cfg.username}.name;
content = '' content = ''
sync.server.url=${config.sops.placeholder."taskwarrior_sync_server_url"} sync.server.url=${config.sops.placeholder."taskwarrior_sync_server_url"}
@@ -43,7 +44,7 @@ in
''; '';
}; };
templates.".gitconfig.email" = { ".gitconfig.email" = {
owner = config.users.users.${cfg.username}.name; owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.email"; path = "/home/${cfg.username}/.gitconfig.email";
content = '' content = ''
@@ -52,7 +53,7 @@ in
''; '';
}; };
templates.".gitconfig.work.email" = { ".gitconfig.work.email" = {
owner = config.users.users.${cfg.username}.name; owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.work.email"; path = "/home/${cfg.username}/.gitconfig.work.email";
content = '' content = ''
@@ -61,7 +62,7 @@ in
''; '';
}; };
templates."hcloud/cli.toml" = { "hcloud/cli.toml" = {
owner = config.users.users.${cfg.username}.name; owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.config/hcloud/cli.toml"; path = "/home/${cfg.username}/.config/hcloud/cli.toml";
content = '' content = ''
@@ -73,7 +74,7 @@ in
''; '';
}; };
templates."opencode/auth.json" = { "opencode/auth.json" = {
owner = config.users.users.${cfg.username}.name; owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.local/share/opencode/auth.json"; path = "/home/${cfg.username}/.local/share/opencode/auth.json";
content = '' content = ''
@@ -87,4 +88,5 @@ in
}; };
}; };
}; };
};
} }

View File

@@ -1,6 +1,6 @@
{ lib, config, ... }: { lib, config, ... }:
let let
username = config.ssh.username; inherit (config.ssh) username;
in in
{ {
# auto extract SSH keys # auto extract SSH keys

View File

@@ -1,4 +1,4 @@
{ ... }: _:
{ {
services.xserver.windowManager.xmonad = { services.xserver.windowManager.xmonad = {