Add Nix flake

and add result to .gitignore
This commit is contained in:
Jeremy Baxter 2023-08-03 12:36:30 +12:00
parent 7a2db8166b
commit d08e97f935
3 changed files with 64 additions and 0 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@
csto csto
doc/ doc/
include/ include/
result
test.lua test.lua
lua lua

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1690881714,
"narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9e1960bc196baf6881340d53dccb203a951745a2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

36
flake.nix Normal file
View file

@ -0,0 +1,36 @@
{
description = "Callisto, a featureful extension runtime for Lua 5.4";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
forAllSystems = fn:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
] (system:
fn (import nixpkgs {
inherit system;
})
);
in
{
packages = forAllSystems (pkgs: {
default = pkgs.stdenv.mkDerivation {
name = "callisto";
src = ./.;
buildPhase = ''
make
'';
installPhase = ''
mkdir -p $out/bin
make DESTDIR="$out" PREFIX=/ install
'';
};
});
};
}