refactor: pull bootstap into regular shell for ease of use

This commit is contained in:
gwg313 2024-01-08 15:49:26 -05:00
parent 8d9684cf50
commit c5d2fbe031
Signed by: gwg313
GPG key ID: 60FF63B4826B7400
3 changed files with 17 additions and 7 deletions

View file

@ -89,13 +89,6 @@
alejandra
];
};
# Shell for bootstrapping flake-enabled nix and home-manager
bootstrap = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [nix home-manager git];
};
}
);

9
nixpkgs.nix Normal file
View file

@ -0,0 +1,9 @@
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
# This is useful to avoid using channels when using legacy nix commands
let
lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in
import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
})

8
shell.nix Normal file
View file

@ -0,0 +1,8 @@
# Shell for bootstrapping flake-enabled nix and home-manager
{pkgs ? (import ./nixpkgs.nix) {}}: {
bootstrap = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [nix home-manager git];
};
}