-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
108 lines (87 loc) · 3.19 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
104
105
106
107
108
{
description = "Prologin 2024 Final Game";
inputs = {
stechec2.url =
"git+https://gitlab.com/prologin/tech/tools/stechec2.git?ref=nix-stechec";
futils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixgl.url = "github:guibou/nixGL";
};
outputs = { self, stechec2, nixpkgs, futils, nixgl }:
let
inherit (nixpkgs) lib;
inherit (lib) recursiveUpdate;
inherit (futils.lib) eachDefaultSystem;
anySystemOutputs = {
overlay = final: prev: rec {
prologin2024 = final.mkStechec2Game {
name = "prologin2024";
game = ./.;
version = "1.0";
};
prologin2024-gui-linux = final.callPackage ./gui/linux.nix { };
html-export-templates = final.callPackage ./gui/html-templates.nix { };
prologin2024-gui-html = final.callPackage ./gui/html.nix { html-export-templates = final.html-export-templates; };
prologin2024-gui-spectator = final.stdenv.mkDerivation {
name = "prologin2024-gui-spectator";
src = ./gui/igui;
buildInputs = [
final.stechec2
final.python3
];
buildPhase = ''
mkdir -p $out/
${final.stechec2}/bin/stechec2-generator player ${prologin2024-yml-docs}/prologin2024.yml spectator
cp $src/spectator.py spectator/python/Champion.py
make -C spectator/python/
mv spectator/python/champion.so spectator/python/gui.so
'';
installPhase = ''
cp -R spectator/python $out/lib
'';
};
prologin2024-yml-docs = final.stdenvNoCC.mkDerivation {
name = "prologin2024-yml-docs";
src = ./.;
installPhase = ''
mkdir $out
cp -r $src/docs/** $out
cp $src/prologin2024.yml $out
'';
};
prologin2024-docs = final.stdenv.mkDerivation {
name = "prologin2024-docs";
src = prologin2024-yml-docs;
buildInputs = [
final.python3Packages.sphinx
final.stechec2
final.python3Packages.sphinx-book-theme
];
configurePhase = ''
'';
buildPhase = ''
${final.stechec2}/bin/stechec2-generator sphinxdoc $src/prologin2024.yml .
cp -r $src/ .
sphinx-build . $out
'';
};
};
};
multipleSystemsOutpus = eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ stechec2.overlay self.overlay nixgl.overlay ];
};
in
rec {
packages = { inherit (pkgs) prologin2024 prologin2024-gui-linux prologin2024-gui-html prologin2024-docs prologin2024-gui-spectator; };
defaultPackage = self.packages.${system}.prologin2024;
devShell = pkgs.mkShell {
buildInputs =
[ pkgs.stechec2 pkgs.godot3 pkgs.nixgl.nixGLIntel ];
};
});
in
recursiveUpdate anySystemOutputs multipleSystemsOutpus;
}