-
Notifications
You must be signed in to change notification settings - Fork 44
/
default.nix
108 lines (94 loc) · 2.29 KB
/
default.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
{ lib
, stdenv
, callPackage
, resholve
, bash
, coreutils
, e2fsprogs
, exfatprogs
, f3
, findutils
, gawk
, gnugrep
, gnused
, jq
, parted
, procps
, systemd
, util-linux
}:
let
src = callPackage ./src.nix { };
solution = {
scripts = [ "bin/*" "lib/hwsupport/*.sh" ];
interpreter = "${bash}/bin/bash";
inputs = [
coreutils
e2fsprogs
exfatprogs
f3
findutils
gawk
gnugrep
gnused
jq
parted
procps
systemd
util-linux
"${placeholder "out"}/lib/hwsupport"
];
execer = [
"cannot:${e2fsprogs}/bin/fsck.ext4"
"cannot:${e2fsprogs}/bin/mkfs.ext4"
"cannot:${procps}/bin/pgrep"
"cannot:${systemd}/bin/systemctl"
"cannot:${systemd}/bin/udevadm"
"cannot:${util-linux}/bin/flock"
"cannot:${util-linux}/bin/setpriv"
"cannot:${placeholder "out"}/lib/hwsupport/format-device.sh"
"cannot:${placeholder "out"}/lib/hwsupport/steamos-automount.sh"
];
fake = {
# we're using wrappers for these
external = [ "umount" ];
};
fix = {
"/usr/lib/hwsupport/format-device.sh" = true;
"/usr/lib/hwsupport/steamos-automount.sh" = true;
};
keep = {
# pre-applied via patch
# FIXME: why do we need to discard string context here?
"${builtins.unsafeDiscardStringContext "${systemd}/bin/systemd-run"}" = true;
"source:${placeholder "out"}/lib/hwsupport/common-functions" = true;
};
};
in
stdenv.mkDerivation {
pname = "jupiter-hw-support";
inherit src;
inherit (src) version;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp usr/bin/jupiter-check-support $out/bin
mkdir -p $out/lib
cp -r usr/lib/hwsupport $out/lib
substituteInPlace $out/lib/hwsupport/* \
--replace-warn ". /usr/lib/hwsupport" ". $out/lib/hwsupport"
${resholve.phraseSolution "jupiter-hw-support" solution}
runHook postInstall
'';
meta = with lib; {
description = ''
Steam Deck (Jupiter) hardware support package
This package only contains the utility scripts as well as UCM files.
For the themes as well as unfree firmware, see the `steamdeck-theme`
and `steamdeck-firmware` packages.
'';
license = licenses.mit;
};
}