NixOS configuration and other dotfiles
- My Awesome config is based on the "rainbow" theme of awesome-copycats
- My Rofi themes are based on the "rounded" theme of rofi-themes-collection
- The wallpapers in
wallpapers/nixos/
as well aswallpapers/login.png
are modified versions ofnix-wallpaper-nineish-dark-gray
of nixos-artwork
Showcase-v2.0.0.mp4
Showcase-v1.0.0.mp4
- This repo contains configuration files I daily drive on multiple machines, including a Windows one through WSL. Its purpose is:
- providing version control for my config files
- serving as documentation and inspiration for customizing your system
- With this repo you get a Flake-based NixOS configuration that includes...
- two fully functional desktop sessions:
- Awesome + Picom (on Xorg)
- Hyprland (on Wayland)
- => See Installation (Desktop)
- a nice WSL setup
- => See Installation (WSL)
- two fully functional desktop sessions:
- See Content overview for explanations of files and directories in this repo.
⚠️ Basic knowledge of NixOS usage, including Nix flakes, is needed for all of the provided installation guides.
Note: "Expected directory" is the path to the directory where the described file (or directory) is usually located. This could just be
/etc/dotfiles/
, because this repository is assumed to be there, or another path, where a dotfile will be symlinked. Search formkOutOfStoreSymlink
innix/
for the exact symlinks that are created.
File or directory | Expected directory | Description |
---|---|---|
nix/ |
/etc/dotfiles/ |
All about NixOS |
nix/update/ |
/etc/dotfiles/ |
Scripts to automatically update and clean up NixOS after a prompt every saturday |
nix/pkgs/ |
/etc/dotfiles/ |
Local Nix packages |
wallpapers/nixos/ |
/etc/dotfiles/ |
NixOS logo wallpapers in all kinds of color combinations |
scripts/ |
/etc/dotfiles/ |
Shell scripts that didn't belong anywhere else |
other/notification.wav |
/etc/dotfiles/ |
Notification sound |
other/starship.toml |
/etc/dotfiles/ |
Starship configuration |
other/.vimrc |
~/ |
Vim configuration |
other/.ideavimrc |
~/ |
Like .vimrc , but for IntelliJ IDEA using IdeaVim |
awesome/ |
~/.config/ |
Awesome configuration including a custom theme based on awesome-copycats' "rainbow" theme |
swaync/ |
~/.config/ |
SwayNotificationCenter configuration with custom theme |
eww/ |
~/.config/ |
Eww configuration with custom widgets |
other/picom.conf |
~/.config/ |
picom (jonaburg-fork) configuration |
hyprland/ |
~/.config/hypr/ |
Hyprland configuration |
other/init.fish |
~/.config/fish/ |
config.fish for Fish |
other/copyq.conf |
~/.config/copyq/ |
CopyQ configuration with custom theme |
other/alacritty.toml |
~/.config/alacritty/ |
Alacritty configuration |
other/vscodium.json |
~/.config/VSCodium/User/ |
settings.json for VSCodium |
nix/devices/[DEVICE]/fastfetch/ |
~/.config/fastfetch/ |
fastfetch configurations |
rofi/ |
~/.local/share/rofi/themes/ |
Rofi (Wayland fork) themes |
other/firefox.css |
~/.mozilla/firefox/[YOUR-PROFILE]/chrome/ |
userChrome.css for Firefox |
other/sddm-sugar-candy.conf |
/usr/share/sddm/themes/sugar-candy/ (somewhere in /nix/store/ on NixOS) |
sddm-sugar-candy configuration |
other/gitnuro.json |
- | Gitnuro theme |
- The following guide explains installation on a NixOS desktop system.
⚠️ I try to make the config files in this repo modular and hardware independent, but you might still have to change some things to make it work with your hardware. The current configuration assumes:- a dual-monitor setup
- a stationary/dektop system (you could try it out on a portable system, but would probably miss things like a battery or wifi indicator)
- If you still want to try setting this up, here you go...
First install NixOS and set it up far enough to have git
, a network connection and a text editor available.
Place the content of this repository inside /etc/dotfiles/
:
cd /etc
# clone specific release (you know what you get, but v1.0.0 might not work anymore)
git clone --branch v2.0.0 --depth 1 --recurse-submodules https://github.com/julius-boettger/dotfiles.git
# clone current commit (although you don't know what you get)
git clone --recurse-submodules https://github.com/julius-boettger/dotfiles.git
chown -R $USER:root /etc/dotfiles # not necessary, but makes editing files more comfortable
chmod -R 755 /etc/dotfiles # should already be set like this
# copy over your hardware-configuration.nix (!)
cp -f /etc/nixos/hardware-configuration.nix /etc/dotfiles/nix/devices/desktop/
If you search for xrandr
in awesome/rc.lua
you will find two commands which are for my specific dual-monitor setup. The idea is that one command configures both monitors and the other just the primary monitor, so that the secondary monitor is toggleable by pressing Super+P. If you want to use this functionality you will have to adjust the commands for your specific setup. But you can also just leave them like that and don't press Super+P.
It's pretty much the same thing for my Hyprland config, but I extracted the device specific stuff into two variables called second_monitor
and second_monitor_config
, which I set in /etc/dotfiles/nix/devices/desktop/hyprland.conf
. The config there shows what works for my setup, you may need to change it for yours.
There are some files you now should take a look at and adjust them to your liking, all in /etc/dotfiles/nix/
:
secrets.nix
andvariables.nix
(should explain themselves)devices/desktop/default.nix
contains some device-specific configuration like mounting a partition. You may pick and choose what seems useful to you, or just delete it.- Of course you may also want to look at and change every other file ;)
Then rebuild your system with sudo nixos-rebuild switch --flake /etc/dotfiles/nix#desktop
. After you've done this once, flake-rebuild
should be available as a shorthand that serves the same purpose.
Next: reboot
for good measure.
Set Gitnuro theme: Run Gitnuro, open the settings and click the "Open file" button next to "Custom theme". Select /etc/dotfiles/other/gitnuro.json
and click on "Accept".
To set a wallpaper for SDDM (the login manager) either put a login.jpg
in /etc/dotfiles/wallpapers/
or adjust the path to the wallpaper at the top of /etc/dotfiles/other/sddm-sugar-candy.conf
.
By default, both the Awesome and the Hyprland session use a random wallpaper out of /etc/dotfiles/wallpapers/nixos/
on every reload. But there's an easy way to set up your own wallpapers on Hyprland: Put just one (or multiple!) in /etc/dotfiles/wallpapers/other/
. A random one will be selected on each reload if you have multiple. You can also configure corresponding accent colors for each wallpaper that will be used e.g. for the client border color. To do this, ajdust /etc/dotfiles/hyprland/wallpaper.py
. You will figure it out.
If you notice that the mouse cursor looks different when hovering over some apps, try setting it with nwg-look
(Wayland) or lxappearance
(Xorg).
And then you should be all set up! Feel free to reach out if there's something missing, misleading or incorrect in this installation guide. (Also reach out if you know how to automate any step of this setup further!)
Installation (WSL)
The following guide explains installation on a Windows system through NixOS on WSL.
First, make sure WSL is installed and up to date:
wsl --install --no-distribution
wsl --update
Also make sure to reboot your system to complete the setup (yes, that is necessary).
Then setup a NixOS distribution, but be careful when executing a command containing a path like .\NixOS\
, you probably want to change that to an absolute path where the installed files can reside permanently, like C:\Users\[YOUR-USER]\Documents\WSL\NixOS\
.
Now enter your NixOS WSL system with wsl -d NixOS
, or just with wsl
if you ran wsl --set-default NixOS
before.
Run sudo nix-channel --update
. If you run into errors like unable to download [...]: Couldn't resolve host name
: Make sure you are not connected to some regulated company network for the rest of this guide, then run sudo nano /etc/resolv.conf
and check that the following lines are the only uncommented ones in that file:
nameserver 8.8.4.4
nameserver 8.8.8.8
Then run sudo nix-channel --update
again.
Now run some more commands to setup my config:
cd /etc
nix-shell -p git --run "sudo git clone --recurse-submodules https://github.com/julius-boettger/dotfiles.git"
# make editing files more comfortable (don't require sudo)
sudo chown -R $USER:root /etc/dotfiles
You now should take a look at two files and adjust them to your liking, both in /etc/dotfiles/nix/
: secrets.nix
and variables.nix
. They should explain themselves what they are for. Of course you may also want to look at and change every other file ;)
Then rebuild your system with
nix-shell -p git --run "sudo nixos-rebuild switch --flake /etc/dotfiles/nix#wsl"
To see the effects, exit your current WSL session (e.g. with exit
), force WSL to shutdown (to achieve a restart) with wsl --shutdown
and then start a new session (e.g. with wsl -d NixOS
).
You should be greeted by a nice little fastfetch
now! flake-rebuild
should also be available as a shorthand that serves the same purpose as the long rebuild command above.
At this point it should also be fine to connect to a regulated company network again, reaching the internet should still be possible.
If using your companys VPN ever causes networking issues, use vpn-start
/vpn-stop
to start/stop wsl-vpnkit
(vpn-status
is also available).