https://github.com/rishabh5321/dotfiles
Just another NixOS dotfiles.
https://github.com/rishabh5321/dotfiles
container dotfiles flakes gnome home-manager hyprland i3 kde nix nix-flake nix-flakes nixos nixos-config nixos-configuration pinned sway swaywm xfce
Last synced: 19 days ago
JSON representation
Just another NixOS dotfiles.
- Host: GitHub
- URL: https://github.com/rishabh5321/dotfiles
- Owner: Rishabh5321
- License: mit
- Created: 2024-08-25T11:23:27.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-05-17T15:46:22.000Z (26 days ago)
- Last Synced: 2026-05-17T17:40:51.284Z (26 days ago)
- Topics: container, dotfiles, flakes, gnome, home-manager, hyprland, i3, kde, nix, nix-flake, nix-flakes, nixos, nixos-config, nixos-configuration, pinned, sway, swaywm, xfce
- Language: Nix
- Homepage:
- Size: 576 MB
- Stars: 37
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rishabh's Flakes
My personal NixOS configurations, managed with Nix Flakes for reproducibility and modularity.
[](https://github.com/Rishabh5321/dotfiles)
[](https://nixos.org)
[](https://github.com/Rishabh5321/dotfiles/blob/main/LICENSE)
[](https://github.com/Rishabh5321/dotfiles/commits/main)
[](https://github.com/Rishabh5321/dotfiles/actions/workflows/build.yml)
## 🖼️ Showcase
## ✨ Philosophy
This project aims to create a highly modular and reusable NixOS setup for all my machines. The core principles are:
- **Reproducibility:** Nix Flakes ensure that every machine has the exact same configuration, defined declaratively.
- **Modularity:** Configurations are broken down into small, reusable modules (`./modules`) that can be mixed and matched for different hosts.
- **Simplicity:** The structure is designed to be easy to understand and manage, with a clear separation between system-level (`configuration.nix`) and user-level (`home.nix`) settings.
- **Automation:** GitHub Actions are used to automatically check, build, and format the code, ensuring quality and consistency.
## 📂 Directory Structure
The repository is organized to separate concerns, making it easy to manage configurations for different machines and purposes.
```
.
├── containers/ # Nix definitions for containerized services (Plex, Sonarr, etc.)
├── hosts/ # Host-specific configurations. Each subdirectory is a unique machine.
│ └── dell/ # Example host configuration for a machine named 'dell'
│ ├── configuration.nix # Main NixOS configuration for this host
│ ├── home.nix # Home Manager configuration for the user on this host
│ └── ... # Other host-specific files (e.g., hardware-configuration.nix)
├── modules/ # Reusable modules for system and user configurations
│ ├── desktop/ # Desktop Enviornments/ Window manager
│ ├── system/ # System-level modules (boot, networking, security, etc.)
│ └── user/ # Home Manager modules (shell, editors, browsers, etc.)
├── overlays/ # Custom Nixpkgs overlays to modify or add packages
├── pkgs/ # Custom packages built with Nix
├── flake.nix # The heart of the project, defining inputs and outputs
└── README.md # This file
```
## 🚀 Usage
### Prerequisites
- A machine with Nix installed, with support for Flakes enabled.
- Git to clone the repository.
### Installation
1. Clone this repository to your local machine:
```bash
git clone --depth 1 https://github.com/Rishabh5321/dotfiles
cd dotfiles
```
2. **IMPORTANT**: Before deploying, you **must** create a new host directory under `./hosts/` that matches your machine's hostname. You will also need to generate a `hardware-configuration.nix` specific to your hardware.
```bash
# 1. Get your machine's hostname
hostname
# 2. Create a directory for your host
mkdir -p hosts/$(hostname)
# 3. Generate a hardware configuration for your new machine
sudo nixos-generate-config --show-hardware-config > hosts/$(hostname)/hardware-configuration.nix
# 4. Create your main configuration.nix and home.nix.
# You can copy from an existing host to get started.
cp hosts/dell/configuration.nix hosts/$(hostname)/
cp hosts/dell/home.nix hosts/$(hostname)/
```
3. Apply the configuration. The flake is set up to automatically detect any directory in `./hosts` as a valid `nixosConfiguration`.
```bash
# Replace with your machine's actual hostname
sudo nixos-rebuild switch --flake .#
```
For example, to deploy the `dell` configuration:
```bash
sudo nixos-rebuild switch --flake .#dell
```
## flake.nix Details
### Inputs
This flake pulls in several external dependencies to build the system. Key inputs include:
- **nixpkgs**: The primary Nix package set, tracking `nixos-unstable-small`.
- **home-manager**: Manages user-level dotfiles and packages.
- **stylix**: For system-wide theming and styling.
- **sops-nix / agenix**: (Future goal) For managing secrets securely.
- And various other flakes for specific applications and themes.
### Outputs
The flake provides the following outputs:
- **`nixosConfigurations`**: The main output. It dynamically generates a NixOS configuration for every host defined in the `hosts/` directory.
- **`formatter`**: Provides a consistent code formatter (`nixpkgs-fmt`) for the entire project. You can run it with `nix fmt`.
- **`overlays`**: Custom overlays defined in the `overlays/` directory.
---
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.