GithubHelp home page GithubHelp logo

Comments (11)

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 18, 2024 1

As of commit states... I Will fix the breaking stuff later, but I am quite happy with the new implementation/dataflow of it.

Feel free to try out github:/gytis-ivaskevicius/flake-utils-plus/staging

Edit:
Also, I went through your config - one note: system = "x86_64-linux"; in nixosProfiles is redundant since that's the default

from flake-utils-plus.

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 18, 2024

When using flake-utils-plus cases like these can be specified in two areas:

  1. For channel-specific configuration (i believe this is what you are looking for) https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/master/examples/fully-featured-flake.nix#L46-L48
  2. Or globally (applied to all channels) https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/master/examples/fully-featured-flake.nix#L63-L66

from flake-utils-plus.

chvp avatar chvp commented on June 18, 2024

Yes, I found that, but I build up a list of allowed packages in the nixos modules for my machines, which I don't have access to at that point.

from flake-utils-plus.

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 18, 2024

Interesting use case, admittedly I don't really see much point in doing something like that but ill look into it regardless. I obviously have not tested it but fix should be as simple as this:
Replace this code block: https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/master/systemFlake.nix#L75-L85
with:

 {config, ...}:  {
          networking.hostName = name;

          nixpkgs = {
            pkgs = selectedNixpkgs;
            config = selectedNixpkgs.config // config.nixpkgs.config;
          };

          system.configurationRevision = mkIf (self ? rev) self.rev;
          nix.package = mkDefault selectedNixpkgs.nixUnstable;
        }

(two lines changed, will test it out once I am available)

from flake-utils-plus.

chvp avatar chvp commented on June 18, 2024

That doesn't seem to work. I think the problem is caused by the pkgs = selectedNixpkgs; line. The config applied in nixpkgs.config doesn't seem to apply to it, but only to the nixpkgs that is used for nixpkgs.lib.nixosSystem. When I remove the pkgs = selectedNixpkgs line (and manually add the overlays I use) it works as expected.

from flake-utils-plus.

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 18, 2024

Pushed some changes, fixed channels switching, few other changes.
What's unfortunate is that it seems that I will not be able to implement nixpkgs.config.xyz with the addition of channel patching (User will be forced to pick one of these features), but we will see. I Will give it some more thought overnight

The next release is planned for the weekend.

from flake-utils-plus.

chvp avatar chvp commented on June 18, 2024

Ah, that is unfortunate, the easy patching was one of my main reasons for starting to use this. Am I correct in thinking that this is the main blocker for the combination? Do you know what the underlying issue is?

from flake-utils-plus.

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 18, 2024

Yes, @chvp, you are correct. More specifically because of this NixOS/nix#4669.

But here is a solution to your specific problem:
TL;DR: implement explicit unfree package definitions in different manner
How?
in your flake.nix:

{
inputs.nixpkgs.input = nixpkgs;
inputs.nixpkgs.overlayBuilder = channels: [
    (final: prev: { unfree = channels.unfree; })
];

inputs.unfree.input = nixpkgs;
inputs.unfree.config.allowUnfree = true;
}

(untested, should more or less work, might have a typo or two)

And instead of building some fancy array of allowed packages now, you can define unfree packages by simply typing pkgs.unfree.google-chrome

This achieves the same result while being much simpler, easier to implement, and resulting in fewer lines of code

from flake-utils-plus.

chvp avatar chvp commented on June 18, 2024

Hmm, that is an interesting alternative for making the unfree packages explicit. I'll try that out tomorrow. Thanks for the issue on nix, I subscribed to it to keep updated.

from flake-utils-plus.

chvp avatar chvp commented on June 18, 2024

It took a while before I was able to get to it, but your solution doesn't seem to work. It refuses to evaluate because of unfree packages.

from flake-utils-plus.

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 18, 2024

I got a strong feeling that this is going to be one of the limitations of Nix (patching + dynamic configuration). Will need to look into it more :/

from flake-utils-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.