Skip to content

NovaViper/NixConfig

Repository files navigation

My NixOS Configurations

https://img.shields.io/badge/Built_with_Nix-white.svg?style=for-the-badge&logo=nixos&logoColor=white&color=41439a&test.svg https://img.shields.io/badge/Codeberg-white.svg?style=for-the-badge&logo=codeberg&logoColor=white&color=2185D0&test.svg https://img.shields.io/badge/Github-white.svg?style=for-the-badge&logo=github&logoColor=white&color=121011&test.svg https://img.shields.io/badge/GitLab-330F63?style=for-the-badge&logo=gitlab&logoColor=white&test.svg

My current NixOS (and constant changing) configuration

Table of Contents

Highlights

  • Multiple NixOS configurations, including laptop and desktop
  • Install and partitioning commands via just
  • Declarative partitioning with disko.
  • Flexible Home Manager with feature flags
  • Modular configuration
  • Wayland/X11 Setups
  • Multiple fully featured desktop environments (KDE Plasma 5/6 and XFCE)
  • Live image ISO build with Nvidia drivers, experimental nix features already enabled, unfree software usage, and some nice options for cli and neovim
  • Declarative themes with theme module and stylix
  • Deployment of secrets using agenix (with yubikey) and evaluation secrets with git-crypt
  • Includes pre-commit scripts to make sure flake is correctly setup and ready to be published to a git repository

References

Structure

Here’s an overview of the repo’s file structure (Generated with eza --icons=never --tree):

.
├── documentation/
├── home/
│  ├── common/
│  ├── lib/
│  ├── nixos/
│  │  ├── features/
│  │  └── image.nix
│  └── novaviper/
│     ├── dotfiles/
│     ├── features/
│     ├── global/
│     ├── ryzennova.nix
│     └── yoganova.nix
├── hosts/
│  ├── common/
│  │  ├── core/
│  │  ├── iso/
│  │  ├── optional/
│  │  ├── users/
│  │  │  ├── nixos/
│  │  │  └── novaviper/
│  ├── live-image/
│  ├── ryzennova/
│  └── yoganova/
│     ├── hardware/
│     │  ├── default.nix
│     │  ├── disks.nix
│     │  └── hardware-configuration.nix
│     └── default.nix
├── modules/
│  ├── home-manager/
│  └── nixos/
├── overlays/
├── pkgs/
├── scripts/
├── secrets/
├── flake.lock
├── flake.nix
├── justfile
├── README.org
└── shell.nix
  • flake.nix: Entrypoint for host and home configurations. Also exposes a devshell for boostrapping the system (nix develop or nix shell).
  • hosts: NixOS Configurations, accessible via nixos-rebuild --flake.
    • common: Shared configurations consumed by the machine-specific ones.
      • core: Configurations applied across all hosts
      • iso: Configurations applied ONLY to live-image/VM builds, trimmed down version of core
      • optional: Opt-in configurations/feature flags that one or more host can use
      • users: Configurations for each system on the machines
    • ryzennova: Primary PC - 32GB RAM, Ryzen 5600G, RTX 2060 6GB | KDE Plasma 6
    • yoganova: Lenovo Yoga 7i 16IRL8 (Type 82YN) - 8GB RAM, Intel i5 1335U | KDE Plasma 6
    • live-image: ISO configuration | Nvidia drivers included | KDE Plasma 6
  • home: My Home-manager configuration, accessible via home-manager --flake when standalone, or nixos-rebuild --flake when NixOS module
    • Each directory here is a “feature” each HM configuration can toggle, thus customizing each machine with configurations for the specific user
  • modules: Custom modules that aren’t available in nixpkgs. Can be NixOS or Home-Manager modules (or both!)
  • overlay: Patches and version overrides for some packages. Accessible via nix build.
  • pkgs: Custom nix packages defined similarly to nixpkg ones. Also accessible via nix build. You can compose these into your own configuration by using my flake’s overlay, or consume them through NUR.
  • secrets: All user/host age secrets are located here
  • scripts: Bash/Posix scripts needed for various precommit and just commands
  • justfile: Command recipe file for just, contains various helpful commands for the flake
  • shell.nix: Declaration of nix-shell, used for nix-shell and nix develop

Installation/Usage

For installation, check out the installation guide located under documentation/installation.org! Check out documentation/tips.org for some tips and important information regarding how the entire flake works.

Tooling and Applications I Use

Main user relevant apps

  • kde plasma 6
  • doom emacs
  • zsh + powerlevel10k
  • vivaldi
  • keepassxc/pass
  • gpg + ssh-agent + yubikey
  • tailscale
  • kdeconnect
  • krita
  • libreoffice
  • bat
  • jellyfin (feishin)
  • konsole+tmux
  • and quite a bit more…

Nix stuff

  • home-manager
  • NixOS and nix, of course

Final Note

I designed my NixOS flake to be modular and customizable; so feel free to change it up and use it in your own setups!