-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrepl.nix
41 lines (36 loc) · 1.08 KB
/
repl.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# better repl with preloaded functions and libs already loaded
# https://bmcgee.ie/posts/2023/01/nix-and-its-slow-feedback-loop/#how-you-should-use-the-repl
{
# host is passed down from the nrepl via a --arg argument, defaulting to the current host
host ? "desktop",
...
}:
let
user = "iynaix";
flake = builtins.getFlake (toString ./.);
in
rec {
inherit (flake) inputs lib self;
inherit (flake.inputs) nixpkgs;
inherit flake host user;
# default host
c = flake.nixosConfigurations.${host}.config;
inherit (flake.nixosConfigurations.${host}) config;
o = c.custom;
inherit (c) hm;
hmo = hm.custom;
inherit (flake.nixosConfigurations.${host}) pkgs;
desktop = flake.nixosConfigurations.desktop.config;
desktopo = desktop.custom;
desktopHm = desktop.hm;
desktopHmo = desktopHm.custom;
framework = flake.nixosConfigurations.framework.config;
frameworko = framework.custom;
frameworkHm = framework.hm;
frameworkHmo = frameworkHm.custom;
vm = flake.nixosConfigurations.vm.config;
vmo = vm.custom;
vmHm = vm.hm;
vmHmo = vmHm.custom;
# your code here
}