This repository was archived by the owner on Oct 31, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathflake.nix
More file actions
109 lines (93 loc) · 2.82 KB
/
flake.nix
File metadata and controls
109 lines (93 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
107
108
109
{
description = "swww, A Solution to your Wayland Wallpaper Woes";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
rust-overlay,
...
}: let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
pkgsFor = lib.genAttrs systems (system:
import nixpkgs {
localSystem.system = system;
overlays = [(import rust-overlay)];
});
cargoToml = lib.importTOML ./Cargo.toml;
inherit (cargoToml.workspace.package) rust-version;
in {
packages =
lib.mapAttrs (system: pkgs: {
swww = let
rust = pkgs.rust-bin.stable.${rust-version}.default;
rustPlatform = pkgs.makeRustPlatform {
cargo = rust;
rustc = rust;
};
in
rustPlatform.buildRustPackage {
pname = "swww";
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
inherit (cargoToml.workspace.package) version;
cargoLock.lockFile = ./Cargo.lock;
buildInputs = with pkgs; [
lz4
libxkbcommon
wayland-scanner
wayland-protocols
];
doCheck = false; # Integration tests do not work in sandbox environment
nativeBuildInputs = with pkgs; [
pkg-config
installShellFiles
scdoc
];
postInstall = ''
for f in doc/*.scd; do
local page="doc/$(basename "$f" .scd)"
scdoc < "$f" > "$page"
installManPage "$page"
done
installShellCompletion --cmd swww \
--bash completions/swww.bash \
--fish completions/swww.fish \
--zsh completions/_swww
'';
meta = {
description = "Efficient animated wallpaper daemon for wayland, controlled at runtime";
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
mainProgram = "swww";
};
};
default = self.packages.${system}.swww;
})
pkgsFor;
formatter = lib.mapAttrs (_: pkgs: pkgs.alejandra) pkgsFor;
devShells =
lib.mapAttrs (system: pkgs: {
default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.swww];
packages = [pkgs.rust-bin.stable.${rust-version}.default];
};
})
pkgsFor;
overlays.default = final: prev: {inherit (self.packages.${prev.system}) swww;};
};
}