Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create version.nix containing used nixos version #2508

Closed
wants to merge 1 commit into from

Conversation

juliapath
Copy link
Contributor

This ensures, that release.nix and shell.nix always use the same version
of nixos. See #2506 (comment).

This ensures, that release.nix and shell.nix always use the same version
of nixos.
Copy link
Member

@shlevy shlevy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it nixpkgs.nix instead?

@edolstra
Copy link
Member

edolstra commented Nov 2, 2018

Or even better, moved into release-common.nix which exists exactly for this purpose.

@juliapath
Copy link
Contributor Author

@edolstra But release-common.nix takes a pkgs argument itself and is called with different pkgs arguments in release.nix. Something like this would be possible for release-common.nix:

{ nixpkgs     ? null
, nixpkgsArgs ? {}
}:

with if nixpkgs != null
  then import nixpkgs nixpkgsArgs
  else import (builtins.fetchGit ...) nixpkgsArgs;

rec {
  inherit pkgs,
  ...
}

Then release.nix could look like this

{ nixpkgs ? null
, ...
}:
...
  build = pkgs.lib.genAttrs systems (system:
    with import ./release-common.nix { inherit nixpkgs; nixpkgsArgs = { inherit system; }; };
...

Alternatively release-common could look like this:

{ nixpkgs ? null }: nixpkgsArgs:
...

and release.nix like this:

{ nixpkgs ? null
, ...
}:
releaseCommon = import ./release-common.nix {inherit nixpkgs;}
...
  build = pkgs.lib.genAttrs systems (system:
    with releaseCommon { inherit system; };

I am very new to nix and do not know which would be the most idiomatic. To me a separate version.nix or nixpkgs.nix seemed the most straight-forward.

@roberth
Copy link
Member

roberth commented Oct 1, 2020

This has been resolved by moving to flakes and flakes-compat.

@zimbatm zimbatm closed this Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants