dots/modules/hosts/nixos/kiosk-gene-desk/default.nix
Gene Liverman 9b3c078319
Add linting, formatting, and CI with fixes for all warnings
Infrastructure:
- Add deadnix, nixfmt, and statix to flake inputs
- Add formatter output to flake for nix fmt support
- Add deadnix, nixfmt, statix to Home Manager packages
- Add GitHub Actions workflow for CI validation
- Add .pre-commit-config.yaml with hooks for nixfmt, deadnix, and statix
- Support x86_64-darwin in formatter

Statix fixes (W10/W20 warnings):
- Remove unused lambda argument from nixpkgs-settings.nix
- Merge repeated keys in hardware-configuration.nix files (boot.initrd, boot, fileSystems)
- Merge repeated keys in nixnuc/default.nix (services, virtualisation)
- Merge repeated keys in rainbow-planet/default.nix (desktopManager)
- Merge repeated keys in home/general/default.nix (home)

Deadnix fixes (unused declarations):
- Remove unused pkgs/lib/username/http_port arguments from various files
- Fix unused final parameter in overlay functions (final -> _final)

CI/pre-commit fixes:
- Fix pre-commit statix config: add pass_filenames: false
- Fix CI workflow: use nix run nixpkgs# prefix and --ci flag for nixfmt
2026-03-20 22:29:46 -04:00

132 lines
2.8 KiB
Nix

{
inputs,
config,
lib,
pkgs,
username,
...
}:
{
imports = [
# SD card image
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
];
system.stateVersion = "24.11";
boot.supportedFilesystems = lib.mkForce [
"vfat"
"ext4"
];
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
raspberrypifw
ubootRaspberryPi4_64bit
wlr-randr
];
hardware = {
enableRedistributableFirmware = true;
graphics.enable = true;
raspberry-pi."4".fkms-3d.enable = true;
};
networking = {
firewall.enable = false;
useNetworkd = true;
wireless = {
enable = true;
networks = {
# Home
"Diagon Alley".pskRaw = "ext:psk_diagon_alley";
# Public networks
"Gallery Row-GuestWiFi" = { };
"LocalTies Guest".pskRaw = "ext:psk_local_ties";
};
secretsFile = "${config.sops.secrets.wifi_creds.path}";
};
};
nixpkgs.overlays = [
(_final: super: {
makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; });
})
];
sdImage.compressImage = true;
services = {
cage =
let
kioskProgram = pkgs.writeShellScript "kiosk.sh" ''
WAYLAND_DISPLAY=wayland-0 wlr-randr --output HDMI-A-1 --transform 90
/etc/profiles/per-user/gene/bin/chromium-browser
'';
in
{
enable = true;
program = kioskProgram;
user = "gene";
environment = {
WLR_LIBINPUT_NO_DEVICES = "1"; # boot up even if no mouse/keyboard connected
};
};
prometheus.exporters.node = {
enable = true;
enabledCollectors = [
"logind"
"systemd"
"network_route"
];
disabledCollectors = [
"textfile"
];
};
};
sops = {
age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml;
secrets = {
local_git_config = {
owner = "${username}";
path = "${config.users.users.${username}.home}/.gitconfig-local";
};
local_private_env = {
owner = "${username}";
path = "${config.users.users.${username}.home}/.private-env";
};
wifi_creds = {
sopsFile = ../../../shared/secrets.yaml;
restartUnits = [
"wpa_supplicant.service"
];
};
};
};
systemd.services.cage-tty1 = {
wants = [
"wpa_supplicant.service"
"network-online.target"
];
};
users.users.${username} = {
isNormalUser = true;
description = "Gene Liverman";
extraGroups = [
"networkmanager"
"wheel"
];
linger = true;
};
zramSwap = {
enable = true;
algorithm = "zstd";
memoryPercent = 90;
};
}