diff options
author | Vika <vika@fireburn.ru> | 2025-01-07 08:43:24 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2025-01-07 08:43:24 +0300 |
commit | 0d86e157cb4fbb5e7480b4d5c1014a1ea78be3d3 (patch) | |
tree | fb90ba3a8bb2cbdce9b8c22abaf80e3ce3b98f30 /default.nix | |
parent | 0db801b049e752f4c78af0cf5ee5f728b5b1dced (diff) | |
download | xdg-desktop-portal-systemd-0d86e157cb4fbb5e7480b4d5c1014a1ea78be3d3.tar.zst |
Initial packaging for NixOS
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 29 |
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; }; + }; +}) |