-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
86 lines (78 loc) · 2.27 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
77
78
79
80
81
82
83
84
85
86
{
description = "nixos-compose";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/24.05";
flake-utils.url = "github:numtide/flake-utils";
nix-editor.url = "github:snowfallorg/nix-editor";
nix-editor.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
flake-utils,
nix-editor,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
python3pkgs = pkgs.python3Packages;
pkgs-ne = nix-editor.packages.${system};
#customOverrides = self: super: {
# Overrides go here
#};
app = python3pkgs.buildPythonPackage rec {
pname = "nag";
version = "locale";
name = "${pname}-${version}";
src = builtins.filterSource (
path: type: type != "directory" || baseNameOf path != ".git" || path != "result"
) ./.;
format = "pyproject";
buildInputs = [ pkgs.poetry ];
propagatedBuildInputs =
with python3pkgs;
[
poetry-core
click
]
++ (with pkgs; [
nixfmt-rfc-style
nix-prefetch-git
])
++ [ pkgs-ne.default ];
};
packageName = "nag";
in
rec {
packages = {
${packageName} = app;
# "${packageName}-full" = app.overrideAttrs(attr: rec {
# propagatedBuildInputs = attr.propagatedBuildInputs ++ [
# pkgs.docker-compose
# pkgs.qemu_kvm
# pkgs.vde2
# ];
# });
};
defaultPackage = self.packages.${system}.${packageName};
devShells = {
default =
let
pythonEnv = with pkgs.python3Packages; [
pytest
click
pyparsing
];
in
pkgs.mkShell {
packages = with pkgs; [ pre-commit ] ++ pythonEnv;
buildInputs = [ self.packages.${system}.${packageName} ];
# inputsFrom = builtins.attrValues self.packages.${system};
inputsFrom = [ self.packages.${system}.${packageName} ];
};
};
}
);
}