This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
76 lines (73 loc) · 2.17 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
description = "Sequence hentai tag classifier";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-22.11";
devenv = {
url = "github:cachix/devenv";
inputs.nixpkgs.follows = "nixpkgs";
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, devenv, ... }@inputs: {
packages = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.unix (system:
let pkgs = import nixpkgs { inherit system; }; in {
default = pkgs.poetry2nix.mkPoetryApplication {
projectDir = self;
};
docker = pkgs.dockerTools.buildLayeredImage {
name = "python-template-project";
tag = "latest";
created = "now";
config = {
Entrypoint = [ "${self.packages.${system}.default.dependencyEnv}/bin/python" ];
Cmd = [ "-m" "python_template_project.app" ];
};
};
}
);
devShells = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.unix (system:
let pkgs = import nixpkgs { inherit system; }; in {
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
pre-commit.hooks = {
actionlint.enable = true;
markdownlint.enable = true;
shellcheck.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
deadnix.enable = true;
hadolint.enable = true;
};
packages = [
pkgs.nixpkgs-fmt
pkgs.docker
];
}
{
pre-commit.hooks = {
black.enable = true;
isort.enable = true;
};
packages = [
pkgs.poetry
(pkgs.python3.withPackages (ps: with ps; [
pip
isort
black
ipython
tokenize-rt
]))
];
}
];
};
}
);
};
}