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

View file

@ -4,3 +4,7 @@ root = true
end_of_line = lf end_of_line = lf
indent_style = tab indent_style = tab
indent_size = 4 indent_size = 4
[*.nix]
indent_style = space
indent_size = 2

2
.gitignore vendored
View file

@ -2,4 +2,6 @@
*.so *.so
*.a *.a
esv esv
result
Makefile Makefile

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1707743206,
"narHash": "sha256-AehgH64b28yKobC/DAWYZWkJBxL/vP83vkY+ag2Hhy4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2d627a2a704708673e56346fcb13d25344b8eaf3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

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=/"
];
});
});
};
}