Adds Homebrew support and packages
parent
c25c30e461
commit
182fbba6ad
|
@ -4,7 +4,7 @@ This is the [Nix] and [Home Manager] configuration for managing my MacBook.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
First install [Nix]. Then, in the repo directory, run `nix develop` to get into the Nix shell.
|
First install [Nix] and [Homebrew]. Then, in the repo directory, run `nix develop` to get into the Nix shell.
|
||||||
|
|
||||||
To set up the MacBook as per the config, run:
|
To set up the MacBook as per the config, run:
|
||||||
|
|
||||||
|
@ -31,5 +31,6 @@ just <repo_dir>/switch # or update or clean
|
||||||
```
|
```
|
||||||
|
|
||||||
[Nix]: https://nixos.org
|
[Nix]: https://nixos.org
|
||||||
|
[Homebrew]: https://brew.sh
|
||||||
[Home Manager]: https://github.com/nix-community/home-manager
|
[Home Manager]: https://github.com/nix-community/home-manager
|
||||||
[`just`]: https://just.systems
|
[`just`]: https://just.systems
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
description = "Home Manager configuration of Abhinav Sarkar";
|
description = "Nix Darwin + Home Manager configuration of Abhinav Sarkar";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?rev=5f5210aa20e343b7e35f40c033000db0ef80d7b9";
|
nixpkgs.url = "github:nixos/nixpkgs?rev=5f5210aa20e343b7e35f40c033000db0ef80d7b9";
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
|
./homebrew.nix
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
{ ... }: {
|
||||||
|
homebrew = {
|
||||||
|
enable = true;
|
||||||
|
onActivation = {
|
||||||
|
autoUpdate = false;
|
||||||
|
cleanup = "uninstall";
|
||||||
|
upgrade = false;
|
||||||
|
};
|
||||||
|
global = {
|
||||||
|
autoUpdate = false;
|
||||||
|
brewfile = true;
|
||||||
|
};
|
||||||
|
casks = [
|
||||||
|
"amethyst"
|
||||||
|
"appcleaner"
|
||||||
|
"calibre"
|
||||||
|
"dropbox"
|
||||||
|
"fanny"
|
||||||
|
"firefox"
|
||||||
|
"garmin-express"
|
||||||
|
"google-chrome"
|
||||||
|
"homebrew/cask/handbrake"
|
||||||
|
"monodraw"
|
||||||
|
"obsidian"
|
||||||
|
"spotify"
|
||||||
|
"steam"
|
||||||
|
"telegram"
|
||||||
|
"utm"
|
||||||
|
"vlc"
|
||||||
|
];
|
||||||
|
masApps = {
|
||||||
|
Amphetamine = 937984704;
|
||||||
|
Bear = 1091189122;
|
||||||
|
GarageBand = 682658836;
|
||||||
|
iMovie = 408981434;
|
||||||
|
Ivory = 6444602274;
|
||||||
|
Keynote = 409183694;
|
||||||
|
Kindle = 302584613;
|
||||||
|
NextDNS = 1464122853;
|
||||||
|
Numbers = 409203825;
|
||||||
|
Pages = 409201541;
|
||||||
|
Reeder = 1449412482;
|
||||||
|
TestFlight = 899247664;
|
||||||
|
Xcode = 497799835;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
10
justfile
10
justfile
|
@ -30,15 +30,21 @@ _switch: _build
|
||||||
# switch to latest home-manager generation
|
# switch to latest home-manager generation
|
||||||
switch: (_run "_switch")
|
switch: (_run "_switch")
|
||||||
|
|
||||||
_update: && _switch
|
_update: && _switch _brew-update
|
||||||
nix flake update --commit-lock-file "{{ root_dir }}"
|
nix flake update --commit-lock-file "{{ root_dir }}"
|
||||||
$NIXPKGS_PATH/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh > \
|
$NIXPKGS_PATH/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh > \
|
||||||
{{ root_dir }}/programs/vscode/extensions.nix
|
{{ root_dir }}/programs/vscode/extensions.nix
|
||||||
|
|
||||||
|
_brew-update:
|
||||||
|
brew update
|
||||||
|
brew upgrade
|
||||||
|
mas upgrade
|
||||||
|
|
||||||
# update packages and switch
|
# update packages and switch
|
||||||
update: (_run "_update")
|
update: (_run "_update")
|
||||||
|
|
||||||
# clean up nix garbage
|
# clean up nix garbage
|
||||||
clean:
|
clean:
|
||||||
home-manager expire-generations "-7 days"
|
home-manager expire-generations "-7 days"
|
||||||
nix-collect-garbage -d --delete-old
|
sudo nix-collect-garbage -d --delete-older-than 7d
|
||||||
|
brew cleanup --prune 7
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ inputs, config, pkgs, ... }:
|
{ inputs, config, osConfig, pkgs, ... }:
|
||||||
|
|
||||||
let username = config.home.username;
|
let username = config.home.username;
|
||||||
in {
|
in {
|
||||||
|
@ -25,6 +25,14 @@ in {
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
fzf_configure_bindings --git_status=\cs --history=\cr --variables=\cv --directory=\cf --git_log=\cg
|
fzf_configure_bindings --git_status=\cs --history=\cr --variables=\cv --directory=\cf --git_log=\cg
|
||||||
neofetch
|
neofetch
|
||||||
|
|
||||||
|
if test -d (brew --prefix)"/share/fish/completions"
|
||||||
|
set -p fish_complete_path (brew --prefix)/share/fish/completions
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -d (brew --prefix)"/share/fish/vendor_completions.d"
|
||||||
|
set -p fish_complete_path (brew --prefix)/share/fish/vendor_completions.d
|
||||||
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
|
@ -32,6 +40,7 @@ in {
|
||||||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||||
fenv source /etc/profiles/per-user/${username}/etc/profile.d/hm-session-vars.sh
|
fenv source /etc/profiles/per-user/${username}/etc/profile.d/hm-session-vars.sh
|
||||||
fish_add_path -m ~/.local/bin ~/.cabal/bin /etc/profiles/per-user/${username}/bin
|
fish_add_path -m ~/.local/bin ~/.cabal/bin /etc/profiles/per-user/${username}/bin
|
||||||
|
eval "$(${osConfig.homebrew.brewPrefix}/brew shellenv)"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue