summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix29
1 files changed, 29 insertions, 0 deletions
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; };
+  };
+})