dots/pkgs/bob-nvim/flake.nix

59 lines
1.5 KiB
Nix
Raw Normal View History

{
description = "Flake for bob-nvim, a Neovim version manager.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
bob = {
flake = false;
url = "github:MordechaiHadad/bob";
};
flake-utils.url = "github:numtide/flake-utils";
};
2024-04-19 22:27:46 -05:00
outputs =
{
self,
nixpkgs,
flake-utils,
bob,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
rust-toolchain = pkgs.symlinkJoin {
name = "rust-toolchain";
2024-04-19 22:27:46 -05:00
paths = with pkgs; [
rustc
cargo
cargo-watch
rust-analyzer
rustfmt
];
};
2024-04-19 22:27:46 -05:00
in
rec {
# This builds the blog binary then runs it and collects the output. Once done it throws away the binary and
# shoves the newly created static site into the result.
packages.default = pkgs.rustPlatform.buildRustPackage {
name = "bob-nvim";
pname = "bob";
src = "${bob}";
cargoLock.lockFile = "${bob}/Cargo.lock";
};
# Rust dev environment
devShells.default = pkgs.mkShell {
shellHook = ''
# For rust-analyzer 'hover' tooltips to work.
export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
'';
nativeBuildInputs = [ rust-toolchain ];
};
2024-04-19 22:27:46 -05:00
}
)
// {
overlays.default = final: prev: { bob-nvim = self.packages.${final.system}.default; };
};
}