2.home-manager/default.nix
teto 4c4fd4ed6b feat: introduce development shell
flakes are not stable yet, community is divided but maintaining both
flake and a set of dependencies in our scripts is hard.
So provide a nix-shell that fetches the nixpkgs recorded in the
flake.lock to keep a single source of truth

doc: updated the doc to advise `nix-shell -A dev`
2026-02-26 20:44:57 -06:00

50 lines
1 KiB
Nix

{
pkgs ? import <nixpkgs> { },
}:
let
path = builtins.path {
path = ./.;
name = "home-manager-source";
};
nixpkgs = (
import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
n = lock.nodes.nixpkgs.locked;
in
fetchTarball {
url = "https://github.com/${n.owner}/${n.repo}/archive/${n.rev}.tar.gz";
sha256 = n.narHash;
}
) { }
);
in
rec {
docs =
let
releaseInfo = pkgs.lib.importJSON ./release.json;
in
with import ./docs {
inherit pkgs;
inherit (releaseInfo) release isReleaseBranch;
};
{
inherit manPages jsonModuleMaintainers;
inherit (manual) html htmlOpenTool;
inherit (options) json;
};
home-manager = pkgs.callPackage ./home-manager { inherit path; };
install = pkgs.callPackage ./home-manager/install.nix { inherit home-manager; };
nixos = import ./nixos;
lib = import ./lib { inherit (pkgs) lib; };
dev = nixpkgs.callPackage ./home-manager/devShell.nix { };
inherit path;
}