From 87c1561b470181a7842b22f6b808cc62719097f3 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 11 Aug 2021 18:17:34 -0500 Subject: [PATCH 1/2] Create a minimal shell derivation for the check-fmt script --- check-fmt | 2 +- check-fmt.nix | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 check-fmt.nix diff --git a/check-fmt b/check-fmt index e3a5587..1fe212b 100755 --- a/check-fmt +++ b/check-fmt @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell ./shell.nix -i bash +#!nix-shell ./check-fmt.nix -i bash # # Just because the nixpkgs-fmt error message is not super readable. Used by # CI. diff --git a/check-fmt.nix b/check-fmt.nix new file mode 100644 index 0000000..ab5f223 --- /dev/null +++ b/check-fmt.nix @@ -0,0 +1,7 @@ +let + sources = import ./nix/sources.nix; + pkgs = import sources.nixpkgs { }; +in +pkgs.mkShell { + nativeBuildInputs = [ pkgs.nixpkgs-fmt ]; +} From cbb6ea499535e146da90eaa0167a1d53fc227198 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 11 Aug 2021 18:41:31 -0500 Subject: [PATCH 2/2] Expose projectDir/pyproject/poetrylock parameters in the Poetry derivation This simplifies overriding Poetry with a different version. Related issue: https://github.com/nix-community/poetry2nix/issues/345 --- pkgs/poetry/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/poetry/default.nix b/pkgs/poetry/default.nix index 70470ba..8e52d73 100644 --- a/pkgs/poetry/default.nix +++ b/pkgs/poetry/default.nix @@ -1,11 +1,18 @@ -{ lib, poetry2nix, python, fetchFromGitHub }: +{ lib +, poetry2nix +, python +, fetchFromGitHub +, projectDir ? ./. +, pyproject ? projectDir + "/pyproject.toml" +, poetrylock ? projectDir + "/poetry.lock" +}: poetry2nix.mkPoetryApplication { inherit python; - projectDir = ./.; + inherit projectDir pyproject poetrylock; # Don't include poetry in inputs __isBootstrap = true;