diff --git a/Makefile b/Makefile index 35152e4..0707839 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ prefix ?= /usr/local bindir = $(prefix)/bin libdir = $(prefix)/lib -libexecdir = $(prefix)/libexec +libexecdir ?= $(prefix)/libexec includedir = $(prefix)/include datarootdir = $(prefix)/share datadir = $(datarootdir) @@ -34,7 +34,7 @@ $(BIN): Cargo.toml Cargo.lock src/main.rs vendor-check install: install -Dm0755 target/$(TARGET)/$(BIN) $(DESTDIR)$(libexecdir)/$(BIN) - install -Dm0644 data/$(DBUS_NAME).service $(DESTDIR)/$(datadir)/dbus-1/services/$(DBUS_NAME).service + install -Dm0644 data/$(DBUS_NAME).service $(DESTDIR)/$(datadir)/systemd/user/$(DBUS_NAME).service install -Dm0644 data/cosmic.portal $(DESTDIR)/$(datadir)/xdg-desktop-portal/portals/cosmic.portal ## Cargo Vendoring diff --git a/flake.nix b/flake.nix index 33a6f90..8ba3a2d 100644 --- a/flake.nix +++ b/flake.nix @@ -28,9 +28,11 @@ ./src ./Cargo.toml ./Cargo.lock + ./Makefile + ./data ]; }; - nativeBuildInputs = with pkgs; [ pkg-config rustPlatform.bindgenHook ]; + nativeBuildInputs = with pkgs; [ pkg-config rustPlatform.bindgenHook gnumake ]; buildInputs = with pkgs; [ pipewire libxkbcommon @@ -47,7 +49,15 @@ inherit xdg-desktop-portal-cosmic; }; - packages.default = xdg-desktop-portal-cosmic; + # FIXME reference the libexecdir for xdp-cosmic in the nix store in cosmic-session + # then the hack putting xdp-cosmic into bin can be removed + packages.default = xdg-desktop-portal-cosmic + .overrideAttrs (oldAttrs: rec { + installPhase = '' + make install prefix=$out libexecdir=$out/bin + ''; + passthru.providedSessions = [ "cosmic" ]; + }); apps.default = flake-utils.lib.mkApp { drv = xdg-desktop-portal-cosmic;