Skip to main content
added 214 characters in body
Source Link
Chris Stryczynski
  • 6.7k
  • 12
  • 57
  • 99

I'd like to figure out the commit and date that a channel references.

For example how can determine that for the nixos2009 channel below?

sudo nix-channel --list nixos https://nixos.org/channels/nixos-20.09 nixos-2003 https://nixos.org/channels/nixos-20.03 nixos2003 https://nixos.org/channels/nixos-20.03 nixos2009 https://nixos.org/channels/nixos-20.09 unstable https://nixos.org/channels/nixpkgs-unstable 

I can see ls /nix/var/nix/profiles/per-user/root/channels-*/manifest.nix shows us the channel generations.. Which the latest channel generation has the following content:

cat /nix/var/nix/profiles/per-user/root/channels-61-link/manifest.nix | nixfmt [ { meta = { }; name = "nixos-20.09.2538.0cfd08f4881"; out = { outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; }; outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; outputs = [ "out" ]; system = "x86_64-linux"; type = "derivation"; } { meta = { }; name = "nixos-2003-20.03.3324.929768261a3"; out = { outPath = "/nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3"; }; 

Potentially I can get it from the store path above like /nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3 - but I'm not sure (and not sure what that "path" is called either).

Seems like an answer for this is documented here: https://discourse.nixos.org/t/how-to-see-what-commit-is-my-channel-on/4818/6?u=chrissound though that is not a programmatic way (which is what I'm looking for).

I'd like to figure out the commit and date that a channel references.

For example how can determine that for the nixos2009 channel below?

sudo nix-channel --list nixos https://nixos.org/channels/nixos-20.09 nixos-2003 https://nixos.org/channels/nixos-20.03 nixos2003 https://nixos.org/channels/nixos-20.03 nixos2009 https://nixos.org/channels/nixos-20.09 unstable https://nixos.org/channels/nixpkgs-unstable 

I can see ls /nix/var/nix/profiles/per-user/root/channels-*/manifest.nix shows us the channel generations.. Which the latest channel generation has the following content:

cat /nix/var/nix/profiles/per-user/root/channels-61-link/manifest.nix | nixfmt [ { meta = { }; name = "nixos-20.09.2538.0cfd08f4881"; out = { outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; }; outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; outputs = [ "out" ]; system = "x86_64-linux"; type = "derivation"; } { meta = { }; name = "nixos-2003-20.03.3324.929768261a3"; out = { outPath = "/nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3"; }; 

Potentially I can get it from the store path above like /nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3 - but I'm not sure (and not sure what that "path" is called either).

I'd like to figure out the commit and date that a channel references.

For example how can determine that for the nixos2009 channel below?

sudo nix-channel --list nixos https://nixos.org/channels/nixos-20.09 nixos-2003 https://nixos.org/channels/nixos-20.03 nixos2003 https://nixos.org/channels/nixos-20.03 nixos2009 https://nixos.org/channels/nixos-20.09 unstable https://nixos.org/channels/nixpkgs-unstable 

I can see ls /nix/var/nix/profiles/per-user/root/channels-*/manifest.nix shows us the channel generations.. Which the latest channel generation has the following content:

cat /nix/var/nix/profiles/per-user/root/channels-61-link/manifest.nix | nixfmt [ { meta = { }; name = "nixos-20.09.2538.0cfd08f4881"; out = { outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; }; outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; outputs = [ "out" ]; system = "x86_64-linux"; type = "derivation"; } { meta = { }; name = "nixos-2003-20.03.3324.929768261a3"; out = { outPath = "/nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3"; }; 

Potentially I can get it from the store path above like /nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3 - but I'm not sure (and not sure what that "path" is called either).

Seems like an answer for this is documented here: https://discourse.nixos.org/t/how-to-see-what-commit-is-my-channel-on/4818/6?u=chrissound though that is not a programmatic way (which is what I'm looking for).

Source Link
Chris Stryczynski
  • 6.7k
  • 12
  • 57
  • 99

How do I determine which commit a channel references with Nixos?

I'd like to figure out the commit and date that a channel references.

For example how can determine that for the nixos2009 channel below?

sudo nix-channel --list nixos https://nixos.org/channels/nixos-20.09 nixos-2003 https://nixos.org/channels/nixos-20.03 nixos2003 https://nixos.org/channels/nixos-20.03 nixos2009 https://nixos.org/channels/nixos-20.09 unstable https://nixos.org/channels/nixpkgs-unstable 

I can see ls /nix/var/nix/profiles/per-user/root/channels-*/manifest.nix shows us the channel generations.. Which the latest channel generation has the following content:

cat /nix/var/nix/profiles/per-user/root/channels-61-link/manifest.nix | nixfmt [ { meta = { }; name = "nixos-20.09.2538.0cfd08f4881"; out = { outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; }; outPath = "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881"; outputs = [ "out" ]; system = "x86_64-linux"; type = "derivation"; } { meta = { }; name = "nixos-2003-20.03.3324.929768261a3"; out = { outPath = "/nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3"; }; 

Potentially I can get it from the store path above like /nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3 - but I'm not sure (and not sure what that "path" is called either).