-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathdefault.nix
More file actions
35 lines (29 loc) · 791 Bytes
/
default.nix
File metadata and controls
35 lines (29 loc) · 791 Bytes
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
{ pkgs ? import <nixpkgs> { }, lib ? pkgs.lib }:
pkgs.stdenvNoCC.mkDerivation {
pname = "nix-gl-host";
version = "0.1";
# TODO: filter that out
src = lib.cleanSource ./.;
nativeBuildInputs = [
pkgs.nixpkgs-fmt
pkgs.python3
pkgs.python3Packages.black
pkgs.nixpkgs-fmt
];
postFixup = ''
substituteInPlace $out/bin/nixglhost \
--replace "@patchelf-bin@" "${pkgs.patchelf}/bin/patchelf" \
--replace "IN_NIX_STORE = False" "IN_NIX_STORE = True"
patchShebangs $out/bin/nixglhost
'';
doCheck = true;
checkPhase = ''
black --check src/*.py
nixpkgs-fmt --check *.nix
python src/nixglhost_test.py
'';
installPhase = ''
install -D -m0755 src/nixglhost.py $out/bin/nixglhost
'';
meta.mainProgram = "nixglhost";
}