This repository was archived by the owner on Sep 14, 2021. It is now read-only.
generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefault.nix
More file actions
74 lines (59 loc) · 1.65 KB
/
default.nix
File metadata and controls
74 lines (59 loc) · 1.65 KB
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
{ stdenv, fetchFromGitHub, bash, arcan}:
stdenv.mkDerivation rec {
pname = "durden";
version = "0.6.1";
src = fetchFromGitHub {
owner = "letoram";
repo = "durden";
rev = "${version}";
sha256 = "03ry8ypsvpjydb9s4c28y3iffz9375pfgwq9q9y68hmj4d89bjvz";
};
buildInputs = [
arcan
];
dontConfigure = true;
dontBuild = true;
patchPhase = ''
sed -i "s,/usr/share/,$out/share/,g" ./distr/durden
'';
# TODO: this is pretty ugly. propably there are nice nix tools for this stuff
# this relies on having arcan configured as suid binary so /run/wrappers/bin/arcan exists
installPhase = ''
mkdir -p $out/share/wayland-sessions
mkdir -p $out/bin
cp -r ./durden $out/share/
echo -e "\
#!${bash}/bin/bash
# check if XDG_RUNTIME_DIR needs to be set
if [[ -z "'"$XDG_RUNTIME_DIR"'" ]];
then
export XDG_RUNTIME_DIR=/run/user/"'$UID'"
mkdir -p "'$XDG_RUNTIME_DIR'"
chmod 700 "'$XDG_RUNTIME_DIR'"
fi
# check if we have a suid wrapper for arcan
if [[ -f "/run/wrappers/bin/arcan" ]];
then
exec /run/wrappers/bin/arcan $out/share/durden
else
${arcan}/bin/arcan $out/share/durden
fi
" > $out/bin/durden
chmod +x $out/bin/durden
echo -e "\
[Desktop Entry]
Name=durden
Comment=Next Generation Window Manager
Exec=$out/bin/durden
Type=Application
" > $out/share/wayland-sessions/durden.desktop
chmod +x $out/share/wayland-sessions/durden.desktop
'';
meta = with stdenv.lib; {
homepage = "https://durden.arcan-fe.com";
description = "Next Generation Desktop Environment";
platforms = platforms.linux;
maintainers = [ "chris@oboe.email" ];
};
passthru.providedSessions = [ "durden" ];
}