How to get to nixos release.nix in nixpkgs in a flake

Hallo everyone,

I am trying to get to nixos release in nixpkgs in a flake, however when i try nixpkgs.nixos.release does not exist. But in nixpkgs in the folder nixos there is a release.nix. Any answers or tips are appreciated!

You can get the path (as string) with nixpkgs.outPath + "nixos/releases.nix":

nix repl
> :lf nixpkgs
> outPath + "/nixos/releases.nix"

edit: forgot a ‘/’

1 Like

Thanks, that helps! I made a mistake. For anyone wanting to use this it is release.nix and not releases.nix. So in a flake, where nixpkgs is in inputs, this works for me:

self.inputs.nixpkgs.outPath + "/nixos/release.nix";