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

use realChannel to overlay #483

Merged
merged 4 commits into from
Aug 4, 2022
Merged

use realChannel to overlay #483

merged 4 commits into from
Aug 4, 2022

Conversation

GTrunSec
Copy link
Contributor

@GTrunSec GTrunSec commented Aug 3, 2022

fixes: #464, #469

@GTrunSec GTrunSec marked this pull request as draft August 3, 2022 07:30
@GTrunSec GTrunSec marked this pull request as ready for review August 3, 2022 07:51
@montchr
Copy link
Collaborator

montchr commented Aug 3, 2022

This is awesome, thanks!

Though I am not sure at the moment what would happen if one of the packages in a function overlay is only supported on Darwin systems. Since the real channel arg uses the default NixOS system, would that result in an error for Darwin-only packages?

I don’t think there are any such packages in the examples, so while the checks pass now, I’d want to make sure we have a Darwin-only package to include in one of the examples before merging.

@montchr montchr self-assigned this Aug 3, 2022
@montchr
Copy link
Collaborator

montchr commented Aug 3, 2022

To my surprise, it seemed like darwin-specific packages were working in c55f079 and 24cb8eb, so I'm not sure that 327b569 is actually necessary at this point.

@GTrunSec
Copy link
Contributor Author

GTrunSec commented Aug 3, 2022

so I'm not sure that 327b569 is actually necessary at this point.

but, user must set the nixos.hostDefaults = { channelName = "xxx", system ="x86_64-linux"}

@montchr
Copy link
Collaborator

montchr commented Aug 3, 2022

To clarify my initial concern about cross-host-type packages, I had thought that the system would cause problems, not the channel itself. But upon inspection, it turns out that darwin-only packages like skhd and mas are still present under unsupported system attrs (on a NixOS machine fwiw):

nix-repl> flake.inputs.nixos-stable.legacyPackages.x86_64-linux.skhd.name
"skhd-0.3.5"

nix-repl> flake.inputs.nixos-stable.legacyPackages.x86_64-linux.mas.name  
"mas-1.8.6"

But, as expected, the derivations can't be evaluated if called. Which is fine as long as there's no IFD happening.

nix-repl> flake.inputs.nixos-stable.legacyPackages.x86_64-linux.mas     
error: Package ‘mas-1.8.6’ in /nix/store/p02y3rdbshbsrdl47vnrf10bq197yf9f-source/pkgs/os-specific/darwin/mas/default.nix:35 is not supported on ‘x86_64-linux’, refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.
«derivation 

montchr added a commit to montchr/dotfield that referenced this pull request Aug 3, 2022
montchr added a commit to montchr/dotfield that referenced this pull request Aug 3, 2022
@GTrunSec
Copy link
Contributor Author

GTrunSec commented Aug 3, 2022

This pr only solves the problem of overlay detection.

@montchr
Copy link
Collaborator

montchr commented Aug 4, 2022

@GTrunSec thanks again for this, it's a huge help 😄 -- i've updated my personal flake (uses emacs-overlay) and was able to rebuild successfully without the weird workarounds.

@GTrunSec GTrunSec deleted the realChannel branch August 5, 2022 02:07
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.

emacs-overlay cause errors
2 participants