| 16 Dec 2024 |
connor (burnt/out) (UTC-8) | I'd recommend testing the waters and getting a sense of prior art done in terms of extending those; perhaps the folks in the Nixpkgs Stdenv room would be good to reach out to? https://matrix.to/#/#stdenv:nixos.org
After that (and you've gotten a list of people interested in or knowledgeable about such work), I think drafting an RFC would be the next step, to fully lay out the plan for design and implementation. If it's a relatively small change, maybe an RFC is unnecessary and a PR would be fine! | 06:55:30 |
SomeoneSerge (back on matrix) | That's the reason I've lately been ignoring flakes in personal projects: just stick to impure eval and autocalling. For me it's usually going in the direction of
{ nixpkgs ? <nixpkgs>
, pkgs ? import nixpkgs { inherit config; }
, lib ? pkgs.lib
, cudaSupport ? false
, config ? { inherit cudaSupport; }
}:
lib.makeScope pkgs.newScope (self: {
# ...
})
| 14:45:04 |
SomeoneSerge (back on matrix) | * That's the reason I've lately been ignoring flakes in personal projects: just stick to impure eval and autocalling. For me it's usually going in the direction of
{ nixpkgs ? <nixpkgs>
, pkgs ? import nixpkgs { inherit config; }
, lib ? pkgs.lib
, cudaSupport ? false
, config ? { inherit cudaSupport; }
}:
lib.makeScope pkgs.newScope (self: {
# ...
})
| 14:45:18 |
matthewcroughan | I actually ended up with a good pattern using flake.parts | 14:45:28 |
matthewcroughan | perSystem = { system, ... }: {
_module.args.rocmPkgs = import inputs.nixpkgs {
overlays = [
inputs.self.overlays.default
(self: super: {
python3 = super.python3.override {
packageOverrides = self: super: { torch = super.torch-bin; };
};
})
];
config.allowUnfree = true;
config.rocmSupport = true;
inherit system;
};
_module.args.nvidiaPkgs = import inputs.nixpkgs {
overlays = [
inputs.self.overlays.default
];
config.allowUnfree = true;
config.cudaSupport = true;
inherit system;
};
_module.args.pkgs = import inputs.nixpkgs {
overlays = [
inputs.self.overlays.default
];
config.allowUnfree = true;
inherit system;
};
};
| 14:46:22 |
matthewcroughan | * perSystem = { system, ... }: {
_module.args.rocmPkgs = import inputs.nixpkgs {
overlays = [
inputs.self.overlays.default
(self: super: {
python3 = super.python3.override {
packageOverrides = self: super: { torch = super.torch-bin; };
};
})
];
config.allowUnfree = true;
config.rocmSupport = true;
inherit system;
};
_module.args.nvidiaPkgs = import inputs.nixpkgs {
overlays = [
inputs.self.overlays.default
];
config.allowUnfree = true;
config.cudaSupport = true;
inherit system;
};
_module.args.pkgs = import inputs.nixpkgs {
overlays = [
inputs.self.overlays.default
];
config.allowUnfree = true;
inherit system;
};
};
| 14:46:27 |
matthewcroughan | Could be deduplicated using a function, but this is what it looks like unfolded | 14:46:38 |
matthewcroughan | Then other flake-modules have these rocmPkgs and nvidiaPkgs arguments passed to them | 14:47:01 |
matthewcroughan | perSystem = { config, pkgs, nvidiaPkgs, rocmPkgs, system, ... }: {
packages = {
comfyui-nvidia = nvidiaPkgs.comfyuiPackages.comfyui;
comfyui-amd = rocmPkgs.comfyuiPackages.comfyui;
};
};
| 14:47:04 |