add nix flake

This commit is contained in:
Jeremy Baxter 2024-02-13 09:51:25 +13:00
parent 566ec45337
commit 87826cba0d
4 changed files with 69 additions and 1 deletions

35
flake.nix Normal file
View file

@ -0,0 +1,35 @@
{
description = "read the ESV Bible from your terminal";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
};
outputs = { self, nixpkgs }:
with nixpkgs.lib;
let
forAllSystems = fn:
genAttrs platforms.unix (system:
fn (import nixpkgs {
inherit system;
})
);
in
{
packages = forAllSystems (pkgs: {
default = pkgs.stdenv.mkDerivation (with pkgs; {
name = "esv";
src = ./.;
nativeBuildInputs = [ ldc ];
buildInputs = [ curl ];
dontAddPrefix = true;
installFlags = [
"DESTDIR=$(out)"
"PREFIX=/"
];
});
});
};
}