Is there a way to get the flake store path that was used to generate a system, e.g. the one pointed to by
/run/current-system and others?
Specifically I mean the store path that you can get from
nix flake metadata in the flake repo itself.
I’m trying to write some tooling around giving myself a reminder to update the flake (to keep nixpkgs up to date), and currently I just look at the
flake.lock file in the checked out flake repo itself, but that only tracks whether the flake repo has been updated, but not whether it’s been applied or not, so I’d like to be able to inspect the lock file that was stored in the Nix store when the system was built.
My first thought was to use
nix show-derivation -r /run/current-system and parse the output, but I don’t seem to be able to find the source path. It’s very likely I’m looking in the wrong part of the output, but I’m hoping someone can point me in the right direction.