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
This commit is contained in:
Gene Liverman 2026-03-20 22:11:58 -04:00
parent 5047d93b86
commit 9b3c078319
No known key found for this signature in database
78 changed files with 1662 additions and 955 deletions

View file

@ -1,4 +1,10 @@
{ inputs, pkgs, username, ... }: {
{
inputs,
pkgs,
username,
...
}:
{
imports = [
../../../shared/nixos/nixroutes.nix
./disk-config.nix
@ -29,9 +35,9 @@
networking = {
# Open ports in the firewall.
firewall.allowedTCPPorts = [
22 # ssh
80 # Nginx
443 # Nginx
22 # ssh
80 # Nginx
443 # Nginx
];
# firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
@ -56,7 +62,10 @@
users.users.${username} = {
isNormalUser = true;
description = "Gene Liverman";
extraGroups = [ "networkmanager" "wheel" ];
extraGroups = [
"networkmanager"
"wheel"
];
linger = true;
};

View file

@ -44,10 +44,10 @@
content = {
type = "gpt";
partitions = {
nix = {
name = "nix";
size = "100%";
content = {
nix = {
name = "nix";
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/nix";

View file

@ -4,34 +4,43 @@
{ lib, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "virtio_scsi" "sr_mod" ];
availableKernelModules = [
"xhci_pci"
"virtio_scsi"
"sr_mod"
];
kernelModules = [ ];
};
kernelModules = [ ];
extraModulePackages = [ ];
};
fileSystems."/" =
{ device = "/dev/disk/by-partlabel/disk-primary-root";
fileSystems = {
"/" = {
device = "/dev/disk/by-partlabel/disk-primary-root";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-partlabel/disk-primary-ESP";
"/boot" = {
device = "/dev/disk/by-partlabel/disk-primary-ESP";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
options = [
"fmask=0022"
"dmask=0022"
];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-partlabel/disk-volume1-nix";
"/nix" = {
device = "/dev/disk/by-partlabel/disk-volume1-nix";
fsType = "ext4";
};
};
swapDevices = [ ];

View file

@ -1,3 +1,3 @@
{ ... }: {
{
home.stateVersion = "24.05";
}

View file

@ -1,4 +1,5 @@
{ config, username, ... }: {
{ config, username, ... }:
{
imports = [
../../../../shared/nixos/lets-encrypt.nix
./monitoring.nix
@ -23,4 +24,3 @@
};
};
}

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }: let
{ config, pkgs, ... }:
let
metrics_server = "https://monitoring.home.technicalissues.us/remotewrite";
in {
in
{
services = {
vmagent = {
enable = true;
@ -14,11 +16,11 @@ in {
{
job_name = "node";
static_configs = [
{ targets = ["127.0.0.1:9100"]; }
{ targets = [ "127.0.0.1:9100" ]; }
];
metric_relabel_configs = [
{
source_labels = ["__name__"];
source_labels = [ "__name__" ];
regex = "go_.*";
action = "drop";
}
@ -35,11 +37,11 @@ in {
{
job_name = "nginx";
static_configs = [
{ targets = ["127.0.0.1:9113"]; }
{ targets = [ "127.0.0.1:9113" ]; }
];
metric_relabel_configs = [
{
source_labels = ["__name__"];
source_labels = [ "__name__" ];
regex = "go_.*";
action = "drop";
}
@ -77,7 +79,7 @@ in {
# ----------------------------
# Exporters (using built-in NixOS modules)
# ----------------------------
# Node exporter - using the built-in module
prometheus.exporters.node = {
enable = true;
@ -110,7 +112,7 @@ in {
group = "vmagent";
};
users.groups.vmagent = {};
users.groups.vmagent = { };
# ----------------------------
# SOPS secrets configuration
@ -119,10 +121,9 @@ in {
secrets = {
vmagent_push_pw = {
owner = "vmagent";
restartUnits = ["vmagent.service"];
restartUnits = [ "vmagent.service" ];
sopsFile = ../../../../shared/secrets.yaml;
};
};
};
}

View file

@ -1,7 +1,8 @@
{ pkgs, ... }: let
{ pkgs, ... }:
let
domain = "genebean.me";
in {
in
{
environment.etc.nginx-littlelinks = {
# Info generated via
# nurl https://github.com/genebean/littlelink genebean-sometag