Bundle bootstrap as nix flake package.

pull/9/head
Joshua Potter 2023-11-26 08:57:58 -07:00
parent ed966effa4
commit 7cfe64f97a
2 changed files with 21 additions and 10 deletions

13
.gitignore vendored
View File

@ -1,6 +1,17 @@
# Directory used by clangd LSP.
.cache/
# Directory used by `direnv` to hold `use flake`-generated profiles.
.direnv/
bootstrap
# The compilation database produced by `bear`.
compile_commands.json
# The directory containing all build outputs.
dist/
# The directory generated by `Doxygen`.
docs/
# A symlink produced by default when running `nix build`.
result

View File

@ -19,20 +19,20 @@
in
{
packages = {
bootstrap = pkgs.stdenv.mkDerivation {
release = pkgs.stdenv.mkDerivation {
pname = "bootstrap";
src = ./.;
version = "0.1.0";
nativeBuildInputs = with pkgs; [
clang
];
buildPhase = ''
make release
'';
makeFlags = [ "BUILD=release" "PREFIX=$(out)" ];
dontInstall = true;
};
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 {
# https://nixos.wiki/wiki/Using_Clang_instead_of_GCC