Bundle bootstrap as nix flake package.
parent
ed966effa4
commit
7cfe64f97a
|
@ -1,6 +1,17 @@
|
||||||
|
# Directory used by clangd LSP.
|
||||||
.cache/
|
.cache/
|
||||||
|
|
||||||
|
# Directory used by `direnv` to hold `use flake`-generated profiles.
|
||||||
.direnv/
|
.direnv/
|
||||||
bootstrap
|
|
||||||
|
# The compilation database produced by `bear`.
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
|
||||||
|
# The directory containing all build outputs.
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
|
# The directory generated by `Doxygen`.
|
||||||
docs/
|
docs/
|
||||||
|
|
||||||
|
# A symlink produced by default when running `nix build`.
|
||||||
|
result
|
||||||
|
|
18
flake.nix
18
flake.nix
|
@ -19,20 +19,20 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = {
|
packages = {
|
||||||
bootstrap = pkgs.stdenv.mkDerivation {
|
release = pkgs.stdenv.mkDerivation {
|
||||||
pname = "bootstrap";
|
pname = "bootstrap";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
nativeBuildInputs = with pkgs; [
|
makeFlags = [ "BUILD=release" "PREFIX=$(out)" ];
|
||||||
clang
|
dontInstall = true;
|
||||||
];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
make release
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
default = self.packages.${system}.bootstrap;
|
default = pkgs.writeShellScriptBin "bootstrap" ''
|
||||||
|
if [ -z "$BOOTSTRAP_ROOT_DIR" ]; then
|
||||||
|
export BOOTSTRAP_ROOT_DIR="${./specs}"
|
||||||
|
fi
|
||||||
|
exec ${self.packages.${system}.release}/bootstrap "$@"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
devShells.default = pkgs.mkShell.override {
|
devShells.default = pkgs.mkShell.override {
|
||||||
# https://nixos.wiki/wiki/Using_Clang_instead_of_GCC
|
# https://nixos.wiki/wiki/Using_Clang_instead_of_GCC
|
||||||
|
|
Loading…
Reference in New Issue