-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from himkt/nix-modularized
misc(nix): make nix files more modularized
- Loading branch information
Showing
14 changed files
with
188 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,27 @@ | ||
{ pkgs, ... }: { | ||
# List packages installed in system profile. To search by name, run: | ||
# $ nix-env -qaP | grep wget | ||
environment.systemPackages = [ | ||
]; | ||
|
||
fonts.packages = [ | ||
pkgs.jetbrains-mono | ||
]; | ||
{ ... }: | ||
|
||
{ | ||
# Necessary for using flakes on this system. | ||
nix.settings.experimental-features = "nix-command flakes"; | ||
nix.settings.trusted-users = [ "root" "himkt" ]; | ||
|
||
# Enable alternative shell support in nix-darwin. | ||
# programs.fish.enable = true; | ||
imports = [ | ||
./darwin/system/defaults/controlcenter.nix | ||
./darwin/system/defaults/dock.nix | ||
./darwin/system/defaults/finder.nix | ||
./darwin/system/defaults/NSGlobalDomain.nix | ||
./darwin/system/defaults/loginwindow.nix | ||
./darwin/system/keyboard.nix | ||
./darwin/security/pam.nix | ||
./darwin/homebrew.nix | ||
./darwin/font.nix | ||
./darwin/environment/systemPackages.nix | ||
]; | ||
|
||
# Used for backwards compatibility, please read the changelog before changing. | ||
# $ darwin-rebuild changelog | ||
system.stateVersion = 5; | ||
|
||
system.defaults.finder = { | ||
AppleShowAllExtensions = true; | ||
AppleShowAllFiles = false; | ||
FXPreferredViewStyle = "clmv"; | ||
}; | ||
|
||
system.defaults.dock = { | ||
autohide = true; | ||
show-recents = false; | ||
orientation = "bottom"; | ||
}; | ||
|
||
system.defaults.controlcenter = { | ||
AirDrop = false; | ||
BatteryShowPercentage = false; | ||
Bluetooth = false; | ||
Display = false; | ||
FocusModes = false; | ||
NowPlaying = false; | ||
Sound = false; | ||
}; | ||
|
||
# TODO(himkt); other items visibility settings (e.g. Wi-Fi). | ||
# It modifies the almost same entries as the following command: | ||
# `defaults -currentHost write com.apple.controlcenter WiFi -int 18` | ||
# (18: show, 24: hide) | ||
# | ||
# However, it didn't change macOS UI actually even if I explicitly ran `killall SystemUIServer`. | ||
# https://superuser.com/questions/398071/how-can-i-hide-show-the-wi-fi-menu-item-from-the-terminal-in-os-x | ||
# | ||
# system.defaults.CustomUserPreferences."com.apple.controlcenter" = { | ||
# "NSStatusItem Preferred Position WiFi" = 18; | ||
# "NSStatusItem Visible WiFi" = 1; | ||
# }; | ||
|
||
system.keyboard = { | ||
enableKeyMapping = true; | ||
remapCapsLockToControl = true; | ||
}; | ||
|
||
system.defaults.NSGlobalDomain = { | ||
InitialKeyRepeat = 15; | ||
KeyRepeat = 2; | ||
}; | ||
|
||
system.defaults.loginwindow = { | ||
GuestEnabled = false; | ||
}; | ||
|
||
security.pam.enableSudoTouchIdAuth = true; | ||
|
||
homebrew = { | ||
enable = true; | ||
casks = [ | ||
"arc" | ||
"font-jetbrains-mono" | ||
"docker" | ||
# "notion" | ||
"ngrok" | ||
"insomnia" | ||
"slack" | ||
"visual-studio-code" | ||
"wezterm" | ||
"1password" | ||
]; | ||
onActivation.cleanup = "uninstall"; | ||
}; | ||
|
||
# The platform the configuration will be used on. | ||
nixpkgs.hostPlatform = "aarch64-darwin"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ ... }: | ||
|
||
{ | ||
# List packages installed in system profile. To search by name, run: | ||
# $ nix-env -qaP | grep wget | ||
environment.systemPackages = [ | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
fonts.packages = [ | ||
pkgs.jetbrains-mono | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ ... }: | ||
|
||
{ | ||
homebrew = { | ||
enable = true; | ||
casks = [ | ||
"arc" | ||
"font-jetbrains-mono" | ||
"docker" | ||
# "notion" | ||
"ngrok" | ||
"insomnia" | ||
"slack" | ||
"visual-studio-code" | ||
"wezterm" | ||
"1password" | ||
]; | ||
onActivation.cleanup = "uninstall"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ ... }: | ||
|
||
{ | ||
security.pam = { | ||
enableSudoTouchIdAuth = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ ... }: | ||
|
||
{ | ||
system.defaults.NSGlobalDomain = { | ||
InitialKeyRepeat = 15; | ||
KeyRepeat = 2; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ ... }: | ||
|
||
{ | ||
# TODO(himkt); other items visibility settings (e.g. Wi-Fi). | ||
# It modifies the almost same entries as the following command: | ||
# `defaults -currentHost write com.apple.controlcenter WiFi -int 18` | ||
# (18: show, 24: hide) | ||
# | ||
# However, it didn't change macOS UI actually even if I explicitly ran `killall SystemUIServer`. | ||
# https://superuser.com/questions/398071/how-can-i-hide-show-the-wi-fi-menu-item-from-the-terminal-in-os-x | ||
# | ||
# system.defaults.CustomUserPreferences."com.apple.controlcenter" = { | ||
# "NSStatusItem Preferred Position WiFi" = 18; | ||
# "NSStatusItem Visible WiFi" = 1; | ||
# }; | ||
|
||
system.defaults.controlcenter = { | ||
AirDrop = false; | ||
BatteryShowPercentage = false; | ||
Bluetooth = false; | ||
Display = false; | ||
FocusModes = false; | ||
NowPlaying = false; | ||
Sound = false; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ ... }: | ||
|
||
{ | ||
system.defaults.dock = { | ||
autohide = true; | ||
show-recents = false; | ||
orientation = "bottom"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ ... }: | ||
|
||
{ | ||
system.defaults.finder = { | ||
AppleShowAllExtensions = true; | ||
AppleShowAllFiles = false; | ||
FXPreferredViewStyle = "clmv"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ ... }: | ||
|
||
{ | ||
system.defaults.loginwindow = { | ||
GuestEnabled = false; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ ... }: | ||
|
||
{ | ||
system.keyboard = { | ||
enableKeyMapping = true; | ||
remapCapsLockToControl = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
home.packages = [ | ||
pkgs.atuin | ||
pkgs.coreutils | ||
pkgs.difftastic | ||
pkgs.fzf | ||
pkgs.jq | ||
pkgs.tree | ||
|
||
pkgs.git | ||
pkgs.git-lfs | ||
pkgs.gh | ||
pkgs.ghq | ||
|
||
pkgs.zsh | ||
pkgs.zsh-autocomplete | ||
pkgs.zsh-syntax-highlighting | ||
pkgs.zoxide | ||
|
||
pkgs.kubectl | ||
pkgs.krew | ||
pkgs.k9s | ||
|
||
pkgs.neovim | ||
|
||
pkgs.nixd | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ config, ... }: | ||
|
||
{ | ||
# NOTE(himkt); https://github.com/nix-community/home-manager/blob/master/modules/programs/zsh.nix | ||
# (different from https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/programs/zsh/zsh.nix) | ||
programs.zsh = { | ||
enable = true; | ||
enableCompletion = true; | ||
autosuggestion.enable = true; | ||
syntaxHighlighting.enable = true; | ||
|
||
history = { | ||
size = 100000; | ||
}; | ||
|
||
shellAliases = { | ||
git-home = "cd `git rev-parse --show-toplevel`"; | ||
t = "tips"; | ||
vim = "nvim"; | ||
cd = "z"; | ||
ls = "ls --color"; | ||
retcode = "echo $?"; | ||
}; | ||
|
||
initExtra = '' | ||
source ${config.home.homeDirectory}/dotfiles/zsh/config.d/zshrc | ||
''; | ||
}; | ||
} |