Nix Chad
An opinionated MacOS setup focused on software development.
Features
Firefox
discoverable key mappings
After pressing ?
key a window enumerating all contextual key mappings
appears.
Neovim
programming/configuration languages support
language | actions | completion | diagnostics | formatting | highlighting |
---|---|---|---|---|---|
bash | ☒ | ☑ | ☑ | ☑ | ☑ |
dhall | ☒ | ☑ | ☑ | ☑ | ☑ |
docker | ☒ | ☒ | ☑ | ☒ | ☑ |
GitHub Actions workflow | ☑ | ☑ | ☑ | ☑ | ☑ |
html | ☒ | ☑ | ☑ | ☑ | ☑ |
java | ☒ | ☑ | ☑ | ☑ | ☑ |
json | ☒ | ☑ | ☑ | ☑ | ☑ |
javascript | ☑ | ☑ | ☑ | ☑ | ☑ |
lua | ☑ | ☑ | ☑ | ☑ | ☑ |
markdown | ☑ | ☑ | ☑ | ☑ | ☑ |
nix | ☒ | ☑ | ☑ | ☑ | ☑ |
purescript | ☑ | ☑ | ☑ | ☑ | ☑ |
python | ☑ | ☑ | ☑ | ☑ | ☑ |
typescript | ☑ | ☑ | ☑ | ☑ | ☑ |
yaml | ☑ | ☒ | ☑ | ☑ | ☑ |
discoverable key mappings
After pressing \
key a window enumerating all key mappings appears.
The same windows shows when user starts but does not finish a key
sequence which has some action assigned to it.
Prerequisites
Configuration
Initializing from a template
Run from a directory of your choice:
nix flake init --template github:mstream/nix-chad/main#default
Tweaking
Update any config entries to your liking like in this example.
Applying
After any change to configuration, run from the directory where
flake.nix
file resides:
nix run .#switch
Updating
To stay up to date witch changes to Nix Chad, run periodically:
nix flake update
chad.browser.bookmarks
Browser bookmarks.
Type: (list of ((bookmark submodule) or (directory submodule))) or (attribute set of ((bookmark submodule) or (directory submodule))) convertible to it
Default:
[ ]
Example:
[
{
bookmarks = [
{
keyword = "nixpkgs";
name = "NixOS Search - Packages";
tags = [
"nix"
];
url = "https://search.nixos.org/packages";
}
];
name = "Nix sites";
toolbar = true;
}
{
title = "Nix Chad";
url = "https://github.com/mstream/nix-chad";
}
]
Declared by:
chad.browser.extraExtensions
Additional Firefox extensions to be installed for the user.
Type: null or (function that evaluates to a(n) list of package)
Default:
null
Example:
exts: with exts; [ grammarly ];
Declared by:
chad.editor.documentWidth
Ideal maximum document’s width measured in number of characters.
Type: signed integer
Default:
72
Declared by:
chad.editor.lineNumbering
Absolute: line numbers counted from the beginning of the document Relative: line numbers counted from the current cursor position
Type: one of “absolute”, “relative”
Default:
"relative"
Declared by:
chad.editor.tabWidth
Tabulation width measured in number of characters.
Type: signed integer
Default:
2
Declared by:
chad.extraPackages
Additional nixpkgs packages to be accessible for the user.
Type: null or (function that evaluates to a(n) list of package)
Default:
null
Example:
pkgs: with pkgs; [ cowsay ];
Declared by:
chad.fontSize
A desired font size in tools that have means to set it fixed.
Type: signed integer
Default:
12
Example:
16
Declared by:
chad.git.alternativeGitIdentities
Alternative Git identities for selected repositories.
Type: list of (submodule)
Default:
[ ]
Example:
[
{
repositoryPath = "~/work/project-1";
sshKeyPath = "~/.ssh/work_id_rsa";
userEmail = "me@mail.com";
}
]
Declared by:
chad.git.alternativeGitIdentities.*.repositoryPath
Git repository path.
Type: string
Declared by:
chad.git.alternativeGitIdentities.*.sshKeyPath
Path to a SSH private key.
Type: string
Declared by:
chad.git.alternativeGitIdentities.*.userEmail
Key.
Type: string
Declared by:
chad.gpg.defaultKey
An ID of a key to be used for GPG signing by default. This is expected to be different for individuals. The key is not part of this repository and has to be provided manually.
Type: null or string
Default:
null
Example:
"BE318F09150F6CB0724FFEC0319EE1D7FC029354"
Declared by:
chad.keyboard.disableKeyRepeat
Holding keys does not make characters being typed repeatedly.
Type: boolean
Default:
true
Declared by:
chad.keyboard.remapCapsLock
Treat Caps Lock key as Escape key.
Type: boolean
Default:
true
Declared by:
chad.keyboard.remapLeftArrow
Treat Left Arrow key as Right Control key.
Type: boolean
Default:
false
Declared by:
chad.manageWindows.enable
Keep windows occupy maximum available share of space on desktop.
Type: boolean
Default:
false
Declared by:
chad.manageWindows.exclusions
List of application names for which automatic window management should not be performed. It can be figured out using this command:
yabai -m query --windows
Type: list of (submodule)
Default:
[ ]
Example:
[
{
app = "^Discord$";
title = ".*Dialog$";
}
]
Declared by:
chad.manageWindows.exclusions.*.app
Regex for application name.
Type: string
Example:
"^Discord$"
Declared by:
chad.manageWindows.exclusions.*.title
Regex for window title.
Type: string
Default:
".*"
Example:
".*Dialog$"
Declared by:
chad.mouse.naturalScrollDirection
Should content scroll opposite to the swipe/roll direction.
Type: boolean
Default:
true
Declared by:
chad.software.openSourceOnly
Restricts software to Open Source only.
Type: boolean
Default:
true
Declared by:
chad.terminal.abbreviations.enable
Enables expandable command abbreviations.
Type: boolean
Default:
true
Declared by:
chad.terminal.abbreviations.extraAbbreviations
An attribute set that maps aliases (the top level attribute names in this option) to abbreviations. Abbreviations are expanded with the longer phrase after they are entered.
Type: attribute set of string
Default:
{ }
Example:
{
gco = "git checkout";
l = "less";
}
Declared by:
chad.terminal.keyBindings
Additional key bindings for terminal emulator.
Type: list of (submodule)
Default:
[ ]
Example:
[
{
chars = "\\u000c";
key = "K";
mods = "Control";
}
]
Declared by:
chad.terminal.keyBindings.*.chars
Substitution.
Type: string
Declared by:
chad.terminal.keyBindings.*.key
Key.
Type: string
Declared by:
chad.terminal.keyBindings.*.mods
Modifier key(s).
Type: string
Declared by:
chad.terminal.zshInitExtra
Additional initialization for ZSH sessions.
Type: strings concatenated with “\n”
Default:
""
Example:
''
export VAR1=val1
export VAR2=val2
''
Declared by:
chad.user.homeDirectories
A list of desirect directories to be created in the home directory of the user. It is up to the user to provide the contents of these directories.
Type: list of string
Default:
[ ]
Example:
[
"Development/exercises"
"Development/presentations"
"Development/projects"
]
Declared by:
chad.user.name
User name.
Type: string
Example:
"bob"
Declared by:
Alacritty
NeoVim
Comment
clA - Comment add at the end of line
clO - Comment add line above
clo - Comment add line below
cb - Comment block operator-pending
cl - Comment line operator-pending
ctb - Comment toggle block
ctl - Comment toggle line
Directory Tree
tf - Directory tree focus
tt - Directory tree toggle
Find
fd - Find definitions
ff - Find files
fgb - Find Git branches
fgc - Find Git commits
fgl - Find Git local changes
fgs - Find Git stashed changes
fi - Find implementations
fvb - Find Vim buffers
fvc - Find Vim commands
fvh - Find Vim help topics
fw - Find words across files
Go To
gD - Go to declaration
gd - Go to definition
gi - Go to implementation
g] - Go to next problem
g[ - Go to previous problem
Miscellaneous
<ESC> - Cancels current selection or mode.
<C-j> - Move to window on the bottom
<C-h> - Move to window on the left
<C-l> - Move to window on the right
<C-k> - Move to window on the top
<C-d> - Sroll content down
<C-u> - Scroll content up
<C-n> - Select next item on a list
<C-p> - Select previous item on a list
\- Show key mappings
K - Show information about the symbol under the cursor
<TAB> - switch to next tab
<S-TAB> - switch to previous tab
Refactor
ra - Refactor action
rf - Refactor format
rn - Refactor name
Select
sd - Select decrement selection
si - Select increment selection
ss - Select initialize selection
For Developers
Bla bla bla
Nix Chad Library
Darwin related functions
lib.darwin.makeSystem
Create activation scripts for Darwin system with a desired config applied.
Contributors
TODO