This is the template for the nix flakes which I use on my personal devices
- Install NixOS and enable experimental nix flakes under
/etc/nixos/configuration.nix
- Add
nix.settings.experimental-features = [ "nix-command" "flakes" ];anywhere in that file. - While you're there, you may also want to add
gitor any text editor likevimto use before the flake is installed - You may also want to update the device hostname, which will be useful for steps 3 and 7
- Clone this repository to
~/.dotfileson your system - Make a folder for your device. I put mine under ./devices/[hostname] but technically they can go anywhere under the project.
- Copy the contents of
/etc/nixos/hardware-configuration.nixand/etc/nixos/configuration.nixand put them in your device's folder. Make sure to adjustconfiguration.nixto import any desired nix files and remove conflicting configurations (packages, desktop manager, etc.) - Make a
home.nixfolder in the same location as yourconfiguration.nixandhardware-configuration.nix. - Add the filepaths and any necessary hardware modules in
flake.nixunder themachinesvalue, following the structure of existing examples. The property names represent the hostname of the device you wish to configure sudo nixos-rebuild switch --flake ~/dotfiles/#[hostname]
You should now have a functional system, and can add any device-specific settings under nix files inside your devices folder.
See how I override niri behavior on a per-device level for examples of this.
Any time you make adjustments to the flake, you will need to run the command from step 7 again. You don't have to specify #hostname if it
matches the hostname your device currently has. If you are using the shared bash home file, you can use rebuild which is aliased to that command
You can use nix flake update whenever you wish to update the system, followed by a rebuild.
nix-collect-garbage -d will remove all generations prior to the current one (you have to rebuild again after to remove it from the boot menu).
Running that command with/without sudo determines whether home or system packages get cleaned.
You can also use the aliases clean-home and clean-system if you use the shared bash home file.
These are the dotfiles I use on my personal NixOS system. The actual config files are organized in a way such that they should work on other distros.
Most of the files under config/ are being 1-to-1 mapped to a folder under the ~/.config/ directory, but you would need to make sure to install any equivalent packages
and dependencies on your distro. I have some overrides in device-specific folders, and some filepaths may need to be adjusted, but other than that
I try to maintain easy portability between other distros.
(Only applies to Nix/home-manager systems)
I can't guarantee anything in the shared and config folders won't have merge conflicts. If you wish to modify any nix files, you can put them in your device folder.
Ninetales wallpaper: Sourced from https://wallpaperaccess.com/alolan-ninetales
- If anyone has/finds a more exact source with artist credit on this one, open a issue and I'll replace this link
Ninetales icon: Sourced from https://pokemondb.net/sprites/ninetales
Porygon Wallpaper: I made it based on a porygon image which I recolored to match shiny colors and then used for a wallpaper
Porygon icon: Sourced from https://pokemondb.net/sprites/porygon2
Cat Wallpaper: Sourced from https://github.com/zhichaoh/catppuccin-wallpapers/
Mimikyu icon: Sourced from https://pokemondb.net/sprites/mimikyu