diff --git a/flake-parts/formatting.nix b/flake-parts/formatting.nix index 7d2e6b9..15cbff2 100644 --- a/flake-parts/formatting.nix +++ b/flake-parts/formatting.nix @@ -9,8 +9,21 @@ treefmt.projectRootFile = "flake.nix"; treefmt.flakeCheck = true; treefmt.flakeFormatter = true; - treefmt.programs.nixpkgs-fmt.enable = true; treefmt.programs.shellcheck.enable = true; + treefmt.settings.formatter.nix = { + command = "sh"; + options = [ + "-eucx" + '' + # First deadnix + ${lib.getExe pkgs.deadnix} --edit "$@" + # Then nixpkgs-fmt + ${lib.getExe pkgs.nixpkgs-fmt} "$@" + '' + "--" # this argument is ignored by bash + ]; + includes = [ "*.nix" ]; + }; treefmt.settings.formatter.python = { command = "sh"; options = [ diff --git a/flake-parts/pre-commit.nix b/flake-parts/pre-commit.nix index d44afc8..fd579e9 100644 --- a/flake-parts/pre-commit.nix +++ b/flake-parts/pre-commit.nix @@ -1,4 +1,4 @@ -{ self, ... }: { +{ ... }: { pre-commit.settings.hooks.alejandra.enable = true; pre-commit.settings.hooks.shellcheck.enable = true; } diff --git a/flake.nix b/flake.nix index 1a18e4b..be2d983 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,6 @@ outputs = inputs @ { flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ lib , config - , self , ... }: { systems = lib.systems.flakeExposed; diff --git a/installer.nix b/installer.nix index 8da5d50..2daef89 100644 --- a/installer.nix +++ b/installer.nix @@ -1,5 +1,4 @@ -{ config -, lib +{ lib , pkgs , ... }: { diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index 9c9cd19..74e88d5 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -51,7 +51,7 @@ let ''; }; - checkPython = python3.withPackages (ps: devDependencies ++ dependencies); + checkPython = python3.withPackages (_ps: devDependencies ++ dependencies); check = runCommand "${name}-check" { } '' cp -r ${src} ./src diff --git a/pkgs/clan-cli/shell.nix b/pkgs/clan-cli/shell.nix index 9df8cbe..79cb983 100644 --- a/pkgs/clan-cli/shell.nix +++ b/pkgs/clan-cli/shell.nix @@ -1,5 +1,4 @@ { pkgs ? import { } -, system ? builtins.currentSystem , }: let diff --git a/templates/python-project/default.nix b/templates/python-project/default.nix index 30dae1b..18fa4c6 100644 --- a/templates/python-project/default.nix +++ b/templates/python-project/default.nix @@ -42,7 +42,7 @@ let passthru.devDependencies = devDependencies; }; - checkPython = python3.withPackages (ps: devDependencies ++ dependencies); + checkPython = python3.withPackages (_ps: devDependencies ++ dependencies); check = runCommand "${name}-check" { } '' cp -r ${src} ./src diff --git a/templates/python-project/flake-module.nix b/templates/python-project/flake-module.nix index 74218c6..cfd5c55 100644 --- a/templates/python-project/flake-module.nix +++ b/templates/python-project/flake-module.nix @@ -1,8 +1,6 @@ { perSystem = { pkgs, ... }: let - pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml); - name = pyproject.project.name; package = pkgs.callPackage ./default.nix { }; in { diff --git a/templates/python-project/shell.nix b/templates/python-project/shell.nix index 2b7b074..861fe5e 100644 --- a/templates/python-project/shell.nix +++ b/templates/python-project/shell.nix @@ -1,5 +1,4 @@ { pkgs ? import { } -, system ? builtins.currentSystem , }: let