From: Amy Date: Sun, 12 Mar 2023 22:16:37 +0000 (+0000) Subject: Add flake.nix (#226) X-Git-Tag: v0.2.0.2~96 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/xdg-ninja.git/commitdiff_plain/b03a94b1b48103eab50e2afe51e6777693d83a91?ds=inline Add flake.nix (#226) * Add nix flake support * Use derivation from nixpkgs in flake --------- Co-authored-by: b3nj5m1n --- diff --git a/.gitignore b/.gitignore index 6542fcd..4886181 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ dist-newstyle .stack-work +result/ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9514603 --- /dev/null +++ b/flake.lock @@ -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 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; + } + ); +}