Installation • Usage • Configuration • Troubleshooting
My dotfiles are not perfekt, but they strive to be:
- highly structured 🧱
- modular 🎛️
- a consistent look'n'feel ✨
- KISS (keep it stupid simple)🥴
This flake can and will radically change as I learn, discover new things and have new ideas.
- 🏗 github:numtide/blueprint nix flake❄️ structure
- 📦 github:gmodena/nix-flatpak declarative flatpaks
- 🎨 github:danth/stylix theming (modified catppuccin 🌿 Mocha)
- 🪟 GNOME with extensions
- 🪟 Hyprland with plugins
- 🪟 Niri
-
Dotfiles preparation (mandatory changes to my dotfiles):
-
git clone https://github.com/dafitt/dotfiles.git -
cd dotfiles -
Read and understand my dotfiles' structure and code
-
Add (your own) system-configuration to
hosts/<host>/configuration.nix.-
Copy and import
hardware-configuration.nix -
Set the correct current
system.stateVersion
-
-
Add (your own) home-configuration(s) to
hosts/<host>/users/<user>.nix -
Commit all changes:
git add . && git commit -m "hosts/<host>: Added new host" -
Uncomment
nixConfigin flake.nix and enternix developon your first build for faster build time
-
-
Build:
- Enter (
nix-shelland then)nix develop .#default sudo nixos-rebuild --flake .#<host> boot- Check for home-manager errors with
systemctl status home-manager-<user>.serviceand resolve them if necessary
- NOTE: First install may take some time; especially with flatpaks enabled.
- Enter (
-
reboot
-
Dotfiles preparation (mandatory changes to my dotfiles):
-
git clone https://github.com/dafitt/dotfiles.git -
cd dotfiles -
Read and understand my dotfiles' structure and code
-
Set the correct current
home.stateVersion -
Add (your own) home-configuration to
hosts/<host>/users/<user>.nix -
Commit all changes:
git add . && git commit -m "hosts/<host>: Added new home" -
Uncomment
nixConfigin flake.nix and enternix developon your first build for faster build time
-
-
Check your system's requirements when importing the following modules (Installation depending on your distribution):
-
Build:
- Enter
nix develop .#default
or run:nix run home-manager -- --flake .#<user>@<host> switch home-manager --flake .#<user>@<host> switch- Check for home-manager errors with
systemctl status home-manager-<user>.serviceand resolve them if necessary
- NOTE: First install may take some time; especially with flatpaks enabled.
- Enter
I have configured my own custom installer iso in hosts/DavidISO, which can be used to install a new system. It can also be used to repair a broken existing machine.
-
Dotfiles preparation:
-
git clone https://github.com/dafitt/dotfiles.git -
cd dotfiles -
Read and understand my dotfiles' structure and code
-
Add (your own) system-configuration to
hosts/<host>/configuration.nix.-
Copy and import
hardware-configuration.nix -
Set the correct current
system.stateVersion
-
-
Add (your own) home-configuration(s) to
hosts/<host>/users/<user>.nix -
Commit all changes:
git add . && git commit -m "hosts/<host>: Added new host"
-
-
Build install-iso with the current dotfiles:
nix build .#nixosConfigurations.DavidISO.config.formats.install-iso- (optional) Flash the result to a USB-Stick
dd if=result/<file.iso> of=/dev/<usb>-
Boot from the ISO (or USB-Stick) on the target system
-
Follow the instructions on the commands
help-installorhelp-repair
Post-install imperative setup
- Accounts and Logins
- Age keypair for sops:
age-keygen -o ~/.config/sops/age/keys.txt - Firefox Addons (Settings)
- Flatpak: Osu
~/.var/app/sh.ppy.osu/data/osu/ - Hyprland: Monitor setup with
nwg-displays - Pavucontrol: Set standard audio output
- SSH keypair
~/.sshssh-keygen - Syncthing https://localhost:8384/
- VPN
- Xfce/Thunar: Set mime-apps
xfce4-mime-settings(nix shell nixpkgs#xfce.xfce4-settings)
Some basic flake commands
nix-shell shell.nix # only when on legacy-nix: enables flakes & git (works only locally)
nix develop github:dafitt/dotfiles#defaultnix flake show github:dafitt/dotfilesNixOS & Home-manager:
nixos-rebuild --flake .#[<host>] switchHome-manager standalone:
home-manager --flake .#[<user>@<host>] switchnix flake update --commit-lock-file
# specific input
nix flake lock --update-input [input]-
NixOS:
sudo nixos-rebuild switch --rollback -
Home-manager standalone: see Home-manager documentation
nix fmt [./folder] [./file.nix]nixos-rebuild --flake .#[<host>] repl
> config # current system configuration
> perSystem.self.homeConfigurations."<user>@<host>".config # current home configurationSuper&Control - System and Hyprland control
Super - Window control
Super&Alt - Applications
Shift - reverse, grab, move
keybind table
| Keybind | Dispatcher | Command |
|---|---|---|
| Super&Alt B | exec | pypr toggle bluetooth |
| Super&Alt W | exec | firefox |
| Super&Alt P | exec | pypr toggle btop |
| Super&Alt E | exec | micro |
| Super&Alt F | exec | nautilus |
| XF86Calculator | exec | gnome-calculator |
| Super&Control Q | exit | |
| Super&Control R | exec | hyprctl reload; forcerendererreload |
| Super&Control ADIAERESIS | exec | poweroff |
| Super&Control ODIAERESIS | exec | poweroff --reboot |
| Super UDIAERESIS | exec | systemctl suspend |
| Super DELETE | exec | hyprctl kill |
| Super X | killactive | |
| Super&Shift X | forcekillactive | |
| Super P | pseudo | |
| Super R | togglesplit | |
| Super H | swapnext | |
| Super&Shift H | swapnext | prev |
| Super F | fullscreen | |
| Super A | fullscreen | 1 |
| Super V | togglefloating | |
| Super Z | alterzorder | top |
| Super&Shift Z | alterzorder | bottom |
| Super B | pin | |
| Super left | movefocus | l |
| Super right | movefocus | r |
| Super up | movefocus | u |
| Super down | movefocus | d |
| Super Tab | cyclenext | |
| Super Tab | cyclenext | prev |
| Super&Shift left | swapwindow | l |
| Super&Shift right | swapwindow | r |
| Super&Shift up | swapwindow | u |
| Super&Shift down | swapwindow | d |
| Super&Shift Tab | swapnext | |
| Super&Alt plus | resizeactive | 100 0 |
| Super&Alt minus | resizeactive | -100 0 |
| Super&Alt right | resizeactive | 100 0 |
| Super&Alt left | resizeactive | -100 0 |
| Super&Alt down | resizeactive | 0 100 |
| Super&Alt up | resizeactive | 0 -100 |
| Super&Control G | togglegroup | |
| Super G | changegroupactive | f |
| Super&Shift G | changegroupactive | f |
| Super&Shift&Control left | movewindoworgroup | l |
| Super&Shift&Control right | movewindoworgroup | r |
| Super&Shift&Control up | movewindoworgroup | u |
| Super&Shift&Control down | movewindoworgroup | d |
| Super 1 | focusworkspaceoncurrentmonitor | 1 |
| Super 2 | focusworkspaceoncurrentmonitor | 2 |
| Super 3 | focusworkspaceoncurrentmonitor | 3 |
| Super 4 | focusworkspaceoncurrentmonitor | 4 |
| Super 5 | focusworkspaceoncurrentmonitor | 5 |
| Super 6 | focusworkspaceoncurrentmonitor | 6 |
| Super 7 | focusworkspaceoncurrentmonitor | 7 |
| Super 8 | focusworkspaceoncurrentmonitor | 8 |
| Super 9 | focusworkspaceoncurrentmonitor | 9 |
| Super 0 | focusworkspaceoncurrentmonitor | 10 |
| Super D | focusworkspaceoncurrentmonitor | name:D |
| Super code:87 | focusworkspaceoncurrentmonitor | 1 |
| Super code:88 | focusworkspaceoncurrentmonitor | 2 |
| Super code:89 | focusworkspaceoncurrentmonitor | 3 |
| Super code:83 | focusworkspaceoncurrentmonitor | 4 |
| Super code:84 | focusworkspaceoncurrentmonitor | 5 |
| Super code:85 | focusworkspaceoncurrentmonitor | 6 |
| Super code:79 | focusworkspaceoncurrentmonitor | 7 |
| Super code:80 | focusworkspaceoncurrentmonitor | 8 |
| Super code:81 | focusworkspaceoncurrentmonitor | 9 |
| Super code:91 | focusworkspaceoncurrentmonitor | 10 |
| Super code:86 | focusworkspaceoncurrentmonitor | +1 |
| Super code:82 | focusworkspaceoncurrentmonitor | -1 |
| Super backspace | focusworkspaceoncurrentmonitor | previous |
| Super mouse_down | focusworkspaceoncurrentmonitor | -1 |
| Super mouse_up | focusworkspaceoncurrentmonitor | +1 |
| Super&Shift 1 | movetoworkspacesilent | 1 |
| Super&Shift 2 | movetoworkspacesilent | 2 |
| Super&Shift 3 | movetoworkspacesilent | 3 |
| Super&Shift 4 | movetoworkspacesilent | 4 |
| Super&Shift 5 | movetoworkspacesilent | 5 |
| Super&Shift 6 | movetoworkspacesilent | 6 |
| Super&Shift 7 | movetoworkspacesilent | 7 |
| Super&Shift 8 | movetoworkspacesilent | 8 |
| Super&Shift 9 | movetoworkspacesilent | 9 |
| Super&Shift 0 | movetoworkspacesilent | 10 |
| Super&Shift code:87 | movetoworkspacesilent | 1 |
| Super&Shift code:88 | movetoworkspacesilent | 2 |
| Super&Shift code:89 | movetoworkspacesilent | 3 |
| Super&Shift code:83 | movetoworkspacesilent | 4 |
| Super&Shift code:84 | movetoworkspacesilent | 5 |
| Super&Shift code:85 | movetoworkspacesilent | 6 |
| Super&Shift code:79 | movetoworkspacesilent | 7 |
| Super&Shift code:80 | movetoworkspacesilent | 8 |
| Super&Shift code:81 | movetoworkspacesilent | 9 |
| Super&Shift code:91 | movetoworkspacesilent | 10 |
| Super&Shift code:86 | movetoworkspacesilent | +1 |
| Super&Shift code:82 | movetoworkspacesilent | -1 |
| Super&Control left | movecurrentworkspacetomonitor | l |
| Super&Control right | movecurrentworkspacetomonitor | r |
| Super&Control up | movecurrentworkspacetomonitor | u |
| Super&Control down | movecurrentworkspacetomonitor | d |
| Super&Alt U | exec | gnome-characters |
| Super&Alt K | exec | wl-copy |
| XF86AudioMute | exec | wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle |
| ALT XF86AudioMute | exec | wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle |
| XF86AudioMicMute | exec | wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle |
| exec | grimblast copysave output /home/david/Pictures/Screenshots/$(date +'%F-%T_%N.png') | |
| Super PRINT | exec | grimblast --notify --freeze copysave area /home/david/Pictures/Screenshots/$(date +'%F-%T_%N.png') |
| ALT PRINT | exec | satty --filename - --fullscreen --output-filename /home/david/Pictures/Screenshots/$(date +'%F-%T_%N.png') |
| Super&Alt PRINT | exec | satty --filename - --output-filename /home/david/Pictures/Screenshots/$(date +'%F-%T_%N.png') |
| Super&Alt V | exec | wl-copy' |
| Super L | exec | hyprlock |
| Super Z | exec | pypr zoom |
| Super minus | exec | pypr zoom --0.5 |
| Super plus | exec | pypr zoom ++0.5 |
| Super&Alt mouse_down | exec | pypr zoom ++0.5 |
| Super&Alt mouse_up | exec | pypr zoom --0.5 |
| Super&Alt mouse:274 | exec | pypr zoom |
| Super ODIAERESIS | exec | pypr toggle_dpms |
| Super Y | exec | pypr toggle_special minimized |
| Super&Shift Y | togglespecialworkspace | minimized |
| Super W | exec | hyprpanel toggleWindow bar-0 |
| Super SPACE | exec | fuzzel |
| Super&Alt N | exec | pypr toggle networkmanager |
| Super&Alt PERIOD | exec | bitwarden |
| Super&Alt A | exec | pypr toggle pavucontrol |
| XF86AudioPlay | exec | playerctl play-pause |
| XF86AudioPause | exec | playerctl play-pause |
| XF86AudioStop | exec | playerctl stop |
| XF86AudioNext | exec | playerctl next |
| XF86AudioPrev | exec | playerctl previous |
| CTRL XF86AudioRaiseVolume | exec | playerctl position 1+ |
| CTRL XF86AudioLowerVolume | exec | playerctl position 1- |
| ALT XF86AudioNext | exec | playerctld shift |
| ALT XF86AudioPrev | exec | playerctld unshift |
| ALT XF86AudioPlay | exec | systemctl --user restart playerctld |
| Super&Alt Z | exec | xdg-open https://localhost:8384 |
| Super RETURN | exec | kitty |
| Super&Alt T | exec | pypr toggle kitty |
| Super&Alt G | exec | codium |
| XF86AudioRaiseVolume | exec | wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 2.5%+ |
| XF86AudioLowerVolume | exec | wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 2.5%- |
| ALT XF86AudioRaiseVolume | exec | wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SOURCE@ 2.5%+ |
| ALT XF86AudioLowerVolume | exec | wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SOURCE@ 2.5%- |
| XF86KbdBrightnessUp | exec | light -s sysfs/leds/kbd_backlight -A 10 |
| XF86KbdBrightnessDown | exec | light -s sysfs/leds/kbd_backlight -U 10 |
| XF86MonBrightnessUp | exec | light -U 5 |
| XF86MonBrightnessDown | exec | light -A 5 |
| Super mouse:272 | movewindow | |
| Super mouse:273 | resizewindow | |
| Escape | exec | pypr hide '*' |
To use nixpkgs stable branch, update the following inputs to the latest release (25.05 as an example) in flake.nix and rebuild the system.
ATTENTION! When the latest release of nixpkgs is some time away, then you will likely need to refactor some breaking changed options. See the backward incompatibilities in the release notes for those. Directly after a new release should be the best time to switch.
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-25.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix/release-25.05";
};
}To still let specific packages follow nixpkgs unstable while on the stable branch you can add an overlay:
{ inputs, ... }:
final: prev:
with inputs.nixpkgs-unstable.legacyPackages.${prev.system}; {
inherit
gamescope
lutris
vscodium
;
}You can try using my modules through importing them:
# flake.nix
inputs = {
dafitt.url = "github:dafitt/dotfiles";
dafitt.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, ... }@inputs: {
nixosConfigurations."<host>" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# e.g.
inputs.dafitt.nixosModules.hyprland
inputs.dafitt.homeModules.hyprland
inputs.dafitt.homeModules.browser-firefox
];
};
};But it is certainly better to simply copy them into your dotfiles and adapt them to your needs.
Starting points for customization:
- modules/nixos/time.nix: timezone
- modules/nixos/locale.nix: locale
- modules/home/browser-firefox.nix:
- the default searx search engine is my own local instance/server, use a official one or setup your own
- custom firefox plugins
- hosts/: your own hosts configuration
-
configuration.nix -
hardware-configuration.nix - users
-
- modules/home/hyprland/default.nix: familiar keybindings
- modules/home/stylix/default.nix: custom base16 theme / icon theme
- Packages and programs you need
Manually reload the fontconfig cache using
fc-cache -r [-f]Error messages:
Failed to set power on: org.bluez.Error.Failed
bluetoothd: Failed to set mode: Failed (0x03)
Check and unblock bluetooth software side with:
rfkill list
sudo rfkill unblock bluetooth-
"Using Nix on non-NixOS distros, it's common to see GL application errors" - NixGL:
nix run --impure github:nix-community/nixGL -- <PROGRAM>
-
Try to also install the program with the underlining distro. E.g. Debian:
sudo apt install <PROGRAM>
You need to reinstall NixOS.
Create a new subvolume (i.e. @nix.new) and mount it under /mnt/nix (i.e. mount -o subvol=nix2 /tmp/foo/nix --mkdir). Next bind-mount your /boot and/or efi in the same place relative to /mnt/ as they are in the real system (i.e. /mnt/boot).
Then you nixos-install --flake .#<hostname>.
Now you’ve got a working Nix store with your current closure in the nix.new subvolume and a bootloader set up to boot from it. All that is left to do is swap the @nix.new subvol with your regular @nix subvol (that’s where your fstab is set up to find it) and reboot. If you’ve done everything correctly, you should boot into your current generation with a brand new Nix store.
Commands to help:
mount /dev/nvme0n1p2 /mnt
btrfs subvolume create /mnt/@nix.new
umount /mnt
mkdir /mnt/nix /mnt/boot
mount /dev/nvme0n1p1 /mnt/nix
mount -o subvol=@nix2 /dev/nvme0n1p2 /mnt/nix
nixos-install --flake .#<hostname>
umount /mnt/nix /mnt/boot
mount /dev/nvme0n1p2 /mnt
mv /mnt/@nix /mnt/@nix.old
mv /mnt/@nix.new /mnt/@nix
reboot
mount /dev/nvme0n1p2 /mnt
btrfs subvolume delete /mnt/@nix.old