aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/flake8-isort.nix11
-rw-r--r--nix/mypython.nix13
-rw-r--r--nix/vale.nix20
3 files changed, 44 insertions, 0 deletions
diff --git a/nix/flake8-isort.nix b/nix/flake8-isort.nix
new file mode 100644
index 0000000..385e4f7
--- /dev/null
+++ b/nix/flake8-isort.nix
@@ -0,0 +1,11 @@
+{ buildPythonPackage, fetchPypi, python3Packages }:
+
+buildPythonPackage rec {
+ pname = "flake8-isort";
+ version = "4.1.1";
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "2BQwSrcObliFm8XD4iHi5ucclY5wBSOSAv7hnCT4Jxc=";
+ };
+ checkInputs = with python3Packages; [ flake8 isort pytest testfixtures ];
+}
diff --git a/nix/mypython.nix b/nix/mypython.nix
new file mode 100644
index 0000000..aa262d4
--- /dev/null
+++ b/nix/mypython.nix
@@ -0,0 +1,13 @@
+{ python3, flake8-isort }:
+
+let
+ my-python-packages = python-packages: with python-packages; [
+ jedi-language-server
+ flake8
+ flake8-isort
+ isort
+ black
+ ];
+ mypython = python3.withPackages my-python-packages;
+in
+mypython
diff --git a/nix/vale.nix b/nix/vale.nix
new file mode 100644
index 0000000..396f0b7
--- /dev/null
+++ b/nix/vale.nix
@@ -0,0 +1,20 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+ pname = "vale";
+ version = "2.17.0";
+ subPackages = [ "cmd/vale" ];
+ outputs = [ "out" "data" ];
+ src = fetchFromGitHub {
+ owner = "errata-ai";
+ repo = "vale";
+ rev = "v${version}";
+ sha256 = "sha256-PUaIx6rEaLz0HUxkglsVHw0Kx/ovI2f4Yhknuysr5Gs=";
+ };
+ vendorSha256 = "sha256-zdgLWEArmtHTDM844LoSJwKp0UGoAR8bHnFOSlrrjdg=";
+ postInstall = ''
+ mkdir -p $data/share/vale
+ cp -r styles $data/share/vale
+ '';
+ ldflags = [ "-s" "-w" "-X main.version=${version}" ];
+}