aboutsummaryrefslogtreecommitdiff
path: root/nix/candelabra.nix
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-01-29 22:48:13 +0000
committerAria Shrimpton <me@aria.rip>2024-01-29 22:48:13 +0000
commitbabd6d51bc3e3b4665cec2b6d0750605c2d6c5bd (patch)
tree2a06caf45d02426e6092409509ed5b90ca1d8648 /nix/candelabra.nix
parent8b2556974cb70cddeedc6f4fb1d06d16c1cff5a1 (diff)
nixos configuration
Diffstat (limited to 'nix/candelabra.nix')
-rw-r--r--nix/candelabra.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nix/candelabra.nix b/nix/candelabra.nix
new file mode 100644
index 0000000..da0a51c
--- /dev/null
+++ b/nix/candelabra.nix
@@ -0,0 +1,31 @@
+inputs @ {
+ pkgs,
+ crane,
+ ...
+}: let
+ inherit (pkgs) system;
+ toolchain = pkgs.rust-bin.fromRustupToolchain ((builtins.fromTOML (builtins.readFile ../src/rust-toolchain.toml)).toolchain // {profile = "minimal";});
+ craneLib = crane.lib.${system}.overrideToolchain toolchain;
+
+ rustCrate = craneLib.buildPackage {
+ pname = "candelabra-unwrapped";
+ version = "1.0.0";
+
+ src = craneLib.cleanCargoSource (craneLib.path ../src);
+ doCheck = false;
+ propagatedBuildInputs = [(pkgs.callPackage ./racket-env.nix inputs)];
+
+ cargoExtraArgs = "-p candelabra-cli";
+ };
+in
+ pkgs.runCommand "candelabra" {} ''
+ . ${pkgs.makeWrapper}/nix-support/setup-hook
+ mkdir -p $out/bin
+ makeWrapper ${rustCrate}/bin/candelabra $out/bin/candelabra \
+ --set CANDELABRA_SRC_DIR ${pkgs.lib.sourceByRegex ../src [
+ ".*crates"
+ ".*racket_specs.*"
+ ".*crates/library.*"
+ ".*crates/benchmarker.*"
+ ]}
+ ''