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

specialisations break the system argument #46

Closed
bbjubjub2494 opened this issue Dec 28, 2020 · 4 comments · Fixed by #47
Closed

specialisations break the system argument #46

bbjubjub2494 opened this issue Dec 28, 2020 · 4 comments · Fixed by #47
Labels
bug Something isn't working

Comments

@bbjubjub2494
Copy link
Contributor

bbjubjub2494 commented Dec 28, 2020

Describe the bug
A clear and concise description of what the bug is.
When the NixOS specialisations feature is used and any NixOS module evaluates the system attribute in its arguments, an EvalError occurs when instantating.

Introduced by 684804e

relevant nixpkgs snippet

To Reproduce
Steps to reproduce the behavior:

  1. Check Minimal Working Example
  2. See error

Expected behavior
The configuration should build cleanly.

Additional context

@nrdxp
Copy link
Collaborator

nrdxp commented Dec 28, 2020

I'm unable to reproduce this after checking out your mentioned branch and running nix flake check. Also tried rebuild iso. What exactly is the error your getting, or what command are you running to produce the error on this branch?

edit Nevermind, I got the error. Working now to find best solution. Possibly reverting the commit might be the best thing to do.

@nrdxp
Copy link
Collaborator

nrdxp commented Dec 28, 2020

I can't remember what my initial impetus was for adding this to extraArgs. I am assuming it was to access the value of system, which should also be available via nixpkgs.system, which apparently, I did't know at the time. Thus, it seems that the best solution is simply to remove the extraArgs attribute all together and if you need to reference your current system in your config do something like so:

{ config, ... }:
{
    lib.whatIsMySystem = config.nixpkgs.system; 
}

I'll send in a pull to close this in a bit, unless you have any objections?

@bbjubjub2494
Copy link
Contributor Author

I would say pkgs.system is slightly more future-proof since it comes somewhat directly from flake.nix rather than through some NixOS snippets that set the default value that we don't control. otherwise. It's also shorter.

nrdxp added a commit that referenced this issue Dec 28, 2020
Fix #46 by reverting commit 684804e.

If you need the value of `system`, use `config.nixpkgs.system` instead.
@nrdxp
Copy link
Collaborator

nrdxp commented Dec 28, 2020

good point I'll rebase the pr

nrdxp added a commit that referenced this issue Dec 28, 2020
Fixes #46 by reverting commit 684804e.

If you need the value of system, use `pkgs.system` instead.
@nrdxp nrdxp closed this as completed in #47 Dec 28, 2020
@nrdxp nrdxp added the bug Something isn't working label Dec 30, 2020
blaggacao pushed a commit to blaggacao/devos that referenced this issue Jul 6, 2021
Fixes divnix#46 by reverting commit f228ca4.

If you need the value of system, use `pkgs.system` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants