From 65a677c6d590583a3d89e4689e6ac7399e44d995 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Thu, 25 Sep 2025 20:44:02 +0000 Subject: [PATCH] style: remove dead code Change-Id: snkqpwyppsmyknqzuqwpzouvpltklnwx --- packetmix/ci.nix | 4 ++-- packetmix/homes/catppuccin/catppuccin.nix | 2 +- packetmix/homes/coded/catppuccin.nix | 1 - packetmix/homes/common/gtk.nix | 1 - packetmix/homes/common/helix.nix | 1 - packetmix/homes/default.nix | 3 --- packetmix/homes/development/helix.nix | 2 -- packetmix/homes/development/tmux.nix | 1 - packetmix/homes/espanso/espanso.nix | 5 ++++- packetmix/homes/maya/niri.nix | 2 -- packetmix/homes/minion/niri.nix | 3 --- packetmix/homes/niri/niri.nix | 2 -- packetmix/modules/nilla-home/home.nix | 1 - packetmix/modules/nilla-home/nixos.nix | 3 +-- packetmix/nilla.nix | 6 ------ packetmix/packages/bluesky-pds/default.nix | 6 ++---- packetmix/systems/common/fonts.nix | 5 ++++- packetmix/systems/common/inputs.nix | 1 - packetmix/systems/default.nix | 5 ++++- packetmix/systems/emden/hardware-configuration.nix | 1 - packetmix/systems/emden/steam.nix | 1 - .../espanso/nixpkgs-328890--espanso-capdacoverride.nix | 2 +- packetmix/systems/gaming/steam.nix | 1 - packetmix/systems/marbled/hardware-configuration.nix | 1 - packetmix/systems/niri/niri.nix | 1 - packetmix/systems/personal/configuration.nix | 1 - packetmix/systems/redhead/hardware-configuration.nix | 1 - packetmix/systems/redhead/remoteBuilds.nix | 4 ---- packetmix/systems/teal/pds.nix | 3 +-- packetmix/systems/teal/stalwart.nix | 1 - packetmix/systems/teal/vaultwarden.nix | 2 -- 31 files changed, 20 insertions(+), 53 deletions(-) diff --git a/packetmix/ci.nix b/packetmix/ci.nix index 1f5bc2e4..cd297171 100644 --- a/packetmix/ci.nix +++ b/packetmix/ci.nix @@ -7,11 +7,11 @@ let project = base.extend { modules = [ ( - { config, lib, ... }: + { config, ... }: { config.inputs = ( builtins.mapAttrs ( - name: value: + _name: value: if value ? settings.configuration.allowUnfree then { settings.configuration = { diff --git a/packetmix/homes/catppuccin/catppuccin.nix b/packetmix/homes/catppuccin/catppuccin.nix index 08e2a987..f5adaeb3 100644 --- a/packetmix/homes/catppuccin/catppuccin.nix +++ b/packetmix/homes/catppuccin/catppuccin.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: MIT -{ project, lib, ... }: +{ project, ... }: { imports = [ project.inputs.catppuccin.result.homeModules.catppuccin ]; config.catppuccin.enable = true; diff --git a/packetmix/homes/coded/catppuccin.nix b/packetmix/homes/coded/catppuccin.nix index bb4febb7..e6fe4ff6 100644 --- a/packetmix/homes/coded/catppuccin.nix +++ b/packetmix/homes/coded/catppuccin.nix @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: MIT -{ project, ... }: { config.catppuccin = { flavor = "macchiato"; diff --git a/packetmix/homes/common/gtk.nix b/packetmix/homes/common/gtk.nix index f1bc799a..9aef67cb 100644 --- a/packetmix/homes/common/gtk.nix +++ b/packetmix/homes/common/gtk.nix @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: MIT -{ pkgs, ... }: { gtk.enable = true; } diff --git a/packetmix/homes/common/helix.nix b/packetmix/homes/common/helix.nix index f9aafa92..592030b4 100644 --- a/packetmix/homes/common/helix.nix +++ b/packetmix/homes/common/helix.nix @@ -4,7 +4,6 @@ { config, - pkgs, project, system, ... diff --git a/packetmix/homes/default.nix b/packetmix/homes/default.nix index 4aab8994..7ef74466 100644 --- a/packetmix/homes/default.nix +++ b/packetmix/homes/default.nix @@ -4,9 +4,6 @@ # SPDX-License-Identifier: MIT { config, ... }: -let - nixpkgs = config.inputs.nixpkgs.result; -in { config.homes."maya:x86_64-linux" = { modules = [ diff --git a/packetmix/homes/development/helix.nix b/packetmix/homes/development/helix.nix index d5db18ed..15e1e6ed 100644 --- a/packetmix/homes/development/helix.nix +++ b/packetmix/homes/development/helix.nix @@ -4,8 +4,6 @@ { pkgs, - project, - system, ... }: { diff --git a/packetmix/homes/development/tmux.nix b/packetmix/homes/development/tmux.nix index cdff44d0..5b7d09a0 100644 --- a/packetmix/homes/development/tmux.nix +++ b/packetmix/homes/development/tmux.nix @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: MIT -{ lib, ... }: { programs.tmux.enable = true; programs.fzf.tmux.enableShellIntegration = true; # Needed for using sesh - which relies on fzf+tmux diff --git a/packetmix/homes/espanso/espanso.nix b/packetmix/homes/espanso/espanso.nix index e97704eb..377efa05 100644 --- a/packetmix/homes/espanso/espanso.nix +++ b/packetmix/homes/espanso/espanso.nix @@ -3,7 +3,10 @@ # # SPDX-License-Identifier: MIT -{ config, lib, ... }: +{ + config, + ... +}: { home.file = { ".cache/espanso/kvs/has_completed_wizard" = { diff --git a/packetmix/homes/maya/niri.nix b/packetmix/homes/maya/niri.nix index c834bffe..1e031677 100644 --- a/packetmix/homes/maya/niri.nix +++ b/packetmix/homes/maya/niri.nix @@ -4,8 +4,6 @@ # SPDX-License-Identifier: MIT { - project, - config, pkgs, lib, ... diff --git a/packetmix/homes/minion/niri.nix b/packetmix/homes/minion/niri.nix index 6dba4ebc..4ad658f3 100644 --- a/packetmix/homes/minion/niri.nix +++ b/packetmix/homes/minion/niri.nix @@ -3,10 +3,7 @@ # SPDX-License-Identifier: MIT { - project, - config, pkgs, - lib, ... }: { diff --git a/packetmix/homes/niri/niri.nix b/packetmix/homes/niri/niri.nix index 1f363b75..9c328ad8 100644 --- a/packetmix/homes/niri/niri.nix +++ b/packetmix/homes/niri/niri.nix @@ -104,8 +104,6 @@ binds = let - inherit (config.lib.niri) actions; - mod = "Super"; mod1 = "Alt"; diff --git a/packetmix/modules/nilla-home/home.nix b/packetmix/modules/nilla-home/home.nix index 3ae61749..6a463073 100644 --- a/packetmix/modules/nilla-home/home.nix +++ b/packetmix/modules/nilla-home/home.nix @@ -4,7 +4,6 @@ { lib, config }: let - inherit (config) inputs; homes-type = import ./homes-type.nix { inherit lib config; }; in { diff --git a/packetmix/modules/nilla-home/nixos.nix b/packetmix/modules/nilla-home/nixos.nix index 9625c827..b472d610 100644 --- a/packetmix/modules/nilla-home/nixos.nix +++ b/packetmix/modules/nilla-home/nixos.nix @@ -30,7 +30,6 @@ in config.modules = let - system = submodule.config.pkgs.system; warn' = builtins.warn or builtins.trace; # builtins.warn doesn't exist on some versions of nix/lix warnIf = condition: message: value: @@ -52,7 +51,7 @@ in { home, homeName, - username, + ... }@identity: warnIf (home.home-manager != homeManager) "The home \"${homeName}\" isn't using the same home-manager input as the NixOS system \"${name}\". This may work, but is not officially supported by the Nilla Home or Nilla NixOS maintainers. Please fix this before reporting any bugs you may find." diff --git a/packetmix/nilla.nix b/packetmix/nilla.nix index d63068e7..f61e72fb 100644 --- a/packetmix/nilla.nix +++ b/packetmix/nilla.nix @@ -6,12 +6,6 @@ let pins = import ./npins; nilla = import pins.nilla; - - settings = { - nixpkgs.configuration.allowUnfree = true; - "nixos-24.11" = settings.nixpkgs; - nixos-unstable = settings.nixpkgs; - }; in nilla.create ( { config, lib }: diff --git a/packetmix/packages/bluesky-pds/default.nix b/packetmix/packages/bluesky-pds/default.nix index 3aa09217..1b858cc5 100644 --- a/packetmix/packages/bluesky-pds/default.nix +++ b/packetmix/packages/bluesky-pds/default.nix @@ -9,11 +9,9 @@ systems = [ "x86_64-linux" ]; package = { - system, stdenv, nodejs, pnpm_9, - lib, srcOnly, python3, ... @@ -83,7 +81,7 @@ system, ... }: - config.inputs.nixos-unstable.result.${system}.bluesky-pds.overrideAttrs (prevAttrs: { + config.inputs.nixos-unstable.result.${system}.bluesky-pds.overrideAttrs { postBuild = '' rm -r node_modules/.pnpm/@atproto+pds@0.4.169 mkdir -p node_modules/.pnpm/@atproto+pds@0.4.169 @@ -91,6 +89,6 @@ config.packages.bluesky-atproto-pds.result.${system} }/lib node_modules/.pnpm/@atproto+pds@0.4.169/node_modules ''; - }); + }; }; } diff --git a/packetmix/systems/common/fonts.nix b/packetmix/systems/common/fonts.nix index a5162605..2da2143b 100644 --- a/packetmix/systems/common/fonts.nix +++ b/packetmix/systems/common/fonts.nix @@ -2,7 +2,10 @@ # # SPDX-License-Identifier: MIT -{ pkgs, lib, ... }: +{ + pkgs, + ... +}: { fonts.packages = [ pkgs.cantarell-fonts diff --git a/packetmix/systems/common/inputs.nix b/packetmix/systems/common/inputs.nix index a5063f58..96f5efbc 100644 --- a/packetmix/systems/common/inputs.nix +++ b/packetmix/systems/common/inputs.nix @@ -4,7 +4,6 @@ { project, - pkgs, lib, ... }: diff --git a/packetmix/systems/default.nix b/packetmix/systems/default.nix index 50b7d5c4..d9607388 100644 --- a/packetmix/systems/default.nix +++ b/packetmix/systems/default.nix @@ -3,7 +3,10 @@ # # SPDX-License-Identifier: MIT -{ config, lib, ... }: +{ + config, + ... +}: let nixpkgs = config.inputs.nixpkgs.result; in diff --git a/packetmix/systems/emden/hardware-configuration.nix b/packetmix/systems/emden/hardware-configuration.nix index aedca11b..31d8dd0d 100644 --- a/packetmix/systems/emden/hardware-configuration.nix +++ b/packetmix/systems/emden/hardware-configuration.nix @@ -5,7 +5,6 @@ { config, lib, - pkgs, modulesPath, ... }: diff --git a/packetmix/systems/emden/steam.nix b/packetmix/systems/emden/steam.nix index e1127d73..166e3b4e 100644 --- a/packetmix/systems/emden/steam.nix +++ b/packetmix/systems/emden/steam.nix @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: MIT -{ lib, ... }: { programs.steam = { enable = true; diff --git a/packetmix/systems/espanso/nixpkgs-328890--espanso-capdacoverride.nix b/packetmix/systems/espanso/nixpkgs-328890--espanso-capdacoverride.nix index 2c19f920..79695f4d 100644 --- a/packetmix/systems/espanso/nixpkgs-328890--espanso-capdacoverride.nix +++ b/packetmix/systems/espanso/nixpkgs-328890--espanso-capdacoverride.nix @@ -42,7 +42,7 @@ in config = lib.mkIf cfg.enable { nixpkgs.overlays = [ - (final: prev: { + (_final: prev: { _espanso-wayland-orig = prev.espanso-wayland; espanso-wayland = pkgs.callPackage ./nixpkgs-328890--espanso-capdacoverride/espanso-capdacoverride.nix diff --git a/packetmix/systems/gaming/steam.nix b/packetmix/systems/gaming/steam.nix index e1127d73..166e3b4e 100644 --- a/packetmix/systems/gaming/steam.nix +++ b/packetmix/systems/gaming/steam.nix @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: MIT -{ lib, ... }: { programs.steam = { enable = true; diff --git a/packetmix/systems/marbled/hardware-configuration.nix b/packetmix/systems/marbled/hardware-configuration.nix index 60847408..f966c4e2 100644 --- a/packetmix/systems/marbled/hardware-configuration.nix +++ b/packetmix/systems/marbled/hardware-configuration.nix @@ -6,7 +6,6 @@ { config, lib, - pkgs, modulesPath, ... }: diff --git a/packetmix/systems/niri/niri.nix b/packetmix/systems/niri/niri.nix index c28cd415..39ffc7db 100644 --- a/packetmix/systems/niri/niri.nix +++ b/packetmix/systems/niri/niri.nix @@ -5,7 +5,6 @@ # # This file is based on some work from sodiboo's niri-flake, see https://github.com/sodiboo/niri-flake/blob/main/flake.nix { - project, pkgs, lib, ... diff --git a/packetmix/systems/personal/configuration.nix b/packetmix/systems/personal/configuration.nix index fac40d3c..e2fcceb9 100644 --- a/packetmix/systems/personal/configuration.nix +++ b/packetmix/systems/personal/configuration.nix @@ -8,7 +8,6 @@ { project, - config, system, pkgs, ... diff --git a/packetmix/systems/redhead/hardware-configuration.nix b/packetmix/systems/redhead/hardware-configuration.nix index e4f2358b..6b14c2eb 100644 --- a/packetmix/systems/redhead/hardware-configuration.nix +++ b/packetmix/systems/redhead/hardware-configuration.nix @@ -5,7 +5,6 @@ { config, lib, - pkgs, modulesPath, ... }: diff --git a/packetmix/systems/redhead/remoteBuilds.nix b/packetmix/systems/redhead/remoteBuilds.nix index 2edfe123..36554023 100644 --- a/packetmix/systems/redhead/remoteBuilds.nix +++ b/packetmix/systems/redhead/remoteBuilds.nix @@ -2,10 +2,6 @@ # # SPDX-License-Identifier: MIT -{ - lib, - ... -}: { nix = { distributedBuilds = true; diff --git a/packetmix/systems/teal/pds.nix b/packetmix/systems/teal/pds.nix index 88414da8..076f7011 100644 --- a/packetmix/systems/teal/pds.nix +++ b/packetmix/systems/teal/pds.nix @@ -4,7 +4,6 @@ { project, - pkgs, system, ... }: @@ -15,7 +14,7 @@ ]; nixpkgs.overlays = [ - (final: prev: { + (final: _prev: { bluesky-pdsadmin = final.pdsadmin; }) ]; diff --git a/packetmix/systems/teal/stalwart.nix b/packetmix/systems/teal/stalwart.nix index d140007a..9f22815d 100644 --- a/packetmix/systems/teal/stalwart.nix +++ b/packetmix/systems/teal/stalwart.nix @@ -5,7 +5,6 @@ { project, config, - pkgs, lib, ... }: diff --git a/packetmix/systems/teal/vaultwarden.nix b/packetmix/systems/teal/vaultwarden.nix index 9ba6eced..6c2ad23e 100644 --- a/packetmix/systems/teal/vaultwarden.nix +++ b/packetmix/systems/teal/vaultwarden.nix @@ -3,8 +3,6 @@ # SPDX-License-Identifier: MIT { - pkgs, - lib, config, ... }: -- 2.43.0 From 687de8ba2ab31d9b9f02ed4f51d4a3e369d6c981 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Thu, 25 Sep 2025 20:41:09 +0000 Subject: [PATCH] ci(treewide): add deadnix Change-Id: vmslusqkrqomnwukklmxvsupqtsuyyzy deadnix is a package to find unused nix code, we can add it to enforce that we don't leave let bindings/inputs/etc. around when they are not needed --- .tangled/workflows/deadnix.yml | 21 +++++++++++++++++++++ packetmix/nilla.nix | 1 + 2 files changed, 22 insertions(+) create mode 100644 .tangled/workflows/deadnix.yml diff --git a/.tangled/workflows/deadnix.yml b/.tangled/workflows/deadnix.yml new file mode 100644 index 00000000..d4f557b5 --- /dev/null +++ b/.tangled/workflows/deadnix.yml @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2025 FreshlyBakedCake +# +# SPDX-License-Identifier: MIT + +when: + - event: ["push", "pull_request"] + branch: ["main"] + +engine: nixery + +dependencies: + nixpkgs: + - ansifilter + - deadnix + +steps: + - name: Check for unused nix bindings + command: | + set -eo pipefail + + deadnix --exclude **/npins --no-underscore --fail | ansifilter diff --git a/packetmix/nilla.nix b/packetmix/nilla.nix index f61e72fb..ca134f81 100644 --- a/packetmix/nilla.nix +++ b/packetmix/nilla.nix @@ -128,6 +128,7 @@ nilla.create ( config.inputs.nilla-home.result.packages.nilla-home.result.${system} config.inputs.nilla-nixos.result.packages.nilla-nixos.result.${system} config.inputs.nixos-unstable.result.${system}.quickshell + config.inputs.nixpkgs.result.${system}.deadnix config.packages.nilla-fmt.result.${system} config.packages.treefmt.result.${system} (config.inputs.npins.result { inherit pkgs system; }) -- 2.43.0