From 276b68bade14a749d530a949fc94613754a57ca8 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 21 Jul 2023 13:24:29 +1200 Subject: [PATCH] Apply statix/deadnix --- dev/treefmt.nix | 6 ++++++ flake.nix | 1 - shell.nix | 2 +- tests/assets/flake.nix | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dev/treefmt.nix b/dev/treefmt.nix index 6fb3b1a..2372dff 100644 --- a/dev/treefmt.nix +++ b/dev/treefmt.nix @@ -16,6 +16,12 @@ options = [ "-eucx" '' + ${pkgs.lib.getExe pkgs.deadnix} --edit "$@" + + for i in "$@"; do + ${pkgs.lib.getExe pkgs.statix} fix "$i" + done + ${pkgs.lib.getExe pkgs.nixpkgs-fmt} "$@" '' "--" diff --git a/flake.nix b/flake.nix index fadf545..1acfcaf 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,6 @@ imports = [ inputs.treefmt-nix.flakeModule ]; perSystem = { pkgs, self', ... }: let - devShell = self'.devShells.default; drvArgs = { srcDir = self; nix = if nixVersion == "unstable" then pkgs.nixUnstable else pkgs.nixVersions."nix_${nixVersion}"; diff --git a/shell.nix b/shell.nix index c24738f..a94d881 100644 --- a/shell.nix +++ b/shell.nix @@ -2,7 +2,7 @@ let inherit (builtins) fromJSON readFile; flakeLock = fromJSON (readFile ./flake.lock); - locked = flakeLock.nodes.nixpkgs.locked; + inherit (flakeLock.nodes.nixpkgs) locked; nixpkgs = assert locked.type == "github"; builtins.fetchTarball { url = "https://github.com/${locked.owner}/${locked.repo}/archive/${locked.rev}.tar.gz"; sha256 = locked.narHash; diff --git a/tests/assets/flake.nix b/tests/assets/flake.nix index bedd225..aa28425 100644 --- a/tests/assets/flake.nix +++ b/tests/assets/flake.nix @@ -1,7 +1,7 @@ { inputs.nixpkgs.url = "github:NixOS/nixpkgs"; - outputs = { self, nixpkgs }: + outputs = { nixpkgs, ... }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; in