-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
46 lines (41 loc) · 1.23 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
description = "pre-commit in docker";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit = {
url = "github:slimslenderslacks/pre-commit";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, devshell, pre-commit }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [
devshell.overlays.default
(self: super: {
pre-commit = pre-commit.packages."${system}";
})
];
pkgs = import nixpkgs {
inherit system overlays;
};
in
rec {
packages.default = pkgs.pre-commit.default;
devShells.default = pkgs.mkShell {
name = "python";
nativeBuildInputs = with pkgs;
let
devpython = pkgs.python39.withPackages
(packages: with packages; [ virtualenv pip setuptools wheel requests python-dotenv pathspec tiktoken pytest ]);
in
[ devpython ];
};
});
}