Add optional systemd support to flake package (#63)
* Enable systemd support in the flake package * Add optional derivation without systemd support
This commit is contained in:
parent
ab2d09962c
commit
8703e243eb
1 changed files with 31 additions and 20 deletions
51
flake.nix
51
flake.nix
|
|
@ -15,11 +15,39 @@
|
|||
let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
lib = pkgs.lib;
|
||||
|
||||
naersk' = pkgs.callPackage naersk {
|
||||
cargo = pkgs.rust-bin.stable.latest.default;
|
||||
rustc = pkgs.rust-bin.stable.latest.default;
|
||||
};
|
||||
in {
|
||||
|
||||
buildXwaylandSatellite = { withSystemd ? false }: naersk'.buildPackage {
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
rustPlatform.bindgenHook
|
||||
rust-bin.stable.latest.default
|
||||
pkg-config
|
||||
|
||||
xcb-util-cursor
|
||||
xorg.libxcb
|
||||
|
||||
makeWrapper
|
||||
] ++ lib.optional withSystemd pkgs.systemd;
|
||||
|
||||
buildInputs = [ pkgs.xwayland ];
|
||||
|
||||
cargoBuildOptions = opts: opts ++ lib.optional withSystemd "--features systemd";
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/xwayland-satellite \
|
||||
--prefix PATH : ${pkgs.xwayland}/bin
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
devShell = (pkgs.mkShell.override { stdenv = pkgs.clangStdenv; }) {
|
||||
buildInputs = with pkgs; [
|
||||
rustPlatform.bindgenHook
|
||||
|
|
@ -33,26 +61,9 @@
|
|||
};
|
||||
|
||||
packages = rec {
|
||||
xwayland-satellite = naersk'.buildPackage {
|
||||
src = ./.;
|
||||
xwayland-satellite-nosd = buildXwaylandSatellite { withSystemd = false; };
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
rustPlatform.bindgenHook
|
||||
rust-bin.stable.latest.default
|
||||
pkg-config
|
||||
|
||||
xcb-util-cursor
|
||||
xorg.libxcb
|
||||
|
||||
makeWrapper
|
||||
];
|
||||
buildInputs = [ pkgs.xwayland ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/xwayland-satellite \
|
||||
--prefix PATH : ${pkgs.xwayland}/bin
|
||||
'';
|
||||
};
|
||||
xwayland-satellite = buildXwaylandSatellite { withSystemd = true; };
|
||||
|
||||
default = xwayland-satellite;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue