applies all recommended deadnix fixes, and adds it to checks

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
ahuston-0 2024-05-21 19:47:21 -04:00 committed by Richie Cahill
parent f3f6c463ca
commit 3522ebd8c5
19 changed files with 27 additions and 88 deletions

View File

@ -23,6 +23,15 @@ forEachSystem (system: {
## static analysis checks for nix ## static analysis checks for nix
nil.enable = true; nil.enable = true;
statix.enable = true; statix.enable = true;
deadnix = {
enable = true;
settings = {
noUnderscore = true; # ignore variables starting with underscore
# ignore lambda patterns (useful for passing args from ({}@args)
# to other functions)
noLambdaPatternNames = true;
};
};
# json hooks # json hooks
check-json = { check-json = {

View File

@ -110,17 +110,7 @@
}; };
outputs = outputs =
{ { self, nixpkgs, ... }@inputs:
self,
nix,
home-manager,
nixos-hardware,
nixos-modules,
nixpkgs,
sops-nix,
wired-notify,
...
}@inputs:
let let
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
@ -135,7 +125,7 @@
# adds our lib functions to lib namespace # adds our lib functions to lib namespace
lib = nixpkgs.lib.extend ( lib = nixpkgs.lib.extend (
self: super: self: _:
import ./lib { import ./lib {
inherit nixpkgs inputs; inherit nixpkgs inputs;
lib = self; lib = self;

View File

@ -1,12 +1,5 @@
{ { pulls, branches, ... }:
nixpkgs,
pulls,
branches,
...
}:
let let
pkgs = import nixpkgs { };
# create the json spec for the jobset # create the json spec for the jobset
makeSpec = makeSpec =
contents: contents:

View File

@ -44,7 +44,7 @@
lsdir = lsdir =
dir: dir:
lib.optionals (builtins.pathExists dir) ( lib.optionals (builtins.pathExists dir) (
lib.attrNames (lib.filterAttrs (path: type: type == "directory") (builtins.readDir dir)) lib.attrNames (lib.filterAttrs (_: type: type == "directory") (builtins.readDir dir))
); );
# return full paths of all files in a directory # return full paths of all files in a directory

View File

@ -69,8 +69,8 @@ rec {
user: src: user: src:
{ {
config, config,
lib,
pkgs, pkgs,
lib,
... ...
}@args: }@args:
{ {
@ -153,7 +153,7 @@ rec {
users, users,
home ? true, home ? true,
modules ? [ ], modules ? [ ],
server ? true, # server ? true,
sops ? true, sops ? true,
system ? "x86_64-linux", system ? "x86_64-linux",
}@args: }@args:

View File

@ -66,7 +66,7 @@ in
]; ];
systemd.services = lib.mapAttrs' ( systemd.services = lib.mapAttrs' (
repo: _:
{ {
repo-name, repo-name,
ssh-key, ssh-key,
@ -90,7 +90,7 @@ in
) repos; ) repos;
systemd.timers = lib.mapAttrs' ( systemd.timers = lib.mapAttrs' (
repo: _:
{ repo-name, frequency, ... }: { repo-name, frequency, ... }:
lib.nameValuePair "autopull@${repo-name}" { lib.nameValuePair "autopull@${repo-name}" {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];

View File

@ -1,9 +1,4 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
# rtkit is optional but recommended # rtkit is optional but recommended

View File

@ -1,9 +1,4 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
# installs hyprland, and its dependencies # installs hyprland, and its dependencies

View File

@ -1,9 +1,4 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
# custom module from modules/pam-fingerprint-swap.nix # custom module from modules/pam-fingerprint-swap.nix
# swaps password and fingerprint in pam ordering # swaps password and fingerprint in pam ordering

View File

@ -1,9 +1,4 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
hardware.opengl = { hardware.opengl = {

View File

@ -1,9 +1,4 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
security.polkit.enable = true; security.polkit.enable = true;

View File

@ -1,9 +1,4 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
environment.systemPackages = [ pkgs.steam-run ]; environment.systemPackages = [ pkgs.steam-run ];

View File

@ -4,7 +4,6 @@
{ {
config, config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:

View File

@ -5,12 +5,6 @@
... ...
}: }:
let let
keygen = key: {
format = "binary";
sopsFile = ./keys/${key};
mode = "0400";
path = "/crypto/keys/${key}";
};
bootkey = key: { "/crypto/keys/${key}" = /crypto/keys/${key}; }; bootkey = key: { "/crypto/keys/${key}" = /crypto/keys/${key}; };
zfskeys = [ zfskeys = [
"zfs-attic-key" "zfs-attic-key"

View File

@ -4,7 +4,6 @@
{ {
config, config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:

View File

@ -1,9 +1,4 @@
{ { ... }:
config,
lib,
pkgs,
...
}:
{ {
xdg.configFile = { xdg.configFile = {

View File

@ -1,9 +1,4 @@
{ { ... }:
config,
lib,
pkgs,
...
}:
{ {
programs.git = { programs.git = {

View File

@ -1,9 +1,4 @@
{ { ... }:
config,
lib,
pkgs,
...
}:
{ {
programs.waybar = { programs.waybar = {

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: { ... }:
{ {
programs.zsh = { programs.zsh = {