Bundle bootstrap as nix flake package.
parent
ed966effa4
commit
7cfe64f97a
|
@ -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
|
||||
|
|
18
flake.nix
18
flake.nix
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue