-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
47 lines (46 loc) · 1.46 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
{
description = "Nix Flake package for smount";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
pkgName = "smount";
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
pp = pkgs.python3Packages;
in
{
${pkgName} = pp.buildPythonApplication rec {
pname = pkgName;
src = ./.;
propagatedBuildInputs = [ pp.pyyaml ];
nativeCheckInputs = [ pp.pyfakefs ];
version = "0.8";
doCheck = false; # To be fixed
prePatch = ''
substituteInPlace setup.py \
--replace "pyyml" "pyyaml"
'';
};
}
);
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
pp = pkgs.python3Packages;
in
{
default = pkgs.mkShell {
buildInputs = with pp; [ pkgs.python3 pyyaml pyfakefs pytest pylint ipython ];
};
}
);
defaultPackage = forAllSystems (system: self.packages.${system}.${pkgName});
};
}