These are the random dot or settings files I use on *nix based devices. Some might be OS specific, or only when I decide to use specific programs (bash/zsh).
- Clone this to ~/dev/dotfiles
- symlink it to ~/.mydotfiles
- Download zsh
- Download oh-my-zsh
- Start zsh at least once (oh-my-zsh should do this for you)
- Update ~/.zshrc to look something like this:
# Path to my oh-my-zsh installation.
export ZSH=/home/bzvestey/.oh-my-zsh
# Path to my .zshrc file
source ~/.mydotfiles/zsh/zshrc-macos.zsh-
Figure out the deivce name you want and set it as an environment variable in your terminal, this way it can be referenced in the other scripts
export device_name="<name of device>"
Also see.
-
Create a folder for the device, and copy the generated configs into it
mkdir -p $HOME/dev/dotfiles/devices/$device_name cp /etc/nixos/hardware-configuration.nix $HOME/dev/dotfiles/devices/$device_name/ cp /etc/nixos/configuration.nix $HOME/dev/dotfiles/devices/$device_name/configuration.nix.base
-
Createa a new configuration for the device using the common configs.
cat <<EOF > $HOME/dev/dotfiles/devices/$device_name/configuration.nix { config, pkgs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix # Include core configurations ../common/core/base.nix ../common/core/locale.nix ../common/core/networking.nix ../common/core/time.nix ../common/core/users.nix # Include hardware configurations ../common/hardware/audio.nix ../common/hardware/fingerprint-reader.nix ../common/hardware/keyboard.nix ../common/hardware/printer.nix # Include display manager configurations ../common/display/gnome.nix # Include services configurations ../common/services/tailscale.nix # ../common/services/syncthing.nix ../common/services/flatpak.nix # Include program configurations ../common/programs/1password.nix ../common/programs/browsers.nix ../common/programs/files.nix ../common/programs/programming.nix ../common/programs/terminal.nix ]; # Fill in "boot.initrd.luks.devices" line from /etc/nixos/configuration.nix # boot.initrd.luks.devices....; networking.hostName = "$device_name"; # Define your hostname. # Set the "system.stateVersion" line from /etc/nixos/configuration.nix # system.stateVersion = "..."; } EOF
-
Update the new
configuration.nixfile with local customizations -
Continue to the steps for all devices
-
Setup the nixos configs
sudo rm -rf /etc/nixos/* sudo ln -s $HOME/dev/dotfiles/devices/$device_name /etc/nixos cp $HOME/dev/dotfiles/devices/common/services/vars.nix.example $HOME/dev/dotfiles/devices/common/services/vars.nix
-
Set the variables in
$HOME/dev/dotfiles/devices/common/services/vars.nixbefore continuing on. -
Setup the home-manager configs
mkdir ~/.config/home-manager ln -s $HOME/dev/dotfiles/config/home-manager $HOME/.comfig/home-manager
-
Move to unstable channel and add home-manager channel
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware
-
Install nixos packages based on updated channels
sudo nix-channel --update sudo nixos-rebuild switch --upgrade
-
Install home-manager
nix-shell '<home-manager>' -A install -
Setup Tailscale
sudo tailscale set --operator=$USER tailscale up
-
Setup the fingerprint reader
fprintd-enroll -f right-index-finger fprintd-enroll -f left-index-finger