My dotfiles are not perfekt, but they strive to be:
- fully declarative π
- 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.
- π₯ Multiple hosts
- π§ Standalone home
- βοΈποΈ Snowfall-lib structure
- βοΈ almost every module can be disabled
- βοΈπ² Snowfall-flake commands
- π¦ Declarative flatpaks
| Operating System π» | NixOS |
|---|---|
| Window manager πͺ | GNOME with extensions, Hyprland with plugins |
| Login manager π | gdm, greetd, tty |
| Session locking π | hyprlock |
| Terminal β¨οΈ | kitty |
| Shell π | fish |
| Prompt β‘οΈ | starship |
| File manager π | nautilus, pcmanfm, yazi |
| Editor βοΈ | VSCodium |
| Web π | Firefox, Librewolf, Epiphany |
| Theming π¨ | Stylix - modified catppuccin πΏ Mocha |
| Networking π | networkmanager, connman |
| Virtualization πͺ | virt-manager, bottles |
-
Install NixOS and enable the (experimental) nix feature flakes.
-
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 a (your) new system-configuration to
/systems/<architecture>/<host>/default.nix. Availabledafitt-nixosoptions can be found at templates/system/default.nix. -
Copy and import
hardware-configuration.nix. -
Set the correct current
system.stateVersion. -
Add a (your) new home-configuration to
homes/<architecture>/<user>[@<host>]/default.nixAvailabledafitt-homeoptions can be found at templates/home/default.nix. -
Commit all changes:
git add . && git commit -m "systems: added <host>" -
Uncomment
nixConfigin flake.nix and enternix developon your first build for faster build time.
-
-
Build:
- Enter
nix-shelland thennix develop .#default sudo nixos-rebuild boot --flake .#<host>- 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. -
Personal imperative setup:
- Configure monitor setup with
nwg-displays - Syncthing setup
- firefox: Sync Login
- NoScript
- 1Password
- Sidebery
- pavucontrol: Set standard audio output
- Configure monitor setup with
-
Install nix and enable the (experimental) nix feature flakes.
-
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
system.stateVersion. -
Add a (your) new home-configuration to
homes/<architecture>/<user>[@<host>]/default.nixAvailabledafitt-homeoptions can be found at templates/home/default.nix. -
Commit all changes:
git add . && git commit -m "homes: added <user>[@<host>]" -
Uncomment
nixConfigin flake.nix and enternix developon your first build for faster build time.
-
-
System Requirements (Installation depending on your Distribution):
-
Build:
- Enter
nix develop .#default's shell. Alternative: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
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";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = { url = "github:nix-community/home-manager/release-25.05"; 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 a overlays/unstable/default.nix:
{ channels, ... }:
final: prev:
with channels.unstable; {
# packages to get from inputs.unstable
inherit
gamescope
lutris
vscodium
;
}You can try using my modules through importing them:
# flake.nix
inputs = {
dafitt = { url = "github:dafitt/dotfiles"; inputs.nixpkgs.follows = "nixpkgs"; };
};
outputs = { nixpkgs, ... }@inputs: {
nixosConfigurations."<host>" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# e.g.
inputs.dafitt.nixosModules."gnome"
inputs.dafitt.nixosModules."bootloader/systemd"
inputs.dafitt.homeManagerModules."stylix"
inputs.dafitt.homeManagerModules."firefox"
];
};
};But it is certainly better to simply copy them into your dotfiles and adapt them to your needs.
What you have to customize:
- modules/nixos/time/default.nix: timezone
- modules/nixos/locale/default.nix: locale
- modules/home/firefox/default.nix:
- the default searx search engine is my own local instance/server, use a official one or setup your own
- custom firefox plugins
- systems/<architecure>/<host>/default.nix: your own host-configuration
-
hardware-configuration.nix - maybe some host-specific
configuration.nix: make sure to import it:imports = [ ./configuration.nix ];
-
- homes/<architecure>/<user>[@<host>]/default.nix: your own user with your home-configuration
Optionally:
- modules/home/desktops/hyprland/default.nix: familiar keybindings
- modules/home/stylix/default.nix: custom base16 theme / icon theme
- Packages and programs you need
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 switch --flake .#[<host>]Home-manager standalone:
home-manager switch --flake .#[<user>@<host>]nix 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]SUPER_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_CTRL left | movecurrentworkspacetomonitor | l |
| SUPER_CTRL right | movecurrentworkspacetomonitor | r |
| SUPER_CTRL up | movecurrentworkspacetomonitor | u |
| SUPER_CTRL 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 '*' |
I use snowfall-lib, so every default.nix is automatically imported.
My systems and homes are assembled using custom modules config.dafitt.<myModule>. Any custom module has at least one enable option config.dafitt.<myModule>.enable which name matches the folder modules/<nixos|home>/<myModule>/.
Modules in modules/nixos/ are built with the standard nixos-rebuild command.
Modules in modules/home/ are built with home-manager (standalone) and in addition to nixos-rebuild if the homes-hostname "<user>[@<host>]" matches with the host your building on. This is done by snowfall-lib with the systemd-service home-manager-<user>.service. snowfall-lib will create the user if it doesn't exist yet.
Some home-modules in my dotfiles are automatically activated, if the twin module in nixos-modules is enabled. See this line in modules/home/suiteGaming/default.nix for example:
options.dafitt.suiteGaming.enable = mkBoolOpt (osConfig.dafitt.suiteGaming.enable or false) "...The special attribute set osConfig which contains all the nixos-configuration is only present when building with nixos-rebuild.
Some options in modules/home/ or homes/ are not being applied with nixos-rebuild
Check if your option is being set through osCfg. Like this:
enable = mkBoolOpt (osCfg.enable or config.dafitt.suiteGaming.enable) "Whether to enable steam.";If that is the case and osCfg.enable is not null then the osCfg-option will be preferred. Even if it is false.
To solve this set your option to true in modules/nixos/ or systems/.
Manually reload the fontconfig cache using
fc-cache -r [-f]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>