-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathnix-alien.nix
More file actions
53 lines (46 loc) · 1.28 KB
/
nix-alien.nix
File metadata and controls
53 lines (46 loc) · 1.28 KB
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
{
lib,
fzf,
nix-index,
nix-index-database-src,
nixpkgs-src,
python3,
version,
}:
let
deps = (lib.importTOML ./src/pyproject.toml).project.dependencies;
in
python3.pkgs.buildPythonApplication {
inherit version;
pname = "nix-alien";
format = "pyproject";
src = ./src;
nativeBuildInputs = [ fzf ];
propagatedBuildInputs =
with python3.pkgs;
[
nix-index
setuptools
]
++ (lib.attrVals deps python3.pkgs);
preBuild = ''
substituteInPlace nix_alien/_version.py \
--subst-var-by version ${version} \
--subst-var-by nixIndexDatabaseRev ${nix-index-database-src.rev or "unknown"} \
--subst-var-by nixpkgsRev ${nixpkgs-src.rev or "unknown"}
substituteInPlace {nix_alien,tests}/*.{py,nix} \
--subst-var-by nixpkgsLastModifiedDate ${nixpkgs-src.lastModifiedDate or "unknown"} \
--subst-var-by nixpkgsRev ${nixpkgs-src.rev or "nixpkgs-unstable"} \
--subst-var-by nixpkgsHash ${nixpkgs-src.narHash or ""}
'';
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];
meta = with lib; {
description = "Run unpatched binaries on Nix/NixOS";
homepage = "https://github.com/thiagokokada/nix-alien";
license = licenses.mit;
mainProgram = "nix-alien";
platforms = platforms.linux;
};
}