From 0d86e157cb4fbb5e7480b4d5c1014a1ea78be3d3 Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 7 Jan 2025 08:43:24 +0300 Subject: Initial packaging for NixOS --- default.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 default.nix (limited to 'default.nix') diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..a5650c9 --- /dev/null +++ b/default.nix @@ -0,0 +1,29 @@ +{ crane, lib }: +let + src = crane.cleanCargoSource ./.; + + args = { + inherit src; + strictDeps = true; + + meta = with lib.meta; { + maintainers = with lib.maintainers; [ vikanezrimaya ]; + platforms = ["aarch64-linux" "x86_64-linux"]; + }; + }; + + cargoArtifacts = crane.buildDepsOnly args; + args' = args // { + inherit cargoArtifacts; + }; +in crane.buildPackage (args' // { + postInstall = '' + install -Dm755 ${./xdg-desktop-portal-systemd.portal} $out/share/xdg-desktop-portal/portals/xdg-desktop-portal-systemd.portal + ''; + passthru = { + clippy = crane.cargoClippy (args' // { + cargoClippyExtraArgs = "--all-targets -- --deny warnings"; + }); + fmt = crane.cargoFmt { inherit src; }; + }; +}) -- cgit 1.4.1