1
0

Don't manage Homebrew versions using Nix

This commit is contained in:
Jip J. Dekker 2024-11-11 17:03:48 +11:00
parent e2bb6dc5cf
commit 33cb1c5488
No known key found for this signature in database
5 changed files with 47 additions and 290 deletions

View File

@ -17,6 +17,7 @@ in
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
cleanup = "zap";
};
@ -25,31 +26,31 @@ in
"openssl" # Required by cargo-update (`LDFLAGS="-L/usr/local/opt/openssl@3/lib" CPPFLAGS="-I/usr/local/opt/openssl@3/include" cargo install cargo-update`)
"scip"
];
taps = builtins.attrNames config.nix-homebrew.taps;
};
taps = [
"dekker1/minizinc"
];
# These app IDs are from using the mas CLI app
# mas = mac app store
# https://github.com/mas-cli/mas
#
# $ nix shell nixpkgs#mas
# $ mas search <app name>
#
homebrew.masApps = {
"1Password for Safari" = 1569813296;
"Baking Soda" = 1601151613;
"Keynote" = 409183694;
"Microsoft Excel" = 462058435;
"Microsoft Word" = 462054704;
"Numbers" = 409203825;
"Pages" = 409201541;
"Pixelmator Pro" = 1289583905;
"Qantas" = 1468230799;
"Textual IRC Client" = 1262957439;
"The Unarchiver" = 425424353;
"Userscripts-Mac-App" = 1463298887;
"Vinegar" = 1591303229;
"Wipr" = 1320666476;
# These app IDs are from using the mas CLI app
# mas = mac app store
# https://github.com/mas-cli/mas
#
# $ nix shell nixpkgs#mas
# $ mas search <app name>
#
masApps = {
"1Password for Safari" = 1569813296;
"Baking Soda" = 1601151613;
"Keynote" = 409183694;
"Numbers" = 409203825;
"Pages" = 409201541;
"Pixelmator Pro" = 1289583905;
"Qantas" = 1468230799;
"Textual IRC Client" = 1262957439;
"The Unarchiver" = 425424353;
"Userscripts-Mac-App" = 1463298887;
"Vinegar" = 1591303229;
"Wipr" = 1320666476;
};
};
# Enable home-manager

218
flake.lock generated
View File

@ -1,22 +1,5 @@
{
"nodes": {
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1727016223,
"narHash": "sha256-iZqd91Cp4O02BU6/eBZ0UZgJN8AlwH+0geQUpqF176E=",
"owner": "Homebrew",
"repo": "brew",
"rev": "916044581862c32fc2365e8e9ff0b1507a98925e",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "4.3.24",
"repo": "brew",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@ -24,11 +7,11 @@
]
},
"locked": {
"lastModified": 1729382845,
"narHash": "sha256-REiWck1zIOnZIgGmmOWfwvkQw1f4UrBsxxOSKVSAG4w=",
"lastModified": 1731153869,
"narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "a001f44cfc47164839eb61c6b1e7f4288813f7e8",
"rev": "5c74ab862c8070cbf6400128a1b56abb213656da",
"type": "github"
},
"original": {
@ -38,40 +21,6 @@
"type": "github"
}
},
"dgfl-tap": {
"flake": false,
"locked": {
"lastModified": 1713015168,
"narHash": "sha256-zQwGwu6PUL7Gv7PeVSQU1Edqji2jSGkZchJ5/03IrlQ=",
"owner": "dgfl-gh",
"repo": "homebrew-taps",
"rev": "e7b966a234cff599e79a5313939cfcfd390537e1",
"type": "github"
},
"original": {
"owner": "dgfl-gh",
"repo": "homebrew-taps",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -93,145 +42,13 @@
"type": "github"
}
},
"homebrew-bundle": {
"flake": false,
"locked": {
"lastModified": 1729292976,
"narHash": "sha256-jDdFAJrKjPdlEvNs3seqAELIJxdoSFwEcrcnC/1aJVY=",
"owner": "homebrew",
"repo": "homebrew-bundle",
"rev": "6dd24ba3e950ac272f80d9d104cd2ae763b092b7",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-bundle",
"type": "github"
}
},
"homebrew-cask": {
"flake": false,
"locked": {
"lastModified": 1729415598,
"narHash": "sha256-O/Gr5lX03ADKWKVoJR7ydphbVsvK5YELXYl5Fuu3Utg=",
"owner": "homebrew",
"repo": "homebrew-cask",
"rev": "1071822669cdcf7ea87b42e0a5fd4f402c8e8f49",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-cask",
"type": "github"
}
},
"homebrew-cask-fonts": {
"flake": false,
"locked": {
"lastModified": 1715830477,
"narHash": "sha256-AjZYkbKvpRIHUwSimOebOQ/AuwP7Z3eIKFTyJaHyG1g=",
"owner": "homebrew",
"repo": "homebrew-cask-fonts",
"rev": "0ed20f35d21ebc3f4f829689b101078718ad5ce1",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-cask-fonts",
"type": "github"
}
},
"homebrew-core": {
"flake": false,
"locked": {
"lastModified": 1729407761,
"narHash": "sha256-kN1LfFFnVDpimYhHY3xaAsyG3ws/MihMMM6L7V18mwE=",
"owner": "homebrew",
"repo": "homebrew-core",
"rev": "5eb3a4076a7106d068b88bd8ea6b7493590c724f",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-core",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1716329735,
"narHash": "sha256-ap51w+VqG21vuzyQ04WrhI2YbWHd3UGz0e7dc/QQmoA=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "eac4f25028c1975a939c8f8fba95c12f8a25e01c",
"type": "github"
},
"original": {
"owner": "LnL7",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src",
"flake-utils": "flake-utils",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1728153462,
"narHash": "sha256-jOF15LIzDf7SIkbjzhKq9nlnkS1aFTUCiIo92ipXMY4=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "86af3bb8f7d365eb496ef5553646ec2fe06a3662",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "nix-homebrew",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687274257,
"narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=",
"path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source",
"rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1716330097,
"narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1729242558,
"narHash": "sha256-VgcLDu4igNT0eYua6OAl9pWCI0cYXhDbR+pWP44tte0=",
"lastModified": 1730891215,
"narHash": "sha256-i85DPrhDuvzgvIWCpJlbfM2UFtNYbapo20MtQXsvay4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4a3f2d3195b60d07530574988df92e049372c10e",
"rev": "c128e44a249d6180740d0a979b6480d5b795c013",
"type": "github"
},
"original": {
@ -244,29 +61,8 @@
"root": {
"inputs": {
"darwin": "darwin",
"dgfl-tap": "dgfl-tap",
"home-manager": "home-manager",
"homebrew-bundle": "homebrew-bundle",
"homebrew-cask": "homebrew-cask",
"homebrew-cask-fonts": "homebrew-cask-fonts",
"homebrew-core": "homebrew-core",
"nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs_3"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
"nixpkgs": "nixpkgs"
}
}
},

View File

@ -11,40 +11,11 @@
url = "github:LnL7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew = {
url = "github:zhaofengli/nix-homebrew";
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-cask-fonts = {
url = "github:homebrew/homebrew-cask-fonts";
flake = false;
};
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
dgfl-tap = {
url = "github:dgfl-gh/homebrew-taps";
flake = false;
};
};
outputs =
{ self
, darwin
, home-manager
, homebrew-bundle
, homebrew-cask
, homebrew-cask-fonts
, homebrew-core
, dgfl-tap
, nix-homebrew
, nixpkgs
} @inputs:
let
@ -73,23 +44,7 @@
system = "aarch64-darwin";
specialArgs = inputs;
modules = [
nix-homebrew.darwinModules.nix-homebrew
home-manager.darwinModules.home-manager
{
nix-homebrew = {
enable = true;
user = "${user}";
taps = {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
"homebrew/homebrew-cask-fonts" = homebrew-cask-fonts;
"homebrew/homebrew-bundle" = homebrew-bundle;
"dgfl-gh/homebrew-taps" = dgfl-tap;
};
mutableTaps = false;
autoMigrate = true;
};
}
./darwin
];
};

View File

@ -6,7 +6,6 @@ let
email = "jip@dekker.one";
in
{
bat.enable = true;
direnv = {
@ -74,8 +73,8 @@ in
jujutsu = {
enable = true;
settings = {
email = "jip@dekker.one";
name = "Jip J. Dekker";
email = "jip@dekker.one";
name = "Jip J. Dekker";
};
};
@ -247,11 +246,6 @@ in
start = "open";
less = "bat";
ls = "eza";
set-light-theme = "kitty +kitten themes GitHub Dark";
set-dark-theme = "kitty +kitten themes GitHub Light";
brew-backup = "brew bundle dump --global --no-lock --formula --cask --mas --tap --force";
brew-cleanup = "brew bundle cleanup --global --no-lock --force --zap";
brew-restore = "brew bundle install --global --no-lock";
};
sessionVariables = {
# Set default editor
@ -265,7 +259,15 @@ in
# Rust settings
RUSTC_WRAPPER = "sccache";
};
initExtra = "zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'";
initExtra = ''
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
# Load Homebrew shell environment
if [[ -f "/opt/homebrew/bin/brew" && -x $(realpath "/opt/homebrew/bin/brew") ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -f "/usr/local/bin/brew" && -x $(realpath "/usr/local/bin/brew") ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
'';
historySubstringSearch = {
enable = true;
};

View File

@ -25,10 +25,13 @@ with pkgs; [
(nerdfonts.override { fonts = [ "Go-Mono" ]; })
# C(++) development tools
sccache
bison
clang-tools
cmake
flex
llvm
ninja
sccache
# Python development tools
black