My over-engineered approach of declaratively syncing my desktop setups between all my devices.
Some nice bits of knowledge I came across along the buildup of this flake are documented accumulated right here
$ tree -a -I '\.git|\.direnv' . # slightly modified for better context/ overview
.
├───────────────────────────────────────────
├── .devenv
├── flake.nix
├── patches # patches for flake inputs
├── disko
│ ├── ext4-encrypted.nix
│ └── ext4-unencrypted.nix
├── .sops.yaml
├── home-manager
│ ├── default.nix
│ ├── users # home-manager is actually user-based
│ │ ├── nixos.nix
│ │ └── darwin.nix # import subset of files that makes sense for my work laptop
│ ├── secrets # secrets are managed using sops & age stored inside of a yubikey
│ │ └── ...
│ ├── packages.nix
│ ├── desktop-env
│ │ └── ...
│ ├── devel
│ │ └── ...
│ └── media
│ └── ...
├── nixos
│ ├── dnix
│ │ ├── default.nix
│ │ └── hardware-configuration.nix
│ ├── lnix # same as dnix
│ ├── default.nix
│ ├── desktop-env.nix
│ ├── gnome.nix
│ ├── packages.nix
│ ├── systemd.nix
│ └── virtualisation.nix
├── nixvim # see README there
│ └── ...
├── overlays
│ ├── default.nix
│ ├── modifications.nix
│ ├── modification # package patches
│ │ └── ...
├── darwin
│ ├── default.nix
└── pkgs # custom packages (+ nixvim)- Misterio77-style Flake-based NixOS + home-manager setup
- Configuration for laptop (
lnix) & desktop (dnix) nix-hardwaresetup for each- nix-darwin setup for work laptop (
wnix), which uses a subset of the home-managed part - Overlays & systemd services to make this a bit more convenient
- Configuration for laptop (
- Highly customized GNOME Wayland DE with some KDE tools
home-managerfor managing everything apart from system stuff- Home-managed secrets with sops-nix (age encrypted)
- nixvim setup with standalone approach to enable
mainbranch despite using "stable"home-manager- To checkout my nixvim setup, don't hesitate to use
nix run .#nixvim <some-file> - Used elythh's config as a starting point
- To checkout my nixvim setup, don't hesitate to use
- disko: For NixOS partitioning & deployment
- Flockenzeit: Date & time parsing and formatting in native Nix. Awesome!
- Used in conjunction with flake's
inputs.self.sourceInfo.lastModifiedfor systemd NixOS automatic rebuild logs :^)
- Used in conjunction with flake's
- mac-app-util: Automatically creating trampoline symlinks for home-managed Mac software
- I really hate MacOS, but this lib makes me hate using it with nix-darwin a bit less
- nix-vscode-extensions: The few extensions being available in
nixpkgs(some of which being outdated) replaced by the latest & all available onopen-vsx& marketplace!
- Over-engineering in it's purest form (heh). Spent days on this config - and there are still ~80 TODOs :|
- Systemd Services:
nixos-upgrade-notify-send-(failure|success).service- Sends desktop notification when nixos-upgrade unit finishednixos-upgrade-automatic-shutdown.service- Shuts down the desktop when nixos-upgrade service finished
Disabled by default; Must be started manually
nixos-upgrade.servicewrites build logs to/var/log/nixos-upgrade/
nixos-fetch-flake-changes.service- Checks for upstream changes of flake and executesnixos-rebuild switchif so- rebuild shell alias: See bottom of shell.nix
- Enter the
nix repl
# aliased as nrepl
nix repl --expr "builtins.getFlake \"$HOME/devel/own/dotfiles.nix\""- Partition disks with disko:
sudo nix run github:nix-community/disko \
--extra-experimental-features "nix-command flakes" -- \
--mode disko ./disko/ext4-(un)encrypted.nix (--arg disks '[ "/dev/sdX" ]')
# If the command succeeds, the partitions are automatically mounted under /mntsudo nixos-install --flake </home/nixos/>dotfiles.nix#<host> -j 4 --cores 2- reboot
Sometimes its nice to have a good starting point, when one spent hours on bringing a system to run :) Let's hope this projects break the hours down to minutes
- Copy the nix-sops secret to the new system
- Enable the installed GNOME-extensions
- Setup
gsconnect
- Setup
- (Configure the CPU-scheduler and profile in
cpupower-gui) - Fix
dconfsettings for shortcuts being ignored by home-manager dconf generator (?):- "Open the quick settings menu" =>
Disabled([delete] key) - "Show the overview" =>
<Super>s
- "Open the quick settings menu" =>
- Nextcloud
- Enter Thunderbird mail account passwords (are mounted, but impossible to automatically pass to Thunderbird)
- Firefox Account
- JetBrains (IDEA, CLion, ...)
- Obsidian
- Telegram, Signal, Threema, Element
- planify
- Anki
- cider
- keepassxc
- telegram-desktop
- planify
- element-desktop (manually created in
autostart.nix)