From 3d3d6bba608e83abaabb5d5373444d03f7ca9442 Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Mon, 31 May 2021 15:08:44 -0700 Subject: [PATCH 1/2] modules: generate registry and add fup-repl to env --- src/modules.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules.nix b/src/modules.nix index c2d27ade2..0749ac518 100644 --- a/src/modules.nix +++ b/src/modules.nix @@ -32,10 +32,9 @@ "home-manager=${self.inputs.home}" ]; - nix.registry = { - devos.flake = self; - nixos.flake = channel.input; - }; + # package and option is from fup + environment.systemPackages = [ pkgs.fup-repl ]; + nix.generateRegistryFromInputs = lib.mkDefault true; nix.extraOptions = '' experimental-features = ${lib.concatStringsSep " " From cf803e823ae4d66b89fc6b0b989779c6b9ad5856 Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Mon, 31 May 2021 15:42:24 -0700 Subject: [PATCH 2/2] shell/flk: add repl sub-command --- src/pkgs-lib/shell/default.nix | 1 + src/pkgs-lib/shell/flk.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pkgs-lib/shell/default.nix b/src/pkgs-lib/shell/default.nix index 8974a1f19..b7909186d 100644 --- a/src/pkgs-lib/shell/default.nix +++ b/src/pkgs-lib/shell/default.nix @@ -36,6 +36,7 @@ let nixos-generate-config nixos-enter pkgs'.nixos-rebuild + pkgs'.fup-repl ]; git.hooks = { diff --git a/src/pkgs-lib/shell/flk.sh b/src/pkgs-lib/shell/flk.sh index aadb618d7..d276fa0bf 100755 --- a/src/pkgs-lib/shell/flk.sh +++ b/src/pkgs-lib/shell/flk.sh @@ -22,7 +22,8 @@ usage () { "iso HOST" "Generate an ISO image of HOST" \ "install HOST [ARGS]" "Shortcut for nixos-install" \ "home HOST USER [switch]" "Home-manager config of USER from HOST" \ - "HOST (switch|boot|test)" "Shortcut for nixos-rebuild" + "HOST (switch|boot|test)" "Shortcut for nixos-rebuild" \ + "repl FLAKE" "Enter a repl with the flake's outputs" } case "$1" in @@ -93,6 +94,10 @@ case "$1" in fi ;; + "repl") + repl ${@:2} + ;; + *) sudo nixos-rebuild --flake "$DEVSHELL_ROOT#$1" "${@:2}" ;;