Skip to content

Per nixosConfiguration pkgs instances? #106

@lpchaim

Description

@lpchaim

This isn't really an issue per se, feel free to close if it doesn't feel appropriate. I'm basically just wondering if this use case I've come up with is possible and looking for guidance. For all I know I might just be missing something simple!

Anyway, I have the following snippet on my flake:

  outputs = inputs:
    inputs.snowfall-lib.mkFlake {
      inherit inputs;
      src = ./.;

      channels-config = {
        allowUnfree = true;
        cudaSupport = true;
      };
    };

Note I have cudaSupport enabled on my channels-config, since my main rig has a NVIDIA GPU. Say I have another machine with an AMD GPU and would like to also add rocmSupport = true as well.

That does in fact work and builds just fine, but I've stumbled upon some services such as ollama which treat cuda and rocm support as mutually exclusive, so when both are enabled it spits out a warning and defaults to none by default. Not really a big deal since I can just have modules override that manually, but it does result in a somewhat inconsistent configuration without manual intervention and I figure it builds packages with unnecessary support for cuda/rocm the actual hardware may not support.

Can I perhaps wire something like that up on my end? Maybe somehow build a pkgs instance by hand and set specific configurations to use it, or specialized overlays I'd selectively apply? I've read the docs and messed around but haven't been able to come up with much, at least not without bypassing snowfalllib and building said configurations by hand or ugly hacks I'd like to avoid if at all possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions