Add a command to launch a repl of the current flake.
This commit is contained in:
parent
f651241f20
commit
3348feb613
@ -90,6 +90,30 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
(
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
repl_path = toString ./.;
|
||||||
|
nix-self-repl = pkgs.writeShellScriptBin "nix-self-repl" ''
|
||||||
|
source /etc/set-environment
|
||||||
|
nix repl "${repl_path}/repl.nix" "$@"
|
||||||
|
'';
|
||||||
|
# If we wanted the current version of a flake then we'd just launch
|
||||||
|
# nix repl
|
||||||
|
# and then run:
|
||||||
|
# :lf /path/to/flake
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
environment.systemPackages = lib.mkIf config.nix.enable [ nix-self-repl ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
) nodes;
|
) nodes;
|
||||||
|
|||||||
5
nix/configuration/repl.nix
Normal file
5
nix/configuration/repl.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
let
|
||||||
|
flake = builtins.getFlake (toString ./.);
|
||||||
|
nixpkgs = import <nixpkgs> { };
|
||||||
|
in
|
||||||
|
{ inherit flake; } // flake // builtins // nixpkgs // nixpkgs.lib // flake.nixosConfigurations
|
||||||
Loading…
x
Reference in New Issue
Block a user