-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
103 lines (80 loc) · 2.79 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This file allows building and running the software with the Nix package
# manager, used in NixOS or on another distribution.
{
description = "a toolset to manage and build `pk3` or `dpk` source directories";
inputs = {
nixpkgs.url = "flake:nixpkgs";
crunch.url = "github:DaemonEngine/crunch";
crunch.inputs.nixpkgs.follows = "nixpkgs";
netradiant.url = "gitlab:xonotic/netradiant";
netradiant.inputs.nixpkgs.follows = "nixpkgs";
sloth.url = "github:Unvanquished/Sloth";
sloth.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, crunch, netradiant, sloth }:
let
lib = nixpkgs.legacyPackages.x86_64-linux.lib;
in {
packages = lib.mapAttrs (system: pkgs: {
iqmtool =
pkgs.stdenv.mkDerivation {
name = "iqmtool";
src = pkgs.fetchsvn {
url = "http://svn.code.sf.net/p/fteqw/code/trunk/iqm/";
rev = 6258;
sha256 = "sha256-ddRG4waOSDNfw0OlAnQAFRfdF4caXVefVZWXAvUaszQ=";
};
buildInputs = with pkgs; [
gcc gnumake
];
installPhase = ''
if [ -f iqmtool ]; then
install -Dm0755 iqmtool -T $out/bin/iqmtool
else
install -Dm0755 iqm -T $out/bin/iqmtool
fi
'';
};
urcheon = pkgs.python3.pkgs.buildPythonPackage {
name = "urcheon";
src = pkgs.lib.cleanSource ./.;
format = "other";
buildInputs = [
(pkgs.python3.withPackages
(ps: [ ps.colorama ps.psutil ps.toml ps.pillow ]))
];
propagatedBuildInputs = with pkgs; [
netradiant.packages."${system}".quake-tools
crunch.defaultPackage."${system}"
sloth.defaultPackage."${system}"
opusTools
libwebp
];
installPhase = ''
runHook preInstall
mkdir $out/
cp -ra bin/ profile/ Urcheon/ $out/
runHook postInstall
'';
};
crunch = crunch.defaultPackage."${system}";
sloth = sloth.defaultPackage."${system}";
} // netradiant.packages."${system}") nixpkgs.legacyPackages;
apps = lib.mapAttrs (system: pkgs: {
iqmtool = {
type = "app";
program = "${self.packages."${system}".iqmtool}/bin/iqmtool";
};
urcheon = {
type = "app";
program = "${self.packages."${system}".urcheon}/bin/urcheon";
};
esquirel = {
type = "app";
program = "${self.packages."${system}".urcheon}/bin/esquirel";
};
crunch = crunch.defaultApp."${system}";
sloth = sloth.defaultApp."${system}";
}) nixpkgs.legacyPackages;
};
}