forked from malbiruk/driftwm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
106 lines (92 loc) · 2.82 KB
/
flake.nix
File metadata and controls
106 lines (92 loc) · 2.82 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
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
{
description = "driftwm — a trackpad-first infinite canvas Wayland compositor";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
wayland
wayland-protocols
seatd # libseat
libdisplay-info
libinput
libgbm
libxkbcommon
libdrm
systemd # libudev
libglvnd
libx11
libxcursor
libxrandr
libxi
libxcb
pixman
];
runtimeLibs = with pkgs; [
wayland
seatd
libdisplay-info
libinput
libgbm
libxkbcommon
libdrm
systemd
libglvnd
libx11
libxcursor
libxrandr
libxi
libxcb
pixman
];
in
{
packages.${system}.default = pkgs.rustPlatform.buildRustPackage rec {
pname = "driftwm";
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = path: type:
let baseName = builtins.baseNameOf path;
in baseName != "target" && baseName != ".git" && baseName != ".direnv";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"smithay-drm-extras-0.1.0" = "sha256-k3x4jRv20c2/TCgURomWgR/5oGpNOnUqnvyO+zovfvQ=";
};
};
inherit nativeBuildInputs buildInputs;
# Make sure the binary can find shared libraries at runtime
postFixup = ''
patchelf --add-rpath "${pkgs.lib.makeLibraryPath runtimeLibs}" $out/bin/driftwm
'';
postInstall = ''
install -Dm755 resources/driftwm-session $out/bin/driftwm-session
install -Dm644 resources/driftwm.desktop $out/share/wayland-sessions/driftwm.desktop
install -Dm644 resources/driftwm-portals.conf $out/share/xdg-desktop-portal/driftwm-portals.conf
install -Dm644 config.example.toml $out/etc/driftwm/config.toml
for f in extras/wallpapers/*.glsl; do
install -Dm644 "$f" "$out/share/driftwm/wallpapers/$(basename "$f")"
done
'';
passthru.providedSessions = [ "driftwm" ];
meta = with pkgs.lib; {
description = "A trackpad-first infinite canvas Wayland compositor";
license = licenses.gpl3Plus;
platforms = [ "x86_64-linux" ];
mainProgram = "driftwm";
};
};
devShells.${system}.default = pkgs.mkShell {
inherit nativeBuildInputs buildInputs;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath runtimeLibs;
};
};
}