bootstrap/flake.nix

55 lines
1.6 KiB
Nix
Raw Normal View History

2023-11-22 17:43:05 +00:00
{
description = ''
CLI for initializing new projects deterministically with flakes.
'';
inputs = {
2023-11-26 19:56:13 +00:00
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
2023-11-22 17:43:05 +00:00
flake-utils.url = "github:numtide/flake-utils";
2023-11-26 19:56:13 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2023-11-22 17:43:05 +00:00
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
codelldb = pkgs.writeShellScriptBin "codelldb" ''
2023-11-22 20:43:34 +00:00
exec ${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb "$@"
2023-11-22 17:43:05 +00:00
'';
in
{
packages = {
2023-11-26 15:57:58 +00:00
release = pkgs.stdenv.mkDerivation {
pname = "bootstrap";
src = ./.;
version = "0.1.0";
2023-11-26 15:57:58 +00:00
makeFlags = [ "BUILD=release" "PREFIX=$(out)" ];
dontInstall = true;
};
2023-11-26 15:57:58 +00:00
default = pkgs.writeShellScriptBin "bootstrap" ''
if [ -z "$BOOTSTRAP_ROOT_DIR" ]; then
export BOOTSTRAP_ROOT_DIR="${./specs}"
fi
exec ${self.packages.${system}.release}/bootstrap "$@"
'';
};
2023-11-22 18:15:12 +00:00
devShells.default = pkgs.mkShell.override {
# https://nixos.wiki/wiki/Using_Clang_instead_of_GCC
stdenv = pkgs.clangStdenv;
} {
2023-11-22 17:43:05 +00:00
packages = with pkgs; [
bear
clang-tools
codelldb
doxygen
2023-11-22 17:43:05 +00:00
];
2023-11-22 20:43:34 +00:00
shellHook = ''
2023-11-23 18:02:40 +00:00
export BOOTSTRAP_ROOT_DIR="${./specs}"
2023-11-22 20:43:34 +00:00
'';
2023-11-22 17:43:05 +00:00
};
}
);
}