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
-1
View File
@@ -93,7 +93,6 @@
inputs.homebrew.homeManagerModules.default inputs.homebrew.homeManagerModules.default
]; ];
lumpiastyHome.macos = true; lumpiastyHome.macos = true;
lumpiastyHome.brew = true;
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.claude-code.overlays.default inputs.claude-code.overlays.default
-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;
})
];
}
+5 -1
View File
@@ -1,6 +1,8 @@
{ flake, pkgs, lib, osConfig ? null, ... }: { flake, pkgs, lib, osConfig ? null, ... }:
{ {
options.lumpiastyHome.macos = lib.mkEnableOption "Macos specific things";
imports = [ imports = [
./gpg.nix ./gpg.nix
./pc.nix ./pc.nix
@@ -8,8 +10,10 @@
./gaming.nix ./gaming.nix
./fhsBash.nix ./fhsBash.nix
./linux.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 ./macos.nix
./brew.nix
] ++ lib.optionals (osConfig.lumpiasty.enablePlasma) [ ] ++ lib.optionals (osConfig.lumpiasty.enablePlasma) [
./plasma.nix ./plasma.nix
]; ];
+26 -3
View File
@@ -1,10 +1,33 @@
{ config, lib, pkgs, osConfig, ... }: { config, lib, pkgs, osConfig, ... }:
{ let
options.lumpiastyHome.macos = lib.mkEnableOption "Macos specific things"; brewPath = config.homebrew.brewPath;
in {
config = lib.mkIf config.lumpiastyHome.macos { config = lib.mkIf config.lumpiastyHome.macos {
targets.darwin.copyApps.enable = true; targets.darwin.copyApps.enable = true;
targets.darwin.linkApps.enable = false; 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 ""
)
);
}; };
} }