more darwin cleanup

This commit is contained in:
Noah Masur
2022-06-19 23:44:29 -04:00
parent a8f497e226
commit e22a4f3df2
18 changed files with 116 additions and 103 deletions

View File

@ -1,34 +1,15 @@
{ lib, ... }: {
{ ... }: {
imports = [
./system.nix
./user.nix
./tmux.nix
./utilities.nix
./hammerspoon.nix
./alacritty.nix
./dotfiles.nix
./fonts.nix
./hammerspoon.nix
./homebrew.nix
./system.nix
./tmux.nix
./user.nix
./utilities.nix
];
options = with lib; {
user = mkOption {
type = types.str;
description = "Primary user of the system";
};
gui = {
enable = mkEnableOption {
description = "Enable graphics";
default = false;
};
colorscheme = mkOption {
type = types.attrs;
description = "Base16 color scheme";
};
};
};
}

View File

@ -0,0 +1,28 @@
{ config, ... }: {
home-manager.users.${config.user} = {
programs.fish = {
shellAbbrs = {
nr = "rebuild-darwin";
nro = "rebuild-darwin offline";
};
functions = {
rebuild-nixos = {
body = ''
if test "$argv[1]" = "offline"
set option "--option substitute false"
end
pushd ${config.dotfilesPath}
git add --all
popd
commandline -r darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook
commandline -f execute
'';
};
};
};
};
}

14
modules/darwin/fonts.nix Normal file
View File

@ -0,0 +1,14 @@
{ config, pkgs, ... }: {
home-manager.users.${config.user} = {
home.packages = with pkgs;
[ (nerdfonts.override { fonts = [ "FiraCode" ]; }) ];
programs.alacritty.settings = {
font.normal.family = "FiraCode Nerd Font Mono";
};
};
}

View File

@ -1,5 +1,8 @@
{ config, ... }: {
# Homebrew - Mac-specific packages that aren't in Nix
# Requires Homebrew to be installed (works if you rebuild twice)
homebrew = {
enable = true;
autoUpdate = false; # Don't update during rebuild
@ -34,10 +37,10 @@
config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
if ! xcode-select --version 2>/dev/null; then
xcode-select --install
$DRY_RUN_CMD xcode-select --install
fi
if ! /usr/local/bin/brew --version 2>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
'';

View File

@ -0,0 +1,8 @@
{ ... }: {
networking = {
computerName = "MacBook"; # Host name
hostName = "MacBook";
};
}

View File

@ -5,9 +5,4 @@
shell = pkgs.zsh; # Default shell
};
#networking = {
# computerName = "MacBook"; # Host name
# hostName = "MacBook";
#};
}

View File

@ -14,7 +14,6 @@
kubectl
k9s
noti # Create notifications programmatically
(pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
];
};