forked from HACKERCHANNEL/benzin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
70 lines (57 loc) · 1.69 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
{
description = "A Wii Channel banner creator and simulator";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
};
outputs = { self, nixpkgs }:
let
forAllSystems = function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
]
(system: function nixpkgs.legacyPackages.${system});
version =
if (self ? shortRev)
then self.shortRev
else "dev";
in
{
devShells = forAllSystems
(pkgs: {
default = pkgs.mkShell {
inputsFrom = [ self.packages.${pkgs.system}.default ];
shellHook = ''
echo 'Run `substituteInPlace Makefile --replace-fail gcc "$CC"` before building.'
'';
};
});
packages = forAllSystems
(pkgs: {
default = pkgs.stdenv.mkDerivation {
pname = "benzin";
inherit version;
src = pkgs.lib.cleanSource self;
nativeBuildInputs = [ pkgs.minixml ];
postPatch = ''
substituteInPlace Makefile --replace-fail gcc "$CC"
'';
installPhase = ''
runHook preInstall
install -Dm755 benzin $out/bin/benzin
runHook postInstall
'';
meta = {
description = "A Wii Channel banner creator and simulator";
homepage = "https://github.com/WiiDatabase/benzin";
license = pkgs.lib.licenses.unfree;
platforms = pkgs.lib.platforms.darwin ++ pkgs.lib.platforms.linux;
};
};
});
};
}