]> glassweightruler.freedombox.rocks Git - xdg-ninja.git/commitdiff
Add flake.nix (#226)
authorAmy <git@amyerskine.me>
Sun, 12 Mar 2023 22:16:37 +0000 (22:16 +0000)
committerGitHub <noreply@github.com>
Sun, 12 Mar 2023 22:16:37 +0000 (23:16 +0100)
* Add nix flake support

* Use derivation from nixpkgs in flake

---------

Co-authored-by: b3nj5m1n <b3nj4m1n@gmx.net>
.gitignore
flake.lock [new file with mode: 0644]
flake.nix [new file with mode: 0644]

index 6542fcdb42885623f3c6fa77e49a818f40644f4c..48861816e9d5b77dfc591f477824dbb0c3127d8b 100644 (file)
@@ -1,2 +1,4 @@
 dist-newstyle
 .stack-work
 dist-newstyle
 .stack-work
+result/
+result
diff --git a/flake.lock b/flake.lock
new file mode 100644 (file)
index 0000000..9514603
--- /dev/null
@@ -0,0 +1,41 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "locked": {
+        "lastModified": 1676283394,
+        "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1678594102,
+        "narHash": "sha256-OHAHYiMWJFPNxuW/PcOMlSD2tvXnEYC1jxREBADHwwQ=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "796b4a3c1d903c4b9270cd2548fe46f524eeb886",
+        "type": "github"
+      },
+      "original": {
+        "id": "nixpkgs",
+        "type": "indirect"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644 (file)
index 0000000..080cee9
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,37 @@
+{
+  inputs = {
+    nixpkgs.url = "nixpkgs";
+    flake-utils.url = "github:numtide/flake-utils";
+  };
+  outputs = {
+    self,
+    nixpkgs,
+    flake-utils,
+  }:
+    flake-utils.lib.eachDefaultSystem (system:
+      let
+        runtimeDependencies = with pkgs; [
+          glow
+          jq
+        ];
+        overlays = [
+          (self: super: {
+            xdg-ninja = super.xdg-ninja.overrideAttrs (old: {
+              version = "git";
+              src = ./.;
+            });
+          })
+        ];
+        pkgs = import nixpkgs { inherit system overlays; };
+      in rec {
+        packages = flake-utils.lib.flattenTree {
+          xdg-ninja = pkgs.xdg-ninja;
+        };
+        defaultPackage = packages.xdg-ninja;
+        apps = {
+          xdg-ninja = flake-utils.lib.mkApp { drv = packages.xdg-ninja; };
+        };
+        defaultApp = apps.xdg-ninja;
+      }
+    );
+}