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 = {
nvim =
{ ... }:
_:
{
settings = {
suffix-path = true;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -27,7 +27,7 @@ in
../../modules/desktops/niri
../../modules/bluetooth
../../modules/keyboard
(import ../../modules/networking { hostName = hostName; })
(import ../../modules/networking { inherit hostName; })
../../modules/users
../../modules/audio
../../modules/localization
@@ -93,36 +93,37 @@ in
inputs.nvim.packages.x86_64-linux.nvim
];
services.xserver = {
videoDrivers = [ "nvidia" ];
};
services = {
xserver = {
videoDrivers = [ "nvidia" ];
};
services.openssh = {
enable = true;
harden = true;
};
openssh = {
enable = true;
harden = true;
};
services.syncthing = {
enable = true;
openDefaultPorts = true;
settings = {
devices = {
# "device1" = {
# id = "DEVICE-ID-GOES-HERE";
# };
};
folders = {
"/home/${username}/sync" = {
id = "sync";
devices = [ ];
syncthing = {
enable = true;
openDefaultPorts = true;
settings = {
devices = {
# "device1" = {
# id = "DEVICE-ID-GOES-HERE";
# };
};
folders = {
"/home/${username}/sync" = {
id = "sync";
devices = [ ];
};
};
};
};
};
services.locate = {
enable = true;
package = pkgs.plocate;
locate = {
enable = true;
package = pkgs.plocate;
};
};
networking = {
@@ -131,7 +132,7 @@ in
interfaces = {
eno1 = {
wakeOnLan.enable = true;
macAddress = wolInterfaces.eno1.macAddress;
inherit (wolInterfaces.eno1) macAddress;
};
};
firewall = {

View File

@@ -14,19 +14,21 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot = {
initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"uas"
"sd_mod"
];
initrd.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

View File

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

View File

@@ -14,16 +14,18 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot = {
initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"uas"
"sd_mod"
];
initrd.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

View File

@@ -14,17 +14,21 @@
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot = {
initrd = {
availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
kernelModules = [ ];
};
kernelModules = [ ];
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

View File

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

View File

@@ -14,16 +14,20 @@
(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 = [ ];
};
# 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -34,56 +34,58 @@ in
"opencode_api_key".owner = config.users.users.${cfg.username}.name;
};
templates."taskrc.d/sync" = {
owner = config.users.users.${cfg.username}.name;
content = ''
sync.server.url=${config.sops.placeholder."taskwarrior_sync_server_url"}
sync.server.client_id=${config.sops.placeholder."taskwarrior_sync_server_client_id"}
sync.encryption_secret=${config.sops.placeholder."taskwarrior_sync_encryption_secret"}
'';
};
templates = {
"taskrc.d/sync" = {
owner = config.users.users.${cfg.username}.name;
content = ''
sync.server.url=${config.sops.placeholder."taskwarrior_sync_server_url"}
sync.server.client_id=${config.sops.placeholder."taskwarrior_sync_server_client_id"}
sync.encryption_secret=${config.sops.placeholder."taskwarrior_sync_encryption_secret"}
'';
};
templates.".gitconfig.email" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.email";
content = ''
[user]
email = ${config.sops.placeholder."email_personal"}
'';
};
".gitconfig.email" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.email";
content = ''
[user]
email = ${config.sops.placeholder."email_personal"}
'';
};
templates.".gitconfig.work.email" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.work.email";
content = ''
[user]
email = ${config.sops.placeholder."email_work"}
'';
};
".gitconfig.work.email" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.work.email";
content = ''
[user]
email = ${config.sops.placeholder."email_work"}
'';
};
templates."hcloud/cli.toml" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.config/hcloud/cli.toml";
content = ''
active_context = "server"
"hcloud/cli.toml" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.config/hcloud/cli.toml";
content = ''
active_context = "server"
[[contexts]]
name = "server"
token = "${config.sops.placeholder."hcloud"}"
'';
};
[[contexts]]
name = "server"
token = "${config.sops.placeholder."hcloud"}"
'';
};
templates."opencode/auth.json" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.local/share/opencode/auth.json";
content = ''
{
"zai-coding-plan": {
"type": "api",
"key": "${config.sops.placeholder."opencode_api_key"}"
"opencode/auth.json" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.local/share/opencode/auth.json";
content = ''
{
"zai-coding-plan": {
"type": "api",
"key": "${config.sops.placeholder."opencode_api_key"}"
}
}
}
'';
'';
};
};
};
};

View File

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

View File

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