diff --git a/.github/workflows/pr-merged.yml b/.github/workflows/pr-merged.yml index 82bae9aa4d..c86b4d3fb4 100644 --- a/.github/workflows/pr-merged.yml +++ b/.github/workflows/pr-merged.yml @@ -79,7 +79,6 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v31 with: - nix_path: nixpkgs=channel:nixpkgs-unstable extra_nix_config: | accept-flake-config = true @@ -124,7 +123,7 @@ jobs: head: ${{ github.event.pull_request.head.sha }} run: | out=$(mktemp) - ./flake/dev/diff-plugins.py --compact "$base" "$head" > "$out" + nix run .#diff-plugins --compact "$base" "$head" > "$out" { echo -n 'json=' jq -c . < "$out" @@ -138,7 +137,7 @@ jobs: head: ${{ github.event.pull_request.merge_commit_sha }} run: | out=$(mktemp) - ./flake/dev/diff-plugins.py --compact "$base" "$head" > "$out" + nix run .#diff-plugins --compact "$base" "$head" > "$out" { echo -n 'json=' jq -c . < "$out" diff --git a/flake/default.nix b/flake/default.nix index 36875c316d..fad3505009 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -51,6 +51,7 @@ packages = lib.optionalAttrs (partitionStack == [ ]) { # Propagate `packages` from the `dev` partition: inherit (config.partitions.dev.module.flake.packages.${system}) + diff-plugins list-plugins ; }; diff --git a/flake/dev/default.nix b/flake/dev/default.nix index a2fa309ee0..86652ff1cc 100644 --- a/flake/dev/default.nix +++ b/flake/dev/default.nix @@ -2,6 +2,7 @@ { imports = [ ./devshell.nix + ./diff-plugins ./list-plugins ./package-tests.nix ./template-tests.nix diff --git a/flake/dev/devshell.nix b/flake/dev/devshell.nix index 1eab420c43..a68c85957c 100644 --- a/flake/dev/devshell.nix +++ b/flake/dev/devshell.nix @@ -115,11 +115,6 @@ command = ''${./new-plugin.py} "$@"''; help = "Create a new plugin"; } - { - name = "diff-plugins"; - command = ''${./diff-plugins.py} "$@"''; - help = "Compare available plugins with another nixvim commit"; - } ]; }; }; diff --git a/flake/dev/diff-plugins/default.nix b/flake/dev/diff-plugins/default.nix new file mode 100644 index 0000000000..d7002ed5fd --- /dev/null +++ b/flake/dev/diff-plugins/default.nix @@ -0,0 +1,30 @@ +{ + perSystem = + { + lib, + pkgs, + ... + }: + let + package = pkgs.writers.writePython3Bin "diff-plugins" { + # Disable flake8 checks that are incompatible with the ruff ones + flakeIgnore = [ + # Thinks shebang is a block comment + "E265" + # line too long + "E501" + ]; + } (builtins.readFile ./diff-plugins.py); + in + { + packages.diff-plugins = package; + + devshells.default.commands = [ + { + name = "diff-plugins"; + command = ''${lib.getExe package} "$@"''; + help = "Compare available plugins with another nixvim commit"; + } + ]; + }; +} diff --git a/flake/dev/diff-plugins.py b/flake/dev/diff-plugins/diff-plugins.py similarity index 100% rename from flake/dev/diff-plugins.py rename to flake/dev/diff-plugins/diff-plugins.py