2configs
games
machines
tools
···
1
1
-
{ config, pkgs, self, ... }:
1
1
+
{
2
2
+
config,
3
3
+
pkgs,
4
4
+
self,
5
5
+
...
6
6
+
}:
2
7
{
3
8
# v4l2loopback with two devices: raw camera and ASCII output
4
9
boot = {
···
1
1
{
2
2
-
self,
3
2
config,
4
3
lib,
5
4
pkgs,
···
80
80
listenPort = 51820;
81
81
privateKeyFile = config.clan.core.vars.generators.wiregrill.files."wiregrill.key".path;
82
82
allowedIPsAsRoutes = true;
83
83
-
peers = mapAttrsToList (_name: host: {
84
84
-
# inherit name;
85
85
-
allowedIPs =
86
86
-
if isRouter then
87
87
-
(optional (!isNull host.nets.wiregrill.ip4) host.nets.wiregrill.ip4.addr)
88
88
-
++ (optional (!isNull host.nets.wiregrill.ip6) host.nets.wiregrill.ip6.addr)
89
89
-
else
90
90
-
host.nets.wiregrill.wireguard.subnets;
91
91
-
endpoint = mkIf (!isNull host.nets.wiregrill.via) (
92
92
-
host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}"
93
93
-
);
94
94
-
persistentKeepalive = mkIf (!isNull host.nets.wiregrill.via) 61;
95
95
-
publicKey = (replaceStrings [ "\n" ] [ "" ] host.nets.wiregrill.wireguard.pubkey);
96
96
-
}) (filterAttrs (_: h:
97
97
-
hasAttr "wiregrill" h.nets
98
98
-
&& hasAttr "wireguard" h.nets.wiregrill
99
99
-
&& !isNull h.nets.wiregrill.wireguard
100
100
-
&& !isNull h.nets.wiregrill.wireguard.pubkey
101
101
-
) config.krebs.hosts);
83
83
+
peers =
84
84
+
mapAttrsToList
85
85
+
(_name: host: {
86
86
+
# inherit name;
87
87
+
allowedIPs =
88
88
+
if isRouter then
89
89
+
(optional (!isNull host.nets.wiregrill.ip4) host.nets.wiregrill.ip4.addr)
90
90
+
++ (optional (!isNull host.nets.wiregrill.ip6) host.nets.wiregrill.ip6.addr)
91
91
+
else
92
92
+
host.nets.wiregrill.wireguard.subnets;
93
93
+
endpoint = mkIf (!isNull host.nets.wiregrill.via) (
94
94
+
host.nets.wiregrill.via.ip4.addr + ":${toString host.nets.wiregrill.wireguard.port}"
95
95
+
);
96
96
+
persistentKeepalive = mkIf (!isNull host.nets.wiregrill.via) 61;
97
97
+
publicKey = (replaceStrings [ "\n" ] [ "" ] host.nets.wiregrill.wireguard.pubkey);
98
98
+
})
99
99
+
(
100
100
+
filterAttrs (
101
101
+
_: h:
102
102
+
hasAttr "wiregrill" h.nets
103
103
+
&& hasAttr "wireguard" h.nets.wiregrill
104
104
+
&& !isNull h.nets.wiregrill.wireguard
105
105
+
&& !isNull h.nets.wiregrill.wireguard.pubkey
106
106
+
) config.krebs.hosts
107
107
+
);
102
108
};
103
109
}
···
1
1
{
2
2
-
inputs,
3
2
lib,
4
4
-
self,
5
3
...
6
4
}:
7
5
{
···
9
7
{ pkgs, ... }:
10
8
let
11
9
gameDirs = builtins.filter (name: name != "lib") (
12
12
-
builtins.attrNames (
13
13
-
lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./.)
14
14
-
)
10
10
+
builtins.attrNames (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./.))
15
11
);
16
12
17
17
-
buildGame = name:
13
13
+
buildGame =
14
14
+
name:
18
15
let
19
16
result = builtins.tryEval (pkgs.callPackage ./${name} { });
20
17
in
21
18
if result.success then result.value else null;
22
19
23
23
-
games = lib.filterAttrs (_: v: v != null) (
24
24
-
lib.genAttrs gameDirs buildGame
25
25
-
);
20
20
+
games = lib.filterAttrs (_: v: v != null) (lib.genAttrs gameDirs buildGame);
26
21
in
27
22
{
28
23
# Expose via legacyPackages so `nix run .#games.haunted-ps1-demo-disc-2021` works
···
1
1
-
{ lib, pkgs, ... }:
1
1
+
{ lib, ... }:
2
2
3
3
with lib;
4
4
···
70
70
'';
71
71
72
72
installPhase = ''
73
73
-
runHook preInstall
73
73
+
runHook preInstall
74
74
75
75
-
# Install all game files
76
76
-
mkdir -p "$out/share/${pname}"
77
77
-
cp -r * "$out/share/${pname}/"
75
75
+
# Install all game files
76
76
+
mkdir -p "$out/share/${pname}"
77
77
+
cp -r * "$out/share/${pname}/"
78
78
79
79
-
# Create wrapper script using umu-run (Proton launcher)
80
80
-
mkdir -p "$out/bin"
81
81
-
cat > "$out/bin/${pname}" <<WRAPPER
82
82
-
#!/bin/sh
83
83
-
export WINEPREFIX="\''${WINEPREFIX:-\$HOME/.local/share/${pname}/prefix}"
84
84
-
export GAMEID="${pname}"
85
85
-
export PROTONPATH="GE-Proton"
86
86
-
exec ${umu-launcher}/bin/umu-run "\$out/share/${pname}/${exeName}" "\$@"
87
87
-
WRAPPER
88
88
-
substituteInPlace "$out/bin/${pname}" --replace-fail '$out' "$out"
89
89
-
chmod +x "$out/bin/${pname}"
79
79
+
# Create wrapper script using umu-run (Proton launcher)
80
80
+
mkdir -p "$out/bin"
81
81
+
cat > "$out/bin/${pname}" <<WRAPPER
82
82
+
#!/bin/sh
83
83
+
export WINEPREFIX="\''${WINEPREFIX:-\$HOME/.local/share/${pname}/prefix}"
84
84
+
export GAMEID="${pname}"
85
85
+
export PROTONPATH="GE-Proton"
86
86
+
exec ${umu-launcher}/bin/umu-run "\$out/share/${pname}/${exeName}" "\$@"
87
87
+
WRAPPER
88
88
+
substituteInPlace "$out/bin/${pname}" --replace-fail '$out' "$out"
89
89
+
chmod +x "$out/bin/${pname}"
90
90
91
91
-
runHook postInstall
91
91
+
runHook postInstall
92
92
'';
93
93
94
94
meta = {
···
1
1
{
2
2
config,
3
3
-
lib,
4
3
pkgs,
5
4
...
6
5
}:
···
25
25
pkgs.rbw
26
26
# retroarch with patched dolphin core (fixes shader compiler thread issue)
27
27
(pkgs.retroarch.withCores (
28
28
-
cores:
28
28
+
_cores:
29
29
builtins.filter (c: c.pname or "" != "libretro-dolphin") pkgs.retroarch-free.cores
30
30
++ [ self.packages.${pkgs.system}.libretro-dolphin ]
31
31
))
···
13
13
ffmpeg-placebo
14
14
pkgs.gnused
15
15
];
16
16
-
text = builtins.replaceStrings
17
17
-
[ "@shaderPath@" ]
18
18
-
[ "${./ascii.hook}" ]
19
19
-
(builtins.readFile ./android-webcam.sh);
16
16
+
text = builtins.replaceStrings [ "@shaderPath@" ] [ "${./ascii.hook}" ] (
17
17
+
builtins.readFile ./android-webcam.sh
18
18
+
);
20
19
};
21
20
};
22
21
}
···
1
1
{
2
2
perSystem =
3
3
-
{ pkgs, lib, ... }:
3
3
+
{ pkgs, ... }:
4
4
let
5
5
tridactylrc = ./tridactylrc;
6
6