feat(nix-hm): add bob-nvim flake to install bob

This commit is contained in:
Price Hiller 2024-01-06 00:39:19 -06:00
parent 7a4478ecd4
commit 8fb75ebbed
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
5 changed files with 129 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
./.luarc.json
result/
.luarc.json

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }:
{ pkgs, config, bob, ... }:
let
dotsDir = "${config.home.homeDirectory}/.dot_files/dots";
softLinkDots = dir:
@ -18,7 +18,7 @@ in
programs.home-manager.enable = true;
home = {
packages = with pkgs; [
gcc
bob.packages.${pkgs.system}.default
sqlite
luajit
imagemagick

View File

@ -1,5 +1,40 @@
{
"nodes": {
"bob": {
"inputs": {
"bob": "bob_2",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1,
"narHash": "sha256-dRRtI4CfEMyPwPv8zwKkSfOZaGGsXVoUg2Lgp0yIj2M=",
"path": "./pkgs/bob-nvim",
"type": "path"
},
"original": {
"path": "./pkgs/bob-nvim",
"type": "path"
}
},
"bob_2": {
"flake": false,
"locked": {
"lastModified": 1702230475,
"narHash": "sha256-UwfFcYi193P/8jFMSrYKGQMsnhfnAHCWCQgOcwIYXNk=",
"owner": "MordechaiHadad",
"repo": "bob",
"rev": "6c2d6d83317b3ca2b4b20b27475e212a8cb7b7df",
"type": "github"
},
"original": {
"owner": "MordechaiHadad",
"repo": "bob",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -62,6 +97,24 @@
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
@ -120,7 +173,7 @@
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
@ -198,6 +251,7 @@
},
"root": {
"inputs": {
"bob": "bob",
"home-manager": "home-manager",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2"
@ -217,6 +271,21 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@ -3,6 +3,10 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
bob = {
url = "path:./pkgs/bob-nvim";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@ -10,7 +14,7 @@
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
};
outputs = inputs @ { home-manager, nixpkgs, ... }:
outputs = inputs @ { home-manager, bob, nixpkgs, ... }:
let
system = "x86_64-linux";
username = "sam";
@ -20,6 +24,9 @@
targets.genericLinux.enable = true;
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit bob;
};
modules = [
({
nixpkgs.overlays = [

48
pkgs/bob-nvim/flake.nix Normal file
View File

@ -0,0 +1,48 @@
{
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";
};
outputs = { self, nixpkgs, flake-utils, bob }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rust-toolchain = pkgs.symlinkJoin {
name = "rust-toolchain";
paths = with pkgs; [
rustc
cargo
cargo-watch
rust-analyzer
rustfmt
];
};
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";
};
overlays.default = packages.default;
# 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 ];
};
});
}