This is my dotfile configuration that is used across all of my systems that have some flavor of Linux. It utilizes the Nix ecosystem to have declarative, reproducible environments for each system to make the only consideration be how stable a system should be.
Operating System
: MacOS, NixOS, Linux-derived operating systemsWindow Manager
: Default (MacOS), KDE Plasma (NixOS), Default (Linux)Terminal
: kittyShell
: zshEditor
: neovim, VS CodeFont
: Fira Code
bin
: Profile management shell scriptssystem
: Shared system configuration entrypoints between NixOS, MacOS, and other Linux-derived operating systemshome
: User-defined environments (home/users
) with applications and their respective configurations (home/features
)brew
: Homebrew configuration and environment for MacOSpkgs
: Custom packages written for use inhome
overlays
: Overlays for nixpkgs and overwritten packages for custom builds
Install nix
with the following command if it is not installed already.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
Note
The source of this is maintained in the following repository.
This configuration uses a template flake for simplifying cloning so that it only requires the nix
command.
nix --experimental-features "nix-command flakes" flake init -t github:ThisJustZack/dotfiles#dotfiles
After retrieving the clone, make the config directory and move the dotfiles using the following command.
rm -rf ~/.config/nix && mkdir -p ~/.config/nix && mv nix/* ~/.config/nix && rm -rf nix
Now, continue the following instructions according to the OS of the system.
Change the pretty hostname of the system with hostnamectl
.
hostnamectl set-hostname wsl --pretty
Important
It is assumed that systemd is enabled on the system. To enable it in WSL, follow this guide.
Install XCode CLI tools
to the system.
xcode-select --install
Install homebrew
to the system.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Change the local hostname of the system using scutil
.
sudo scutil -set LocalHostName macbook
There are no additional instructions to follow currently.
Now that the dependencies have been installed, the profiles established within flake.nix
from the template can be installed.
This is streamlined through a script found in bin
. It is executed with the following command.
~/.config/nix/bin/build
Important
Within NixOS, the profile should be executed with the following command, until a solution is decided on for streamlining the process.
~/.config/nix/bin/build zack
This may be changed to where it is internal and uses the following as a build profile for a solution, although that is not desired.
"$(whoami)@$(hostnamectl --static)"
Warning
If any of the scripts have a Permission denied
message, use the following command to grant permission.
chmod 755 ~/.config/nix/bin/build && chmod 755 ~/.config/nix/bin/build-profiles/*
Warning
On MacOS, nix-darwin
may want to repopulate the /etc/bashrc
or other configuration files but be unable to and error, in which case the following command should be used or adapted accordingly.
sudo mv /etc/bashrc /etc/bashrc.before-nix-darwin