From 9101a0c42649d3096f245f24f111ea180586d1c4 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 1 May 2025 17:17:48 +0200 Subject: [PATCH] ljksdfjklsdfjkl --- profiles/auto-upgrade.nix | 64 ++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 11 deletions(-) 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 \ +