gate homebrew improt by darwin check to fix building on linux

This commit is contained in:
2026-09-11 01:22:57 +02:00
parent 93df208274
commit 6ed62f94db
4 changed files with 33 additions and 44 deletions
-37
View File
@@ -1,37 +0,0 @@
{ config, lib, pkgs, ... }:
let
brewPath = config.homebrew.brewPath;
in {
options.lumpiastyHome.brew = lib.mkEnableOption "Homebrew integration via home-manager-brew";
config = lib.mkMerge [
(lib.mkIf config.lumpiastyHome.brew {
homebrew = {
enable = true;
brewInstall = true;
update = true;
upgrade = true;
cleanup = true;
casks = [
"steam"
];
};
home.activation.homebrewInstall = lib.mkForce (
lib.hm.dag.entryAfter ["installPackages" "linkGeneration" "createGpgHomedir"] (
if config.homebrew.brewInstall then ''
if [ ! -f "${brewPath}" ]; then
echo "Homebrew not found (${brewPath}), installing..."
export PATH="${pkgs.curl}/bin:${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.gnugrep}/bin:${pkgs.gnused}/bin:$PATH"
${pkgs.bash}/bin/bash -c "$(${pkgs.curl}/bin/curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
'' else ""
)
);
})
(lib.mkIf (!config.lumpiastyHome.brew) {
homebrew.enable = lib.mkForce false;
})
];
}
+6 -2
View File
@@ -1,6 +1,8 @@
{ flake, pkgs, lib, osConfig ? null, ... }:
{
options.lumpiastyHome.macos = lib.mkEnableOption "Macos specific things";
imports = [
./gpg.nix
./pc.nix
@@ -8,9 +10,11 @@
./gaming.nix
./fhsBash.nix
./linux.nix
] ++ lib.optionals (osConfig ? system.defaults) [
# Can't use config.lumpiastyHome.macos here — imports are evaluated before config,
# causing infinite recursion. osConfig ? system.defaults detects nix-darwin.
./macos.nix
./brew.nix
] ++ lib.optionals (osConfig.lumpiasty.enablePlasma) [
./plasma.nix
];
}
}
+27 -4
View File
@@ -1,10 +1,33 @@
{ config, lib, pkgs, osConfig, ... }:
{
options.lumpiastyHome.macos = lib.mkEnableOption "Macos specific things";
let
brewPath = config.homebrew.brewPath;
in {
config = lib.mkIf config.lumpiastyHome.macos {
targets.darwin.copyApps.enable = true;
targets.darwin.linkApps.enable = false;
homebrew = {
enable = true;
brewInstall = true;
update = true;
upgrade = true;
cleanup = true;
casks = [
"steam"
];
};
home.activation.homebrewInstall = lib.mkForce (
lib.hm.dag.entryAfter ["installPackages" "linkGeneration" "createGpgHomedir"] (
if config.homebrew.brewInstall then ''
if [ ! -f "${brewPath}" ]; then
echo "Homebrew not found (${brewPath}), installing..."
export PATH="${pkgs.curl}/bin:${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.gnugrep}/bin:${pkgs.gnused}/bin:$PATH"
${pkgs.bash}/bin/bash -c "$(${pkgs.curl}/bin/curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
'' else ""
)
);
};
}
}