gate homebrew improt by darwin check to fix building on linux
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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, ... }:
|
{ 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
@@ -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 ""
|
||||||
|
)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user