swayosd flake, better multihead

This commit is contained in:
atagen 2024-01-13 01:53:30 +11:00
parent a45ac1792c
commit 7882fe6841
9 changed files with 266 additions and 68 deletions

71
flakes/swayosd/flake.nix Normal file
View file

@ -0,0 +1,71 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
swayosd-src = {
url = "github:ErikReider/SwayOSD";
flake = false;
};
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = inputs @ {
self,
nixpkgs,
rust-overlay,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs; {
packages.default = stdenv.mkDerivation {
pname = "swayosd";
version = "unstable-${inputs.swayosd-src.lastModifiedDate}";
src = inputs.swayosd-src;
cargoDeps = rustPlatform.importCargoLock {
lockFile = "${inputs.swayosd-src}/Cargo.lock";
};
nativeBuildInputs = [
wrapGAppsHook
pkg-config
meson
ninja
glib
sassc
rustPlatform.cargoSetupHook
(rust-bin.selectLatestNightlyWith (toolchain: toolchain.default))
];
buildInputs = [
gtk-layer-shell
libevdev
libinput
libpulseaudio
udev
systemd
];
patches = [
./systemd.patch
];
postPatch = ''
substituteInPlace data/udev/99-swayosd.rules \
--replace /bin/chgrp ${coreutils}/bin/chgrp \
--replace /bin/chmod ${coreutils}/bin/chmod
'';
};
}
);
}