summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2025-01-07 08:43:24 +0300
committerVika <vika@fireburn.ru>2025-01-07 08:43:24 +0300
commit0d86e157cb4fbb5e7480b4d5c1014a1ea78be3d3 (patch)
treefb90ba3a8bb2cbdce9b8c22abaf80e3ce3b98f30 /flake.nix
parent0db801b049e752f4c78af0cf5ee5f728b5b1dced (diff)
downloadxdg-desktop-portal-systemd-0d86e157cb4fbb5e7480b4d5c1014a1ea78be3d3.tar.zst
Initial packaging for NixOS
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..55e32bf
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,33 @@
+{
+  inputs = {
+    flake-utils.url = "github:numtide/flake-utils/main";
+    crane.url = "github:ipetkov/crane";
+    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+  };
+  outputs = { self, nixpkgs, flake-utils, crane }: let
+    supportedSystems = ["aarch64-linux" "x86_64-linux"];
+    forAllSystems = f: flake-utils.lib.eachSystem supportedSystems f;
+  in forAllSystems (system: let
+    pkgs = import nixpkgs {
+      localSystem = { inherit system; };
+    };
+    crane' = crane.mkLib pkgs;
+
+    package = pkgs.callPackage ./default.nix {
+      crane = crane';
+    };
+  in {
+    packages = {
+      xdg-desktop-portal-systemd = package;
+      default = self.packages.${system}.xdg-desktop-portal-systemd;
+    };
+
+    checks = {
+      clippy = package.clippy;
+      fmt = package.fmt;
+    };
+    devShells.default = crane'.devShell {
+      checks = self.checks.${system};
+    };
+  });
+}