diff --git a/.gitattributes b/.gitattributes index 9f1cb3c..1917907 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.yaml diff=sopsdiffer +.pre-commit-config.yaml diff=default diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..acbde48 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: local + hooks: + - id: nixfmt + name: nixfmt + entry: nix + language: system + types: [nix] + pass_filenames: false + args: ["fmt"] + + - id: deadnix + name: deadnix + entry: deadnix + language: system + types: [nix] + args: ["./modules", "./lib"] + + - id: statix + name: statix + entry: statix + language: system + types: [nix] + args: ["check", "--", "."] + diff --git a/flake.nix b/flake.nix index f3b09bf..9320164 100644 --- a/flake.nix +++ b/flake.nix @@ -100,7 +100,7 @@ ]; in { - formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt); + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree); # Darwin (macOS) hosts darwinConfigurations = { diff --git a/modules/hosts/darwin/AirPuppet/default.nix b/modules/hosts/darwin/AirPuppet/default.nix index 9054dad..6375688 100644 --- a/modules/hosts/darwin/AirPuppet/default.nix +++ b/modules/hosts/darwin/AirPuppet/default.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { system.stateVersion = 4; homebrew = { diff --git a/modules/hosts/home-manager-only/home-gene.liverman.nix b/modules/hosts/home-manager-only/home-gene.liverman.nix index 74fdca6..4d3a026 100644 --- a/modules/hosts/home-manager-only/home-gene.liverman.nix +++ b/modules/hosts/home-manager-only/home-gene.liverman.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +_: { # Settings just for work machines go here } diff --git a/modules/hosts/nixos/hetznix01/home-gene.nix b/modules/hosts/nixos/hetznix01/home-gene.nix index 40a51d2..2f6f186 100644 --- a/modules/hosts/nixos/hetznix01/home-gene.nix +++ b/modules/hosts/nixos/hetznix01/home-gene.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +_: { home.stateVersion = "24.05"; } diff --git a/modules/hosts/nixos/hetznix02/home-gene.nix b/modules/hosts/nixos/hetznix02/home-gene.nix index 40a51d2..2f6f186 100644 --- a/modules/hosts/nixos/hetznix02/home-gene.nix +++ b/modules/hosts/nixos/hetznix02/home-gene.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +_: { home.stateVersion = "24.05"; } diff --git a/modules/hosts/nixos/kiosk-entryway/home-gene.nix b/modules/hosts/nixos/kiosk-entryway/home-gene.nix index 2810df5..635af55 100644 --- a/modules/hosts/nixos/kiosk-entryway/home-gene.nix +++ b/modules/hosts/nixos/kiosk-entryway/home-gene.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { home.stateVersion = "24.11"; programs = { diff --git a/modules/hosts/nixos/kiosk-gene-desk/home-gene.nix b/modules/hosts/nixos/kiosk-gene-desk/home-gene.nix index 71e9b90..ea0f4db 100644 --- a/modules/hosts/nixos/kiosk-gene-desk/home-gene.nix +++ b/modules/hosts/nixos/kiosk-gene-desk/home-gene.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { home.stateVersion = "24.11"; programs = { diff --git a/modules/hosts/nixos/nixnas1/disk-config.nix b/modules/hosts/nixos/nixnas1/disk-config.nix index 48e606b..c521aa9 100644 --- a/modules/hosts/nixos/nixnas1/disk-config.nix +++ b/modules/hosts/nixos/nixnas1/disk-config.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { disko.devices = { disk = { sdc = { diff --git a/modules/hosts/nixos/nixnas1/home-gene.nix b/modules/hosts/nixos/nixnas1/home-gene.nix index 40a51d2..2f6f186 100644 --- a/modules/hosts/nixos/nixnas1/home-gene.nix +++ b/modules/hosts/nixos/nixnas1/home-gene.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +_: { home.stateVersion = "24.05"; } diff --git a/modules/hosts/nixos/nixnuc/containers/audiobookshelf.nix b/modules/hosts/nixos/nixnuc/containers/audiobookshelf.nix index 82f7241..4e8d2b0 100644 --- a/modules/hosts/nixos/nixnuc/containers/audiobookshelf.nix +++ b/modules/hosts/nixos/nixnuc/containers/audiobookshelf.nix @@ -1,4 +1,4 @@ -{ ... }: +_: let volume_base = "/var/lib/audiobookshelf"; http_port = "13378"; diff --git a/modules/hosts/nixos/nixnuc/home-gene.nix b/modules/hosts/nixos/nixnuc/home-gene.nix index 1182a49..d574493 100644 --- a/modules/hosts/nixos/nixnuc/home-gene.nix +++ b/modules/hosts/nixos/nixnuc/home-gene.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +_: { home.stateVersion = "23.11"; } diff --git a/modules/hosts/nixos/rainbow-planet/home-gene.nix b/modules/hosts/nixos/rainbow-planet/home-gene.nix index 6a8693b..db28e94 100644 --- a/modules/hosts/nixos/rainbow-planet/home-gene.nix +++ b/modules/hosts/nixos/rainbow-planet/home-gene.nix @@ -11,15 +11,14 @@ ]; home.file = { - ".config/hypr/frappe.conf".source = ( + ".config/hypr/frappe.conf".source = pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "hyprland"; rev = "99a88fd21fac270bd999d4a26cf0f4a4222c58be"; hash = "sha256-07B5QmQmsUKYf38oWU3+2C6KO4JvinuTwmW1Pfk8CT8="; } - + "/themes/frappe.conf" - ); + + "/themes/frappe.conf"; }; programs = { diff --git a/modules/shared/home/general/default.nix b/modules/shared/home/general/default.nix index dd045ca..5b3aeda 100644 --- a/modules/shared/home/general/default.nix +++ b/modules/shared/home/general/default.nix @@ -51,7 +51,7 @@ in nodejs nurl nvd - nixfmt + nixfmt-tree onefetch powershell pre-commit diff --git a/modules/shared/home/linux/apps/hexchat.nix b/modules/shared/home/linux/apps/hexchat.nix index 33fd094..11267f8 100644 --- a/modules/shared/home/linux/apps/hexchat.nix +++ b/modules/shared/home/linux/apps/hexchat.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +_: { programs.hexchat.enable = true; } diff --git a/modules/shared/home/linux/apps/pidgin.nix b/modules/shared/home/linux/apps/pidgin.nix index c469d88..5101306 100644 --- a/modules/shared/home/linux/apps/pidgin.nix +++ b/modules/shared/home/linux/apps/pidgin.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +_: { programs.pidgin.enable = true; } diff --git a/modules/shared/home/linux/apps/tilix.nix b/modules/shared/home/linux/apps/tilix.nix index a82dee3..a70af5f 100644 --- a/modules/shared/home/linux/apps/tilix.nix +++ b/modules/shared/home/linux/apps/tilix.nix @@ -39,14 +39,13 @@ with lib.hm.gvariant; home.file = { ".config/tilix/schemes/Beanbag-Mathias.json".source = ../../../files/tilix/Beanbag-Mathias.json; - ".config/tilix/schemes/Catppuccin-Frappe.json".source = ( + ".config/tilix/schemes/Catppuccin-Frappe.json".source = pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "tilix"; rev = "3fd05e03419321f2f2a6aad6da733b28be1765ef"; hash = "sha256-SI7QxQ+WBHzeuXbTye+s8pi4tDVZOV4Aa33mRYO276k="; } - + "/src/Catppuccin-Frappe.json" - ); + + "/src/Catppuccin-Frappe.json"; }; } diff --git a/modules/shared/home/linux/apps/waybar.nix b/modules/shared/home/linux/apps/waybar.nix index 07665c7..806ee21 100644 --- a/modules/shared/home/linux/apps/waybar.nix +++ b/modules/shared/home/linux/apps/waybar.nix @@ -2,15 +2,14 @@ { home.file = { ".config/waybar/config".source = ../../../files/waybar/config; - ".config/waybar/frappe.css".source = ( + ".config/waybar/frappe.css".source = pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "waybar"; rev = "f74ab1eecf2dcaf22569b396eed53b2b2fbe8aff"; hash = "sha256-WLJMA2X20E5PCPg0ZPtSop0bfmu+pLImP9t8A8V4QK8="; } - + "/themes/frappe.css" - ); + + "/themes/frappe.css"; ".config/waybar/style.css".source = ../../../files/waybar/style.css; }; diff --git a/modules/shared/home/linux/apps/xfce4-terminal.nix b/modules/shared/home/linux/apps/xfce4-terminal.nix index a301c8a..83857b1 100644 --- a/modules/shared/home/linux/apps/xfce4-terminal.nix +++ b/modules/shared/home/linux/apps/xfce4-terminal.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { home.file = { ".config/xfce4/terminal/accels.scm".source = ../../../files/xfce4/terminal/accels.scm; }; diff --git a/modules/shared/nixos/flatpaks.nix b/modules/shared/nixos/flatpaks.nix index 44dc6ca..acbfe9f 100644 --- a/modules/shared/nixos/flatpaks.nix +++ b/modules/shared/nixos/flatpaks.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { services = { flatpak = { enable = true; diff --git a/modules/shared/nixos/internationalisation.nix b/modules/shared/nixos/internationalisation.nix index b79e01c..1d06191 100644 --- a/modules/shared/nixos/internationalisation.nix +++ b/modules/shared/nixos/internationalisation.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { # Select internationalisation properties. i18n = { defaultLocale = "en_US.UTF-8"; diff --git a/modules/shared/nixos/nixroutes.nix b/modules/shared/nixos/nixroutes.nix index 3335139..43d0a42 100644 --- a/modules/shared/nixos/nixroutes.nix +++ b/modules/shared/nixos/nixroutes.nix @@ -1,6 +1,6 @@ { config, lib, ... }: let - hostName = config.networking.hostName; + inherit (config.networking) hostName; in { programs.zsh.shellAliases.nixroutes = "cd ~/repos/dots && echo '=== Current Routes ===' && ip route show && ip -6 route show && echo '' && echo '=== New Build Routes ===' && nix eval --json '.#nixosConfigurations.${hostName}.config.systemd.network.networks.\"10-wan\".routes'";