-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
53 lines (47 loc) · 1.24 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
{
description = "pkiviewer a cedrtificate viewer for your terminal";
inputs.pyproject-nix.url = "github:nix-community/pyproject.nix";
inputs.pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
nixConfig = {
bash-prompt = ''\n\[\033[1;34m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] '';
};
outputs = {
nixpkgs,
pyproject-nix,
...
}: let
inherit (nixpkgs) lib;
project = pyproject-nix.lib.project.loadPyproject {
projectRoot = ./.;
};
forAllSystems = function:
nixpkgs.lib.genAttrs [
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
] (system: function nixpkgs.legacyPackages.${system});
in {
devShells = forAllSystems (pkgs: (
let
python = pkgs.python3;
arg = project.renderers.withPackages {inherit python;};
pythonEnv = python.withPackages arg;
in {
default = pkgs.mkShell {
packages = [
pkgs.pdm
pythonEnv
];
};
}
));
packages = forAllSystems (pkgs: (
let
python = pkgs.python3;
attrs = project.renderers.buildPythonPackage {inherit python;};
in {
default = python.pkgs.buildPythonPackage attrs;
}
));
};
}