SkillAgentSearch skills...

NixOS

NixOS + Hyprland rice with flakes, home-manager and dev-shells

Install / Use

/learn @Sly-Harvey/NixOS

README

<h1 align="center"> <img src="assets/nixos-logo.png" width="100px" /> <br> My NixOS Configuration <br> <img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/palette/macchiato.png" width="600px" /> <br> <div align="center"> <div align="center"> <p></p> <div align="center"> <a href="https://github.com/Sly-Harvey/NixOS/stargazers"> <img src="https://img.shields.io/github/stars/Sly-Harvey/NixOS?color=F5BDE6&labelColor=303446&style=for-the-badge&logo=starship&logoColor=F5BDE6"> </a> <a href="https://github.com/Sly-Harvey/NixOS/network/members"> <img src="https://img.shields.io/github/forks/Sly-Harvey/NixOS?color=C6A0F6&labelColor=303446&style=for-the-badge&logo=git&logoColor=C6A0F6" alt="GitHub Forks"> </a> <!-- <a href="https://github.com/Sly-Harvey/NixOS/"> --> <!-- <img src="https://img.shields.io/github/repo-size/Sly-Harvey/NixOS?color=C6A0F6&labelColor=303446&style=for-the-badge&logo=github&logoColor=C6A0F6"> --> <!-- </a> --> <a = href="https://nixos.org"> <img src="https://img.shields.io/badge/NixOS-Unstable-blue?style=for-the-badge&logo=NixOS&logoColor=91D7E3&label=NixOS&labelColor=303446&color=91D7E3"> <!-- <img src="https://img.shields.io/badge/NixOS-unstable-blue.svg?style=for-the-badge&labelColor=303446&logo=NixOS&logoColor=white&color=91D7E3"> --> </a> <a href="https://github.com/Sly-Harvey/NixOS/blob/main/LICENSE"> <img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&colorA=313244&colorB=F5A97F&logo=unlicense&logoColor=F5A97F&"/> </a> </div> <br> </div> </h1>

Screenshots

Screenshot Screenshot

<details> <summary>More screenshots</summary>

Screenshot Screenshot Screenshot

</details>

Table of Contents

Installation

[!Note] Before proceeding with the installation, check these files and adjust them for your system:

  • hosts/Default/variables.nix: Contains host-specific variables.
  • hosts/Default/host-packages.nix: Lists installed packages for the host.
  • hosts/Default/configuration.nix: Module imports for the host and extra configuration.
<!-- You can install this configuration either on a running system or from the NixOS live installer. The minimal ISO is recommended and can be downloaded from the [official NixOS website](https://nixos.org/download/#nixos-iso). -->

You can install on a running system or from the NixOS live installer. Get the minimal ISO from the NixOS website.

Installation Steps

  1. Clone the Repository:
git clone https://github.com/Sly-Harvey/NixOS.git ~/NixOS
<!-- 2. Navigate to the Directory: -->
  1. Change Directory:
cd ~/NixOS
  1. Run the Installer:
./install.sh
<!-- The script handles host setup, username configuration, and automatically generates `hardware-configuration.nix` based on your hardware. -->

The install and rebuild scripts automate the setup process, including hosts, username, and applying the configuration. It also automatically generates the hardware-configuration.nix file based on your system's detected hardware, eliminating the need to manually generate it.

Usage

Managing Hosts

Method 1: Automatic - run the installer again to select or create another host:

./install.sh

Method 2: Manual:

  1. Copy hosts/Default to a new directory (e.g., hosts/Laptop)

  2. Edit the new host's variables.nix and host-packages.nix

  3. Add the host to flake.nix:

    nixosConfigurations = {
      Default = mkHost "Default";
      Laptop = mkHost "Laptop";
    };
    
  4. Track the new host with git:

    git add hosts/Laptop
    
<!-- 4. Rebuild with the new hostname (see below) -->
  1. Rebuild with the new hostname using either nixos-rebuild or nh (see Rebuilding below). Once rebuilt, any rebuilding method can be used, as the host name will be implicitly recognised.

Rebuilding

Apply configuration changes:

  • Keyboard shortcut: Super + U
  • rebuild script: rebuild
  • nixos-rebuild: sudo nixos-rebuild switch --flake ~/NixOS#<HOST>
  • nh: nh os switch --hostname <HOST>

Replace <HOST> with the name of your host (e.g., Laptop).

Rollbacks

List generations:

list-gens

Rollback to generation N:

rollback N

Replace N with the generation number (e.g., 69).

Keybindings

View all keybindings with Super + ? or Super + Ctrl + K.

Development Shells

Pre-configured dev shells for various languages are included.

Initialize a project from a template:

nix flake init -t ~/NixOS#<TEMPLATE_NAME>

Create a new project directory:

nix flake new -t ~/NixOS#<TEMPLATE_NAME> <PROJECT_NAME>

Templates are defined in dev-shells/default.nix (python, node, etc.).

Enter the shell:

cd <PROJECT_NAME>
nix develop

If you're using direnv, the shell activates automatically.

Credits/Inspiration

| Credit | Reason | | ------------------------------------------------------------- | ---------------------------- | | Hyprland-Dots | Scripts and Waybar templates | | HyDE | Additional scripts | | rofi | Rofi launcher styles | | dev-templates | Development templates | | Vimjoyer | NixOS tutorials |

<!-- --- ## ⭐ Star History <details> <summary>View Star History</summary> <a href="https://github.com/Sly-Harvey/NixOS/stargazers"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=Sly-Harvey/NixOS&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=Sly-Harvey/NixOS&type=Date" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=Sly-Harvey/NixOS&type=Date" /> </picture> </a> </details> -->

Related Skills

View on GitHub
GitHub Stars505
CategoryDevelopment
Updated7h ago
Forks49

Languages

Nix

Security Score

100/100

Audited on Mar 24, 2026

No findings