1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/home-manager/home-manager.nix
Adam Dinwoodie cab8104e92
home-manager: add repl subcommand (#5600)
Similar to the `nixos-rebuild repl` command, `home-manager repl` will
launch the Nix read-evaluate-print-loop environment with the Home
Manager configuration loaded.

To make that more useful, also add the pkgs and options attributes from
the generated Home Manager configuration to the environment.

This doesn't currently work with flakes, because I don't use them and
I'm not confident I could safely test that function.
2025-06-29 18:12:33 -05:00

25 lines
356 B
Nix

{
pkgs ? import <nixpkgs> { },
confPath,
confAttr ? null,
check ? true,
}:
let
env = import ../modules {
configuration =
if confAttr == "" || confAttr == null then confPath else (import confPath).${confAttr};
pkgs = pkgs;
check = check;
};
in
{
inherit (env)
activationPackage
config
pkgs
options
;
}