Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kedwar83/nix-scripts
A collection of scripts used for automating the process of uploading to github, and syncing dotfiles
https://github.com/kedwar83/nix-scripts
Last synced: 3 days ago
JSON representation
A collection of scripts used for automating the process of uploading to github, and syncing dotfiles
- Host: GitHub
- URL: https://github.com/kedwar83/nix-scripts
- Owner: kedwar83
- Created: 2024-11-18T17:58:13.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-14T19:05:50.000Z (about 1 month ago)
- Last Synced: 2024-12-14T20:18:40.682Z (about 1 month ago)
- Language: Nix
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NixOS Configuration Management Scripts
This repository contains a collection of scripts for managing NixOS configurations and dotfiles. These scripts help automate the process of setting up a new NixOS system, synchronizing configurations, and managing dotfiles.
## Scripts Overview
### 1. First-Time Setup Script (`setup.sh`)
A comprehensive setup script that initializes a new NixOS system with the following features:
- Git repository initialization
- SSH key generation
- LUKS configuration generation
- NixOS configuration structure creation
- Home-manager installation
- Dotfiles setup**Key Features:**
- Automatic LUKS device detection and configuration
- Git repository management
- User-specific configuration
- Hardware configuration copying
- Dotfiles management using stow### 2. Dotfiles Sync Script (`dotfiles-sync`)
A Nix-based script for synchronizing dotfiles between your home directory and a Git repository.
**Key Features:**
- Automated dotfiles backup
- Selective file synchronization
- Extensive file exclusion list
- Firefox profile management
- Automatic git commits and pushes
- Error logging and notifications### 3. NixOS Sync Script (`nixos-sync`)
A script for synchronizing and rebuilding NixOS configurations.
**Key Features:**
- Automated NixOS rebuilding
- System-wide configuration management
- Root privilege handling
- Success/failure notifications### 4. Home Manager Sync Script (`home-manager-sync`)
A script for synchronizing and rebuilding Home Manager configurations.
**Key Features:**
- User-level configuration management
- Automated Home Manager rebuilding
- Success/failure notifications
- No root privileges required## Requirements
- NixOS installation
- Git
- Home Manager
- GNU Stow
- Root access (for system-wide operations)## Usage
### First-Time Setup
```bash
sudo ./setup.sh
```Follow the prompts to configure your system. You'll need to:
1. Provide a hostname
2. Add your SSH key to GitHub when prompted
3. Edit configuration files as needed### Regular Synchronization
For dotfiles:
```bash
dotfiles-sync
```For NixOS configuration:
```bash
sudo nixos-sync
```For Home Manager configuration:
```bash
home-manager-sync
```## Configuration Files
- NixOS configurations are stored in `/etc/nixos`
- Dotfiles are stored in `~/.dotfiles`
- Home Manager configurations are managed through the dotfiles repository## File Structure
```
/etc/nixos/
├── flake.nix
├── hosts/
│ └── /
│ ├── configuration.nix
│ ├── hardware-configuration.nix
│ ├── boot.nix
│ └── home.nix
└── ...~/.dotfiles/
├── .config/
├── .mozilla/
└── ...
```## Notes
- The setup script is specifically configured for the user "keganre". Modify the script for your username if needed.
- LUKS configuration is automatically generated based on your system's encrypted volumes.
- Certain sensitive files and directories are excluded from dotfiles synchronization (see exclusion list in `dotfiles-sync`).
- All sync scripts include error handling and notifications.