diff --git a/profiles/auto-upgrade.nix b/profiles/auto-upgrade.nix index 662b20e..375a25d 100644 --- a/profiles/auto-upgrade.nix +++ b/profiles/auto-upgrade.nix @@ -2,6 +2,7 @@ let inherit (config.virtualisation) isVmVariant; + inputUrls = lib.mapAttrs (input: value: value.url) (import (inputs.self + "/flake.nix")).inputs; in # TODO: make /etc/nixos a symlink to the in-store flake? - bad idea, horrible error recovery @@ -26,6 +27,43 @@ in ) ); + environment.etc."current-system-flake-inputs-overrides.sh".enable = !isVmVariant; + environment.etc."current-system-flake-inputs-overrides.sh".source = pkgs.writeShellScript "with-input-overrides.sh" '' + if [[ $# -eq 0 ]]; then + echo >&2 "Example usage: $0 nix flake update --output-lock-file flake.lock" + exit 1 + fi + set -euo pipefail + declare -a cmd_args=() + readarray -td $'\0' cmd_args < <( + ${lib.getExe pkgs.jq} --raw-output0 \ +