feat: nix repl

This commit is contained in:
punkfairie 2025-04-06 11:34:15 -07:00
parent 83de2f8264
commit da60df353f
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
2 changed files with 19 additions and 5 deletions

View file

@ -63,10 +63,15 @@
}
'';
home.shellAbbrs = {
nrepl = ''
nix repl --expr 'rec {pkgs=(import <nixpkgs> {}); lib=pkgs.lib;}'
'';
};
home.packages = let
nrepl =
pkgs.writeShellScriptBin "nrepl"
# sh
''
nix repl "${toString ./.}/repl.nix" "$@"
'';
in [
nrepl
];
};
}

9
repl.nix Normal file
View file

@ -0,0 +1,9 @@
let
flake = builtins.getFlake (toString ./.);
nixpkgs = import <nixpkgs> {};
in
{inherit flake;}
// flake
// builtins
// nixpkgs
// nixpkgs.lib