commit 1fe99552a7f68030508e9e06c15315e5b8a5221b
parent 62ef51d4cfd88fee30c7d67803a625ebdbfee79d
Author: Leah (ctucx) <git@ctu.cx>
Date: Sat, 10 Dec 2022 16:06:45 +0100
parent 62ef51d4cfd88fee30c7d67803a625ebdbfee79d
Author: Leah (ctucx) <git@ctu.cx>
Date: Sat, 10 Dec 2022 16:06:45 +0100
add flake.nix
3 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -1,3 +1,4 @@ *.o stagit stagit-index +result
diff --git a/flake.lock b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1670543317, + "narHash": "sha256-4mMR56rtxKr+Gwz399jFr4i76SQZxsLWxxyfQlPXRm0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7a6a010c3a1d00f8470a5ca888f2f927f1860a19", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +}
diff --git a/flake.nix b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "git static site generator"; + + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; + }; + + outputs = { self, nixpkgs, flake-utils }: { + + overlay = final: prev: { + + stagit = final.stdenv.mkDerivation rec { + name = "stagit"; + src = self; + + makeFlags = [ "PREFIX=$(out)" ]; + + buildInputs = [ final.libgit2 final.md4c ]; + }; + + }; + + } // (flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlay ]; + }; + + in rec { + + packages.default = pkgs.stagit; + packages.stagit = pkgs.stagit; + + apps.default = { + type = "app"; + program = "${pkgs.stagit}/bin/stagit"; + }; + + })); +}+ \ No newline at end of file