gate homebrew improt by darwin check to fix building on linux
This commit is contained in:
@@ -93,7 +93,6 @@
|
||||
inputs.homebrew.homeManagerModules.default
|
||||
];
|
||||
lumpiastyHome.macos = true;
|
||||
lumpiastyHome.brew = true;
|
||||
};
|
||||
nixpkgs.overlays = [
|
||||
inputs.claude-code.overlays.default
|
||||
|
||||
@@ -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;
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -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
@@ -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 ""
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user