mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 22:00:14 +00:00
more darwin cleanup
This commit is contained in:
@ -19,15 +19,7 @@
|
||||
opacity = 1.0;
|
||||
};
|
||||
scrolling.history = 10000;
|
||||
font = {
|
||||
size = 14.0;
|
||||
normal = {
|
||||
family = builtins.head (if pkgs.stdenv.isDarwin then
|
||||
[ "FiraCode Nerd Font Mono" ]
|
||||
else
|
||||
config.fonts.fontconfig.defaultFonts.monospace);
|
||||
};
|
||||
};
|
||||
font = { size = 14.0; };
|
||||
key_bindings = [
|
||||
{
|
||||
key = "L";
|
||||
|
@ -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";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
28
modules/darwin/dotfiles.nix
Normal file
28
modules/darwin/dotfiles.nix
Normal 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
14
modules/darwin/fonts.nix
Normal 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";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -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
|
||||
'';
|
||||
|
||||
|
8
modules/darwin/networking.nix
Normal file
8
modules/darwin/networking.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{ ... }: {
|
||||
|
||||
networking = {
|
||||
computerName = "MacBook"; # Host name
|
||||
hostName = "MacBook";
|
||||
};
|
||||
|
||||
}
|
@ -5,9 +5,4 @@
|
||||
shell = pkgs.zsh; # Default shell
|
||||
};
|
||||
|
||||
#networking = {
|
||||
# computerName = "MacBook"; # Host name
|
||||
# hostName = "MacBook";
|
||||
#};
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
kubectl
|
||||
k9s
|
||||
noti # Create notifications programmatically
|
||||
(pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -16,16 +16,13 @@
|
||||
|
||||
};
|
||||
|
||||
programs.fish = let
|
||||
system = if pkgs.stdenv.isDarwin then "darwin" else "nixos";
|
||||
sudo = if pkgs.stdenv.isDarwin then "" else "doas";
|
||||
in {
|
||||
programs.fish = {
|
||||
shellAbbrs = {
|
||||
nr = "rebuild-${system}";
|
||||
nro = "rebuild-${system} offline";
|
||||
nr = "rebuild-nixos";
|
||||
nro = "rebuild-nixos offline";
|
||||
};
|
||||
functions = {
|
||||
"rebuild-${system}" = {
|
||||
rebuild-nixos = {
|
||||
body = ''
|
||||
if test "$argv[1]" = "offline"
|
||||
set option "--option substitute false"
|
||||
@ -33,8 +30,8 @@
|
||||
pushd ${config.dotfilesPath}
|
||||
git add --all
|
||||
popd
|
||||
echo "${sudo} ${system}-rebuild switch $option --flake ${config.dotfilesPath}"
|
||||
${sudo} ${system}-rebuild switch $option --flake ${config.dotfilesPath}
|
||||
commandline -r doas nixos-rebuild switch $option --flake ${config.dotfilesPath}
|
||||
commandline -f execute
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -13,10 +13,6 @@
|
||||
options = with lib; {
|
||||
|
||||
gui = {
|
||||
enable = mkEnableOption {
|
||||
description = "Enable graphics";
|
||||
default = false;
|
||||
};
|
||||
compositor.enable = mkEnableOption {
|
||||
description = "Enable transparency, blur, shadows";
|
||||
default = false;
|
||||
@ -48,10 +44,6 @@
|
||||
default = "gnome-themes-extra";
|
||||
};
|
||||
};
|
||||
colorscheme = mkOption {
|
||||
type = types.attrs;
|
||||
description = "Base16 color scheme";
|
||||
};
|
||||
wallpaper = mkOption {
|
||||
type = types.path;
|
||||
description = "Wallpaper background image file";
|
||||
|
@ -20,6 +20,7 @@ in {
|
||||
};
|
||||
services.polybar.config."bar/main".font-0 = "Hack Nerd Font:size=10;2";
|
||||
programs.rofi.font = "Hack Nerd Font 14";
|
||||
programs.alacritty.settings.font.normal.family = fontName;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -39,7 +39,7 @@
|
||||
himalaya = {
|
||||
enable = true;
|
||||
settings = {
|
||||
downloads-dir = if pkgs.stdenv.isDarwin then "$HOME/Downloads" else config.userDirs.download;
|
||||
downloads-dir = config.userDirs.download;
|
||||
smtp-insecure = true;
|
||||
};
|
||||
};
|
||||
|
@ -2,4 +2,7 @@
|
||||
|
||||
imports = [ ./user.nix ./timezone.nix ./doas.nix ];
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
system.stateVersion = "22.11";
|
||||
|
||||
}
|
||||
|
@ -2,26 +2,11 @@
|
||||
|
||||
options = {
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Primary user of the system";
|
||||
default = "nixos";
|
||||
};
|
||||
|
||||
passwordHash = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Password created with mkpasswd -m sha-512";
|
||||
};
|
||||
|
||||
userDirs = {
|
||||
# Required to prevent infinite recursion when referenced by himalaya
|
||||
download = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "XDG directory for downloads";
|
||||
default = "$HOME/downloads";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = {
|
||||
|
Reference in New Issue
Block a user