How to integrate nix-homebrew into den? #96
-
|
I'm lost on how to set den up with nix-homebrew support. I'm very intrigued and there is lots of documentation and code but I'm quite overwhelmed. This is how one is supposed to integrate it into the flake.nix regular nix-darwin style: I don't know where the equivalent of the Thanks in advance for any advice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
|
Hey @bennyandresen, Our default template is a good start, you only need to have a nix-darwin input somewhere. Here is where the darwinConfiguration is being created, Den automatically detects how to build the OS based on your host system. So, following our default-template example, the darwin host is named { inputs, ... }:
{
den.aspects.apple = {
darwin = {
# everything inside here is a nix-darwin module, so basically anything you did before
# when creating darwinConfiguration manually can be added here.
# like any darwin module, you can import other modules. All these are from your code:
imports = [
inputs.nix-homebrew.darwinModules.nix-homebrew
{ nix-homebrew = {
enable = true;
enableRosetta = true;
user = "benny";
taps = {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
};
# declarative taps
mutableTaps = false;
}; }
# nix-homebrew / nix-darwin tap awareness
({ config, ... }: {
homebrew.taps = builtins.attrNames config.nix-homebrew.taps;
})
];
};
};
}Just make sure you also have a Hope that helps, thanks for trying Den :) |
Beta Was this translation helpful? Give feedback.
There's no magic, your intuition is correct, if you add the
flake-file.inputs.nix-homebrew.url, after runningnix run .#write-flake, then you access it viainputs.nix-homebrew(NOTinputs.flake-file.inputs.nix-homebrewthat does not exist),inputscome from your flake manifest. So there's no magic regarding how inputs are read.Anything that you previously did in a nix-darwin setup, translates directly into Den:
Maybe I should just used a short example like this, instead of trying to paste your previous code to make the answer clear.
Also, looking at your rep…