Welcome to my NixOS configuration, you can find the repo here.
β¨ Features
- π₯οΈ Multiple Hosts Support: Easy to configure for different hosts.
- πͺ Hyprland + Waybar: Highly configurable window compositor on Wayland.
- π Home Manager Integration: Manage user-specific configurations with ease.
- π Zsh + Starship: Efficient shell setup with lots of aliases.
- π» Ghostty: Fast and feature-rich terminal emulator.
- βοΈ Neovim: The best editor.
- π YubiKey Login: Fast and secure authentication with YubiKeys.
π Notes
- Iβve chosen to tightly integrate Home Manager and NixOS within the
same file and directory structure, rather than separating them into different
files and folders. This keeps the configuration more cohesive but comes with
some important caveats:
- Home Manager options must always be written inside a:
block within your configuration files.
home-manager.users.${user} = { ... };
- Home Manager attributes cannot be imported at the top level (outside of
the
home-manager.users.<user>
block). For example:Here, note that{ pkgs, user, ... }: { home-manager.users.${user} = { config, ... }: { programs.rofi = { ... theme = let inherit (config.lib.formats.rasi) mkLiteral; in { ... }; }; }; }
config
is only available within thehome-manager.users.<user>
blockβtrying to import Home Manager attributes directly at the top level will fail.
- Home Manager options must always be written inside a:
- This design choice reduces duplication and keeps related configurations together, but it requires extra attention to module scoping and to distinguishing between NixOS and Home Manager settings.
- If you prefer a more typical separated configuration structure (e.g. fully
declarative Home Manager setup using
home.nix
per host), check out Andrey0189βs NixOS Config Reborn, which this repository was briefly based on before the latest refactor.
π Installation
To get started with this setup, follow these steps:
-
Install NixOS If you havenβt already installed NixOS, follow the NixOS Installation Guide for detailed instructions.
-
Clone the Repository
git clone https://github.com/jonwin1/nixos-jonwin cd nixos-jonwin
-
Copy one of the host configurations to set up your own
cp -r config/desktop config/<your_hostname>
-
Put your
hardware-configuration.nix
file therecp /etc/nixos/hardware-configuration.nix nixos/<your_hostname>/
-
Edit the configuration files as needed See File Structure below for an overview of where to find what. You might for example what to set you git name and email or change the name and logo on the hyprlock screen.
-
Add a YubiKey or disable the module See NixOS Wiki - YubiKey PAM U2F or remove the module from
config/common/modules.nix
. -
Edit the
flake.nix
file... let hosts = [ -- { -- user = "jonwin"; -- hostname = "desktop"; -- system = "x86_64-linux"; -- } -- { -- user = "jonwin"; -- hostname = "laptop"; -- system = "x86_64-linux"; -- } ++ { ++ user = "<your_username>"; ++ hostname = "<your_hostname>"; ++ system = "x86_64-linux"; ++ } ]; ...
-
Rebuild
git add . sudo nixos-rebuild switch --flake .#<hostname> # or, if you're installing on a fresh system: sudo nixos-install --flake .#<hostname>
-
Wallpaper Add a file
~/Pictures/wallpaper.png
to set the wallpaper.
π File Structure
π .
β£ βοΈ flake.nix (Main entry point for the NixOS flake)
β£ π config/ (Host and shared configuration files)
β β£ π common/ (Shared settings for all hosts)
β β β£ βοΈ configuration.nix (Shared config options)
β β β£ βοΈ modules.nix (Shared module imports)
β β β βοΈ packages.nix (Shared packages)
β β π <hostname>/ (Settings for a specific machine)
β β£ βοΈ configuration.nix (Host-specific config options)
β β£ βοΈ hardware-configuration.nix (Hardware configuration for this host)
β β£ βοΈ modules.nix (Host-specific module imports)
β β βοΈ packages.nix (Host-specific packages)
β π modules/ (Reusable custom modules)
β β¦ (e.g. window manager, shell, applications)
π€ Contributions
Feel free to fork the repository and submit pull requests if you’d like to contribute improvements. Open issues if you encounter any problems with the config or have ideas for new features.
π License
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.