https://github.com/divitmittal/os-nixcfg
nix (via nix-darwin, nixos, nix-on-droid, home-manager, etc.) declarative configurations to attain my deterministically reproducible layer
https://github.com/divitmittal/os-nixcfg
flake-parts flakes home-manager nix nix-darwin nix-on-droid nixos nixos-wsl
Last synced: about 1 year ago
JSON representation
nix (via nix-darwin, nixos, nix-on-droid, home-manager, etc.) declarative configurations to attain my deterministically reproducible layer
- Host: GitHub
- URL: https://github.com/divitmittal/os-nixcfg
- Owner: DivitMittal
- License: mit
- Created: 2024-04-16T09:30:38.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-16T00:48:09.000Z (about 1 year ago)
- Last Synced: 2025-04-16T01:28:08.163Z (about 1 year ago)
- Topics: flake-parts, flakes, home-manager, nix, nix-darwin, nix-on-droid, nixos, nixos-wsl
- Language: Nix
- Homepage:
- Size: 43.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
OS-nixCfg
My personal declarative Nix configurations for macOS, Android, and Linux (NixOS/WSL).
---
---
## π Overview
This repository contains primarily [nix](https://github.com/nixos/nix) configurations, leveraging [Nix Flakes](https://nixos.wiki/wiki/Flakes), [Home Manager](https://github.com/nix-community/home-manager), and system-specific modules ([NixOS](https://nixos.org/), [nix-darwin](https://github.com/LnL7/nix-darwin), [nix-on-droid](https://github.com/nix-community/nix-on-droid)) to achieve a purely declarative, reproducible, and consistent environment across multiple OSes on multiple hosts for multiple users:
- π **macOS** (via `nix-darwin`)
- π€ **Android** (via `nix-on-droid`)
- π§ **\*nix (NixOS)** (including WSL via `NixOS-WSL`)
## π Project Structure
The repository is organized using [flake-parts](https://github.com/hercules-ci/flake-parts) for better modularity.
```
βββ OS-nixCfg/
βββ assets/
βΒ Β βββ qezta.png
βββ flake/
βΒ Β βββ default.nix
βΒ Β βββ devshells.nix
βΒ Β βββ formatters.nix
βΒ Β βββ mkHost.nix
βΒ Β βββ pre-commit.nix
βββ flake.lock
βββ flake.nix
βββ home/
βΒ Β βββ common
βΒ Β βββ comms
βΒ Β βββ default.nix
βΒ Β βββ desktop-env
βΒ Β βββ dev
βΒ Β βββ keyboard
βΒ Β βββ media
βΒ Β βββ tools
βΒ Β βββ tty
βΒ Β βββ web
βββ hosts/
βΒ Β βββ common
βΒ Β βββ darwin
βΒ Β βββ default.nix
βΒ Β βββ droid
βΒ Β βββ nixos
βββ lib/
βΒ Β βββ default.nix
βββ LICENSE
βββ modules/
βΒ Β βββ common
βΒ Β βββ home
βΒ Β βββ hosts
βββ nix.nix
βββ README.md
βββ scripts/
βΒ Β βββ home_rebuild.sh
βΒ Β βββ hosts_rebuild.sh
βββ SECURITY.md
βββ shell.nix
```
## βοΈFlake Inputs
This flake relies on several external inputs to manage dependencies and configurations:
- **`nixpkgs`**: The core Nix package set (tracking `nixpkgs-unstable`).
- **`flake-parts`**: Used for structuring the flake outputs with modularity.
- **`home-manager`**: Manages user-level configurations and dotfiles.
- **`nix-darwin`**: Enables declarative macOS system configuration.
- **`nix-on-droid`**: Enables declarative Android configuration via Termux fork.
- **`NixOS-WSL`**: Provides modules for running NixOS on WSL.
- **`nix-homebrew`**: For Homebrew bootstrapping within `nix-darwin`.
- **`agenix` / `ragenix`**: Used for managing secrets declaratively via age encryption.
- **`OS-nixCfg-secrets`**: **(Private Repository)** Contains encrypted secrets managed by `agenix`.
- **`Nvim-Cfg`**: My external Neovim configuration repository.
- **`nvchad4nix`**: Integrates Neovim configurations (like NvChad or custom starters) with Home Manager.
- **`kanata-tray`**: Provides a system tray application for managing Kanata keyboard remapping presets.
- **`devshell`**: Provides a convenient development shell
- **`pre-commit-hooks`**: Manages Git hooks for code quality and formatting.
- **`systems`**: Provides standard system identifiers list (e.g., `x86_64-darwin`).
- **(Other dependencies)**: Various helper flakes and libraries.
_(See `flake.nix` for the complete list and specific sources)_
## π Secrets Management
Secrets (API keys, passwords, sensitive configurations) are managed using [agenix](https://github.com/ryantm/agenix) or specificaly [ragenix](https://github.com/yaxitech/ragenix).
1. Secrets are encrypted using `ssh` keys. My public key is explicitly available to `ragenix`.
2. The encrypted files reside in a **private** GitHub repository: `DivitMittal/OS-nixCfg-secrets`. This repository is referenced as a flake input.
3. During the Nix build process, `agenix` decrypts these files using my private key (which must be present on the target machine at `~/.ssh/agenix/id_ed25519`).
4. The decrypted files are placed in the Nix store and symlinked to their target locations.
β οΈ **Building this configuration requires access to the private `OS-nixCfg-secrets` repository and the corresponding private `ssh` key.**
## π Related Repositories
- [DivitMittal/Nvim-Cfg](https://github.com/DivitMittal/Nvim-Cfg): Pure lua standalone Neovim configuration, used as an input via `nix4nvchad`.
- `DivitMittal/OS-nixCfg-secrets`: (Private) Contains encrypted secrets managed by `agenix`.
- [DivitMittal/TLTR](https://github.com/DivitMittal/TLTR): Cross-platform complex multi-layer keyboard layout tailored for programmers .
[![][back-to-top]](#top)
[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square&color=purple