Compare commits
241 Commits
k3s
...
nix-deck-s
| Author | SHA1 | Date | |
|---|---|---|---|
| a9772259f0 | |||
| 4f6d65316a | |||
| 0b8e3bf527 | |||
| d3c906134b | |||
| 30b616dd93 | |||
| c9252c42c2 | |||
| fa7cb55c78 | |||
| 2283b0a6df | |||
| 4ea9437bb0 | |||
| d0760a22bd | |||
| f67a12c29a | |||
| fc8a43504d | |||
| 4a73b3a5ae | |||
| be68202523 | |||
| 608fed35ab | |||
| c2e2dd8675 | |||
| 5750f737f1 | |||
| c27518e0dc | |||
| 7f318edc4d | |||
| f995240153 | |||
| d62bae0ddb | |||
| 79ae42f41d | |||
| 0c15aad5c0 | |||
| d87793d39b | |||
| fad6e61aac | |||
| 1bc65ceb51 | |||
| bda76c6abc | |||
| c42e09e972 | |||
| 4d986c0b48 | |||
| 4e3fdd78d2 | |||
| d3703fc5a9 | |||
| 35c2ebb592 | |||
| 569ac528a5 | |||
| 6cc8fa4f5d | |||
| 67a82f14fd | |||
| 4b68e3f051 | |||
| 81a3657759 | |||
| 32e1b81034 | |||
| 6f00c72540 | |||
| d26007aa61 | |||
| 1caa8bba3e | |||
| d3cb09040a | |||
| 4bfacffa17 | |||
| a6961f05ca | |||
| b75c43257b | |||
| 63d741e55e | |||
| 9ed3ad8fb8 | |||
| 330cd6f92b | |||
| 3b9d9ed60b | |||
| 2a017f584b | |||
| 47c4e0097e | |||
| 2b7cf66e69 | |||
| eed88a9ac0 | |||
| c02b74cce4 | |||
| 1132dda8a0 | |||
| 2696262ed3 | |||
| 40ac30c78f | |||
| ac986e37e7 | |||
| d3664fcf9d | |||
| 5591087be1 | |||
| 09a701989c | |||
| 62dbf84b4b | |||
| 81799cd6d2 | |||
| 35d965e432 | |||
| 2c4e6cc060 | |||
| 5c6dba77f0 | |||
| a6effa3944 | |||
| 0d53b86fcb | |||
| 6bf5c502d8 | |||
| 05592a9ec2 | |||
| 923aaf9e95 | |||
| 23b1c450a2 | |||
| a65a8e9af7 | |||
| 56b1111f54 | |||
| 6bf0a37533 | |||
| 396c8e0318 | |||
| b359acfcf0 | |||
| 455181365a | |||
| 06dd292524 | |||
| 8924fdbc6d | |||
| 671dc229de | |||
| 14cdee1468 | |||
| c6276c9758 | |||
| 31880e21e8 | |||
| 3d95995ebc | |||
| fb9dd66cf4 | |||
| a90b30eb1c | |||
| b22a4952e5 | |||
| 32f70d46b2 | |||
| d76e9e73f5 | |||
| 53504ffde3 | |||
| e5be1b5675 | |||
| 878962ad41 | |||
| 6d5eadcf6a | |||
| c323d1301b | |||
| 6cdbd2e300 | |||
| f0bf2f2d8c | |||
| 9d6abce8cc | |||
| 68f63db930 | |||
| 2e39984d14 | |||
| 9fed36e6ee | |||
| 38a8997448 | |||
| a3c8995422 | |||
| b9bb5d387f | |||
| e3aff80a97 | |||
| 574c8e6482 | |||
| 0f59a558cd | |||
| 14b7de30f6 | |||
| 8b676203e7 | |||
| beeb7acefd | |||
| a512d9bc06 | |||
| cc3d398963 | |||
| f757ea7271 | |||
| 64149713d2 | |||
| 88b413e0af | |||
| c5070eb4bf | |||
| 6b4dc1e6b7 | |||
| aadd8c7b6c | |||
| f8d145b495 | |||
| 9232d46f6a | |||
| b2b34fc05f | |||
| aa4dacb3af | |||
| 6dc4d6956a | |||
| be83fc566f | |||
| 485df44aea | |||
| 4861128de6 | |||
| 9fe7cfbbfc | |||
| 741e3a67d6 | |||
| 22254eb1f3 | |||
| 79dde1a0fe | |||
| f4b3c36a4e | |||
| 1fa7a2689c | |||
| c08c5e2486 | |||
| ecaa6dcb83 | |||
| 7729ff7434 | |||
| 52c110a505 | |||
| d5997575df | |||
| 57bc35101e | |||
| 6b09b1b0bc | |||
| 1851743a21 | |||
| c6d787f9f5 | |||
| f4a8f9d614 | |||
| 1e01d44f2f | |||
| 39dbe6644c | |||
| 870e1073dc | |||
| c1f132026a | |||
| 5650125d7e | |||
| 6536213bd0 | |||
| a0ce3b810e | |||
| abbcfebc97 | |||
| 495aba3fef | |||
| f9bcec74d3 | |||
| 97c4d7035c | |||
| 8abd331619 | |||
| aca0afa0dc | |||
| 1d0b3a0367 | |||
| 50f9defdd5 | |||
| d71d7a1ffb | |||
| ee511f6ab8 | |||
| e3dd0bdb30 | |||
| 10300ed10b | |||
| 8e72ef71d2 | |||
| d6e031efd0 | |||
| 16fa4a641c | |||
| 7a5ec23cc5 | |||
| ff1124fbe6 | |||
| 53088f9536 | |||
| 68c04b43fd | |||
| efbfffbb61 | |||
| 0e1a67b980 | |||
| 7d6e294340 | |||
| 8690a0289d | |||
| e95f56e240 | |||
| 2dffbb0a98 | |||
| 2ceaf78825 | |||
| e164097f36 | |||
| d1605e386d | |||
| 4a41533ba8 | |||
| 9d45449fce | |||
| 877bc2c739 | |||
| cd6e028142 | |||
| 421b27f76f | |||
| 1f4a72d28c | |||
| a8f19af989 | |||
| d4b0fe5b9e | |||
| 09cff42222 | |||
| 0183e7c823 | |||
| 29cdd1e239 | |||
| 7ced8f11ba | |||
| 244b7c0888 | |||
| 80744bcbf1 | |||
| 56d03f4228 | |||
| 32d0c7fa5a | |||
| 1c2aae93b7 | |||
| 0ab6562694 | |||
| 986ee06a46 | |||
| 34abaeeec9 | |||
| 11638cfa1b | |||
| 1ce431b0e5 | |||
| 98ef9b1443 | |||
| 4c779663df | |||
| e2bb87fcf1 | |||
| ef47c5dc9a | |||
| 7da089daa3 | |||
| 8134d7cb33 | |||
| 24f1a64f3c | |||
| 19531074ca | |||
| a30c130f21 | |||
| e088ee2dc8 | |||
| 366a7e2ea3 | |||
| 9116e44dfe | |||
| e3ef710bdb | |||
| e1a804cfed | |||
| ec59936012 | |||
| 844d17a855 | |||
| b19dc65c6d | |||
| 6db2c78e0b | |||
| 475aafa33e | |||
| 09562f0af9 | |||
| ae543d9628 | |||
| c7716d2bca | |||
| 54cf339d52 | |||
| b9097e91d5 | |||
| abf8fe9ad2 | |||
| 926b47f07f | |||
| 749ef988f1 | |||
| dfa91d327f | |||
| 37c455d75e | |||
| c0d7d934f3 | |||
| cb91f69c49 | |||
| bc6378cb22 | |||
| a13676311a | |||
| ec57592715 | |||
| 051c223eb7 | |||
| 6030f6ea42 | |||
| df77fd5c74 | |||
| 458bcb4cdf | |||
| 40e10bab34 | |||
| 3477a3480f | |||
| d2ae7f8e11 | |||
| ff3a0a4738 |
21
.goosehints
Normal file
21
.goosehints
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
NixOS Configurations Repository
|
||||||
|
================================
|
||||||
|
|
||||||
|
Overview:
|
||||||
|
---------
|
||||||
|
This repository hosts modular and reproducible NixOS configurations managed via Nix flakes. It is structured to separate concerns across machine-specific setups, common roles, and custom packages.
|
||||||
|
|
||||||
|
Directory Structure:
|
||||||
|
----------------------
|
||||||
|
• packages/ - Custom Nix packages leveraged across various configurations.
|
||||||
|
• roles/ - Role-based configurations (e.g., kodi, bluetooth) each with its own module (default.nix) for inclusion in machine setups.
|
||||||
|
• machines/ - Machine-specific configurations (e.g., nix-book, z790prors, boxy, wixos) including configuration.nix and hardware-configuration.nix tailored for each hardware.
|
||||||
|
• home/ - Home-manager configurations for personal environments and application settings (e.g., home-nix-book.nix, home-z790prors.nix).
|
||||||
|
|
||||||
|
Design Principles:
|
||||||
|
------------------
|
||||||
|
• Modularity: Clear separation between roles, machines, and packages allows for flexible and reusable configurations.
|
||||||
|
• Declarative & Reproducible: Using Nix flakes guarantees a fully declarative setup that can be effortlessly reproduced across systems.
|
||||||
|
• Scalability: The structure is designed to accommodate adding new roles or machines with minimal disruption to existing configurations.
|
||||||
|
|
||||||
|
This file serves as a concise guide for navigating and understanding the repository from an advanced Nix perspective. Further documentation can be found within the respective directories or individual README files where applicable.
|
||||||
11
.sops.yaml
11
.sops.yaml
@@ -1,11 +0,0 @@
|
|||||||
keys:
|
|
||||||
- &admin_johno age1ls6a033d4p4u8h4rwazjwt8w4c4xg73wq0mdnm64jajxzcz4k9asvjnks3
|
|
||||||
- &host_z790prors age12l5u7sw59u5pkwp83qm8t3ff7uv0ld2c9k3zh5j4ame9k2szcynqu7ftqe
|
|
||||||
- &host_nixbook age1fa3zqavfmqk4ssa22yne9td90gyqv9q5a8y0s8jp3xak8q7p3yjqyn7rkg
|
|
||||||
creation_rules:
|
|
||||||
- path_regex: secrets/[^/]+\.(yaml|json|env|ini)$
|
|
||||||
key_groups:
|
|
||||||
- age:
|
|
||||||
- *admin_johno
|
|
||||||
- *host_z790prors
|
|
||||||
- *host_nixbook
|
|
||||||
177
AGENTS.md
Normal file
177
AGENTS.md
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Repository Overview
|
||||||
|
|
||||||
|
This is a NixOS configuration repository using flakes, managing multiple machines and home-manager configurations. The repository follows a modular architecture with reusable "roles" that can be composed for different machines.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Flake Structure
|
||||||
|
- **flake.nix**: Main entry point defining inputs (nixpkgs, home-manager, plasma-manager, etc.) and outputs for multiple NixOS configurations
|
||||||
|
- **Machines**: `nix-book`, `boxy`, `wixos` (WSL configuration), `zix790prors`, `live-usb`, `johno-macbookpro` (Darwin/macOS)
|
||||||
|
- **Home configurations**: Standalone home-manager configuration for user `johno`
|
||||||
|
|
||||||
|
### Directory Structure
|
||||||
|
- `machines/`: Machine-specific configurations with hardware-configuration.nix
|
||||||
|
- `roles/`: Modular system configurations (audio, bluetooth, desktop, users, etc.)
|
||||||
|
- `home/`: Home Manager configurations and user-specific modules
|
||||||
|
- `home/modules/`: User environment modules (emacs, i3+sway, plasma-manager, tmux)
|
||||||
|
- `packages/`: Custom package definitions
|
||||||
|
|
||||||
|
### Role-Based Configuration System
|
||||||
|
The repository uses a custom "roles" system where each role is a NixOS module with enable options:
|
||||||
|
- `roles.desktop`: Desktop environment with sub-options for X11, Wayland, KDE, gaming, SDDM
|
||||||
|
- `roles.audio`: Audio configuration
|
||||||
|
- `roles.bluetooth`: Bluetooth support
|
||||||
|
- `roles.users`: User account management
|
||||||
|
- `roles.virtualisation`: Virtualization setup
|
||||||
|
- `roles.kodi`: Kodi media center
|
||||||
|
- `roles.nvidia`: NVIDIA GPU configuration
|
||||||
|
- `roles.printing`: Printing support (CUPS)
|
||||||
|
- `roles.spotifyd`: Spotify daemon
|
||||||
|
- `roles.btrfs`: Btrfs filesystem configuration
|
||||||
|
- `roles.nfs-mounts`: NFS mount configuration
|
||||||
|
- `roles.darwin`: macOS-specific configurations
|
||||||
|
|
||||||
|
Example role usage in machine configuration:
|
||||||
|
```nix
|
||||||
|
roles = {
|
||||||
|
audio.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
gaming = true;
|
||||||
|
kde = true;
|
||||||
|
wayland = true;
|
||||||
|
};
|
||||||
|
users.enable = true;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Home-Manager Role System
|
||||||
|
The repository also uses a modular home-manager role system for user-space configuration:
|
||||||
|
|
||||||
|
**Available Home Roles:**
|
||||||
|
- `home.roles.base`: Core CLI tools, git, ssh, bash, rbw (enabled everywhere)
|
||||||
|
- `home.roles.desktop`: GUI applications, Firefox, KDE services
|
||||||
|
- `home.roles.office`: LibreOffice, OpenSCAD (heavy packages)
|
||||||
|
- `home.roles.media`: VLC, Jellyfin, Moonlight (media consumption)
|
||||||
|
- `home.roles.development`: Custom packages, kubectl, development tools
|
||||||
|
- `home.roles.communication`: Element, Nextcloud Talk, Google cookie tools
|
||||||
|
- `home.roles.sync`: Syncthing service and tray (for file synchronization)
|
||||||
|
- `home.roles.kdeconnect`: KDE Connect for device integration
|
||||||
|
- `home.roles.gaming`: Gaming applications (future expansion)
|
||||||
|
|
||||||
|
**Role-Based Home Configurations:**
|
||||||
|
- `home-desktop.nix`: Full-featured desktop for development workstations
|
||||||
|
- `home-media-center.nix`: Living room media consumption and gaming setup (boxy)
|
||||||
|
- `home-laptop-compact.nix`: Essential tools only, excludes office/media for storage constraints (nix-book)
|
||||||
|
- `home-live-usb.nix`: Minimal setup for live environments, no persistent services
|
||||||
|
- `home-darwin-work.nix`: macOS work laptop configuration
|
||||||
|
|
||||||
|
**Machine-Specific Role Usage:**
|
||||||
|
- **nix-book**: Compact laptop → excludes office/media roles due to SSD space constraints
|
||||||
|
- **boxy**: Living room media center → optimized for media consumption, excludes sync/office (shared machine)
|
||||||
|
- **zix790prors**: All-purpose workstation → full desktop experience with all roles enabled
|
||||||
|
- **wixos**: WSL2 development → full desktop experience, inherits from zix790prors Windows host
|
||||||
|
- **live-usb**: Temporary environment → only base + desktop roles, no persistent services
|
||||||
|
- **johno-macbookpro**: macOS work laptop → Darwin-specific configuration with development tools
|
||||||
|
|
||||||
|
## Common Commands
|
||||||
|
|
||||||
|
### Building and Switching Configurations
|
||||||
|
|
||||||
|
**NixOS (Linux):**
|
||||||
|
```bash
|
||||||
|
# Build and switch to a specific machine configuration
|
||||||
|
sudo nixos-rebuild switch --flake .#<hostname>
|
||||||
|
|
||||||
|
# Build without switching
|
||||||
|
nixos-rebuild build --flake .#<hostname>
|
||||||
|
|
||||||
|
# Build home-manager configuration only
|
||||||
|
home-manager switch --flake .#johno
|
||||||
|
```
|
||||||
|
|
||||||
|
**Darwin (macOS):**
|
||||||
|
```bash
|
||||||
|
# Build and switch to Darwin configuration
|
||||||
|
darwin-rebuild switch --flake .#johno-macbookpro
|
||||||
|
|
||||||
|
# Build without switching
|
||||||
|
darwin-rebuild build --flake .#johno-macbookpro
|
||||||
|
```
|
||||||
|
|
||||||
|
### Available Machine Configurations
|
||||||
|
- `nix-book`: Compact laptop with storage constraints, uses `home/home-laptop-compact.nix`
|
||||||
|
- `boxy`: Shared living room media center/gaming desktop with AMD GPU, uses `home/home-media-center.nix`
|
||||||
|
- `zix790prors`: Powerful all-purpose workstation (gaming, 3D modeling, development), dual-boots Windows 11 with shared btrfs /games partition, uses `home/home-desktop.nix`
|
||||||
|
- `wixos`: WSL2 development environment running in Windows partition of zix790prors, uses `home/home-desktop.nix`
|
||||||
|
- `live-usb`: Bootable ISO configuration, uses `home/home-live-usb.nix`
|
||||||
|
- `johno-macbookpro`: macOS work laptop, uses `home/home-darwin-work.nix`
|
||||||
|
|
||||||
|
### Flake Operations
|
||||||
|
```bash
|
||||||
|
# Update flake inputs
|
||||||
|
nix flake update
|
||||||
|
|
||||||
|
# Check flake
|
||||||
|
nix flake check
|
||||||
|
|
||||||
|
# Show flake info
|
||||||
|
nix flake show
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bootstrap New Machine
|
||||||
|
Use the provided bootstrap script:
|
||||||
|
```bash
|
||||||
|
sudo ./bootstrap.sh <hostname>
|
||||||
|
```
|
||||||
|
This script pulls from the remote git repository and applies the configuration.
|
||||||
|
|
||||||
|
### Build Live USB ISO
|
||||||
|
Use the provided script to build a bootable ISO:
|
||||||
|
```bash
|
||||||
|
./build-liveusb.sh
|
||||||
|
```
|
||||||
|
Creates an ISO suitable for Ventoy and other USB boot tools in `./result/iso/`.
|
||||||
|
|
||||||
|
## Development Workflow
|
||||||
|
|
||||||
|
### Adding New Machines
|
||||||
|
|
||||||
|
**NixOS:**
|
||||||
|
1. Create new directory in `machines/<hostname>/`
|
||||||
|
2. Add `configuration.nix` with role assignments
|
||||||
|
3. Include hardware-configuration.nix (generated by nixos-generate-config)
|
||||||
|
4. Add nixosConfiguration to flake.nix outputs
|
||||||
|
|
||||||
|
**Darwin (macOS):**
|
||||||
|
1. Create new directory in `machines/<hostname>/`
|
||||||
|
2. Add `configuration.nix` with Darwin role assignments
|
||||||
|
3. Add darwinConfiguration to flake.nix outputs
|
||||||
|
|
||||||
|
### Adding New Roles
|
||||||
|
1. Create directory in `roles/<role-name>/`
|
||||||
|
2. Create `default.nix` with module definition using mkEnableOption
|
||||||
|
3. Add role import to `roles/default.nix`
|
||||||
|
4. Configure role options in machine configurations
|
||||||
|
|
||||||
|
### Home Manager Modules
|
||||||
|
- Located in `home/modules/`
|
||||||
|
- Each module has its own `default.nix`
|
||||||
|
- Imported in main home configuration files
|
||||||
|
|
||||||
|
## Key Configuration Details
|
||||||
|
|
||||||
|
- **Experimental features**: nix-command and flakes are enabled
|
||||||
|
- **User**: Primary user is `johno` with trusted-user privileges
|
||||||
|
- **Locale**: en_US.UTF-8, America/Los_Angeles timezone
|
||||||
|
- **SSH**: OpenSSH enabled on all configurations
|
||||||
|
- **Garbage collection**: Automatic, deletes older than 10 days
|
||||||
|
- **Unfree packages**: Allowed globally
|
||||||
|
|
||||||
|
## Important Notes
|
||||||
|
|
||||||
|
- **Sudo access**: Claude Code does not have sudo access. Ask the user to run elevated commands like `sudo nixos-rebuild switch`
|
||||||
280
STEAM_DECK_JOVIAN_SETUP.md
Normal file
280
STEAM_DECK_JOVIAN_SETUP.md
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
# Steam Deck (nix-deck) Jovian-NixOS Setup Guide
|
||||||
|
|
||||||
|
This document describes the setup for installing and maintaining NixOS with Jovian-NixOS on a Steam Deck.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
The `nix-deck` configuration provides:
|
||||||
|
- **Jovian-NixOS integration** for Steam Deck hardware support
|
||||||
|
- **Remote building** using `zix790prors` as the build host
|
||||||
|
- **SteamOS role** for easy Steam Deck UI configuration
|
||||||
|
- **Compatibility shim** for using Jovian on NixOS 25.05 stable
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Remote Building
|
||||||
|
|
||||||
|
The setup uses distributed builds to avoid slow compilation on the Steam Deck:
|
||||||
|
|
||||||
|
- **Build Host**: `zix790prors` (powerful desktop)
|
||||||
|
- Runs as a dedicated `nix-builder` user (not root)
|
||||||
|
- Accepts SSH connections from client machines
|
||||||
|
- Performs all heavy compilation work
|
||||||
|
|
||||||
|
- **Build Clients**: `nix-book` and `nix-deck`
|
||||||
|
- Automatically offload builds to `zix790prors`
|
||||||
|
- Fall back to local building if remote builder is unavailable
|
||||||
|
- Steam Deck heavily prefers remote (speedFactor=4)
|
||||||
|
|
||||||
|
### Jovian-NixOS Integration
|
||||||
|
|
||||||
|
- **Jovian module**: Provides Steam Deck hardware support, drivers, and Steam UI
|
||||||
|
- **Compatibility layer**: `roles/jovian-compat.nix` provides `services.logind.settings` for NixOS 25.05
|
||||||
|
- **IMPORTANT**: Remove this when upgrading to NixOS 25.11+
|
||||||
|
- An assertion will fail the build if used on 25.11+
|
||||||
|
|
||||||
|
- **SteamOS role**: `roles.desktop.steamos` abstracts Jovian configuration
|
||||||
|
```nix
|
||||||
|
roles.desktop.steamos = {
|
||||||
|
enable = true;
|
||||||
|
autoStart = false; # Set to true to boot directly to Steam UI
|
||||||
|
desktopSession = "plasmawayland";
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Initial Installation
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
1. Steam Deck in recovery mode or booted to a live Linux environment
|
||||||
|
2. SSH access enabled on the Steam Deck
|
||||||
|
3. SSH key set up for passwordless authentication
|
||||||
|
|
||||||
|
### Option 1: Using nixos-anywhere (Initial Install Only)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# From your main machine
|
||||||
|
nix run github:nix-community/nixos-anywhere -- \
|
||||||
|
--flake .#nix-deck \
|
||||||
|
root@<steam-deck-ip>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: This is only for the initial install. For updates, see below.
|
||||||
|
|
||||||
|
### Option 2: Manual Installation
|
||||||
|
|
||||||
|
1. Boot Steam Deck from NixOS installer USB
|
||||||
|
2. Partition and format the disk
|
||||||
|
3. Mount filesystems
|
||||||
|
4. Clone this repository
|
||||||
|
5. Generate hardware config:
|
||||||
|
```bash
|
||||||
|
nixos-generate-config --show-hardware-config > /tmp/hw.nix
|
||||||
|
```
|
||||||
|
6. Copy the hardware config content to `machines/nix-deck/hardware-configuration.nix`
|
||||||
|
7. Keep the `jovian.devices.steamdeck` settings in the file
|
||||||
|
8. Install:
|
||||||
|
```bash
|
||||||
|
nixos-install --flake .#nix-deck
|
||||||
|
```
|
||||||
|
|
||||||
|
## Updates and Rebuilds
|
||||||
|
|
||||||
|
### Method 1: Remote Build and Deploy (Recommended)
|
||||||
|
|
||||||
|
Build on your main machine, deploy to Steam Deck:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# From nix-book or zix790prors
|
||||||
|
nixos-rebuild switch \
|
||||||
|
--flake .#nix-deck \
|
||||||
|
--target-host root@nix-deck \
|
||||||
|
--build-host localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method 2: On-Device Rebuild (Uses Remote Builder)
|
||||||
|
|
||||||
|
The Steam Deck is configured to automatically use `zix790prors` as a remote builder:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# SSH into the Steam Deck
|
||||||
|
ssh root@nix-deck
|
||||||
|
|
||||||
|
# This will automatically build on zix790prors
|
||||||
|
nixos-rebuild switch --flake /path/to/nixos-configs#nix-deck
|
||||||
|
```
|
||||||
|
|
||||||
|
The build will automatically happen on `zix790prors` and be deployed locally.
|
||||||
|
|
||||||
|
## Remote Builder Setup
|
||||||
|
|
||||||
|
### On the Build Host (zix790prors)
|
||||||
|
|
||||||
|
The configuration creates a `nix-builder` user that client machines connect to:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
roles.remote-build.enableBuilder = true;
|
||||||
|
```
|
||||||
|
|
||||||
|
### On Client Machines (nix-book, nix-deck)
|
||||||
|
|
||||||
|
Configure the remote builder:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
roles.remote-build.builders = [{
|
||||||
|
hostName = "zix790prors";
|
||||||
|
maxJobs = 16;
|
||||||
|
speedFactor = 4; # Higher = prefer remote more
|
||||||
|
}];
|
||||||
|
```
|
||||||
|
|
||||||
|
### SSH Key Setup
|
||||||
|
|
||||||
|
1. Generate SSH key on the builder host for the `nix-builder` user:
|
||||||
|
```bash
|
||||||
|
sudo -u nix-builder ssh-keygen -t ed25519 -f /var/lib/nix-builder/.ssh/id_ed25519
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Copy the public key to client machines:
|
||||||
|
```bash
|
||||||
|
# Add to /var/lib/nix-builder/.ssh/authorized_keys on zix790prors
|
||||||
|
```
|
||||||
|
|
||||||
|
3. On client machines, ensure you can connect:
|
||||||
|
```bash
|
||||||
|
ssh nix-builder@zix790prors
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration Files
|
||||||
|
|
||||||
|
### Key Files Created/Modified
|
||||||
|
|
||||||
|
- `flake.nix` - Added Jovian input and nix-deck configuration
|
||||||
|
- `roles/jovian-compat.nix` - Compatibility shim (remove in 25.11+)
|
||||||
|
- `roles/desktop/steamos.nix` - SteamOS/Jovian role abstraction
|
||||||
|
- `roles/remote-build/default.nix` - Remote builder role
|
||||||
|
- `machines/nix-deck/configuration.nix` - Steam Deck system config
|
||||||
|
- `machines/nix-deck/hardware-configuration.nix` - Hardware config (placeholder)
|
||||||
|
|
||||||
|
### Example Configuration
|
||||||
|
|
||||||
|
```nix
|
||||||
|
# machines/nix-deck/configuration.nix
|
||||||
|
{
|
||||||
|
roles = {
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
wayland = true;
|
||||||
|
gaming.enable = true;
|
||||||
|
kde = true;
|
||||||
|
sddm = true;
|
||||||
|
steamos = {
|
||||||
|
enable = true;
|
||||||
|
autoStart = false; # or true to boot to Steam UI
|
||||||
|
desktopSession = "plasmawayland";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
remote-build.builders = [{
|
||||||
|
hostName = "zix790prors";
|
||||||
|
maxJobs = 16;
|
||||||
|
speedFactor = 4;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Jovian Features
|
||||||
|
|
||||||
|
### Enabled by Default
|
||||||
|
|
||||||
|
- Steam Deck hardware support (`jovian.devices.steamdeck.enable`)
|
||||||
|
- Steam UI (`jovian.steam.enable`)
|
||||||
|
- Decky Loader plugin system (`jovian.decky-loader.enable`)
|
||||||
|
|
||||||
|
### Optional Features
|
||||||
|
|
||||||
|
Set in the hardware-configuration.nix:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
jovian.devices.steamdeck = {
|
||||||
|
enable = true;
|
||||||
|
autoUpdate = false; # Auto-update BIOS/controller firmware
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Firmware Updates
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# BIOS update
|
||||||
|
sudo jupiter-biosupdate
|
||||||
|
|
||||||
|
# Controller update
|
||||||
|
sudo jupiter-controller-update
|
||||||
|
|
||||||
|
# Docking station (connect via USB-C first)
|
||||||
|
jupiter-dock-updater
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Remote Builds Not Working
|
||||||
|
|
||||||
|
1. Check SSH connectivity:
|
||||||
|
```bash
|
||||||
|
ssh nix-builder@zix790prors
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Verify builder is trusted:
|
||||||
|
```bash
|
||||||
|
# On zix790prors
|
||||||
|
nix show-config | grep trusted-users
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Check build logs:
|
||||||
|
```bash
|
||||||
|
journalctl -u nix-daemon -f
|
||||||
|
```
|
||||||
|
|
||||||
|
### Jovian Not Working
|
||||||
|
|
||||||
|
1. Ensure you're on NixOS 25.05 or the compatibility layer is removed for 25.11+
|
||||||
|
2. Check Jovian is imported in flake.nix
|
||||||
|
3. Verify hardware config has `jovian.devices.steamdeck.enable = true`
|
||||||
|
|
||||||
|
### Compatibility Layer Issues
|
||||||
|
|
||||||
|
If you see an error about `jovian-compat.nix` being incompatible:
|
||||||
|
|
||||||
|
1. You're running NixOS 25.11 or later
|
||||||
|
2. Remove `./roles/jovian-compat.nix` from `flake.nix`
|
||||||
|
3. Jovian should work natively on 25.11+
|
||||||
|
|
||||||
|
## Future Upgrades
|
||||||
|
|
||||||
|
### Upgrading to NixOS 25.11
|
||||||
|
|
||||||
|
1. Update `nixpkgs` input in flake.nix to 25.11
|
||||||
|
2. Remove `./roles/jovian-compat.nix` from flake.nix imports
|
||||||
|
3. The assertion in jovian-compat.nix will prevent accidental use
|
||||||
|
4. Test the build
|
||||||
|
5. Deploy
|
||||||
|
|
||||||
|
### Switching to Unstable
|
||||||
|
|
||||||
|
If you need Jovian to follow unstable nixpkgs:
|
||||||
|
|
||||||
|
1. Edit `flake.nix`:
|
||||||
|
```nix
|
||||||
|
jovian = {
|
||||||
|
url = "github:Jovian-Experiments/Jovian-NixOS";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
2. This only affects Jovian packages, not your base system
|
||||||
|
|
||||||
|
## Additional Resources
|
||||||
|
|
||||||
|
- [Jovian-NixOS Documentation](https://jovian-experiments.github.io/Jovian-NixOS/)
|
||||||
|
- [Jovian Steam Deck Guide](https://jovian-experiments.github.io/Jovian-NixOS/devices/valve-steam-deck/)
|
||||||
|
- [NixOS Remote Builds](https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html)
|
||||||
11
bootstrap.sh
Executable file
11
bootstrap.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# bootstrap.sh
|
||||||
|
# Usage: sudo ./bootstrap.sh <hostname>
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
NEW_HOSTNAME="${1:?missing hostname}"
|
||||||
|
FLAKE_URI="git+https://git.johnogle.info/johno/nixos-configs.git#${NEW_HOSTNAME}"
|
||||||
|
|
||||||
|
export NIX_CONFIG="experimental-features = nix-command flakes"
|
||||||
|
nixos-rebuild switch --flake "$FLAKE_URI"
|
||||||
|
|
||||||
19
build-liveusb.sh
Executable file
19
build-liveusb.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Build Live USB ISO from flake configuration
|
||||||
|
# Creates an uncompressed ISO suitable for Ventoy and other USB boot tools
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Building Live USB ISO..."
|
||||||
|
nix build .#nixosConfigurations.live-usb.config.system.build.isoImage --show-trace
|
||||||
|
|
||||||
|
if [ -f "./result/iso/"*.iso ]; then
|
||||||
|
iso_file=$(ls ./result/iso/*.iso)
|
||||||
|
echo "✅ Build complete!"
|
||||||
|
echo "📁 ISO location: $iso_file"
|
||||||
|
echo "💾 Ready for Ventoy or dd to USB"
|
||||||
|
else
|
||||||
|
echo "❌ Build failed - no ISO file found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
262
flake.lock
generated
262
flake.lock
generated
@@ -1,5 +1,41 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761588595,
|
||||||
|
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"google-cookie-retrieval": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761423376,
|
||||||
|
"narHash": "sha256-pMy3cnUFfue4vz/y0jx71BfcPGxZf+hk/DtnzWvfU0c=",
|
||||||
|
"ref": "refs/heads/main",
|
||||||
|
"rev": "a1f695665771841a988afc965526cbf99160cd77",
|
||||||
|
"revCount": 11,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.johnogle.info/johno/google-cookie-retrieval.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.johnogle.info/johno/google-cookie-retrieval.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -7,26 +43,148 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728041527,
|
"lastModified": 1758463745,
|
||||||
"narHash": "sha256-03liqiJtk9UP7YQHW4r8MduKCK242FQzud8iWvvlK+o=",
|
"narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "509dbf8d45606b618e9ec3bbe4e936b7c5bc6c1e",
|
"rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
|
"ref": "release-25.05",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"home-manager-unstable": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-unstable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763416652,
|
||||||
|
"narHash": "sha256-8EBEEvtzQ11LCxpQHMNEBQAGtQiCu/pqP9zSovDSbNM=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "ea164b7c9ccdc2321379c2ff78fd4317b4c41312",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"jovian": {
|
||||||
|
"inputs": {
|
||||||
|
"nix-github-actions": "nix-github-actions",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-unstable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763223001,
|
||||||
|
"narHash": "sha256-Hi6XxTJJjKsDrO+D0fYXS88ehCYzQkZlp9qxX1zoM1s=",
|
||||||
|
"owner": "Jovian-Experiments",
|
||||||
|
"repo": "Jovian-NixOS",
|
||||||
|
"rev": "68a1bcc019378272e601558719f82005a80ddab0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Jovian-Experiments",
|
||||||
|
"repo": "Jovian-NixOS",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nix-darwin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1762912391,
|
||||||
|
"narHash": "sha256-4hpBE7bGd24SfD28rzMdUGXsLsNEYxCCrTipFdoqoNM=",
|
||||||
|
"owner": "nix-darwin",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"rev": "d76299b2cd01837c4c271a7b5186e3d5d8ebd126",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-darwin",
|
||||||
|
"ref": "nix-darwin-25.05",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nix-github-actions": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"jovian",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1729697500,
|
||||||
|
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"repo": "nix-github-actions",
|
||||||
|
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"ref": "matrix-name",
|
||||||
|
"repo": "nix-github-actions",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixos-wsl": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763385941,
|
||||||
|
"narHash": "sha256-99CBNgyMvg3Zu/hxqixtShevrF4Kfr/qjtizQ6oseVI=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"rev": "cc6483354b236c2fc95cc1d4ba1f0f40b7345e69",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "main",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1727802920,
|
"lastModified": 1762977756,
|
||||||
"narHash": "sha256-HP89HZOT0ReIbI7IJZJQoJgxvB2Tn28V6XS3MNKnfLs=",
|
"narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-unstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763283776,
|
||||||
|
"narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "27e30d177e57d912d614c88c622dcfdb2e6e6515",
|
"rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -36,48 +194,80 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725762081,
|
"lastModified": 1763049705,
|
||||||
"narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=",
|
"narHash": "sha256-A5LS0AJZ1yDPTa2fHxufZN++n8MCmtgrJDtxFxrH4S8=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05",
|
"rev": "3acb677ea67d4c6218f33de0db0955f116b7588c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"ref": "release-24.05",
|
"ref": "nixos-25.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plasma-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": [
|
||||||
|
"home-manager"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1762784320,
|
||||||
|
"narHash": "sha256-odsk96Erywk5hs0dhArF38zb7Oe0q6LZ70gXbxAPKno=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "plasma-manager",
|
||||||
|
"rev": "7911a0f8a44c7e8b29d031be3149ee8943144321",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "plasma-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plasma-manager-unstable": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": [
|
||||||
|
"home-manager-unstable"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-unstable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1762784320,
|
||||||
|
"narHash": "sha256-odsk96Erywk5hs0dhArF38zb7Oe0q6LZ70gXbxAPKno=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "plasma-manager",
|
||||||
|
"rev": "7911a0f8a44c7e8b29d031be3149ee8943144321",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "plasma-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"google-cookie-retrieval": "google-cookie-retrieval",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs",
|
"home-manager-unstable": "home-manager-unstable",
|
||||||
"sops-nix": "sops-nix"
|
"jovian": "jovian",
|
||||||
}
|
"nix-darwin": "nix-darwin",
|
||||||
},
|
"nixos-wsl": "nixos-wsl",
|
||||||
"sops-nix": {
|
"nixpkgs": "nixpkgs_2",
|
||||||
"inputs": {
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"nixpkgs": [
|
"plasma-manager": "plasma-manager",
|
||||||
"nixpkgs"
|
"plasma-manager-unstable": "plasma-manager-unstable"
|
||||||
],
|
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1727423009,
|
|
||||||
"narHash": "sha256-+4B/dQm2EnORIk0k2wV3aHGaE0WXTBjColXjj7qWh10=",
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "sops-nix",
|
|
||||||
"rev": "127a96f49ddc377be6ba76964411bab11ae27803",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "sops-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
214
flake.nix
214
flake.nix
@@ -2,66 +2,216 @@
|
|||||||
description = "A very basic flake";
|
description = "A very basic flake";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||||
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
||||||
|
|
||||||
sops-nix = {
|
nix-darwin = {
|
||||||
url = "github:Mic92/sops-nix";
|
url = "github:nix-darwin/nix-darwin/nix-darwin-25.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager/release-25.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home-manager-unstable = {
|
||||||
|
url = "github:nix-community/home-manager/master";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... } @ inputs: let
|
plasma-manager = {
|
||||||
baseModules = [
|
url = "github:nix-community/plasma-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.home-manager.follows = "home-manager";
|
||||||
|
};
|
||||||
|
|
||||||
|
plasma-manager-unstable = {
|
||||||
|
url = "github:nix-community/plasma-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
|
inputs.home-manager.follows = "home-manager-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
google-cookie-retrieval = {
|
||||||
|
url = "git+https://git.johnogle.info/johno/google-cookie-retrieval.git";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
jovian = {
|
||||||
|
url = "github:Jovian-Experiments/Jovian-NixOS";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, nixpkgs-unstable, nixos-wsl, ... } @ inputs: let
|
||||||
|
nixosModules = [
|
||||||
./roles
|
./roles
|
||||||
inputs.sops-nix.nixosModules.sops
|
] ++ [
|
||||||
|
./roles/jovian-compat.nix
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
unstable = import nixpkgs-unstable {
|
||||||
|
system = prev.system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
custom = prev.callPackage ./packages {};
|
||||||
|
# Compatibility: bitwarden renamed to bitwarden-desktop in unstable
|
||||||
|
bitwarden-desktop = prev.bitwarden-desktop or prev.bitwarden;
|
||||||
|
})
|
||||||
|
];
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
}
|
home-manager.sharedModules = [
|
||||||
];
|
inputs.plasma-manager.homeModules.plasma-manager
|
||||||
in {
|
|
||||||
nixosConfigurations.z790prors-nix = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
modules = baseModules ++ [
|
|
||||||
./machines/z790prors/configuration.nix
|
|
||||||
{
|
|
||||||
home-manager.users.johno = import ./home/home-z790prors.nix;
|
|
||||||
home-manager.extraSpecialArgs.customPkgs =
|
|
||||||
nixpkgs.legacyPackages."${system}".callPackage ./packages {};
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
home-manager.extraSpecialArgs = {
|
||||||
|
globalInputs = inputs;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
# Modules for unstable-based systems (like nix-deck)
|
||||||
|
nixosModulesUnstable = [
|
||||||
|
./roles
|
||||||
|
] ++ [
|
||||||
|
inputs.home-manager-unstable.nixosModules.home-manager
|
||||||
|
inputs.jovian.nixosModules.jovian
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
unstable = import nixpkgs-unstable {
|
||||||
|
system = prev.system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
custom = prev.callPackage ./packages {};
|
||||||
|
# Compatibility: bitwarden renamed to bitwarden-desktop in unstable
|
||||||
|
bitwarden-desktop = prev.bitwarden-desktop or prev.bitwarden;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.plasma-manager-unstable.homeModules.plasma-manager
|
||||||
|
];
|
||||||
|
home-manager.extraSpecialArgs = {
|
||||||
|
globalInputs = inputs;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
darwinModules = [
|
||||||
|
./roles/darwin.nix
|
||||||
|
] ++ [
|
||||||
|
inputs.home-manager.darwinModules.home-manager
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
unstable = import nixpkgs-unstable {
|
||||||
|
system = prev.system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
custom = prev.callPackage ./packages {};
|
||||||
|
# Compatibility: bitwarden renamed to bitwarden-desktop in unstable
|
||||||
|
bitwarden-desktop = prev.bitwarden-desktop or prev.bitwarden;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.extraSpecialArgs = {
|
||||||
|
globalInputs = inputs;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
in {
|
||||||
nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem rec {
|
nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = baseModules ++ [
|
modules = nixosModules ++ [
|
||||||
./machines/nix-book/configuration.nix
|
./machines/nix-book/configuration.nix
|
||||||
{
|
{
|
||||||
home-manager.users.johno = import ./home/home-nix-book.nix;
|
home-manager.users.johno = {
|
||||||
home-manager.extraSpecialArgs.customPkgs =
|
imports = [ ./home/home-laptop-compact.nix ];
|
||||||
nixpkgs.legacyPackages."${system}".callPackage ./packages {};
|
# Machine-specific overrides
|
||||||
|
home.i3_sway.extraSwayConfig = {
|
||||||
|
output.eDP-1.scale = "1.75";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.boxy = nixpkgs.lib.nixosSystem rec {
|
nixosConfigurations.boxy = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = baseModules ++ [
|
modules = nixosModules ++ [
|
||||||
./machines/boxy/configuration.nix
|
./machines/boxy/configuration.nix
|
||||||
# inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
# {
|
{
|
||||||
# home-manager.users.johno = import ./home/home-default.nix;
|
home-manager.users.johno = import ./home/home-media-center.nix;
|
||||||
# home-manager.extraSpecialArgs.customPkgs =
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
# nixpkgs.legacyPackages."${system}".callPackage ./packages {};
|
}
|
||||||
# customPkgs = nixpkgs.legacyPackages."${system}".callPackage ./packages {};
|
];
|
||||||
# }
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.wixos = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = nixosModules ++ [
|
||||||
|
nixos-wsl.nixosModules.default
|
||||||
|
./machines/wixos/configuration.nix
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.users.johno = import ./home/home-desktop.nix;
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.zix790prors = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = nixosModules ++ [
|
||||||
|
./machines/zix790prors/configuration.nix
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.users.johno = import ./home/home-desktop.nix;
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Live USB ISO configuration
|
||||||
|
nixosConfigurations.live-usb = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = nixosModules ++ [
|
||||||
|
./machines/live-usb/configuration.nix
|
||||||
|
{
|
||||||
|
home-manager.users.nixos = import ./home/home-live-usb.nix;
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Steam Deck configuration (using unstable for better Jovian compatibility)
|
||||||
|
nixosConfigurations.nix-deck = nixpkgs-unstable.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = nixosModulesUnstable ++ [
|
||||||
|
./machines/nix-deck/configuration.nix
|
||||||
|
{
|
||||||
|
home-manager.users.johno = import ./home/home-desktop.nix;
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Darwin/macOS configurations
|
||||||
|
darwinConfigurations."blkfv4yf49kt7" = inputs.nix-darwin.lib.darwinSystem rec {
|
||||||
|
system = "aarch64-darwin";
|
||||||
|
modules = darwinModules ++ [
|
||||||
|
./machines/johno-macbookpro/configuration.nix
|
||||||
|
{
|
||||||
|
home-manager.users.johno = import ./home/home-darwin-work.nix;
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
233
home/home-darwin-work.nix
Normal file
233
home/home-darwin-work.nix
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
{ config, lib, pkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
leader = "cmd"; # Change this to experiment with different leader keys (e.g., "cmd", "ctrl")
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Home Manager configuration for Darwin work laptop
|
||||||
|
# Corporate-friendly setup with essential development tools
|
||||||
|
|
||||||
|
home.username = lib.mkForce "johno";
|
||||||
|
home.homeDirectory = lib.mkForce "/Users/johno";
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
|
||||||
|
# System packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
autoraise
|
||||||
|
];
|
||||||
|
|
||||||
|
# Note: ghostty installed via Homebrew (managed outside of nix)
|
||||||
|
|
||||||
|
# Auto-start autoraise on login
|
||||||
|
launchd.agents.autoraise = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
ProgramArguments = [
|
||||||
|
"${pkgs.autoraise}/bin/AutoRaise"
|
||||||
|
"-pollMillis" "50"
|
||||||
|
"-delay" "2"
|
||||||
|
"-focusDelay" "2"
|
||||||
|
];
|
||||||
|
RunAtLoad = true;
|
||||||
|
KeepAlive = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Auto-start aerospace on login
|
||||||
|
# NOTE: In 25.11+, this can be simplified to `programs.aerospace.launchd.enable = true`
|
||||||
|
launchd.agents.aerospace = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
Program = "${pkgs.aerospace}/Applications/AeroSpace.app/Contents/MacOS/AeroSpace";
|
||||||
|
RunAtLoad = true;
|
||||||
|
KeepAlive = true;
|
||||||
|
StandardOutPath = "/tmp/aerospace.log";
|
||||||
|
StandardErrorPath = "/tmp/aerospace.err.log";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Override Darwin-incompatible settings from base role
|
||||||
|
programs.rbw.settings.pinentry = lib.mkForce pkgs.pinentry_mac;
|
||||||
|
|
||||||
|
# Disable Home Manager from managing shell RC files
|
||||||
|
# topsoil/compost will manage these files instead
|
||||||
|
programs.bash.enable = lib.mkForce false;
|
||||||
|
programs.zsh.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
# Create a local nix integration file that topsoil-managed configs can source
|
||||||
|
home.file.".nix-integration.sh" = {
|
||||||
|
text = ''
|
||||||
|
# Source Home Manager session variables (nix paths, environment, etc.)
|
||||||
|
if [ -e /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh ]; then
|
||||||
|
. /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Setup bash completions from nix profiles
|
||||||
|
if [[ ! -v BASH_COMPLETION_VERSINFO ]] && [ -n "$NIX_PROFILES" ]; then
|
||||||
|
for profile in $NIX_PROFILES; do
|
||||||
|
if [ -f "$profile/etc/profile.d/bash_completion.sh" ]; then
|
||||||
|
. "$profile/etc/profile.d/bash_completion.sh"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# command-not-found handler
|
||||||
|
command_not_found_handle() {
|
||||||
|
local p=/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite
|
||||||
|
if [ -n "$NIX_PROFILES" ]; then
|
||||||
|
for profile in $NIX_PROFILES; do
|
||||||
|
if [ -x "$profile/bin/command-not-found" ] && [ -f "$p" ]; then
|
||||||
|
"$profile/bin/command-not-found" "$@"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo "$1: command not found" >&2
|
||||||
|
return 127
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".nix-integration.zsh" = {
|
||||||
|
text = ''
|
||||||
|
# Source Home Manager session variables (nix paths, environment, etc.)
|
||||||
|
if [ -e /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh ]; then
|
||||||
|
. /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Setup zsh completions from nix profiles
|
||||||
|
typeset -U path cdpath fpath manpath
|
||||||
|
for profile in ''${(z)NIX_PROFILES}; do
|
||||||
|
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
|
||||||
|
done
|
||||||
|
autoload -U compinit && compinit
|
||||||
|
|
||||||
|
# command-not-found handler
|
||||||
|
command_not_found_handler() {
|
||||||
|
local p=/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite
|
||||||
|
if [ -n "$NIX_PROFILES" ]; then
|
||||||
|
for profile in ''${(z)NIX_PROFILES}; do
|
||||||
|
if [ -x "$profile/bin/command-not-found" ] && [ -f "$p" ]; then
|
||||||
|
"$profile/bin/command-not-found" "$@"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo "$1: command not found" >&2
|
||||||
|
return 127
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Keep SSH and Git disabled to avoid conflicts with work environment
|
||||||
|
programs.ssh.enable = lib.mkForce false;
|
||||||
|
programs.git.enable = lib.mkForce false;
|
||||||
|
programs.rbw.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
home.shell.enableShellIntegration = true;
|
||||||
|
|
||||||
|
# TODO: Move this to its own role and/or module
|
||||||
|
programs.aerospace = {
|
||||||
|
enable = true;
|
||||||
|
userSettings.mode.main.binding = {
|
||||||
|
"${leader}-slash" = "layout tiles horizontal vertical";
|
||||||
|
"${leader}-comma" = "layout accordion horizontal vertical";
|
||||||
|
"${leader}-shift-q" = "close";
|
||||||
|
"${leader}-shift-f" = "fullscreen";
|
||||||
|
"${leader}-h" = "focus left";
|
||||||
|
"${leader}-j" = "focus down";
|
||||||
|
"${leader}-k" = "focus up";
|
||||||
|
"${leader}-l" = "focus right";
|
||||||
|
"${leader}-shift-h" = "move left";
|
||||||
|
"${leader}-shift-j" = "move down";
|
||||||
|
"${leader}-shift-k" = "move up";
|
||||||
|
"${leader}-shift-l" = "move right";
|
||||||
|
"${leader}-minus" = "resize smart -50";
|
||||||
|
"${leader}-equal" = "resize smart +50";
|
||||||
|
"${leader}-1" = "workspace 1";
|
||||||
|
"${leader}-2" = "workspace 2";
|
||||||
|
"${leader}-3" = "workspace 3";
|
||||||
|
"${leader}-4" = "workspace 4";
|
||||||
|
"${leader}-5" = "workspace 5";
|
||||||
|
"${leader}-6" = "workspace 6";
|
||||||
|
"${leader}-7" = "workspace 7";
|
||||||
|
"${leader}-8" = "workspace 8";
|
||||||
|
"${leader}-9" = "workspace 9";
|
||||||
|
"${leader}-0" = "workspace 10";
|
||||||
|
"${leader}-shift-1" = "move-node-to-workspace 1";
|
||||||
|
"${leader}-shift-2" = "move-node-to-workspace 2";
|
||||||
|
"${leader}-shift-3" = "move-node-to-workspace 3";
|
||||||
|
"${leader}-shift-4" = "move-node-to-workspace 4";
|
||||||
|
"${leader}-shift-5" = "move-node-to-workspace 5";
|
||||||
|
"${leader}-shift-6" = "move-node-to-workspace 6";
|
||||||
|
"${leader}-shift-7" = "move-node-to-workspace 7";
|
||||||
|
"${leader}-shift-8" = "move-node-to-workspace 8";
|
||||||
|
"${leader}-shift-9" = "move-node-to-workspace 9";
|
||||||
|
"${leader}-shift-0" = "move-node-to-workspace 10";
|
||||||
|
"${leader}-tab" = "workspace-back-and-forth";
|
||||||
|
"${leader}-shift-tab" = "move-workspace-to-monitor --wrap-around next";
|
||||||
|
|
||||||
|
"${leader}-enter" = ''
|
||||||
|
exec-and-forget osascript <<'APPLESCRIPT'
|
||||||
|
tell application "Ghostty"
|
||||||
|
activate
|
||||||
|
tell application "System Events"
|
||||||
|
keystroke "n" using {command down}
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
APPLESCRIPT
|
||||||
|
'';
|
||||||
|
|
||||||
|
"${leader}-shift-enter" = ''
|
||||||
|
exec-and-forget osascript <<'APPLESCRIPT'
|
||||||
|
tell application "Google Chrome"
|
||||||
|
set newWindow to make new window
|
||||||
|
activate
|
||||||
|
tell newWindow to set index to 1
|
||||||
|
end tell
|
||||||
|
APPLESCRIPT
|
||||||
|
'';
|
||||||
|
|
||||||
|
"${leader}-shift-e" = "exec-and-forget zsh --login -c \"emacsclient -c -n\"";
|
||||||
|
|
||||||
|
# Service mode: Deliberate aerospace window management
|
||||||
|
"${leader}-i" = "mode service";
|
||||||
|
|
||||||
|
# Passthrough mode: Temporarily disable aerospace to use macOS shortcuts
|
||||||
|
# Press Cmd-P, then use any macOS shortcut (like Cmd-K in Slack), then press Cmd-P again to exit
|
||||||
|
"${leader}-p" = "mode passthrough";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Service mode: For deliberate aerospace window management operations
|
||||||
|
userSettings.mode.service.binding = {
|
||||||
|
esc = ["reload-config" "mode main"];
|
||||||
|
r = ["flatten-workspace-tree" "mode main"]; # reset layout
|
||||||
|
f = ["layout floating tiling" "mode main"]; # Toggle between floating and tiling layout
|
||||||
|
backspace = ["close-all-windows-but-current" "mode main"];
|
||||||
|
|
||||||
|
"${leader}-shift-h" = ["join-with left" "mode main"];
|
||||||
|
"${leader}-shift-j" = ["join-with down" "mode main"];
|
||||||
|
"${leader}-shift-k" = ["join-with up" "mode main"];
|
||||||
|
"${leader}-shift-l" = ["join-with right" "mode main"];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Passthrough mode: All shortcuts pass through to macOS
|
||||||
|
# This mode has minimal bindings - just ways to exit back to main mode
|
||||||
|
userSettings.mode.passthrough.binding = {
|
||||||
|
esc = "mode main";
|
||||||
|
"${leader}-p" = "mode main"; # Toggle back with same key (Cmd-P)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.roles = {
|
||||||
|
base.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./roles
|
||||||
|
./modules/emacs
|
||||||
|
./modules/kubectl
|
||||||
|
./modules/tmux
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
{ pkgs, customPkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
|
||||||
# manage.
|
|
||||||
home.username = "johno";
|
|
||||||
home.homeDirectory = "/home/johno";
|
|
||||||
|
|
||||||
# This value determines the Home Manager release that your configuration is
|
|
||||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
|
||||||
# introduces backwards incompatible changes.
|
|
||||||
#
|
|
||||||
# You should not change this value, even if you update Home Manager. If you do
|
|
||||||
# want to update the value, then make sure to first check the Home Manager
|
|
||||||
# release notes.
|
|
||||||
home.stateVersion = "24.05"; # Please read the comment before changing.
|
|
||||||
|
|
||||||
# The home.packages option allows you to install Nix packages into your
|
|
||||||
# environment.
|
|
||||||
home.packages = [
|
|
||||||
# # Adds the 'hello' command to your environment. It prints a friendly
|
|
||||||
# # "Hello, world!" when run.
|
|
||||||
# pkgs.hello
|
|
||||||
|
|
||||||
# # It is sometimes useful to fine-tune packages, for example, by applying
|
|
||||||
# # overrides. You can do that directly here, just don't forget the
|
|
||||||
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
|
||||||
# # fonts?
|
|
||||||
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
|
||||||
|
|
||||||
# # You can also create simple shell scripts directly inside your
|
|
||||||
# # configuration. For example, this adds a command 'my-hello' to your
|
|
||||||
# # environment:
|
|
||||||
# (pkgs.writeShellScriptBin "my-hello" ''
|
|
||||||
# echo "Hello, ${config.home.username}!"
|
|
||||||
# '')
|
|
||||||
|
|
||||||
pkgs.bitwarden
|
|
||||||
pkgs.dunst
|
|
||||||
pkgs.element-desktop
|
|
||||||
pkgs.fd
|
|
||||||
#pkgs.fluffychat # security vulnerability in current version
|
|
||||||
pkgs.gzip
|
|
||||||
pkgs.htop
|
|
||||||
pkgs.jellyfin-media-player
|
|
||||||
pkgs.keepassxc
|
|
||||||
pkgs.killall
|
|
||||||
pkgs.kitty
|
|
||||||
pkgs.less
|
|
||||||
pkgs.moonlight-qt
|
|
||||||
pkgs.ncdu
|
|
||||||
pkgs.pandoc
|
|
||||||
pkgs.pinentry-qt
|
|
||||||
#pkgs.pytest
|
|
||||||
pkgs.shellcheck
|
|
||||||
pkgs.solaar # Logitech management software
|
|
||||||
pkgs.tmux
|
|
||||||
pkgs.waybar
|
|
||||||
pkgs.wofi
|
|
||||||
pkgs.vlc
|
|
||||||
|
|
||||||
customPkgs.nextcloudTalkDesktop
|
|
||||||
];
|
|
||||||
|
|
||||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
|
||||||
# plain files is through 'home.file'.
|
|
||||||
home.file = {
|
|
||||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
|
||||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
|
||||||
# # symlink to the Nix store copy.
|
|
||||||
# ".screenrc".source = dotfiles/screenrc;
|
|
||||||
|
|
||||||
# # You can also set the file content immediately.
|
|
||||||
# ".gradle/gradle.properties".text = ''
|
|
||||||
# org.gradle.console=verbose
|
|
||||||
# org.gradle.daemon.idletimeout=3600000
|
|
||||||
# '';
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# Home Manager can also manage your environment variables through
|
|
||||||
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
|
||||||
# shell provided by Home Manager. If you don't want to manage your shell
|
|
||||||
# through Home Manager then you have to manually source 'hm-session-vars.sh'
|
|
||||||
# located at either
|
|
||||||
#
|
|
||||||
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
#
|
|
||||||
# or
|
|
||||||
#
|
|
||||||
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
#
|
|
||||||
# or
|
|
||||||
#
|
|
||||||
# /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh
|
|
||||||
#
|
|
||||||
home.sessionVariables = {
|
|
||||||
};
|
|
||||||
|
|
||||||
home.sessionPath = [
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./modules/emacs
|
|
||||||
./modules/lutris
|
|
||||||
./modules/i3+sway
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.bash.enable = true;
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
gc = {
|
|
||||||
automatic = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
|
|
||||||
programs.command-not-found.enable = true;
|
|
||||||
|
|
||||||
programs.firefox = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
userName = "John Ogle";
|
|
||||||
userEmail = "john@ogle.fyi";
|
|
||||||
extraConfig = {
|
|
||||||
safe.directory = "/etc/nixos";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.gpg.enable = true;
|
|
||||||
|
|
||||||
services.gpg-agent = {
|
|
||||||
enable = true;
|
|
||||||
enableSshSupport = true;
|
|
||||||
defaultCacheTtl = 1800;
|
|
||||||
pinentryPackage = pkgs.pinentry-qt;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.jq.enable = true;
|
|
||||||
|
|
||||||
programs.k9s.enable = true;
|
|
||||||
|
|
||||||
programs.neovim = {
|
|
||||||
enable = true;
|
|
||||||
viAlias = true;
|
|
||||||
vimAlias = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.rbw = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
email = "john@johnogle.info";
|
|
||||||
base_url = "https://bitwarden.johnogle.info";
|
|
||||||
pinentry = pkgs.pinentry-qt;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.spotify-player.enable = true;
|
|
||||||
|
|
||||||
programs.ssh = {
|
|
||||||
enable = true;
|
|
||||||
addKeysToAgent = "yes";
|
|
||||||
matchBlocks = {
|
|
||||||
"nucdeb1" = {
|
|
||||||
hostname = "nucdeb1.oglehome";
|
|
||||||
user = "root";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.home-manager.autoUpgrade = {
|
|
||||||
enable = true;
|
|
||||||
frequency = "weekly";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.kdeconnect = {
|
|
||||||
enable = true;
|
|
||||||
indicator = true;
|
|
||||||
package = pkgs.kdePackages.kdeconnect-kde;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.syncthing = {
|
|
||||||
enable = true;
|
|
||||||
tray = {
|
|
||||||
enable = true;
|
|
||||||
command = "syncthingtray --wait";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.enable = true;
|
|
||||||
}
|
|
||||||
33
home/home-desktop.nix
Normal file
33
home/home-desktop.nix
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{ pkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Home Manager configuration for full desktop experience
|
||||||
|
home.username = "johno";
|
||||||
|
home.homeDirectory = "/home/johno";
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
|
||||||
|
# Enable all desktop roles for full-featured experience
|
||||||
|
home.roles = {
|
||||||
|
base.enable = true;
|
||||||
|
desktop.enable = true;
|
||||||
|
office.enable = true;
|
||||||
|
media.enable = true;
|
||||||
|
development.enable = true;
|
||||||
|
communication.enable = true;
|
||||||
|
sync.enable = true;
|
||||||
|
kdeconnect.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
home.sessionVariables = {};
|
||||||
|
home.sessionPath = [];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./roles
|
||||||
|
./modules/emacs
|
||||||
|
./modules/i3+sway
|
||||||
|
./modules/kubectl
|
||||||
|
./modules/plasma-manager
|
||||||
|
./modules/tmux
|
||||||
|
];
|
||||||
|
}
|
||||||
36
home/home-laptop-compact.nix
Normal file
36
home/home-laptop-compact.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{ config, lib, pkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Home Manager configuration for compact laptop setups
|
||||||
|
# Optimized for space-constrained environments
|
||||||
|
|
||||||
|
home.username = "johno";
|
||||||
|
home.homeDirectory = "/home/johno";
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
|
||||||
|
# Enable essential roles only (exclude heavy office/media packages)
|
||||||
|
home.roles = {
|
||||||
|
base.enable = true;
|
||||||
|
desktop.enable = true;
|
||||||
|
development.enable = true;
|
||||||
|
communication.enable = true;
|
||||||
|
kdeconnect.enable = true;
|
||||||
|
media.enable = true;
|
||||||
|
sync.enable = true;
|
||||||
|
# office.enable = false; # Excluded for storage constraints
|
||||||
|
};
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
home.sessionVariables = {};
|
||||||
|
home.sessionPath = [];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./roles
|
||||||
|
./modules/emacs
|
||||||
|
./modules/i3+sway
|
||||||
|
./modules/kubectl
|
||||||
|
./modules/plasma-manager
|
||||||
|
./modules/tmux
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
37
home/home-live-usb.nix
Normal file
37
home/home-live-usb.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{ pkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Home Manager configuration for live USB environments
|
||||||
|
# Minimal setup without persistent services
|
||||||
|
|
||||||
|
home.username = "nixos";
|
||||||
|
home.homeDirectory = "/home/nixos";
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
|
||||||
|
# Enable minimal roles only (no sync or kdeconnect for live environment)
|
||||||
|
home.roles = {
|
||||||
|
base.enable = true;
|
||||||
|
desktop.enable = true;
|
||||||
|
# development.enable = false; # Not needed for live USB
|
||||||
|
# communication.enable = false; # Not needed for live USB
|
||||||
|
# office.enable = false; # Not needed for live USB
|
||||||
|
# media.enable = false; # Not needed for live USB
|
||||||
|
# sync.enable = false; # No persistent sync on live USB
|
||||||
|
# kdeconnect.enable = false; # No device integration on live USB
|
||||||
|
};
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
home.sessionVariables = {};
|
||||||
|
home.sessionPath = [];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./roles
|
||||||
|
./modules/emacs
|
||||||
|
./modules/i3+sway
|
||||||
|
./modules/kubectl
|
||||||
|
./modules/plasma-manager
|
||||||
|
./modules/tmux
|
||||||
|
];
|
||||||
|
|
||||||
|
# Live USB specific overrides can go here if needed
|
||||||
|
}
|
||||||
37
home/home-media-center.nix
Normal file
37
home/home-media-center.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{ pkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Home Manager configuration for media center setups
|
||||||
|
# Optimized for living room media consumption and gaming
|
||||||
|
|
||||||
|
home.username = "johno";
|
||||||
|
home.homeDirectory = "/home/johno";
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
|
||||||
|
# Enable media center focused roles
|
||||||
|
home.roles = {
|
||||||
|
base.enable = true;
|
||||||
|
desktop.enable = true;
|
||||||
|
media.enable = true;
|
||||||
|
communication.enable = true;
|
||||||
|
kdeconnect.enable = true;
|
||||||
|
development.enable = true;
|
||||||
|
# office.enable = false; # Not needed for media center
|
||||||
|
# sync.enable = false; # Shared machine, no personal file sync
|
||||||
|
};
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
home.sessionVariables = {};
|
||||||
|
home.sessionPath = [];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./roles
|
||||||
|
./modules/emacs
|
||||||
|
./modules/i3+sway
|
||||||
|
./modules/kubectl
|
||||||
|
./modules/plasma-manager
|
||||||
|
./modules/tmux
|
||||||
|
];
|
||||||
|
|
||||||
|
# Media center specific overrides can go here if needed
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./home-default.nix
|
|
||||||
./modules/hyprland/nix-book.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
home.i3_sway.extraSwayConfig = {
|
|
||||||
output.eDP-1.scale = "1.75";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./home-default.nix
|
|
||||||
./modules/hyprland/z790prors.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -3,20 +3,36 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
doomSync = (let
|
doomEmacs = pkgs.fetchFromGitHub {
|
||||||
git = pkgs.git;
|
owner = "doomemacs";
|
||||||
in ''
|
repo = "doomemacs";
|
||||||
export PATH=${pkgs.emacs}/bin:${git}/bin:$PATH
|
rev = "8f55404781edacf66fa330205533b002de3fb5ee";
|
||||||
${config.xdg.configHome}/emacs/bin/doom sync -u -j $((`nproc`/4*3))
|
sha256 = "sha256-vHwgENjip2+AFzs4oZfnKEAJKwf5Zid7fakImvxxQUw=";
|
||||||
'');
|
};
|
||||||
in {
|
|
||||||
|
# Shared emacs packages
|
||||||
|
emacsPackages = epkgs: [
|
||||||
|
epkgs.vterm
|
||||||
|
epkgs.treesit-grammars.with-all-grammars
|
||||||
|
];
|
||||||
|
|
||||||
|
# Default emacs configuration with vterm support
|
||||||
|
defaultEmacsPackage =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then pkgs.emacs-macport.pkgs.withPackages emacsPackages
|
||||||
|
else pkgs.emacs.pkgs.withPackages emacsPackages;
|
||||||
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.emacs-all-the-icons-fonts
|
pkgs.emacs-all-the-icons-fonts
|
||||||
|
pkgs.fira-code
|
||||||
pkgs.fontconfig
|
pkgs.fontconfig
|
||||||
pkgs.graphviz
|
pkgs.graphviz
|
||||||
pkgs.isort
|
pkgs.isort
|
||||||
pkgs.nerdfonts
|
#pkgs.libvterm # native vterm library
|
||||||
|
pkgs.nerd-fonts.fira-code
|
||||||
|
pkgs.nerd-fonts.droid-sans-mono
|
||||||
pkgs.nil # nix lsp language server
|
pkgs.nil # nix lsp language server
|
||||||
pkgs.nixfmt-rfc-style
|
pkgs.nixfmt-rfc-style
|
||||||
(pkgs.ripgrep.override {withPCRE2 = true;})
|
(pkgs.ripgrep.override {withPCRE2 = true;})
|
||||||
@@ -25,43 +41,32 @@ in {
|
|||||||
pkgs.python3
|
pkgs.python3
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.emacs = {
|
||||||
|
enable = true;
|
||||||
|
package = defaultEmacsPackage;
|
||||||
|
};
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
# Mount emacs and tree-sitter grammars from nix store
|
||||||
home.file = {
|
home.file = {
|
||||||
".config/emacs" = {
|
"${config.xdg.configHome}/emacs".source = doomEmacs;
|
||||||
source = fetchGit {
|
|
||||||
url = "https://github.com/doomemacs/doomemacs.git";
|
|
||||||
# When updating me, remember to run `doom sync`
|
|
||||||
rev = "5ad99220b86ae1bf421861dfad24492d768ac4d9";
|
|
||||||
};
|
|
||||||
# We need to use recursive mode here or else doom fails to sync for
|
|
||||||
# some reason related to the permissions on the synced path. I'm not
|
|
||||||
# quite sure of everything that's going on here.
|
|
||||||
recursive = true;
|
|
||||||
|
|
||||||
# Because `recursive = true` will cause this to sync every single
|
|
||||||
# activation, we turn this off here.
|
|
||||||
#
|
|
||||||
# There's probably a way we could do better detection of this within
|
|
||||||
# our onChange shell?
|
|
||||||
#
|
|
||||||
# onChange = doomSync;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home.sessionVariables = {
|
|
||||||
DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
|
|
||||||
EDITOR = "emacs -nw";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home.sessionPath = [
|
home.sessionPath = [
|
||||||
"${config.xdg.configHome}/emacs/bin"
|
"${config.xdg.configHome}/emacs/bin"
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.configFile."doom" = {
|
home.sessionVariables = {
|
||||||
source = ./doom;
|
DOOMDIR = "${config.xdg.configHome}/doom";
|
||||||
# Sync doom if we updated the config
|
DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
|
||||||
onChange = doomSync;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO: Use mkOutOfStoreSymlink instead?
|
||||||
|
home.activation.doomConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
# Always remove and recreate the symlink to ensure it points to the source directory
|
||||||
|
rm -rf "${config.xdg.configHome}/doom"
|
||||||
|
ln -sf "${config.home.homeDirectory}/nixos-configs/home/modules/emacs/doom" "${config.xdg.configHome}/doom"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,22 @@
|
|||||||
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
|
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
|
||||||
;; refresh your font settings. If Emacs still can't find your font, it likely
|
;; refresh your font settings. If Emacs still can't find your font, it likely
|
||||||
;; wasn't installed correctly. Font issues are rarely Doom issues!
|
;; wasn't installed correctly. Font issues are rarely Doom issues!
|
||||||
|
(setq doom-font (font-spec :family "Fira Code"))
|
||||||
|
|
||||||
|
;; Auto-install nerd-icons fonts if they're missing
|
||||||
|
(defun my/ensure-nerd-icons-fonts ()
|
||||||
|
"Check if nerd-icons fonts are installed and install them if missing."
|
||||||
|
(when (display-graphic-p)
|
||||||
|
(unless (find-font (font-spec :name "Symbols Nerd Font Mono"))
|
||||||
|
(when (fboundp 'nerd-icons-install-fonts)
|
||||||
|
(nerd-icons-install-fonts t)))))
|
||||||
|
|
||||||
|
(add-hook 'doom-init-ui-hook #'my/ensure-nerd-icons-fonts)
|
||||||
|
|
||||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||||
;; `load-theme' function. This is the default:
|
;; `load-theme' function. This is the default:
|
||||||
(setq doom-theme 'doom-one)
|
(setq doom-theme 'doom-tokyo-night)
|
||||||
|
|
||||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
;; This determines the style of line numbers in effect. If set to `nil', line
|
||||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
||||||
@@ -43,7 +54,12 @@
|
|||||||
(setq org-directory "~/org/")
|
(setq org-directory "~/org/")
|
||||||
(after! org
|
(after! org
|
||||||
(setq org-agenda-span 'week
|
(setq org-agenda-span 'week
|
||||||
org-agenda-files `(,org-directory ,(concat org-directory "roam/"))
|
org-agenda-start-with-log-mode t
|
||||||
|
my-agenda-dirs '("projects" "roam")
|
||||||
|
org-agenda-files (cons org-directory (mapcan (lambda (x) (directory-files-recursively
|
||||||
|
(expand-file-name x org-directory)
|
||||||
|
"\.org$"))
|
||||||
|
my-agenda-dirs))
|
||||||
org-log-done 'time
|
org-log-done 'time
|
||||||
org-agenda-custom-commands '(("n" "Agenda"
|
org-agenda-custom-commands '(("n" "Agenda"
|
||||||
((agenda "")
|
((agenda "")
|
||||||
@@ -57,6 +73,13 @@
|
|||||||
'(("t" "Todo" entry (file+headline "~/org/todo.org" "Inbox")
|
'(("t" "Todo" entry (file+headline "~/org/todo.org" "Inbox")
|
||||||
"* TODO %? \n %i \n%a" :prepend t))))
|
"* TODO %? \n %i \n%a" :prepend t))))
|
||||||
|
|
||||||
|
(map! :after org-agenda
|
||||||
|
:map org-agenda-mode-map
|
||||||
|
:localleader
|
||||||
|
(:prefix ("v" . "view")
|
||||||
|
"d" #'org-agenda-day-view
|
||||||
|
"w" #'org-agenda-week-view))
|
||||||
|
|
||||||
;; (use-package! org-caldav
|
;; (use-package! org-caldav
|
||||||
;; :defer t
|
;; :defer t
|
||||||
;; :config
|
;; :config
|
||||||
@@ -67,6 +90,74 @@
|
|||||||
;; org-caldav-files nil
|
;; org-caldav-files nil
|
||||||
;; org-caldav-sync-direction 'cal->org))
|
;; org-caldav-sync-direction 'cal->org))
|
||||||
|
|
||||||
|
(defun my/get-rbw-password (alias)
|
||||||
|
"Return the password for ALIAS via rbw, unlocking the vault only if needed."
|
||||||
|
(let* ((cmd (format "rbw get %s 2>&1" alias))
|
||||||
|
(output (shell-command-to-string cmd)))
|
||||||
|
(string-trim output)))
|
||||||
|
|
||||||
|
(after! gptel
|
||||||
|
:config
|
||||||
|
(setq! gptel-api-key (my/get-rbw-password "openai-api-key-chatgpt-el")
|
||||||
|
gptel-default-mode 'org-mode
|
||||||
|
gptel-use-tools t
|
||||||
|
gptel-confirm-tool-calls 'always
|
||||||
|
gptel-include-reasoning 'ignore
|
||||||
|
gptel-model "qwen3:30b")
|
||||||
|
|
||||||
|
;; Set default backend to be Ollama-Local
|
||||||
|
(setq! gptel-backend
|
||||||
|
(gptel-make-ollama "Ollama-Local"
|
||||||
|
:host "localhost:11434"
|
||||||
|
:stream t
|
||||||
|
:models '(deepseek-r1 deepseek-r1-fullctx qwen3:30b qwen3:4b llama3.1 qwen2.5-coder mistral-nemo gpt-oss)))
|
||||||
|
|
||||||
|
;; Define custom tools
|
||||||
|
(gptel-make-tool
|
||||||
|
:name "run_shell_command"
|
||||||
|
:description "Execute shell commands and return output. Use this to run system commands, check file contents, or perform system operations."
|
||||||
|
:function (lambda (command)
|
||||||
|
(condition-case err
|
||||||
|
(shell-command-to-string command)
|
||||||
|
(error (format "Error running command: %s" (error-message-string err)))))
|
||||||
|
:args (list '(:name "command" :type "string" :description "Shell command to execute")))
|
||||||
|
|
||||||
|
(gptel-make-tool
|
||||||
|
:name "read_file"
|
||||||
|
:description "Read the contents of a file and return as text"
|
||||||
|
:function (lambda (filepath)
|
||||||
|
(condition-case err
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert-file-contents (expand-file-name filepath))
|
||||||
|
(buffer-string))
|
||||||
|
(error (format "Error reading file %s: %s" filepath (error-message-string err)))))
|
||||||
|
:args (list '(:name "filepath" :type "string" :description "Path to the file to read")))
|
||||||
|
|
||||||
|
(gptel-make-tool
|
||||||
|
:name "list_directory"
|
||||||
|
:description "List contents of a directory"
|
||||||
|
:function (lambda (dirpath)
|
||||||
|
(condition-case err
|
||||||
|
(mapconcat 'identity
|
||||||
|
(directory-files (expand-file-name dirpath) nil "^[^.]")
|
||||||
|
"\n")
|
||||||
|
(error (format "Error listing directory %s: %s" dirpath (error-message-string err)))))
|
||||||
|
:args (list '(:name "dirpath" :type "string" :description "Directory path to list"))))
|
||||||
|
|
||||||
|
(use-package! claude-code-ide
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
(claude-code-ide-emacs-tools-setup)
|
||||||
|
(map! :leader
|
||||||
|
(:prefix ("o" . "open")
|
||||||
|
:desc "Claude Code IDE" "c" #'claude-code-ide-menu)))
|
||||||
|
|
||||||
|
(after! gptel
|
||||||
|
(require 'gptel-tool-library)
|
||||||
|
(setq gptel-tool-library-use-maybe-safe t
|
||||||
|
gptel-tool-library-use-unsafe t)
|
||||||
|
(dolist (module '("bbdb" "buffer" "elisp" "emacs" "gnus" "os" "search-and-replace" "url"))
|
||||||
|
(gptel-tool-library-load-module module)))
|
||||||
|
|
||||||
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
||||||
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
doom ; what makes DOOM look the way it does
|
doom ; what makes DOOM look the way it does
|
||||||
doom-dashboard ; a nifty splash screen for Emacs
|
doom-dashboard ; a nifty splash screen for Emacs
|
||||||
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
|
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||||
(emoji +unicode) ; 🙂
|
;;(emoji +unicode) ; 🙂
|
||||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||||
;;indent-guides ; highlighted indent columns
|
;;indent-guides ; highlighted indent columns
|
||||||
;;ligatures ; ligatures and symbols to make your code pretty again
|
;;ligatures ; ligatures and symbols to make your code pretty again
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||||
;;tabs ; a tab bar for Emacs
|
;;tabs ; a tab bar for Emacs
|
||||||
;;treemacs ; a project drawer, like neotree but cooler
|
;;treemacs ; a project drawer, like neotree but cooler
|
||||||
;;unicode ; extended unicode support for various languages
|
unicode ; extended unicode support for various languages
|
||||||
(vc-gutter +pretty) ; vcs diff in the fringe
|
(vc-gutter +pretty) ; vcs diff in the fringe
|
||||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||||
;;window-select ; visually switch windows
|
;;window-select ; visually switch windows
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
;;(format +onsave) ; automated prettiness
|
;;(format +onsave) ; automated prettiness
|
||||||
;;god ; run Emacs commands without modifier keys
|
;;god ; run Emacs commands without modifier keys
|
||||||
;;lispy ; vim for lisp, for people who don't like vim
|
;;lispy ; vim for lisp, for people who don't like vim
|
||||||
;;multiple-cursors ; editing in many places at once
|
multiple-cursors ; editing in many places at once
|
||||||
;;objed ; text object editing for the innocent
|
;;objed ; text object editing for the innocent
|
||||||
;;parinfer ; turn lisp into python, sort of
|
;;parinfer ; turn lisp into python, sort of
|
||||||
;;rotate-text ; cycle region at point between text candidates
|
;;rotate-text ; cycle region at point between text candidates
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
;;eshell ; the elisp shell that works everywhere
|
;;eshell ; the elisp shell that works everywhere
|
||||||
;;shell ; simple shell REPL for Emacs
|
;;shell ; simple shell REPL for Emacs
|
||||||
;;term ; basic terminal emulator for Emacs
|
;;term ; basic terminal emulator for Emacs
|
||||||
;;vterm ; the best terminal emulation in Emacs
|
vterm ; the best terminal emulation in Emacs
|
||||||
|
|
||||||
:checkers
|
:checkers
|
||||||
syntax ; tasing you for every semicolon you forget
|
syntax ; tasing you for every semicolon you forget
|
||||||
@@ -94,6 +94,7 @@
|
|||||||
;;editorconfig ; let someone else argue about tabs vs spaces
|
;;editorconfig ; let someone else argue about tabs vs spaces
|
||||||
;;ein ; tame Jupyter notebooks with emacs
|
;;ein ; tame Jupyter notebooks with emacs
|
||||||
(eval +overlay) ; run code, run (also, repls)
|
(eval +overlay) ; run code, run (also, repls)
|
||||||
|
llm ; When I said you needed friends, I didn't mean...
|
||||||
lookup ; navigate your code and its documentation
|
lookup ; navigate your code and its documentation
|
||||||
lsp ; M-x vscode
|
lsp ; M-x vscode
|
||||||
magit ; a git porcelain for Emacs
|
magit ; a git porcelain for Emacs
|
||||||
@@ -108,7 +109,7 @@
|
|||||||
|
|
||||||
:os
|
:os
|
||||||
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
|
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
|
||||||
;;tty ; improve the terminal Emacs experience
|
tty ; improve the terminal Emacs experience
|
||||||
|
|
||||||
:lang
|
:lang
|
||||||
;;agda ; types of types of types of types...
|
;;agda ; types of types of types of types...
|
||||||
@@ -149,7 +150,7 @@
|
|||||||
;;lua ; one-based indices? one-based indices
|
;;lua ; one-based indices? one-based indices
|
||||||
markdown ; writing docs for people to ignore
|
markdown ; writing docs for people to ignore
|
||||||
;;nim ; python + lisp at the speed of c
|
;;nim ; python + lisp at the speed of c
|
||||||
(nix +tree-sitter +lsp) ; I hereby declare "nix geht mehr!"
|
(nix +tree-sitter) ; I hereby declare "nix geht mehr!"
|
||||||
;;ocaml ; an objective camel
|
;;ocaml ; an objective camel
|
||||||
(org +roam2) ; organize your plain life in plain text
|
(org +roam2) ; organize your plain life in plain text
|
||||||
;;php ; perl's insecure younger brother
|
;;php ; perl's insecure younger brother
|
||||||
|
|||||||
@@ -50,3 +50,12 @@
|
|||||||
;; (unpin! t)
|
;; (unpin! t)
|
||||||
|
|
||||||
;; (package! org-caldav)
|
;; (package! org-caldav)
|
||||||
|
|
||||||
|
(package! gptel :recipe (:nonrecursive t))
|
||||||
|
|
||||||
|
(package! claude-code-ide
|
||||||
|
:recipe (:host github :repo "manzaltu/claude-code-ide.el"))
|
||||||
|
|
||||||
|
(package! gptel-tool-library
|
||||||
|
:recipe (:host github :repo "aard-fi/gptel-tool-library"
|
||||||
|
:files ("*.el")))
|
||||||
|
|||||||
@@ -1,94 +0,0 @@
|
|||||||
{ inputs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hyprpaper.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
plugins = [ inputs.hy3.packages.x86_64-linux.hy3 ];
|
|
||||||
settings = {
|
|
||||||
"$mod" = "SUPER";
|
|
||||||
"$terminal" = "kitty";
|
|
||||||
"$fileManager" = "dolphin";
|
|
||||||
"$menu" = "wofi --show drun";
|
|
||||||
|
|
||||||
exec-once = [
|
|
||||||
"waybar"
|
|
||||||
"dunst"
|
|
||||||
];
|
|
||||||
|
|
||||||
xwayland = {
|
|
||||||
force_zero_scaling = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
input = {
|
|
||||||
kb_layout = "us";
|
|
||||||
kb_options = "caps:escape";
|
|
||||||
follow_mouse = 1;
|
|
||||||
touchpad.natural_scroll = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
windowrulev2 = [
|
|
||||||
# I can guess, but I should figure out what this actually does
|
|
||||||
"suppressevent maximize, class:.*"
|
|
||||||
];
|
|
||||||
|
|
||||||
general.layout = "hy3";
|
|
||||||
|
|
||||||
bind =
|
|
||||||
[
|
|
||||||
"SHIFT_$mod, Q, killactive"
|
|
||||||
"SHIFT_$mod, M, exit"
|
|
||||||
|
|
||||||
"$mod, D, exec, $menu"
|
|
||||||
"$mod, Return, exec, $terminal"
|
|
||||||
|
|
||||||
"$mod, H, hy3:movefocus, l"
|
|
||||||
"$mod, L, hy3:movefocus, r"
|
|
||||||
"$mod, K, hy3:movefocus, u"
|
|
||||||
"$mod, J, hy3:movefocus, d"
|
|
||||||
|
|
||||||
"SHIFT_$mod, H, hy3:movewindow, l"
|
|
||||||
"SHIFT_$mod, L, hy3:movewindow, r"
|
|
||||||
"SHIFT_$mod, K, hy3:movewindow, u"
|
|
||||||
"SHIFT_$mod, J, hy3:movewindow, d"
|
|
||||||
|
|
||||||
"$mod, V, hy3:makegroup, opposite"
|
|
||||||
"$mod, W, hy3:changegroup, toggletab"
|
|
||||||
|
|
||||||
"$mod, A, hy3:changefocus, raise"
|
|
||||||
"SHIFT_$mod, A, hy3:changefocus, lower"
|
|
||||||
|
|
||||||
"$mod, M, fullscreen, 0"
|
|
||||||
"$mod, E, hy3:expand, expand"
|
|
||||||
"SHIFT_$mod, E, hy3:expand, base"
|
|
||||||
|
|
||||||
"$mod, Q, hy3:warpcursor"
|
|
||||||
]
|
|
||||||
++ (
|
|
||||||
# workspaces
|
|
||||||
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
|
||||||
builtins.concatLists (builtins.genList (
|
|
||||||
x: let
|
|
||||||
ws = let
|
|
||||||
c = (x + 1) / 10;
|
|
||||||
in
|
|
||||||
builtins.toString (x + 1 - (c * 10));
|
|
||||||
in [
|
|
||||||
"$mod, ${ws}, workspace, ${toString (x + 1)}"
|
|
||||||
"$mod SHIFT, ${ws}, hy3:movetoworkspace, ${toString (x + 1)}"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
10)
|
|
||||||
);
|
|
||||||
|
|
||||||
bindm =
|
|
||||||
[
|
|
||||||
"$mod, mouse:272, movewindow"
|
|
||||||
"$mod, mouse:273, resizewindow"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.hyprpaper = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
ipc = "on";
|
|
||||||
splash = false;
|
|
||||||
preload = [
|
|
||||||
"${config.xdg.dataHome}/wallpaper.jpg"
|
|
||||||
];
|
|
||||||
wallpaper = [
|
|
||||||
",${config.xdg.dataHome}/wallpaper.jpg"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.dataFile."wallpaper.jpg" = {
|
|
||||||
source = ./wallpaper.jpg;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
wayland.windowManager.hyprland.settings.monitor = ",preferred,2880x1800@90.00Hz,1.33333";
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 842 KiB |
@@ -1,16 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
wayland.windowManager.hyprland.settings.monitor = "DP-1,3440x1440@164.90,0x0,1.33333,vrr,1";
|
|
||||||
wayland.windowManager.hyprland.settings.env = [
|
|
||||||
"LIBVA_DRIVER_NAME,nvidia"
|
|
||||||
"XDG_SESSION_TYPE,wayland"
|
|
||||||
"GBM_BACKEND,nvidia-drm"
|
|
||||||
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
|
|
||||||
"NVD_BACKEND,direct"
|
|
||||||
"ELECTRON_OZONE_PLATFORM_HINT,auto"
|
|
||||||
"NIXOS_OZONE_WL,1"
|
|
||||||
];
|
|
||||||
|
|
||||||
wayland.windowManager.hyprland.settings.cursor.no_hardware_cursors = true;
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,18 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.home.i3_sway;
|
cfg = config.home.i3_sway;
|
||||||
i3_cfg = config.xsession.windowManager.i3.config;
|
|
||||||
|
|
||||||
shared_config = recursiveUpdate {
|
shared_config = recursiveUpdate rec {
|
||||||
modifier = "Mod4";
|
modifier = "Mod4";
|
||||||
terminal = "kitty";
|
terminal = "ghostty";
|
||||||
defaultWorkspace = "workspace number 1";
|
defaultWorkspace = "workspace number 1";
|
||||||
|
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"${shared_config.modifier}+Return" = "exec ${i3_cfg.terminal}";
|
"${shared_config.modifier}+Return" = "exec ${terminal}";
|
||||||
"${shared_config.modifier}+Shift+q" = "kill";
|
"${shared_config.modifier}+Shift+q" = "kill";
|
||||||
"${shared_config.modifier}+d" = "exec ${i3_cfg.menu}";
|
|
||||||
|
|
||||||
"${shared_config.modifier}+h" = "focus left";
|
"${shared_config.modifier}+h" = "focus left";
|
||||||
"${shared_config.modifier}+j" = "focus down";
|
"${shared_config.modifier}+j" = "focus down";
|
||||||
@@ -38,7 +36,7 @@ let
|
|||||||
|
|
||||||
#"${shared_config.modifier}+h" = "split h";
|
#"${shared_config.modifier}+h" = "split h";
|
||||||
"${shared_config.modifier}+v" = "split v";
|
"${shared_config.modifier}+v" = "split v";
|
||||||
"${shared_config.modifier}+f" = "fullscreen toggle";
|
"${shared_config.modifier}+Shift+f" = "fullscreen toggle";
|
||||||
|
|
||||||
"${shared_config.modifier}+s" = "layout stacking";
|
"${shared_config.modifier}+s" = "layout stacking";
|
||||||
"${shared_config.modifier}+w" = "layout tabbed";
|
"${shared_config.modifier}+w" = "layout tabbed";
|
||||||
@@ -89,8 +87,8 @@ let
|
|||||||
|
|
||||||
"${shared_config.modifier}+r" = "mode resize";
|
"${shared_config.modifier}+r" = "mode resize";
|
||||||
|
|
||||||
"XF86MonBrightnessUp" = "exec brightnessctl s +5%";
|
"XF86MonBrightnessUp" = "exec ddcutil setvcp 10 + 5";
|
||||||
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
|
"XF86MonBrightnessDown" = "exec ddcutil setvcp 10 - 5";
|
||||||
};
|
};
|
||||||
} cfg.extraSharedConfig;
|
} cfg.extraSharedConfig;
|
||||||
in {
|
in {
|
||||||
@@ -107,12 +105,176 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
# i3blocks configuration file
|
||||||
|
home.file.".config/i3blocks/config".text = ''
|
||||||
|
# i3blocks config - replicating waybar setup
|
||||||
|
separator_block_width=15
|
||||||
|
markup=pango
|
||||||
|
|
||||||
|
[disk]
|
||||||
|
command=df -h / | awk 'NR==2 {print "💾 " $5}'
|
||||||
|
interval=30
|
||||||
|
separator=true
|
||||||
|
|
||||||
|
[cpu]
|
||||||
|
command=top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print "🧠 " int(100 - $1) "%"}'
|
||||||
|
interval=2
|
||||||
|
separator=true
|
||||||
|
|
||||||
|
[memory]
|
||||||
|
command=free | awk 'NR==2 {printf "🐏 %.0f%%\n", $3*100/$2}'
|
||||||
|
interval=5
|
||||||
|
separator=true
|
||||||
|
|
||||||
|
[pulseaudio]
|
||||||
|
command=${pkgs.writeShellScript "i3blocks-pulseaudio" ''
|
||||||
|
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+%' | head -1)
|
||||||
|
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | grep -o 'yes')
|
||||||
|
if [ "$muted" = "yes" ]; then
|
||||||
|
echo "🔇"
|
||||||
|
else
|
||||||
|
vol_num=''${volume%\%}
|
||||||
|
if [ $vol_num -le 33 ]; then
|
||||||
|
echo "🔈 $volume"
|
||||||
|
elif [ $vol_num -le 66 ]; then
|
||||||
|
echo "🔉 $volume"
|
||||||
|
else
|
||||||
|
echo "🔊 $volume"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
interval=1
|
||||||
|
signal=10
|
||||||
|
separator=true
|
||||||
|
|
||||||
|
[backlight]
|
||||||
|
command=${pkgs.writeShellScript "i3blocks-backlight" ''
|
||||||
|
if command -v ddcutil &>/dev/null; then
|
||||||
|
# Handle mouse scroll events
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
4) ddcutil setvcp 10 + 5 ;; # Scroll up - increase brightness
|
||||||
|
5) ddcutil setvcp 10 - 5 ;; # Scroll down - decrease brightness
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Display current brightness
|
||||||
|
brightness=$(ddcutil getvcp 10 2>/dev/null | grep -oP 'current value =\s*\K\d+')
|
||||||
|
if [ -n "$brightness" ]; then
|
||||||
|
echo "☀️ $brightness%"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
interval=5
|
||||||
|
separator=true
|
||||||
|
|
||||||
|
[network]
|
||||||
|
command=${pkgs.writeShellScript "i3blocks-network" ''
|
||||||
|
if iwgetid -r &>/dev/null; then
|
||||||
|
ssid=$(iwgetid -r)
|
||||||
|
signal=$(grep "^\s*w" /proc/net/wireless | awk '{print int($3 * 100 / 70)}')
|
||||||
|
echo "📶 $ssid ($signal%)"
|
||||||
|
else
|
||||||
|
ip=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '127.0.0.1' | head -1)
|
||||||
|
if [ -n "$ip" ]; then
|
||||||
|
echo "🔌 $ip"
|
||||||
|
else
|
||||||
|
echo "❌"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
interval=5
|
||||||
|
separator=true
|
||||||
|
|
||||||
|
[battery]
|
||||||
|
command=${pkgs.writeShellScript "i3blocks-battery" ''
|
||||||
|
if [ -d /sys/class/power_supply/BAT0 ]; then
|
||||||
|
capacity=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||||
|
status=$(cat /sys/class/power_supply/BAT0/status)
|
||||||
|
|
||||||
|
if [ "$status" = "Charging" ]; then
|
||||||
|
echo "⚡ $capacity%"
|
||||||
|
else
|
||||||
|
echo "🔋 $capacity%"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
interval=10
|
||||||
|
separator=true
|
||||||
|
|
||||||
|
[time]
|
||||||
|
command=date '+%Y-%m-%d %H:%M'
|
||||||
|
interval=1
|
||||||
|
separator=false
|
||||||
|
'';
|
||||||
|
|
||||||
xsession.windowManager.i3 = let
|
xsession.windowManager.i3 = let
|
||||||
base_i3_config = recursiveUpdate shared_config {
|
base_i3_config = recursiveUpdate shared_config {
|
||||||
keybindings = {
|
bars = [{
|
||||||
|
position = "bottom";
|
||||||
|
statusCommand = "${pkgs.i3blocks}/bin/i3blocks";
|
||||||
|
trayOutput = "primary"; # Enable system tray on primary output
|
||||||
|
fonts = {
|
||||||
|
names = [ "Fira Code" "monospace" ];
|
||||||
|
size = 11.0;
|
||||||
|
};
|
||||||
|
colors = {
|
||||||
|
background = "#000000";
|
||||||
|
statusline = "#ffffff";
|
||||||
|
separator = "#666666";
|
||||||
|
|
||||||
|
# Workspace button colors (matching waybar)
|
||||||
|
focusedWorkspace = {
|
||||||
|
border = "#285577";
|
||||||
|
background = "#285577";
|
||||||
|
text = "#ffffff";
|
||||||
|
};
|
||||||
|
activeWorkspace = {
|
||||||
|
border = "#5f676a";
|
||||||
|
background = "#5f676a";
|
||||||
|
text = "#ffffff";
|
||||||
|
};
|
||||||
|
inactiveWorkspace = {
|
||||||
|
border = "#222222";
|
||||||
|
background = "#222222";
|
||||||
|
text = "#888888";
|
||||||
|
};
|
||||||
|
urgentWorkspace = {
|
||||||
|
border = "#900000";
|
||||||
|
background = "#900000";
|
||||||
|
text = "#ffffff";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
keybindings = shared_config.keybindings // {
|
||||||
|
"${shared_config.modifier}+d" = "exec rofi -show drun";
|
||||||
"${shared_config.modifier}+Shift+e" =
|
"${shared_config.modifier}+Shift+e" =
|
||||||
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||||
};
|
};
|
||||||
|
startup = [
|
||||||
|
# GNOME polkit authentication agent
|
||||||
|
{
|
||||||
|
command = "/run/current-system/sw/libexec/polkit-gnome-authentication-agent-1";
|
||||||
|
always = false;
|
||||||
|
notification = false;
|
||||||
|
}
|
||||||
|
# Picom compositor for smooth rendering and no tearing (important for Nvidia)
|
||||||
|
{
|
||||||
|
command = "picom --backend glx -b";
|
||||||
|
always = false;
|
||||||
|
notification = false;
|
||||||
|
}
|
||||||
|
# NetworkManager system tray applet
|
||||||
|
{
|
||||||
|
command = "nm-applet";
|
||||||
|
always = false;
|
||||||
|
notification = false;
|
||||||
|
}
|
||||||
|
# Set wallpaper with feh
|
||||||
|
{
|
||||||
|
command = "feh --bg-scale ${../../wallpapers/metroid-samus-returns-kz-3440x1440.jpg}";
|
||||||
|
always = false;
|
||||||
|
notification = false;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -121,7 +283,9 @@ in {
|
|||||||
|
|
||||||
wayland.windowManager.sway = let
|
wayland.windowManager.sway = let
|
||||||
base_sway_config = recursiveUpdate shared_config {
|
base_sway_config = recursiveUpdate shared_config {
|
||||||
keybindings = {
|
bars = []; # Disable default bar, use waybar instead
|
||||||
|
keybindings = shared_config.keybindings // {
|
||||||
|
"${shared_config.modifier}+d" = "exec wofi --show drun";
|
||||||
"${shared_config.modifier}+Shift+e" =
|
"${shared_config.modifier}+Shift+e" =
|
||||||
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||||
};
|
};
|
||||||
@@ -129,11 +293,166 @@ in {
|
|||||||
"type:keyboard" = {
|
"type:keyboard" = {
|
||||||
xkb_options = "caps:escape";
|
xkb_options = "caps:escape";
|
||||||
};
|
};
|
||||||
|
"type:touchpad" = {
|
||||||
|
tap = "enabled";
|
||||||
|
tap_button_map = "lrm";
|
||||||
|
drag = "enabled";
|
||||||
|
natural_scroll = "disabled";
|
||||||
|
dwt = "enabled";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
output = {
|
||||||
|
"*" = {
|
||||||
|
bg = "${../../wallpapers/metroid-samus-returns-kz-3440x1440.jpg} fill";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
startup = [
|
||||||
|
# Launch waybar status bar
|
||||||
|
{
|
||||||
|
command = "waybar";
|
||||||
|
always = false;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = recursiveUpdate base_sway_config cfg.extraSwayConfig;
|
config = recursiveUpdate base_sway_config cfg.extraSwayConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
systemd.enable = false; # Don't auto-start via systemd - only launch in sway
|
||||||
|
settings = {
|
||||||
|
mainBar = {
|
||||||
|
layer = "top";
|
||||||
|
position = "bottom";
|
||||||
|
height = 30;
|
||||||
|
spacing = 4;
|
||||||
|
|
||||||
|
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||||
|
modules-center = [ ];
|
||||||
|
modules-right = [ "disk" "cpu" "memory" "pulseaudio" "backlight" "network" "battery" "tray" "clock" ];
|
||||||
|
|
||||||
|
"sway/workspaces" = {
|
||||||
|
disable-scroll = true;
|
||||||
|
all-outputs = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"clock" = {
|
||||||
|
format = "{:%Y-%m-%d %H:%M}";
|
||||||
|
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
||||||
|
calendar = {
|
||||||
|
mode = "year";
|
||||||
|
mode-mon-col = 3;
|
||||||
|
weeks-pos = "right";
|
||||||
|
on-scroll = 1;
|
||||||
|
format = {
|
||||||
|
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||||
|
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||||
|
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||||
|
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||||
|
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
"disk" = {
|
||||||
|
interval = 30;
|
||||||
|
format = "💾 {percentage_used}%";
|
||||||
|
path = "/";
|
||||||
|
tooltip-format = "Used: {used} / {total} ({percentage_used}%)\nFree: {free} ({percentage_free}%)";
|
||||||
|
};
|
||||||
|
|
||||||
|
"cpu" = {
|
||||||
|
format = "🧠 {usage}%";
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
"memory" = {
|
||||||
|
format = "🐏 {percentage}%";
|
||||||
|
tooltip-format = "RAM: {used:0.1f}G / {total:0.1f}G";
|
||||||
|
};
|
||||||
|
|
||||||
|
"pulseaudio" = {
|
||||||
|
format = "{icon} {volume}%";
|
||||||
|
format-muted = "🔇";
|
||||||
|
format-icons = {
|
||||||
|
headphone = "🎧";
|
||||||
|
default = [ "🔈" "🔉" "🔊" ];
|
||||||
|
};
|
||||||
|
on-click = "pavucontrol";
|
||||||
|
};
|
||||||
|
|
||||||
|
"backlight" = {
|
||||||
|
format = "☀️ {percent}%";
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
"network" = {
|
||||||
|
format-wifi = "📶 {essid} ({signalStrength}%)";
|
||||||
|
format-ethernet = "🔌 {ipaddr}";
|
||||||
|
format-disconnected = "❌";
|
||||||
|
tooltip-format = "{ifname}: {ipaddr}/{cidr}";
|
||||||
|
};
|
||||||
|
|
||||||
|
"battery" = {
|
||||||
|
states = {
|
||||||
|
warning = 30;
|
||||||
|
critical = 15;
|
||||||
|
};
|
||||||
|
format = "{icon} {capacity}%";
|
||||||
|
format-charging = "⚡ {capacity}%";
|
||||||
|
format-icons = [ "🪫" "🔋" "🔋" "🔋" "🔋" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"tray" = {
|
||||||
|
spacing = 10;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
style = ''
|
||||||
|
* {
|
||||||
|
padding: 0 4px;
|
||||||
|
font-family: "Fira Code", monospace;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
padding: 0 8px;
|
||||||
|
background-color: transparent;
|
||||||
|
color: #ffffff;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.focused {
|
||||||
|
background-color: #285577;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.visible {
|
||||||
|
background-color: #5f676a;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.urgent {
|
||||||
|
background-color: #900000;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.rofi = {
|
||||||
|
enable = true;
|
||||||
|
theme = "solarized";
|
||||||
|
extraConfig = {
|
||||||
|
modi = "drun,run,window";
|
||||||
|
show-icons = true;
|
||||||
|
drun-display-format = "{name}";
|
||||||
|
disable-history = false;
|
||||||
|
hide-scrollbar = true;
|
||||||
|
display-drun = " Apps";
|
||||||
|
display-run = " Run";
|
||||||
|
display-window = " Windows";
|
||||||
|
sidebar-mode = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
249
home/modules/kubectl/default.nix
Normal file
249
home/modules/kubectl/default.nix
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.kubectl-secure;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.programs.kubectl-secure = {
|
||||||
|
enable = mkEnableOption "secure kubectl configuration with Bitwarden integration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
kubectl
|
||||||
|
kubernetes-helm
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.k9s.enable = true;
|
||||||
|
|
||||||
|
programs.bash.initExtra = mkAfter ''
|
||||||
|
# Kubectl secure session management
|
||||||
|
export KUBECTL_SESSION_DIR="/dev/shm/kubectl-$$"
|
||||||
|
|
||||||
|
kube-select() {
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo "Usage: kube-select <context-name>"
|
||||||
|
echo "Available contexts: $(kube-list)"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local context="$1"
|
||||||
|
|
||||||
|
# Clean up any existing session first
|
||||||
|
kube-clear 2>/dev/null
|
||||||
|
|
||||||
|
# Create new session directory
|
||||||
|
mkdir -p "$KUBECTL_SESSION_DIR"
|
||||||
|
chmod 700 "$KUBECTL_SESSION_DIR"
|
||||||
|
|
||||||
|
# Set cleanup trap for this shell session
|
||||||
|
trap "rm -rf '$KUBECTL_SESSION_DIR' 2>/dev/null" EXIT
|
||||||
|
|
||||||
|
# Set KUBECONFIG for this session
|
||||||
|
export KUBECONFIG="$KUBECTL_SESSION_DIR/config"
|
||||||
|
|
||||||
|
# Load config from Bitwarden secure notes
|
||||||
|
if ! rbw get "kubectl-$context" > "$KUBECONFIG" 2>/dev/null; then
|
||||||
|
echo "Error: Could not retrieve kubectl-$context from Bitwarden"
|
||||||
|
echo "Make sure the entry exists with name: kubectl-$context"
|
||||||
|
kube-clear
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify the kubeconfig is valid
|
||||||
|
if ! kubectl config view >/dev/null 2>&1; then
|
||||||
|
echo "Error: Invalid kubeconfig retrieved from Bitwarden"
|
||||||
|
kube-clear
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✓ Loaded kubectl context: $context (session: $$)"
|
||||||
|
echo " Config location: $KUBECONFIG"
|
||||||
|
}
|
||||||
|
|
||||||
|
kube-list() {
|
||||||
|
echo "Available kubectl contexts in Bitwarden:"
|
||||||
|
rbw search kubectl- 2>/dev/null | grep "^kubectl-" | sed 's/^kubectl-/ - /' || echo " (none found or rbw not accessible)"
|
||||||
|
}
|
||||||
|
|
||||||
|
kube-clear() {
|
||||||
|
if [[ -n "$KUBECTL_TIMEOUT_PID" ]]; then
|
||||||
|
kill "$KUBECTL_TIMEOUT_PID" 2>/dev/null
|
||||||
|
unset KUBECTL_TIMEOUT_PID
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "$KUBECTL_SESSION_DIR" ]]; then
|
||||||
|
rm -rf "$KUBECTL_SESSION_DIR"
|
||||||
|
echo "Cleared kubectl session ($$)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset KUBECONFIG
|
||||||
|
}
|
||||||
|
|
||||||
|
kube-status() {
|
||||||
|
if [[ -f "$KUBECONFIG" ]]; then
|
||||||
|
local current_context
|
||||||
|
current_context=$(kubectl config current-context 2>/dev/null)
|
||||||
|
if [[ -n "$current_context" ]]; then
|
||||||
|
echo "Active kubectl context: $current_context"
|
||||||
|
echo "Session: $$ | Config: $KUBECONFIG"
|
||||||
|
|
||||||
|
# Show cluster info
|
||||||
|
local cluster_server
|
||||||
|
cluster_server=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}' 2>/dev/null)
|
||||||
|
if [[ -n "$cluster_server" ]]; then
|
||||||
|
echo "Cluster: $cluster_server"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No active context in current session"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No kubectl session active in this shell"
|
||||||
|
echo "Use 'kube-select <context>' to start a session"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper function to show available commands
|
||||||
|
kube-help() {
|
||||||
|
echo "Secure kubectl session management commands:"
|
||||||
|
echo ""
|
||||||
|
echo "Session management:"
|
||||||
|
echo " kube-select <context> - Load kubeconfig from Bitwarden"
|
||||||
|
echo " kube-status - Show current session status"
|
||||||
|
echo " kube-clear - Clear current session"
|
||||||
|
echo ""
|
||||||
|
echo "Configuration management:"
|
||||||
|
echo " kube-list - List available contexts in Bitwarden"
|
||||||
|
echo ""
|
||||||
|
echo "Help:"
|
||||||
|
echo " kube-help - Show this help"
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " kube-select prod # Loads from secure note"
|
||||||
|
echo " kubectl get pods"
|
||||||
|
echo " kube-clear"
|
||||||
|
echo ""
|
||||||
|
echo "Note: Kubeconfigs are stored as secure notes in Bitwarden"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
programs.zsh.initExtra = mkAfter ''
|
||||||
|
# Kubectl secure session management (zsh)
|
||||||
|
export KUBECTL_SESSION_DIR="/dev/shm/kubectl-$$"
|
||||||
|
|
||||||
|
kube-select() {
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo "Usage: kube-select <context-name>"
|
||||||
|
echo "Available contexts: $(kube-list)"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local context="$1"
|
||||||
|
|
||||||
|
# Clean up any existing session first
|
||||||
|
kube-clear 2>/dev/null
|
||||||
|
|
||||||
|
# Create new session directory
|
||||||
|
mkdir -p "$KUBECTL_SESSION_DIR"
|
||||||
|
chmod 700 "$KUBECTL_SESSION_DIR"
|
||||||
|
|
||||||
|
# Set cleanup trap for this shell session
|
||||||
|
trap "rm -rf '$KUBECTL_SESSION_DIR' 2>/dev/null" EXIT
|
||||||
|
|
||||||
|
# Set KUBECONFIG for this session
|
||||||
|
export KUBECONFIG="$KUBECTL_SESSION_DIR/config"
|
||||||
|
|
||||||
|
# Load config from Bitwarden secure notes
|
||||||
|
if ! rbw get "kubectl-$context" > "$KUBECONFIG" 2>/dev/null; then
|
||||||
|
echo "Error: Could not retrieve kubectl-$context from Bitwarden"
|
||||||
|
echo "Make sure the entry exists with name: kubectl-$context"
|
||||||
|
kube-clear
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify the kubeconfig is valid
|
||||||
|
if ! kubectl config view >/dev/null 2>&1; then
|
||||||
|
echo "Error: Invalid kubeconfig retrieved from Bitwarden"
|
||||||
|
kube-clear
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✓ Loaded kubectl context: $context (session: $$)"
|
||||||
|
echo " Config location: $KUBECONFIG"
|
||||||
|
|
||||||
|
# Optional: Set timeout cleanup
|
||||||
|
if [[ ${toString cfg.sessionTimeout} -gt 0 ]]; then
|
||||||
|
(sleep ${toString cfg.sessionTimeout}; kube-clear 2>/dev/null) &
|
||||||
|
export KUBECTL_TIMEOUT_PID=$!
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
kube-list() {
|
||||||
|
echo "Available kubectl contexts in Bitwarden:"
|
||||||
|
rbw search kubectl- 2>/dev/null | grep "^kubectl-" | sed 's/^kubectl-/ - /' || echo " (none found or rbw not accessible)"
|
||||||
|
}
|
||||||
|
|
||||||
|
kube-clear() {
|
||||||
|
if [[ -n "$KUBECTL_TIMEOUT_PID" ]]; then
|
||||||
|
kill "$KUBECTL_TIMEOUT_PID" 2>/dev/null
|
||||||
|
unset KUBECTL_TIMEOUT_PID
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "$KUBECTL_SESSION_DIR" ]]; then
|
||||||
|
rm -rf "$KUBECTL_SESSION_DIR"
|
||||||
|
echo "Cleared kubectl session ($$)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset KUBECONFIG
|
||||||
|
}
|
||||||
|
|
||||||
|
kube-status() {
|
||||||
|
if [[ -f "$KUBECONFIG" ]]; then
|
||||||
|
local current_context
|
||||||
|
current_context=$(kubectl config current-context 2>/dev/null)
|
||||||
|
if [[ -n "$current_context" ]]; then
|
||||||
|
echo "Active kubectl context: $current_context"
|
||||||
|
echo "Session: $$ | Config: $KUBECONFIG"
|
||||||
|
|
||||||
|
# Show cluster info
|
||||||
|
local cluster_server
|
||||||
|
cluster_server=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}' 2>/dev/null)
|
||||||
|
if [[ -n "$cluster_server" ]]; then
|
||||||
|
echo "Cluster: $cluster_server"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No active context in current session"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No kubectl session active in this shell"
|
||||||
|
echo "Use 'kube-select <context>' to start a session"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper function to show available commands
|
||||||
|
kube-help() {
|
||||||
|
echo "Secure kubectl session management commands:"
|
||||||
|
echo ""
|
||||||
|
echo "Session management:"
|
||||||
|
echo " kube-select <context> - Load kubeconfig from Bitwarden"
|
||||||
|
echo " kube-status - Show current session status"
|
||||||
|
echo " kube-clear - Clear current session"
|
||||||
|
echo ""
|
||||||
|
echo "Configuration management:"
|
||||||
|
echo " kube-list - List available contexts in Bitwarden"
|
||||||
|
echo ""
|
||||||
|
echo "Help:"
|
||||||
|
echo " kube-help - Show this help"
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " kube-select prod # Loads from secure note"
|
||||||
|
echo " kubectl get pods"
|
||||||
|
echo " kube-clear"
|
||||||
|
echo ""
|
||||||
|
echo "Note: Kubeconfigs are stored as secure notes in Bitwarden"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = [
|
|
||||||
pkgs.gamescope
|
|
||||||
pkgs.lutris
|
|
||||||
pkgs.mangohud
|
|
||||||
];
|
|
||||||
}
|
|
||||||
178
home/modules/plasma-manager/default.nix
Normal file
178
home/modules/plasma-manager/default.nix
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
|
||||||
|
# The current KDE config can be output with the command:
|
||||||
|
# nix run github:nix-community/plasma-manager
|
||||||
|
#
|
||||||
|
# Plasma-manager options documentation
|
||||||
|
# https://nix-community.github.io/plasma-manager/options.xhtml
|
||||||
|
#
|
||||||
|
# TODO: (ambitious) Add Kmail support to plasma-manager
|
||||||
|
{
|
||||||
|
programs.plasma = {
|
||||||
|
enable = true;
|
||||||
|
overrideConfig = true;
|
||||||
|
|
||||||
|
hotkeys.commands."launch-ghostty" = {
|
||||||
|
name = "Launch Ghostty";
|
||||||
|
key = "Meta+Return";
|
||||||
|
command = "ghostty";
|
||||||
|
};
|
||||||
|
|
||||||
|
shortcuts = {
|
||||||
|
kmix = {
|
||||||
|
"decrease_microphone_volume" = "Microphone Volume Down";
|
||||||
|
"decrease_volume" = "Volume Down";
|
||||||
|
"decrease_volume_small" = "Shift+Volume Down";
|
||||||
|
"increase_microphone_volume" = "Microphone Volume Up";
|
||||||
|
"increase_volume" = "Volume Up";
|
||||||
|
"increase_volume_small" = "Shift+Volume Up";
|
||||||
|
"mic_mute" = ["Microphone Mute" "Meta+Volume Mute,Microphone Mute" "Meta+Volume Mute,Mute Microphone"];
|
||||||
|
"mute" = "Volume Mute";
|
||||||
|
};
|
||||||
|
|
||||||
|
mediacontrol = {
|
||||||
|
"mediavolumedown" = "none,,Media volume down";
|
||||||
|
"mediavolumeup" = "none,,Media volume up";
|
||||||
|
"nextmedia" = "Media Next";
|
||||||
|
"pausemedia" = "Media Pause";
|
||||||
|
"playmedia" = "none,,Play media playback";
|
||||||
|
"playpausemedia" = "Media Play";
|
||||||
|
"previousmedia" = "Media Previous";
|
||||||
|
"stopmedia" = "Media Stop";
|
||||||
|
};
|
||||||
|
|
||||||
|
ksmserver = {
|
||||||
|
"Lock Session" = ["Meta+Ctrl+Q" "Screensaver" "Screensaver,Lock Session"];
|
||||||
|
};
|
||||||
|
|
||||||
|
kwin = {
|
||||||
|
"Window Close" = "Meta+Shift+Q";
|
||||||
|
"Kill Window" = "Meta+Ctrl+Esc";
|
||||||
|
"Window Operations Menu" = "Alt+F3";
|
||||||
|
"Window Resize" = "Meta+R,,Resize Window";
|
||||||
|
|
||||||
|
"Overview" = "Meta+Ctrl+W";
|
||||||
|
"Grid View" = "Meta+G";
|
||||||
|
"Edit Tiles" = "Meta+T";
|
||||||
|
|
||||||
|
"Activate Window Demanding Attention" = "Meta+Ctrl+A";
|
||||||
|
|
||||||
|
"Show Desktop" = "Meta+Ctrl+D";
|
||||||
|
|
||||||
|
"Walk Through Windows" = "Alt+Tab";
|
||||||
|
"Walk Through Windows (Reverse)" = "Alt+Shift+Tab";
|
||||||
|
"Walk Through Windows of Current Application" = "Alt+`";
|
||||||
|
"Walk Through Windows of Current Application (Reverse)" = "Alt+~";
|
||||||
|
|
||||||
|
"Window Quick Tile Bottom" = "Meta+Down";
|
||||||
|
"Window Quick Tile Left" = "Meta+Left";
|
||||||
|
"Window Quick Tile Right" = "Meta+Right";
|
||||||
|
"Window Quick Tile Top" = "Meta+Up";
|
||||||
|
|
||||||
|
"Switch to Desktop 1" = "Meta+1";
|
||||||
|
"Switch to Desktop 2" = "Meta+2";
|
||||||
|
"Switch to Desktop 3" = "Meta+3";
|
||||||
|
"Switch to Desktop 4" = "Meta+4";
|
||||||
|
"Switch to Desktop 5" = "Meta+5";
|
||||||
|
"Switch to Desktop 6" = "Meta+6";
|
||||||
|
"Switch to Desktop 7" = "Meta+7";
|
||||||
|
"Switch to Desktop 8" = "Meta+8";
|
||||||
|
"Switch to Desktop 9" = "Meta+9";
|
||||||
|
"Switch to Desktop 10" = "Meta+0";
|
||||||
|
|
||||||
|
"Window to Desktop 1" = "Meta+!"; # Meta+Shift+1
|
||||||
|
"Window to Desktop 2" = "Meta+@"; # Meta+Shift+2
|
||||||
|
"Window to Desktop 3" = "Meta+#"; # Meta+Shift+3
|
||||||
|
"Window to Desktop 4" = "Meta+$"; # Meta+Shift+4
|
||||||
|
"Window to Desktop 5" = "Meta+%"; # Meta+Shift+5
|
||||||
|
"Window to Desktop 6" = "Meta+^"; # Meta+Shift+6
|
||||||
|
"Window to Desktop 7" = "Meta+&"; # Meta+Shift+7
|
||||||
|
"Window to Desktop 8" = "Meta+*"; # Meta+Shift+8
|
||||||
|
"Window to Desktop 9" = "Meta+("; # Meta+Shift+9
|
||||||
|
"Window to Desktop 10" = "Meta+)"; # Meta+Shift+0
|
||||||
|
|
||||||
|
"view_actual_size" = "Meta+Ctrl+=";
|
||||||
|
"view_zoom_in" = ["Meta++" "Meta+=,Meta++" "Meta+=,Zoom In"];
|
||||||
|
"view_zoom_out" = "Meta+-";
|
||||||
|
};
|
||||||
|
"org_kde_powerdevil"."Decrease Keyboard Brightness" = "Keyboard Brightness Down";
|
||||||
|
"org_kde_powerdevil"."Decrease Screen Brightness" = "Monitor Brightness Down";
|
||||||
|
"org_kde_powerdevil"."Decrease Screen Brightness Small" = "Shift+Monitor Brightness Down";
|
||||||
|
"org_kde_powerdevil"."Hibernate" = "Hibernate";
|
||||||
|
"org_kde_powerdevil"."Increase Keyboard Brightness" = "Keyboard Brightness Up";
|
||||||
|
"org_kde_powerdevil"."Increase Screen Brightness" = "Monitor Brightness Up";
|
||||||
|
"org_kde_powerdevil"."Increase Screen Brightness Small" = "Shift+Monitor Brightness Up";
|
||||||
|
"org_kde_powerdevil"."PowerDown" = "Power Down";
|
||||||
|
"org_kde_powerdevil"."PowerOff" = "Power Off";
|
||||||
|
"org_kde_powerdevil"."Sleep" = "Sleep";
|
||||||
|
"org_kde_powerdevil"."Toggle Keyboard Backlight" = "Keyboard Light On/Off";
|
||||||
|
"org_kde_powerdevil"."Turn Off Screen" = [ ];
|
||||||
|
"org_kde_powerdevil"."powerProfile" = ["Battery" "Meta+B,Battery" "Meta+B,Switch Power Profile"];
|
||||||
|
|
||||||
|
plasmashell = {
|
||||||
|
"activate application launcher" = ["Meta" "Alt+F1,Meta" "Alt+F1,Activate Application Launcher"];
|
||||||
|
"activate task manager entry 1" = "none,,";
|
||||||
|
"activate task manager entry 2" = "none,,";
|
||||||
|
"activate task manager entry 3" = "none,,";
|
||||||
|
"activate task manager entry 4" = "none,,";
|
||||||
|
"activate task manager entry 5" = "none,,";
|
||||||
|
"activate task manager entry 6" = "none,,";
|
||||||
|
"activate task manager entry 7" = "none,,";
|
||||||
|
"activate task manager entry 8" = "none,,";
|
||||||
|
"activate task manager entry 9" = "none,,";
|
||||||
|
"activate task manager entry 10" = "none,,";
|
||||||
|
"show activity switcher" = "none,,";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
configFile = {
|
||||||
|
kwinrc.Desktops.Number = {
|
||||||
|
value = 10;
|
||||||
|
immutable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable KWin tiling features
|
||||||
|
kwinrc.Tiling = {
|
||||||
|
# Enable tiling functionality
|
||||||
|
"padding" = 4;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable krohnkite plugin automatically
|
||||||
|
kwinrc.Plugins = {
|
||||||
|
krohnkiteEnabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
kwinrc.Effect-overview = {
|
||||||
|
# Configure overview effect for better tiling workflow
|
||||||
|
BorderActivate = 9; # Top-left corner activation
|
||||||
|
};
|
||||||
|
|
||||||
|
kcminputrc.Libinput = {
|
||||||
|
AccelerationProfile = "adaptive";
|
||||||
|
PointerAcceleration = 0.5;
|
||||||
|
};
|
||||||
|
|
||||||
|
kcminputrc.Mouse = {
|
||||||
|
X11LibInputXAccelProfileFlat = false;
|
||||||
|
XLbInptAccelProfileFlat = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
kdeglobals.KDE.LookAndFeelPackage = "org.kde.breezedark.desktop";
|
||||||
|
|
||||||
|
# Focus follows mouse configuration
|
||||||
|
kwinrc.Windows = {
|
||||||
|
FocusPolicy = "FocusFollowsMouse";
|
||||||
|
AutoRaise = true; # Set to true if you want windows to auto-raise on focus
|
||||||
|
AutoRaiseInterval = 750; # Delay in ms before auto-raise (if enabled)
|
||||||
|
DelayFocusInterval = 0; # Delay in ms before focus follows mouse
|
||||||
|
};
|
||||||
|
|
||||||
|
# Desktop wallpaper configuration
|
||||||
|
plasma-localerc.Formats.LANG = "en_US.UTF-8";
|
||||||
|
|
||||||
|
# Set wallpaper for all desktops
|
||||||
|
plasmarc.Wallpapers.usersWallpapers = "${../../wallpapers/metroid-samus-returns-kz-3440x1440.jpg}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
52
home/modules/tmux/default.nix
Normal file
52
home/modules/tmux/default.nix
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
tokyo-night = pkgs.tmuxPlugins.mkTmuxPlugin {
|
||||||
|
pluginName = "tokyo-night";
|
||||||
|
rtpFilePath = "tokyo-night.tmux";
|
||||||
|
version = "1.6.1";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "janoamaral";
|
||||||
|
repo = "tokyo-night-tmux";
|
||||||
|
rev = "d610ced20d5f602a7995854931440e4a1e0ab780";
|
||||||
|
sha256 = "sha256-17vEgkL7C51p/l5gpT9dkOy0bY9n8l0/LV51mR1k+V8=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.tmux.enable = true;
|
||||||
|
programs.tmux.terminal = "tmux-direct";
|
||||||
|
programs.tmux.keyMode = "vi";
|
||||||
|
programs.tmux.escapeTime = 0;
|
||||||
|
programs.tmux.mouse = true;
|
||||||
|
programs.tmux.newSession = true;
|
||||||
|
programs.tmux.historyLimit = 50000;
|
||||||
|
programs.tmux.clock24 = true;
|
||||||
|
programs.tmux.baseIndex = 1;
|
||||||
|
programs.tmux.prefix = "M-\\\\";
|
||||||
|
|
||||||
|
programs.tmux.plugins = with pkgs; [
|
||||||
|
tmuxPlugins.cpu
|
||||||
|
tmuxPlugins.battery
|
||||||
|
tmuxPlugins.better-mouse-mode
|
||||||
|
tmuxPlugins.net-speed
|
||||||
|
tmuxPlugins.online-status
|
||||||
|
tmuxPlugins.pain-control
|
||||||
|
tmuxPlugins.tilish
|
||||||
|
tmuxPlugins.yank
|
||||||
|
|
||||||
|
{
|
||||||
|
plugin = tmuxPlugins.resurrect;
|
||||||
|
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = tmuxPlugins.continuum;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @continuum-restore 'on'
|
||||||
|
set -g @continuum-save-interval '15' # minutes
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
tokyo-night
|
||||||
|
];
|
||||||
|
}
|
||||||
81
home/roles/base/default.nix
Normal file
81
home/roles/base/default.nix
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.base;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.base = {
|
||||||
|
enable = mkEnableOption "Enable base CLI tools and essential programs";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
fd
|
||||||
|
glances
|
||||||
|
gzip
|
||||||
|
htop
|
||||||
|
killall
|
||||||
|
less
|
||||||
|
ncdu
|
||||||
|
shellcheck
|
||||||
|
tmux
|
||||||
|
tree
|
||||||
|
];
|
||||||
|
|
||||||
|
# Essential programs everyone needs
|
||||||
|
programs.bash = {
|
||||||
|
enable = true;
|
||||||
|
initExtra = ''
|
||||||
|
codex() {
|
||||||
|
local key
|
||||||
|
key="$(rbw get openai-api-key-codex)"
|
||||||
|
OPENAI_API_KEY="$key" command codex "$@"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
programs.command-not-found.enable = true;
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "John Ogle";
|
||||||
|
userEmail = "john@ogle.fyi";
|
||||||
|
extraConfig = {
|
||||||
|
safe.directory = "/etc/nixos";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.jq.enable = true;
|
||||||
|
|
||||||
|
programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
viAlias = true;
|
||||||
|
vimAlias = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
addKeysToAgent = "yes";
|
||||||
|
matchBlocks = {
|
||||||
|
"nucdeb1" = {
|
||||||
|
hostname = "nucdeb1.oglehome";
|
||||||
|
user = "root";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.rbw = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
email = "john@johnogle.info";
|
||||||
|
base_url = "https://bitwarden.johnogle.info";
|
||||||
|
pinentry = pkgs.pinentry-qt;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Note: modules must be imported at top-level home config
|
||||||
|
};
|
||||||
|
}
|
||||||
24
home/roles/communication/default.nix
Normal file
24
home/roles/communication/default.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{ config, lib, pkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.communication;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.communication = {
|
||||||
|
enable = mkEnableOption "Enable communication and messaging applications";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [
|
||||||
|
# Communication apps
|
||||||
|
pkgs.element-desktop
|
||||||
|
#pkgs.fluffychat #marked insecure as of nixos 25.05
|
||||||
|
pkgs.nextcloud-talk-desktop
|
||||||
|
|
||||||
|
# For logging back into google chat
|
||||||
|
globalInputs.google-cookie-retrieval.packages.${system}.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
13
home/roles/default.nix
Normal file
13
home/roles/default.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./base
|
||||||
|
./communication
|
||||||
|
./desktop
|
||||||
|
./development
|
||||||
|
./gaming
|
||||||
|
./kdeconnect
|
||||||
|
./media
|
||||||
|
./office
|
||||||
|
./sync
|
||||||
|
];
|
||||||
|
}
|
||||||
160
home/roles/desktop/default.nix
Normal file
160
home/roles/desktop/default.nix
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.desktop = {
|
||||||
|
enable = mkEnableOption "Enable desktop GUI applications and utilities";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Desktop applications
|
||||||
|
bitwarden-desktop
|
||||||
|
dunst
|
||||||
|
keepassxc
|
||||||
|
unstable.ghostty
|
||||||
|
|
||||||
|
# Desktop utilities
|
||||||
|
feh # Image viewer and wallpaper setter for X11
|
||||||
|
rofi # Application launcher for X11
|
||||||
|
solaar # Logitech management software
|
||||||
|
waybar
|
||||||
|
wofi # Application launcher for Wayland
|
||||||
|
xdg-utils # XDG utilities for opening files/URLs with default applications
|
||||||
|
|
||||||
|
# System utilities with GUI components
|
||||||
|
(snapcast.override { pulseaudioSupport = true; })
|
||||||
|
|
||||||
|
# KDE tiling window management
|
||||||
|
kdePackages.krohnkite # Dynamic tiling extension for KWin 6
|
||||||
|
|
||||||
|
# KDE PIM applications for email, calendar, and contacts
|
||||||
|
kdePackages.kmail
|
||||||
|
kdePackages.kmail-account-wizard
|
||||||
|
kdePackages.kmailtransport
|
||||||
|
kdePackages.korganizer
|
||||||
|
kdePackages.kaddressbook
|
||||||
|
kdePackages.kontact
|
||||||
|
|
||||||
|
# KDE System components needed for proper integration
|
||||||
|
kdePackages.kded
|
||||||
|
kdePackages.systemsettings
|
||||||
|
kdePackages.kmenuedit
|
||||||
|
|
||||||
|
# Desktop menu support
|
||||||
|
kdePackages.plasma-desktop # Contains applications.menu
|
||||||
|
|
||||||
|
# KDE Online Accounts support
|
||||||
|
kdePackages.kaccounts-integration
|
||||||
|
kdePackages.kaccounts-providers
|
||||||
|
kdePackages.signond
|
||||||
|
|
||||||
|
# KDE Mapping
|
||||||
|
kdePackages.marble # Virtual globe and world atlas
|
||||||
|
|
||||||
|
# KDE Productivity
|
||||||
|
kdePackages.kate # Advanced text editor with syntax highlighting
|
||||||
|
kdePackages.okular # Universal document viewer (PDF, ePub, etc.)
|
||||||
|
kdePackages.spectacle # Screenshot capture utility
|
||||||
|
kdePackages.filelight # Visual disk usage analyzer
|
||||||
|
|
||||||
|
# KDE Multimedia
|
||||||
|
kdePackages.gwenview # Image viewer and basic editor
|
||||||
|
kdePackages.elisa # Music player
|
||||||
|
|
||||||
|
# KDE System Utilities
|
||||||
|
kdePackages.ark # Archive manager (zip, tar, 7z, etc.)
|
||||||
|
kdePackages.yakuake # Drop-down terminal emulator
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.firefox = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.spotify-player.enable = true;
|
||||||
|
|
||||||
|
services.gnome-keyring = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# KDE environment variables for proper integration
|
||||||
|
home.sessionVariables = {
|
||||||
|
QT_QPA_PLATFORMTHEME = "kde";
|
||||||
|
KDE_SESSION_VERSION = "6";
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Ensure desktop files are made available for discovery
|
||||||
|
desktopEntries = {}; # This creates the desktop files directory structure
|
||||||
|
|
||||||
|
mimeApps = {
|
||||||
|
enable = true;
|
||||||
|
associations.added = {
|
||||||
|
# Ensure associations are properly registered
|
||||||
|
"text/html" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/http" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/https" = "firefox.desktop";
|
||||||
|
};
|
||||||
|
defaultApplications = {
|
||||||
|
# Web browsers
|
||||||
|
"text/html" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/http" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/https" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/about" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/unknown" = "firefox.desktop";
|
||||||
|
|
||||||
|
# Documents
|
||||||
|
"application/pdf" = "okular.desktop";
|
||||||
|
"text/plain" = "kate.desktop";
|
||||||
|
"text/x-tex" = "kate.desktop";
|
||||||
|
"text/x-c" = "kate.desktop";
|
||||||
|
"text/x-python" = "kate.desktop";
|
||||||
|
"application/x-shellscript" = "kate.desktop";
|
||||||
|
|
||||||
|
# Images
|
||||||
|
"image/png" = "gwenview.desktop";
|
||||||
|
"image/jpeg" = "gwenview.desktop";
|
||||||
|
"image/jpg" = "gwenview.desktop";
|
||||||
|
"image/gif" = "gwenview.desktop";
|
||||||
|
"image/bmp" = "gwenview.desktop";
|
||||||
|
"image/tiff" = "gwenview.desktop";
|
||||||
|
"image/webp" = "gwenview.desktop";
|
||||||
|
|
||||||
|
# Archives
|
||||||
|
"application/zip" = "ark.desktop";
|
||||||
|
"application/x-tar" = "ark.desktop";
|
||||||
|
"application/x-compressed-tar" = "ark.desktop";
|
||||||
|
"application/x-7z-compressed" = "ark.desktop";
|
||||||
|
"application/x-rar" = "ark.desktop";
|
||||||
|
|
||||||
|
# Audio
|
||||||
|
"audio/mpeg" = "elisa.desktop";
|
||||||
|
"audio/mp4" = "elisa.desktop";
|
||||||
|
"audio/flac" = "elisa.desktop";
|
||||||
|
"audio/ogg" = "elisa.desktop";
|
||||||
|
"audio/wav" = "elisa.desktop";
|
||||||
|
|
||||||
|
# Email
|
||||||
|
"message/rfc822" = "kmail.desktop";
|
||||||
|
"x-scheme-handler/mailto" = "kmail.desktop";
|
||||||
|
|
||||||
|
# Calendar
|
||||||
|
"text/calendar" = "korganizer.desktop";
|
||||||
|
"application/x-vnd.akonadi.calendar.event" = "korganizer.desktop";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Fix for KDE applications.menu file issue on Plasma 6
|
||||||
|
# KDE still looks for applications.menu but Plasma 6 renamed it to plasma-applications.menu
|
||||||
|
xdg.configFile."menus/applications.menu".source = "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||||
|
|
||||||
|
# Note: modules must be imported at top-level home config
|
||||||
|
};
|
||||||
|
}
|
||||||
26
home/roles/development/default.nix
Normal file
26
home/roles/development/default.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, pkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.development;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.development = {
|
||||||
|
enable = mkEnableOption "Enable development tools and utilities";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [
|
||||||
|
pkgs.unstable.claude-code
|
||||||
|
pkgs.codex
|
||||||
|
|
||||||
|
# Custom packages
|
||||||
|
pkgs.custom.tea-rbw
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.kubectl-secure.enable = true;
|
||||||
|
|
||||||
|
# Note: modules must be imported at top-level home config
|
||||||
|
};
|
||||||
|
}
|
||||||
20
home/roles/gaming/default.nix
Normal file
20
home/roles/gaming/default.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.gaming;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.gaming = {
|
||||||
|
enable = mkEnableOption "Enable gaming applications and tools";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Gaming applications would go here
|
||||||
|
# This role is created for future expansion
|
||||||
|
# moonlight-qt is currently in media role but could be moved here
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
20
home/roles/kdeconnect/default.nix
Normal file
20
home/roles/kdeconnect/default.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.kdeconnect;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.kdeconnect = {
|
||||||
|
enable = mkEnableOption "Enable KDE Connect for device integration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.kdeconnect = {
|
||||||
|
enable = true;
|
||||||
|
indicator = true;
|
||||||
|
package = pkgs.kdePackages.kdeconnect-kde;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
27
home/roles/media/default.nix
Normal file
27
home/roles/media/default.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.media;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.media = {
|
||||||
|
enable = mkEnableOption "Enable media and multimedia applications";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Media players and streaming
|
||||||
|
# Using delfin instead of jellyfin-media-player to avoid qtwebengine security issues
|
||||||
|
# For full Jellyfin features, use web interface at http://jellyfin-server:8096
|
||||||
|
delfin
|
||||||
|
moonlight-qt
|
||||||
|
vlc
|
||||||
|
|
||||||
|
# Spotify client
|
||||||
|
# Using unstable version for better authentication support
|
||||||
|
unstable.ncspot
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
22
home/roles/office/default.nix
Normal file
22
home/roles/office/default.nix
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.office;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.office = {
|
||||||
|
enable = mkEnableOption "Enable office applications and document processing tools";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Office suite
|
||||||
|
libreoffice
|
||||||
|
|
||||||
|
# CAD/Design tools
|
||||||
|
openscad-unstable
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
22
home/roles/sync/default.nix
Normal file
22
home/roles/sync/default.nix
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.home.roles.sync;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.home.roles.sync = {
|
||||||
|
enable = mkEnableOption "Enable file synchronization services";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
syncthingtray
|
||||||
|
];
|
||||||
|
|
||||||
|
services.syncthing = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
BIN
home/wallpapers/metroid-samus-returns-kz-3440x1440.jpg
Normal file
BIN
home/wallpapers/metroid-samus-returns-kz-3440x1440.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
@@ -2,7 +2,7 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
{ lib, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
@@ -14,11 +14,20 @@ with lib;
|
|||||||
|
|
||||||
roles = {
|
roles = {
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
gaming.enable = true;
|
||||||
|
kde = true;
|
||||||
|
sddm = true;
|
||||||
|
wayland = true;
|
||||||
|
};
|
||||||
kodi = {
|
kodi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autologin = true;
|
autologin = true;
|
||||||
wayland = false;
|
wayland = true;
|
||||||
};
|
};
|
||||||
|
users.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
@@ -27,9 +36,15 @@ with lib;
|
|||||||
|
|
||||||
networking.hostName = "boxy"; # Define your hostname.
|
networking.hostName = "boxy"; # Define your hostname.
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
hardware.graphics.enable = true;
|
hardware.graphics.enable = true;
|
||||||
|
hardware.graphics.enable32Bit = true;
|
||||||
#services.displayManager.enable = mkForce false;
|
hardware.graphics.extraPackages = with pkgs; [
|
||||||
|
amdvlk
|
||||||
|
];
|
||||||
|
hardware.graphics.extraPackages32 = with pkgs; [
|
||||||
|
driversi686Linux.amdvlk
|
||||||
|
];
|
||||||
|
|
||||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
|||||||
23
machines/johno-macbookpro/configuration.nix
Normal file
23
machines/johno-macbookpro/configuration.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Basic system configuration for macOS work laptop
|
||||||
|
system.stateVersion = 6;
|
||||||
|
|
||||||
|
# Set primary user for nix-darwin
|
||||||
|
system.primaryUser = "johno";
|
||||||
|
|
||||||
|
# System preferences (can be expanded later)
|
||||||
|
system.defaults = {
|
||||||
|
dock.autohide = true;
|
||||||
|
finder.AppleShowAllExtensions = true;
|
||||||
|
NSGlobalDomain.AppleShowAllExtensions = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO: Find a way to not duplicate this
|
||||||
|
launchd.user.envVariables = {
|
||||||
|
# DOOM Emacs environment variables
|
||||||
|
DOOMDIR = "/Users/johno/.config/doom";
|
||||||
|
DOOMLOCALDIR = "/Users/johno/.local/doom";
|
||||||
|
};
|
||||||
|
}
|
||||||
91
machines/live-usb/configuration.nix
Normal file
91
machines/live-usb/configuration.nix
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# Live USB ISO configuration for recovery and installation
|
||||||
|
{ pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Use minimal installation CD as base
|
||||||
|
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
# Use roles structure for consistent configuration
|
||||||
|
roles = {
|
||||||
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
kde = true;
|
||||||
|
x11 = true;
|
||||||
|
wayland = true;
|
||||||
|
sddm = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow unfree packages for broader hardware support
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# Essential packages for system recovery and installation
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Text editors
|
||||||
|
neovim
|
||||||
|
nano
|
||||||
|
|
||||||
|
# System tools
|
||||||
|
git
|
||||||
|
curl
|
||||||
|
wget
|
||||||
|
htop
|
||||||
|
tree
|
||||||
|
lsof
|
||||||
|
strace
|
||||||
|
|
||||||
|
# Filesystem tools
|
||||||
|
btrfs-progs
|
||||||
|
e2fsprogs
|
||||||
|
xfsprogs
|
||||||
|
ntfs3g
|
||||||
|
dosfstools
|
||||||
|
|
||||||
|
# Network tools
|
||||||
|
networkmanager
|
||||||
|
wirelesstools
|
||||||
|
|
||||||
|
# Hardware tools
|
||||||
|
pciutils
|
||||||
|
usbutils
|
||||||
|
smartmontools
|
||||||
|
|
||||||
|
# Archive tools
|
||||||
|
unzip
|
||||||
|
p7zip
|
||||||
|
|
||||||
|
# Development tools (for quick fixes)
|
||||||
|
gcc
|
||||||
|
binutils
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enable NetworkManager for easy wifi setup
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
# Disable wireless networking (conflicts with NetworkManager)
|
||||||
|
networking.wireless.enable = false;
|
||||||
|
|
||||||
|
# Enable SSH daemon for remote access
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = "yes";
|
||||||
|
PasswordAuthentication = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# ISO customization
|
||||||
|
isoImage = {
|
||||||
|
volumeID = "NIXOS-LIVE";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable some useful services
|
||||||
|
services.udisks2.enable = true; # For mounting USB drives
|
||||||
|
|
||||||
|
# Hardware support
|
||||||
|
hardware.enableAllFirmware = true;
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
}
|
||||||
@@ -12,9 +12,21 @@
|
|||||||
roles = {
|
roles = {
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
desktop.enable = true;
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
wayland = true;
|
||||||
|
gaming.enable = false;
|
||||||
|
kde = true;
|
||||||
|
sddm = true;
|
||||||
|
};
|
||||||
nfs-mounts.enable = true;
|
nfs-mounts.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
|
remote-build.builders = [{
|
||||||
|
hostName = "zix790prors";
|
||||||
|
maxJobs = 16;
|
||||||
|
speedFactor = 3;
|
||||||
|
}];
|
||||||
|
spotifyd.enable = true;
|
||||||
users = {
|
users = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraGroups = [ "video" ];
|
extraGroups = [ "video" ];
|
||||||
@@ -30,11 +42,16 @@
|
|||||||
networking.hostName = "nix-book"; # Define your hostname.
|
networking.hostName = "nix-book"; # Define your hostname.
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
|
|
||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# WireGuard setup
|
||||||
|
networking.wg-quick.interfaces = {
|
||||||
|
ogleNet = {
|
||||||
|
configFile = "/root/Oglehome-VPN-johno-nixbook.conf";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
|
|||||||
@@ -10,15 +10,27 @@
|
|||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "sdhci_pci" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "sdhci_pci" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.initrd.luks.devices."luks-4126fbd4-bd09-4ece-af0d-6fff414c21b3".device = "/dev/disk/by-uuid/4126fbd4-bd09-4ece-af0d-6fff414c21b3";
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
roles.btrfs = {
|
||||||
{ device = "/dev/disk/by-uuid/bd396529-e2c4-47cb-b844-8d6ed841f81a";
|
enable = true;
|
||||||
fsType = "ext4";
|
filesystems."/dev/disk/by-uuid/223a44e5-91e2-4272-830e-129166042a1d" = {
|
||||||
|
mountpoints = {
|
||||||
|
"/" = {
|
||||||
|
compression = "zstd";
|
||||||
|
extraOptions = [ "noatime" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrub.enable = true;
|
||||||
|
deduplication = {
|
||||||
|
enable = true;
|
||||||
|
hashTableSizeMB = 32;
|
||||||
|
verbosity = "err";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd.luks.devices."luks-4126fbd4-bd09-4ece-af0d-6fff414c21b3".device = "/dev/disk/by-uuid/4126fbd4-bd09-4ece-af0d-6fff414c21b3";
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{ device = "/dev/disk/by-uuid/7A0B-CF88";
|
{ device = "/dev/disk/by-uuid/7A0B-CF88";
|
||||||
@@ -29,6 +41,7 @@
|
|||||||
swapDevices =
|
swapDevices =
|
||||||
[ { device = "/dev/disk/by-uuid/ec1f70ea-27b6-4646-ad3b-eac41bd83e3e"; }
|
[ { device = "/dev/disk/by-uuid/ec1f70ea-27b6-4646-ad3b-eac41bd83e3e"; }
|
||||||
];
|
];
|
||||||
|
zramSwap.enable = true;
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
|||||||
223
machines/nix-book/nixbook-btrfs-migration.md
Normal file
223
machines/nix-book/nixbook-btrfs-migration.md
Normal file
@@ -0,0 +1,223 @@
|
|||||||
|
# NixBook ext4 to btrfs Migration Guide
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
This guide converts your nixbook machine from ext4 to btrfs with zstd compression and beesd deduplication while preserving your LUKS encryption and all data.
|
||||||
|
|
||||||
|
## Current System Info
|
||||||
|
- **Hostname**: nix-book
|
||||||
|
- **Root filesystem**: ext4 on `/dev/disk/by-uuid/bd396529-e2c4-47cb-b844-8d6ed841f81a`
|
||||||
|
- **Encryption**: LUKS with two devices configured
|
||||||
|
- **Current usage**: 138GB used / 225GB total (65% full)
|
||||||
|
- **Free space**: 76GB available (sufficient for conversion)
|
||||||
|
|
||||||
|
## Pre-Migration Checklist
|
||||||
|
|
||||||
|
### 1. Create Full System Backup (CRITICAL)
|
||||||
|
```bash
|
||||||
|
# Boot from NixOS live USB
|
||||||
|
# Mount encrypted filesystem
|
||||||
|
cryptsetup luksOpen /dev/disk/by-uuid/4126fbd4-bd09-4ece-af0d-6fff414c21b3 luks-nixbook
|
||||||
|
mount /dev/mapper/luks-nixbook /mnt
|
||||||
|
|
||||||
|
# Create backup to external drive (adjust target as needed)
|
||||||
|
rsync -avxHAX --progress /mnt/ /path/to/backup/nixbook-backup/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Verify Configuration Changes
|
||||||
|
The following files have been updated for btrfs:
|
||||||
|
- `machines/nix-book/configuration.nix` - Added beesd service
|
||||||
|
- `machines/nix-book/hardware-configuration.nix` - Changed fsType to btrfs with compression
|
||||||
|
|
||||||
|
## Migration Process
|
||||||
|
|
||||||
|
### Phase 1: Boot to Live Environment
|
||||||
|
1. **Create NixOS live USB**:
|
||||||
|
```bash
|
||||||
|
# Download latest NixOS ISO
|
||||||
|
# Flash to USB drive
|
||||||
|
dd if=nixos-minimal-xx.xx-x86_64-linux.iso of=/dev/sdX bs=4M status=progress
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Boot from live USB** and ensure you can access the encrypted drives
|
||||||
|
|
||||||
|
### Phase 2: Filesystem Conversion
|
||||||
|
3. **Unlock LUKS volumes**:
|
||||||
|
```bash
|
||||||
|
cryptsetup luksOpen /dev/disk/by-uuid/4126fbd4-bd09-4ece-af0d-6fff414c21b3 luks-nixbook
|
||||||
|
cryptsetup luksOpen /dev/disk/by-uuid/b614167b-9045-4234-a441-ac6f60a96d81 luks-nixbook2
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Check filesystem before conversion**:
|
||||||
|
```bash
|
||||||
|
fsck.ext4 -f /dev/mapper/luks-nixbook
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **Convert ext4 to btrfs** (this preserves all data):
|
||||||
|
```bash
|
||||||
|
# Install btrfs-progs if not available
|
||||||
|
nix-shell -p btrfs-progs
|
||||||
|
|
||||||
|
# Convert the filesystem (takes 15-45 minutes depending on data)
|
||||||
|
btrfs-convert /dev/mapper/luks-nixbook
|
||||||
|
|
||||||
|
# Verify conversion succeeded
|
||||||
|
mount /dev/mapper/luks-nixbook /mnt
|
||||||
|
ls -la /mnt # Should show your normal filesystem
|
||||||
|
btrfs filesystem show /mnt
|
||||||
|
```
|
||||||
|
|
||||||
|
6. **Get new filesystem UUID** (may have changed):
|
||||||
|
```bash
|
||||||
|
blkid /dev/mapper/luks-nixbook
|
||||||
|
# Note the new UUID if it changed
|
||||||
|
```
|
||||||
|
|
||||||
|
### Phase 3: Configuration Update
|
||||||
|
7. **Mount and chroot into system**:
|
||||||
|
```bash
|
||||||
|
mount -o compress=zstd,noatime /dev/mapper/luks-nixbook /mnt
|
||||||
|
mount /dev/disk/by-uuid/7A0B-CF88 /mnt/boot
|
||||||
|
nixos-enter --root /mnt
|
||||||
|
```
|
||||||
|
|
||||||
|
8. **Update hardware-configuration.nix** if UUID changed:
|
||||||
|
```bash
|
||||||
|
# Edit /etc/nixos/hardware-configuration.nix if needed
|
||||||
|
# Update the UUID in fileSystems."/" section
|
||||||
|
```
|
||||||
|
|
||||||
|
9. **Rebuild system with btrfs configuration**:
|
||||||
|
```bash
|
||||||
|
cd /home/johno/nixos-configs
|
||||||
|
nixos-rebuild switch --flake .#nix-book
|
||||||
|
```
|
||||||
|
|
||||||
|
### Phase 4: Enable Compression and Deduplication
|
||||||
|
10. **Reboot into new btrfs system**:
|
||||||
|
```bash
|
||||||
|
exit # Exit chroot
|
||||||
|
umount -R /mnt
|
||||||
|
reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
11. **Verify btrfs is working**:
|
||||||
|
```bash
|
||||||
|
mount | grep btrfs
|
||||||
|
btrfs filesystem usage /
|
||||||
|
```
|
||||||
|
|
||||||
|
12. **Enable and start beesd**:
|
||||||
|
```bash
|
||||||
|
systemctl status beesd-root
|
||||||
|
systemctl start beesd-root
|
||||||
|
systemctl enable beesd-root
|
||||||
|
```
|
||||||
|
|
||||||
|
13. **Force compression on existing files** (optional but recommended):
|
||||||
|
```bash
|
||||||
|
# This will compress existing files with zstd
|
||||||
|
btrfs filesystem defragment -r -czstd /
|
||||||
|
```
|
||||||
|
|
||||||
|
## Post-Migration Verification
|
||||||
|
|
||||||
|
### Check System Health
|
||||||
|
```bash
|
||||||
|
# Verify btrfs health
|
||||||
|
btrfs scrub start /
|
||||||
|
btrfs scrub status /
|
||||||
|
|
||||||
|
# Check compression effectiveness
|
||||||
|
compsize /
|
||||||
|
|
||||||
|
# Monitor beesd deduplication
|
||||||
|
journalctl -u beesd-root -f
|
||||||
|
|
||||||
|
# Check filesystem usage
|
||||||
|
btrfs filesystem usage /
|
||||||
|
df -h /
|
||||||
|
```
|
||||||
|
|
||||||
|
### Performance Monitoring
|
||||||
|
```bash
|
||||||
|
# Monitor beesd hash table
|
||||||
|
ls -lh /.beeshash
|
||||||
|
|
||||||
|
# Check compression ratio over time
|
||||||
|
compsize /home /nix /var
|
||||||
|
```
|
||||||
|
|
||||||
|
## Expected Benefits
|
||||||
|
|
||||||
|
### Space Savings
|
||||||
|
- **Compression**: 20-30% reduction in disk usage from zstd
|
||||||
|
- **Deduplication**: Additional 10-20% savings on duplicate files
|
||||||
|
- **Combined**: Potentially 30-40% total space savings
|
||||||
|
|
||||||
|
### Performance Impact
|
||||||
|
- **Compression**: Minimal CPU overhead, often improves I/O performance
|
||||||
|
- **Deduplication**: Background process, minimal impact during normal use
|
||||||
|
- **Overall**: Should be neutral to positive performance impact
|
||||||
|
|
||||||
|
## Rollback Plan (Emergency)
|
||||||
|
|
||||||
|
If something goes wrong:
|
||||||
|
|
||||||
|
1. **Boot from live USB**
|
||||||
|
2. **Restore from backup**:
|
||||||
|
```bash
|
||||||
|
cryptsetup luksOpen /dev/disk/by-uuid/4126fbd4-bd09-4ece-af0d-6fff414c21b3 luks-nixbook
|
||||||
|
mkfs.ext4 /dev/mapper/luks-nixbook
|
||||||
|
mount /dev/mapper/luks-nixbook /mnt
|
||||||
|
rsync -avxHAX --progress /path/to/backup/nixbook-backup/ /mnt/
|
||||||
|
```
|
||||||
|
3. **Restore original hardware-configuration.nix** with ext4 settings
|
||||||
|
4. **Rebuild and reboot**
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Common Issues
|
||||||
|
|
||||||
|
**"Device busy" during conversion**:
|
||||||
|
- Ensure no processes are accessing the filesystem
|
||||||
|
- Check with `lsof` and `fuser`
|
||||||
|
|
||||||
|
**UUID changed after conversion**:
|
||||||
|
- Update hardware-configuration.nix with new UUID
|
||||||
|
- Regenerate initrd: `nixos-rebuild switch`
|
||||||
|
|
||||||
|
**Beesd service fails to start**:
|
||||||
|
- Check disk space for hash table
|
||||||
|
- Verify filesystem is btrfs: `mount | grep btrfs`
|
||||||
|
- Check logs: `journalctl -u beesd-root`
|
||||||
|
|
||||||
|
**Boot issues after conversion**:
|
||||||
|
- Boot from live USB
|
||||||
|
- Check /boot partition is mounted correctly
|
||||||
|
- Verify LUKS UUIDs match in configuration
|
||||||
|
- Rebuild bootloader: `nixos-rebuild switch --install-bootloader`
|
||||||
|
|
||||||
|
## Maintenance
|
||||||
|
|
||||||
|
### Regular Tasks
|
||||||
|
```bash
|
||||||
|
# Monthly scrub (checks for corruption)
|
||||||
|
btrfs scrub start /
|
||||||
|
|
||||||
|
# Monitor compression effectiveness
|
||||||
|
compsize /
|
||||||
|
|
||||||
|
# Check beesd deduplication status
|
||||||
|
systemctl status beesd-root
|
||||||
|
```
|
||||||
|
|
||||||
|
### Space Management
|
||||||
|
```bash
|
||||||
|
# Balance filesystem (defragments and optimizes)
|
||||||
|
btrfs balance start -dusage=50 /
|
||||||
|
|
||||||
|
# Check for space issues
|
||||||
|
btrfs filesystem usage /
|
||||||
|
```
|
||||||
|
|
||||||
|
This migration preserves all your data while gaining the benefits of modern btrfs features including transparent compression and automatic deduplication.
|
||||||
40
machines/nix-deck/configuration.nix
Normal file
40
machines/nix-deck/configuration.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
roles = {
|
||||||
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
wayland = true;
|
||||||
|
gaming.enable = true;
|
||||||
|
kde = true;
|
||||||
|
steamos = {
|
||||||
|
enable = true;
|
||||||
|
autoStart = true;
|
||||||
|
desktopSession = "plasma";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
remote-build.builders = [{
|
||||||
|
hostName = "zix790prors";
|
||||||
|
maxJobs = 16;
|
||||||
|
speedFactor = 4; # Prefer remote heavily on Steam Deck
|
||||||
|
}];
|
||||||
|
users = {
|
||||||
|
enable = true;
|
||||||
|
extraGroups = [ "video" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Bootloader
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "nix-deck";
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
system.stateVersion = "25.05";
|
||||||
|
}
|
||||||
51
machines/nix-deck/hardware-configuration.nix
Normal file
51
machines/nix-deck/hardware-configuration.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Hardware configuration for Steam Deck (nix-deck)
|
||||||
|
# Generated from nixos-generate-config on 2025-11-17
|
||||||
|
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
# Steam Deck specific hardware configuration (Jovian)
|
||||||
|
jovian.devices.steamdeck = {
|
||||||
|
enable = true;
|
||||||
|
autoUpdate = false; # Set to true if you want automatic firmware updates
|
||||||
|
};
|
||||||
|
|
||||||
|
# Kernel modules detected by nixos-generate-config
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"usb_storage"
|
||||||
|
"uas"
|
||||||
|
"usbhid"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# IMPORTANT: Update these filesystem configurations based on your actual partition layout
|
||||||
|
# The configuration below is a placeholder - adjust according to how you partitioned the disk
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-label/boot";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [{
|
||||||
|
device = "/swapfile";
|
||||||
|
size = 8192; # 8GB swap file
|
||||||
|
}];
|
||||||
|
|
||||||
|
# AMD CPU microcode updates
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
62
machines/wixos/configuration.nix
Normal file
62
machines/wixos/configuration.nix
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
|
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
|
||||||
|
# https://github.com/nix-community/NixOS-WSL
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
];
|
||||||
|
|
||||||
|
roles = {
|
||||||
|
audio.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
wayland = true;
|
||||||
|
};
|
||||||
|
users.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hostName = "wixos";
|
||||||
|
|
||||||
|
wsl.enable = true;
|
||||||
|
wsl.defaultUser = "johno";
|
||||||
|
wsl.startMenuLaunchers = true;
|
||||||
|
wsl.useWindowsDriver = true;
|
||||||
|
wsl.wslConf.network.hostname = "wixos";
|
||||||
|
wsl.wslConf.user.default = "johno";
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
hardware.graphics = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
mesa
|
||||||
|
libvdpau-va-gl
|
||||||
|
vaapiVdpau
|
||||||
|
];
|
||||||
|
};
|
||||||
|
environment.sessionVariables = {
|
||||||
|
LD_LIBRARY_PATH = [
|
||||||
|
"/usr/lib/wsl/lib"
|
||||||
|
"/run/opengl-driver/lib"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
hardware.nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
open = true;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||||
|
};
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It's perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "24.05"; # Did you read the comment?
|
||||||
|
}
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
||||||
|
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ # Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
roles = {
|
|
||||||
audio.enable = true;
|
|
||||||
desktop = {
|
|
||||||
enable = true;
|
|
||||||
x11Only = true;
|
|
||||||
};
|
|
||||||
kodi.enable = true;
|
|
||||||
nfs-mounts.enable = true;
|
|
||||||
printing.enable = true;
|
|
||||||
spotifyd.enable = true;
|
|
||||||
users = {
|
|
||||||
enable = true;
|
|
||||||
extraGroups = [ "input" "libvirtd" ];
|
|
||||||
kids = true;
|
|
||||||
};
|
|
||||||
virtualisation.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
boot.loader.grub.useOSProber = true;
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "z790prors-nix"; # Define your hostname.
|
|
||||||
domain = "oglehome";
|
|
||||||
defaultGateway = "10.0.0.1";
|
|
||||||
nameservers = [ "10.0.0.1" ];
|
|
||||||
|
|
||||||
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
||||||
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
||||||
# replicates the default behaviour.
|
|
||||||
useDHCP = false;
|
|
||||||
|
|
||||||
interfaces.enp3s0.ipv4.addresses = [{
|
|
||||||
address = "10.0.0.37";
|
|
||||||
prefixLength = 24;
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: Figure out something with this
|
|
||||||
nix.settings.secret-key-files = /root/cache-priv-key.pem;
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "21.11"; # Did you read the comment?
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
|
||||||
boot.initrd.kernelModules = [
|
|
||||||
"nvidia"
|
|
||||||
"nvidia_modeset"
|
|
||||||
"nvidia_uvm"
|
|
||||||
"nvidia_drm"
|
|
||||||
];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
hardware.graphics.enable = true;
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
services.xserver.screenSection = ''Option "metamodes" "3440x1440_165 +0+0"'';
|
|
||||||
services.xserver.enableTearFree = true;
|
|
||||||
hardware.nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = false;
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
open = false;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.production;
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/8d996d13-6d55-4524-83a2-6f6fb47a09ea";
|
|
||||||
fsType = "btrfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/7445-C336";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/arch" =
|
|
||||||
{ device = "/dev/disk/by-label/endeavouros";
|
|
||||||
fsType = "btrfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
||||||
31
machines/zix790prors/README.org
Normal file
31
machines/zix790prors/README.org
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
* zix790prors
|
||||||
|
|
||||||
|
The re-birthed NixOS install of my 2024/2025 gaming pc / workstation.
|
||||||
|
|
||||||
|
** Specs
|
||||||
|
- **CPU:** Intel Core i7-14700K (20 cores, 28 threads, up to 5.6 GHz)
|
||||||
|
- **Memory:** 64 GB RAM
|
||||||
|
- **Storage:**
|
||||||
|
- 4TB NVMe SSD (main drive with dual-boot partitions)
|
||||||
|
- Windows 11 partition (NTFS)
|
||||||
|
- NixOS /nix/store partition (btrfs)
|
||||||
|
- Shared /games partition (btrfs, accessible from both Windows and NixOS)
|
||||||
|
- **GPU:** NVIDIA GeForce RTX 4070 Ti
|
||||||
|
- **Boot:** UEFI with 100MB EFI System Partition
|
||||||
|
|
||||||
|
This is a powerful all-purpose workstation optimized for gaming, 3D modeling, and development. It dual-boots Windows 11 with a shared btrfs /games partition accessible from both operating systems.
|
||||||
|
*** Validation
|
||||||
|
Given the above specs, I want to run shell commands to validate them for accuracy. Use the run_shell_command tool to get the results required to complete this validation. Do not return to the user until you have exhausted your self-serve options for accomplishing your task.
|
||||||
|
|
||||||
|
** BIOS Settings
|
||||||
|
|
||||||
|
**2025-09-08**
|
||||||
|
|
||||||
|
I underclocked the CPU today. I set the cpu/cache voltage offset to -50mV and lowered the P-Core multiplier from 56x to 50x. I was able to run Intel XTU benchmarks and the CPU stayed around 80C without any throttling kicking in, whereas before it would bounce around various cores at 100C with lots of throttling taking place.
|
||||||
|
|
||||||
|
My goals for this change are:
|
||||||
|
- CPU longevity
|
||||||
|
- Fan noise
|
||||||
|
- Addressing various apps that say 100C is a "critical temperature" (though I believe the CPU is rated for up to 110C)
|
||||||
|
|
||||||
|
I'm leaving some performance on the table, but it almost feels like the default settings for this CPU were to effectively be overclocked.
|
||||||
96
machines/zix790prors/configuration.nix
Normal file
96
machines/zix790prors/configuration.nix
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ # Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
roles = {
|
||||||
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
gaming = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
kde = true;
|
||||||
|
sddm = true;
|
||||||
|
wayland = true;
|
||||||
|
x11 = true;
|
||||||
|
};
|
||||||
|
nfs-mounts.enable = true;
|
||||||
|
nvidia.enable = true;
|
||||||
|
printing.enable = true;
|
||||||
|
remote-build.enableBuilder = true;
|
||||||
|
users.enable = true;
|
||||||
|
virtualisation.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.systemd-boot.configurationLimit = 20;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
boot.loader.timeout = 10;
|
||||||
|
|
||||||
|
networking.hostName = "zix790prors"; # Define your hostname.
|
||||||
|
|
||||||
|
# Enable networking
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Fix dual boot clock sync - tell Linux to use local time for hardware clock
|
||||||
|
time.hardwareClockInLocalTime = true;
|
||||||
|
|
||||||
|
# NVIDIA Graphics configuration
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
hardware.graphics.enable = true;
|
||||||
|
hardware.graphics.enable32Bit = true;
|
||||||
|
|
||||||
|
# Set DP-0 as primary display with 164.90Hz refresh rate
|
||||||
|
services.xserver.displayManager.sessionCommands = ''
|
||||||
|
${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --mode 3440x1440 --rate 164.90 --primary
|
||||||
|
'';
|
||||||
|
|
||||||
|
hardware.nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
package = pkgs.linuxPackages.nvidiaPackages.stable;
|
||||||
|
open = true;
|
||||||
|
|
||||||
|
# For gaming performance
|
||||||
|
powerManagement.enable = false;
|
||||||
|
powerManagement.finegrained = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.ollama = {
|
||||||
|
enable = true;
|
||||||
|
acceleration = "cuda";
|
||||||
|
loadModels = [ "gpt-oss" "deepseek-r1" "qwen3:30b" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
#
|
||||||
|
# Most users should NEVER change this value after the initial install, for any reason,
|
||||||
|
# even if you've upgraded your system to a new NixOS release.
|
||||||
|
#
|
||||||
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||||
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||||
|
# to actually do that.
|
||||||
|
#
|
||||||
|
# This value being lower than the current NixOS release does NOT mean your system is
|
||||||
|
# out of date, out of support, or vulnerable.
|
||||||
|
#
|
||||||
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||||
|
# and migrated your data accordingly.
|
||||||
|
#
|
||||||
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
system.stateVersion = "25.11"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
||||||
57
machines/zix790prors/hardware-configuration.nix
Normal file
57
machines/zix790prors/hardware-configuration.nix
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/11C1-EB58";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
roles.btrfs = {
|
||||||
|
enable = true;
|
||||||
|
filesystems."/dev/disk/by-uuid/ec22734b-d1a3-4c99-8c6f-86f6a8d79007" = {
|
||||||
|
mountpoints = {
|
||||||
|
"/" = {
|
||||||
|
compression = "zstd";
|
||||||
|
extraOptions = [ "noatime" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrub.enable = true;
|
||||||
|
deduplication = {
|
||||||
|
enable = true;
|
||||||
|
hashTableSizeMB = 128;
|
||||||
|
verbosity = "err";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
filesystems."/dev/disk/by-uuid/4f9844ac-c1ad-4426-8eb3-21f2306345fb" = {
|
||||||
|
mountpoints = {
|
||||||
|
"/games" = {
|
||||||
|
extraOptions = [ "noatime" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrub.enable = true;
|
||||||
|
deduplication = {
|
||||||
|
enable = true;
|
||||||
|
hashTableSizeMB = 256;
|
||||||
|
verbosity = "err";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
176
packages/app-launcher-server/app-launcher-server.py
Normal file
176
packages/app-launcher-server/app-launcher-server.py
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import json
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
import psutil
|
||||||
|
|
||||||
|
# Configure logging
|
||||||
|
logging.basicConfig(
|
||||||
|
level=logging.INFO,
|
||||||
|
format='%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
)
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Allowlisted applications that can be launched
|
||||||
|
ALLOWED_APPS = {
|
||||||
|
'firefox': 'firefox',
|
||||||
|
'kodi': 'kodi'
|
||||||
|
}
|
||||||
|
|
||||||
|
def is_app_running(app_name):
|
||||||
|
"""Check if an application is already running, returns (is_running, pid)"""
|
||||||
|
command = ALLOWED_APPS.get(app_name)
|
||||||
|
if not command:
|
||||||
|
return False, None
|
||||||
|
|
||||||
|
logger.debug(f"Looking for processes related to app '{app_name}' (command: '{command}')")
|
||||||
|
|
||||||
|
for proc in psutil.process_iter(['name', 'cmdline', 'pid']):
|
||||||
|
try:
|
||||||
|
proc_name = proc.info['name']
|
||||||
|
cmdline = proc.info['cmdline'] or []
|
||||||
|
|
||||||
|
logger.debug(f"Checking process PID {proc.info['pid']}: name='{proc_name}', cmdline={cmdline}")
|
||||||
|
|
||||||
|
# Check multiple patterns for the application:
|
||||||
|
# 1. Process name exactly matches command
|
||||||
|
# 2. Process name contains the command (e.g., "kodi.bin" contains "kodi")
|
||||||
|
# 3. Command line starts with the command
|
||||||
|
# 4. Command line contains the wrapped version (e.g., ".kodi-wrapped")
|
||||||
|
# 5. Any command line argument ends with the command executable
|
||||||
|
|
||||||
|
matches = False
|
||||||
|
match_reason = ""
|
||||||
|
|
||||||
|
if proc_name == command:
|
||||||
|
matches = True
|
||||||
|
match_reason = f"exact process name match: '{proc_name}'"
|
||||||
|
elif command in proc_name:
|
||||||
|
matches = True
|
||||||
|
match_reason = f"process name contains command: '{proc_name}' contains '{command}'"
|
||||||
|
elif cmdline and cmdline[0] == command:
|
||||||
|
matches = True
|
||||||
|
match_reason = f"exact cmdline match: '{cmdline[0]}'"
|
||||||
|
elif cmdline and cmdline[0].endswith('/' + command):
|
||||||
|
matches = True
|
||||||
|
match_reason = f"cmdline path ends with command: '{cmdline[0]}'"
|
||||||
|
elif cmdline and any(f'.{command}-wrapped' in arg for arg in cmdline):
|
||||||
|
matches = True
|
||||||
|
match_reason = f"wrapped command in cmdline: {cmdline}"
|
||||||
|
elif cmdline and any(f'{command}.bin' in arg for arg in cmdline):
|
||||||
|
matches = True
|
||||||
|
match_reason = f"binary command in cmdline: {cmdline}"
|
||||||
|
|
||||||
|
if matches:
|
||||||
|
logger.info(f"Found running {app_name} process: PID {proc.info['pid']} ({match_reason})")
|
||||||
|
return True, proc.info['pid']
|
||||||
|
|
||||||
|
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
||||||
|
continue
|
||||||
|
|
||||||
|
logger.debug(f"No running process found for {app_name}")
|
||||||
|
return False, None
|
||||||
|
|
||||||
|
class AppLauncherHandler(BaseHTTPRequestHandler):
|
||||||
|
def log_message(self, format, *args):
|
||||||
|
logger.info(format % args)
|
||||||
|
|
||||||
|
def do_GET(self):
|
||||||
|
if self.path == '/':
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header('Content-type', 'application/json')
|
||||||
|
self.end_headers()
|
||||||
|
response = {
|
||||||
|
'status': 'running',
|
||||||
|
'available_apps': list(ALLOWED_APPS.keys()),
|
||||||
|
'usage': 'POST /launch/<app_name> to launch an application'
|
||||||
|
}
|
||||||
|
self.wfile.write(json.dumps(response, indent=2).encode())
|
||||||
|
else:
|
||||||
|
self.send_error(404)
|
||||||
|
|
||||||
|
def do_POST(self):
|
||||||
|
parsed_path = urlparse(self.path)
|
||||||
|
path_parts = parsed_path.path.strip('/').split('/')
|
||||||
|
|
||||||
|
if len(path_parts) == 2 and path_parts[0] == 'launch':
|
||||||
|
app_name = path_parts[1]
|
||||||
|
self.launch_app(app_name)
|
||||||
|
else:
|
||||||
|
self.send_error(404, "Invalid endpoint. Use /launch/<app_name>")
|
||||||
|
|
||||||
|
def launch_app(self, app_name):
|
||||||
|
if app_name not in ALLOWED_APPS:
|
||||||
|
self.send_error(400, f"Application '{app_name}' not allowed. Available apps: {list(ALLOWED_APPS.keys())}")
|
||||||
|
return
|
||||||
|
|
||||||
|
command = ALLOWED_APPS[app_name]
|
||||||
|
|
||||||
|
# Check if app is already running
|
||||||
|
is_running, existing_pid = is_app_running(app_name)
|
||||||
|
if is_running:
|
||||||
|
logger.info(f"Application {app_name} is already running (PID: {existing_pid}), skipping launch")
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header('Content-type', 'application/json')
|
||||||
|
self.end_headers()
|
||||||
|
response = {
|
||||||
|
'status': 'success',
|
||||||
|
'message': f'{app_name} is already running',
|
||||||
|
'pid': existing_pid,
|
||||||
|
'already_running': True
|
||||||
|
}
|
||||||
|
self.wfile.write(json.dumps(response).encode())
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Launch the application in the background
|
||||||
|
# Ensure we have the proper environment for GUI apps
|
||||||
|
env = os.environ.copy()
|
||||||
|
|
||||||
|
logger.info(f"Launching application: {command}")
|
||||||
|
process = subprocess.Popen(
|
||||||
|
[command],
|
||||||
|
env=env,
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL,
|
||||||
|
start_new_session=True
|
||||||
|
)
|
||||||
|
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header('Content-type', 'application/json')
|
||||||
|
self.end_headers()
|
||||||
|
response = {
|
||||||
|
'status': 'success',
|
||||||
|
'message': f'Successfully launched {app_name}',
|
||||||
|
'pid': process.pid,
|
||||||
|
'already_running': False
|
||||||
|
}
|
||||||
|
self.wfile.write(json.dumps(response).encode())
|
||||||
|
|
||||||
|
except FileNotFoundError:
|
||||||
|
logger.error(f"Application not found: {command}")
|
||||||
|
self.send_error(500, f"Application '{app_name}' not found on system")
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error launching {command}: {e}")
|
||||||
|
self.send_error(500, f"Failed to launch {app_name}: {str(e)}")
|
||||||
|
|
||||||
|
def main():
|
||||||
|
port = int(sys.argv[1]) if len(sys.argv) > 1 else 8081
|
||||||
|
|
||||||
|
server = HTTPServer(('0.0.0.0', port), AppLauncherHandler)
|
||||||
|
logger.info(f"App launcher server starting on port {port}")
|
||||||
|
logger.info(f"Available applications: {list(ALLOWED_APPS.keys())}")
|
||||||
|
|
||||||
|
try:
|
||||||
|
server.serve_forever()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
logger.info("Server shutting down...")
|
||||||
|
server.server_close()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
10
packages/app-launcher-server/default.nix
Normal file
10
packages/app-launcher-server/default.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
let
|
||||||
|
python = pkgs.python3.withPackages (ps: with ps; [
|
||||||
|
psutil
|
||||||
|
]);
|
||||||
|
in
|
||||||
|
pkgs.writeShellScriptBin "app-launcher-server" ''
|
||||||
|
exec ${python}/bin/python3 ${./app-launcher-server.py} "$@"
|
||||||
|
''
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
nextcloudTalkDesktop = pkgs.callPackage ./nextcloud-talk-desktop {};
|
vulkanHDRLayer = pkgs.callPackage ./vulkan-hdr-layer {};
|
||||||
|
tea-rbw = pkgs.callPackage ./tea-rbw {};
|
||||||
|
app-launcher-server = pkgs.callPackage ./app-launcher-server {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
{ lib
|
|
||||||
, stdenv
|
|
||||||
, fetchzip
|
|
||||||
, autoPatchelfHook
|
|
||||||
|
|
||||||
, nss
|
|
||||||
, cairo
|
|
||||||
, xorg
|
|
||||||
, libxkbcommon
|
|
||||||
, alsa-lib
|
|
||||||
, at-spi2-core
|
|
||||||
, mesa
|
|
||||||
, pango
|
|
||||||
, libdrm
|
|
||||||
, vivaldi-ffmpeg-codecs
|
|
||||||
, gtk3
|
|
||||||
, libGL
|
|
||||||
, libglvnd
|
|
||||||
, systemd
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
|
||||||
pname = "nextcloud-talk-desktop";
|
|
||||||
version = "0.29.0";
|
|
||||||
|
|
||||||
# Building from source would require building also building Server and Talk components
|
|
||||||
# See https://github.com/nextcloud/talk-desktop?tab=readme-ov-file#%EF%B8%8F-prerequisites
|
|
||||||
src = fetchzip {
|
|
||||||
url = "https://github.com/nextcloud-releases/talk-desktop/releases/download/v${finalAttrs.version}/Nextcloud.Talk-linux-x64-${finalAttrs.version}.zip";
|
|
||||||
hash = "sha256-fBIeNv8tfrVTFExLQDBPhIazvbsJ7a76+W9G0cuQDlw=";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ autoPatchelfHook ];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
nss
|
|
||||||
cairo
|
|
||||||
alsa-lib
|
|
||||||
at-spi2-core
|
|
||||||
pango
|
|
||||||
libdrm
|
|
||||||
libxkbcommon
|
|
||||||
gtk3
|
|
||||||
vivaldi-ffmpeg-codecs
|
|
||||||
mesa
|
|
||||||
libGL
|
|
||||||
libglvnd
|
|
||||||
] ++ (with xorg; [libX11 libXcomposite libXdamage libXrandr libXfixes libXcursor]);
|
|
||||||
|
|
||||||
# Required to launch the application and proceed past the zygote_linux fork() process
|
|
||||||
# Fixes `Zygote could not fork`
|
|
||||||
runtimeDependencies = [ systemd ];
|
|
||||||
|
|
||||||
preInstall = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mkdir -p $out/opt
|
|
||||||
|
|
||||||
cp -r $src/* $out/opt/
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
# Link the application in $out/bin away from contents of `preInstall`
|
|
||||||
ln -s "$out/opt/Nextcloud Talk-linux-x64/Nextcloud Talk" $out/bin/${finalAttrs.pname}
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Nextcloud Talk Desktop Client Preview";
|
|
||||||
homepage = "https://github.com/nextcloud/talk-desktop";
|
|
||||||
changelog = "https://github.com/nextcloud/talk-desktop/blob/${finalAttrs.version}/CHANGELOG.md";
|
|
||||||
license = licenses.agpl3Only;
|
|
||||||
maintainers = with maintainers; [ kashw2 ];
|
|
||||||
mainProgram = finalAttrs.pname;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
58
packages/tea-rbw/default.nix
Normal file
58
packages/tea-rbw/default.nix
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.writeShellScriptBin "tea" ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Check if tea config directory exists and has authentication
|
||||||
|
TEA_CONFIG_DIR="''${XDG_CONFIG_HOME:-$HOME/.config}/tea"
|
||||||
|
TEA_CONFIG_FILE="$TEA_CONFIG_DIR/config.yml"
|
||||||
|
|
||||||
|
# Function to setup tea authentication with rbw
|
||||||
|
setup_tea_auth() {
|
||||||
|
echo "Tea authentication not found. Setting up with rbw..."
|
||||||
|
|
||||||
|
# Check if rbw is available
|
||||||
|
if ! command -v rbw &> /dev/null; then
|
||||||
|
echo "Error: rbw is not available. Please ensure rbw is installed and configured."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try to get the token from rbw
|
||||||
|
echo "Attempting to retrieve Gitea token from rbw..."
|
||||||
|
echo "Please enter the rbw entry name for your Gitea token:"
|
||||||
|
read -r rbw_entry
|
||||||
|
|
||||||
|
if ! token=$(rbw get "$rbw_entry" 2>/dev/null); then
|
||||||
|
echo "Error: Failed to retrieve token from rbw entry '$rbw_entry'"
|
||||||
|
echo "Available rbw entries:"
|
||||||
|
rbw list 2>/dev/null || echo "Failed to list rbw entries"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prompt for Gitea URL
|
||||||
|
echo "Please enter your Gitea URL (e.g., https://git.example.com):"
|
||||||
|
read -r gitea_url
|
||||||
|
|
||||||
|
# Create tea config directory if it doesn't exist
|
||||||
|
mkdir -p "$TEA_CONFIG_DIR"
|
||||||
|
|
||||||
|
# Setup tea login
|
||||||
|
if ! ${pkgs.tea}/bin/tea login add --name "default" --url "$gitea_url" --token "$token"; then
|
||||||
|
echo "Error: Failed to setup tea authentication"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Tea authentication setup complete!"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if tea is already configured
|
||||||
|
if [[ ! -f "$TEA_CONFIG_FILE" ]]; then
|
||||||
|
setup_tea_auth
|
||||||
|
elif ! ${pkgs.tea}/bin/tea whoami &>/dev/null; then
|
||||||
|
echo "Tea config exists but authentication failed. Re-running setup..."
|
||||||
|
setup_tea_auth
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Execute tea with all provided arguments
|
||||||
|
exec ${pkgs.tea}/bin/tea "$@"
|
||||||
|
''
|
||||||
34
packages/vulkan-hdr-layer/default.nix
Normal file
34
packages/vulkan-hdr-layer/default.nix
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{ lib, stdenv, fetchFromGitHub, meson, pkg-config, vulkan-loader, ninja, writeText, vulkan-headers, vulkan-utility-libraries, jq, libX11, libXrandr, libxcb, wayland, wayland-scanner }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "vulkan-hdr-layer";
|
||||||
|
version = "63d2eec";
|
||||||
|
|
||||||
|
src = (fetchFromGitHub {
|
||||||
|
owner = "Zamundaaa";
|
||||||
|
repo = "VK_hdr_layer";
|
||||||
|
rev = "869199cd2746e7f69cf19955153080842b6dacfc";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
hash = "sha256-xfVYI+Aajmnf3BTaY2Ysg5fyDO6SwDFGyU0L+F+E3is=";
|
||||||
|
}).overrideAttrs (_: {
|
||||||
|
GIT_CONFIG_COUNT = 1;
|
||||||
|
GIT_CONFIG_KEY_0 = "url.https://github.com/.insteadOf";
|
||||||
|
GIT_CONFIG_VALUE_0 = "git@github.com:";
|
||||||
|
});
|
||||||
|
|
||||||
|
nativeBuildInputs = [ vulkan-headers meson ninja pkg-config jq ];
|
||||||
|
|
||||||
|
buildInputs = [ vulkan-headers vulkan-loader vulkan-utility-libraries libX11 libXrandr libxcb wayland wayland-scanner ];
|
||||||
|
|
||||||
|
# Help vulkan-loader find the validation layers
|
||||||
|
setupHook = writeText "setup-hook" ''
|
||||||
|
addToSearchPath XDG_DATA_DIRS @out@/share
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Layers providing Vulkan HDR";
|
||||||
|
homepage = "https://github.com/Zamundaaa/VK_hdr_layer";
|
||||||
|
platforms = platforms.linux;
|
||||||
|
license = licenses.mit;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -10,9 +10,10 @@ in
|
|||||||
enable = mkEnableOption "Enable the audio role";
|
enable = mkEnableOption "Enable the audio role";
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = mkIf cfg.enable
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
easyeffects
|
||||||
paprefs
|
paprefs
|
||||||
pavucontrol
|
pavucontrol
|
||||||
pulsemixer
|
pulsemixer
|
||||||
@@ -22,11 +23,19 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
|
||||||
hardware.pulseaudio.extraConfig = "
|
services.pulseaudio = {
|
||||||
|
package = pkgs.pulseaudioFull;
|
||||||
|
extraConfig = ''
|
||||||
load-module module-combine-sink
|
load-module module-combine-sink
|
||||||
load-module module-switch-on-connect
|
load-module module-switch-on-connect
|
||||||
";
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.squeezelite = {
|
||||||
|
#enable = true;
|
||||||
|
pulseAudio = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ in
|
|||||||
enable = mkEnableOption "Enable the bluetooth role";
|
enable = mkEnableOption "Enable the bluetooth role";
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = mkIf cfg.enable
|
||||||
{
|
{
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
hardware.bluetooth.powerOnBoot = true;
|
hardware.bluetooth.powerOnBoot = true;
|
||||||
|
|||||||
173
roles/btrfs/default.nix
Normal file
173
roles/btrfs/default.nix
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.btrfs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.roles.btrfs = {
|
||||||
|
enable = mkEnableOption "Enable btrfs filesystem management";
|
||||||
|
|
||||||
|
filesystems = mkOption {
|
||||||
|
type = types.attrsOf (types.submodule {
|
||||||
|
options = {
|
||||||
|
# Filesystem-level maintenance options
|
||||||
|
scrub = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable automatic scrubbing for this filesystem";
|
||||||
|
};
|
||||||
|
interval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "weekly";
|
||||||
|
description = "Scrub interval (systemd timer format)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
deduplication = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable beesd deduplication for this filesystem";
|
||||||
|
};
|
||||||
|
hashTableSizeMB = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 1024;
|
||||||
|
description = "Hash table size in MB (should be multiple of 16)";
|
||||||
|
};
|
||||||
|
verbosity = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "info";
|
||||||
|
description = "Logging verbosity level";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
balance = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable periodic balance operations";
|
||||||
|
};
|
||||||
|
interval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "monthly";
|
||||||
|
description = "Balance interval (systemd timer format)";
|
||||||
|
};
|
||||||
|
dataUsage = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 50;
|
||||||
|
description = "Data usage threshold for balance";
|
||||||
|
};
|
||||||
|
metadataUsage = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 50;
|
||||||
|
description = "Metadata usage threshold for balance";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Mountpoint-based configuration
|
||||||
|
mountpoints = mkOption {
|
||||||
|
type = types.attrsOf (types.submodule {
|
||||||
|
options = {
|
||||||
|
subvolume = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "Subvolume name. If null, uses default subvolume.";
|
||||||
|
};
|
||||||
|
compression = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "zstd";
|
||||||
|
description = "Compression algorithm (zstd, lzo, lz4, none)";
|
||||||
|
};
|
||||||
|
autodefrag = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable automatic defragmentation";
|
||||||
|
};
|
||||||
|
extraOptions = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
description = "Additional mount options";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = {};
|
||||||
|
description = "Mountpoint configurations for this filesystem";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = {};
|
||||||
|
description = "Btrfs filesystems configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
btrfs-progs
|
||||||
|
compsize
|
||||||
|
];
|
||||||
|
|
||||||
|
# Generate fileSystems configuration from mountpoints
|
||||||
|
fileSystems = mkMerge (flatten (mapAttrsToList (device: fsCfg:
|
||||||
|
mapAttrsToList (mountpoint: mountCfg:
|
||||||
|
{
|
||||||
|
${mountpoint} = {
|
||||||
|
device = device;
|
||||||
|
fsType = "btrfs";
|
||||||
|
options =
|
||||||
|
(optional (mountCfg.subvolume != null) "subvol=${mountCfg.subvolume}") ++
|
||||||
|
[ "compress=${mountCfg.compression}" ] ++
|
||||||
|
(optional mountCfg.autodefrag "autodefrag") ++
|
||||||
|
mountCfg.extraOptions;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
) fsCfg.mountpoints
|
||||||
|
) cfg.filesystems));
|
||||||
|
|
||||||
|
# Configure scrub service using NixOS built-in
|
||||||
|
services.btrfs.autoScrub = mkIf (any (fs: fs.scrub.enable) (attrValues cfg.filesystems)) {
|
||||||
|
enable = true;
|
||||||
|
interval = "weekly"; # TODO: Make this configurable per filesystem
|
||||||
|
fileSystems = attrNames (filterAttrs (_: fs: fs.scrub.enable) cfg.filesystems);
|
||||||
|
};
|
||||||
|
|
||||||
|
# Configure beesd for filesystems with deduplication enabled
|
||||||
|
services.beesd.filesystems = mapAttrs' (device: fsCfg:
|
||||||
|
nameValuePair (replaceStrings ["/"] ["_"] (replaceStrings ["-"] ["_"] device)) {
|
||||||
|
spec = device;
|
||||||
|
hashTableSizeMB = fsCfg.deduplication.hashTableSizeMB;
|
||||||
|
verbosity = fsCfg.deduplication.verbosity;
|
||||||
|
}
|
||||||
|
) (filterAttrs (_: fs: fs.deduplication.enable) cfg.filesystems);
|
||||||
|
|
||||||
|
# Custom balance services for filesystems with balance enabled
|
||||||
|
systemd.services = mkMerge (mapAttrsToList (device: fsCfg: mkIf fsCfg.balance.enable {
|
||||||
|
"btrfs-balance-${replaceStrings ["/"] ["-"] (replaceStrings ["-"] ["_"] device)}" = {
|
||||||
|
description = "Balance btrfs filesystem ${device}";
|
||||||
|
script = ''
|
||||||
|
${pkgs.btrfs-progs}/bin/btrfs balance start \
|
||||||
|
-dusage=${toString fsCfg.balance.dataUsage} \
|
||||||
|
-musage=${toString fsCfg.balance.metadataUsage} \
|
||||||
|
${device}
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
Nice = 19;
|
||||||
|
IOSchedulingClass = "idle";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) cfg.filesystems);
|
||||||
|
|
||||||
|
# Balance timers
|
||||||
|
systemd.timers = mkMerge (mapAttrsToList (device: fsCfg: mkIf fsCfg.balance.enable {
|
||||||
|
"btrfs-balance-${replaceStrings ["/"] ["-"] (replaceStrings ["-"] ["_"] device)}" = {
|
||||||
|
description = "Periodic balance for ${device}";
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = fsCfg.balance.interval;
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) cfg.filesystems);
|
||||||
|
};
|
||||||
|
}
|
||||||
120
roles/darwin.nix
Normal file
120
roles/darwin.nix
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
# Extract the set-environment path that nix-darwin generates
|
||||||
|
setEnvironmentPath = "${config.system.build.setEnvironment}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
# Salt manages /etc/bashrc, /etc/zshrc, /etc/zshenv
|
||||||
|
# nix-darwin writes to .local variants for nix-specific configuration
|
||||||
|
|
||||||
|
# Disable nix-darwin from managing the main shell files
|
||||||
|
environment.etc."bashrc".enable = false;
|
||||||
|
environment.etc."zshrc".enable = false;
|
||||||
|
environment.etc."zshenv".enable = false;
|
||||||
|
environment.etc."zprofile".enable = false;
|
||||||
|
|
||||||
|
# Create .local files with nix environment setup
|
||||||
|
environment.etc."bash.local".text = ''
|
||||||
|
# Nix environment setup
|
||||||
|
if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then
|
||||||
|
. ${setEnvironmentPath}
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
environment.etc."zshrc.local".text = ''
|
||||||
|
# Nix environment setup (already done in zshenv.local)
|
||||||
|
'';
|
||||||
|
|
||||||
|
environment.etc."zshenv.local".text = ''
|
||||||
|
# Nix environment setup
|
||||||
|
if [[ -o rcs ]]; then
|
||||||
|
if [ -z "''${__NIX_DARWIN_SET_ENVIRONMENT_DONE-}" ]; then
|
||||||
|
. ${setEnvironmentPath}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Tell zsh how to find installed completions
|
||||||
|
for p in ''${(z)NIX_PROFILES}; do
|
||||||
|
fpath=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions $fpath)
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|
||||||
|
# System preferences
|
||||||
|
system.defaults = {
|
||||||
|
# Custom keyboard shortcuts
|
||||||
|
CustomUserPreferences = {
|
||||||
|
"com.apple.symbolichotkeys" = {
|
||||||
|
AppleSymbolicHotKeys = {
|
||||||
|
# Screenshot - Capture entire screen (Cmd+Ctrl+3)
|
||||||
|
"28" = {
|
||||||
|
enabled = true;
|
||||||
|
value = {
|
||||||
|
parameters = [ 51 20 1310720 ];
|
||||||
|
type = "standard";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# Screenshot - Capture selected portion (Cmd+Ctrl+4)
|
||||||
|
"30" = {
|
||||||
|
enabled = true;
|
||||||
|
value = {
|
||||||
|
parameters = [ 52 21 1310720 ];
|
||||||
|
type = "standard";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# Screenshot - Show screenshot toolbar (Cmd+Ctrl+5)
|
||||||
|
"184" = {
|
||||||
|
enabled = true;
|
||||||
|
value = {
|
||||||
|
parameters = [ 53 23 1310720 ];
|
||||||
|
type = "standard";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
glances
|
||||||
|
pciutils
|
||||||
|
tree
|
||||||
|
usbutils
|
||||||
|
vim
|
||||||
|
];
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
package = pkgs.nix;
|
||||||
|
# distributedBuilds = true;
|
||||||
|
# buildMachines = [{
|
||||||
|
# hostName = "z790prors.oglehome";
|
||||||
|
# system = "x86_64-linux";
|
||||||
|
# protocol = "ssh-ng";
|
||||||
|
# sshUser = "johno";
|
||||||
|
# sshKey = "/root/.ssh/id_ed25519";
|
||||||
|
# maxJobs = 3;
|
||||||
|
# speedFactor = 2;
|
||||||
|
# }];
|
||||||
|
settings = {
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
max-jobs = "auto";
|
||||||
|
trusted-users = [ "johno" ];
|
||||||
|
substituters = [
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
options = "--delete-older-than 10d";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,28 +1,23 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.roles;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./audio
|
./audio
|
||||||
./bluetooth
|
./bluetooth
|
||||||
|
./btrfs
|
||||||
./desktop
|
./desktop
|
||||||
./kodi
|
./kodi
|
||||||
./nfs-mounts
|
./nfs-mounts
|
||||||
|
./nvidia
|
||||||
./printing
|
./printing
|
||||||
./secrets
|
./remote-build
|
||||||
./spotifyd
|
./spotifyd
|
||||||
./users
|
./users
|
||||||
./virtualisation
|
./virtualisation
|
||||||
];
|
];
|
||||||
|
|
||||||
options.roles = {
|
|
||||||
enable = mkEnableOption "Enable roles";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
i18n.extraLocaleSettings = {
|
i18n.extraLocaleSettings = {
|
||||||
@@ -38,37 +33,56 @@ in
|
|||||||
};
|
};
|
||||||
time.timeZone = "America/Los_Angeles";
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us";
|
||||||
|
variant = "";
|
||||||
|
options = "caps:escape";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Don't go to emergency mode if we aren't able to mount filesystems.
|
||||||
|
# This is silly if you have multiple hard drives or partitions
|
||||||
|
# configured on a machine and then one goes away intentionally or
|
||||||
|
# unintentionally. If the system is already booting, let it continue
|
||||||
|
# to try and boot.
|
||||||
|
systemd.enableEmergencyMode = false;
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
|
||||||
git
|
git
|
||||||
|
glances
|
||||||
|
pciutils
|
||||||
|
tree
|
||||||
|
usbutils
|
||||||
|
vim
|
||||||
];
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nixFlakes;
|
package = pkgs.nix;
|
||||||
distributedBuilds = true;
|
# distributedBuilds = true;
|
||||||
buildMachines = [{
|
# buildMachines = [{
|
||||||
hostName = "z790prors.oglehome";
|
# hostName = "z790prors.oglehome";
|
||||||
system = "x86_64-linux";
|
# system = "x86_64-linux";
|
||||||
protocol = "ssh-ng";
|
# protocol = "ssh-ng";
|
||||||
sshUser = "johno";
|
# sshUser = "johno";
|
||||||
sshKey = "/root/.ssh/id_ed25519";
|
# sshKey = "/root/.ssh/id_ed25519";
|
||||||
maxJobs = 3;
|
# maxJobs = 3;
|
||||||
speedFactor = 2;
|
# speedFactor = 2;
|
||||||
}];
|
# }];
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
max-jobs = "auto";
|
max-jobs = "auto";
|
||||||
trusted-users = [ "johno" ];
|
trusted-users = [ "johno" ];
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://hyprland.cachix.org"
|
|
||||||
];
|
|
||||||
trusted-public-keys = [
|
|
||||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
randomizedDelaySec = "14m";
|
||||||
|
options = "--delete-older-than 10d";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|||||||
@@ -2,103 +2,26 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.roles.desktop;
|
|
||||||
|
|
||||||
basePackages = with pkgs; [
|
|
||||||
brightnessctl
|
|
||||||
];
|
|
||||||
|
|
||||||
x11BasePackages = with pkgs; [
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
x11OnlyPackages = with pkgs; [
|
|
||||||
emacs
|
|
||||||
];
|
|
||||||
|
|
||||||
waylandBasePackages = with pkgs; [
|
|
||||||
grim
|
|
||||||
slurp
|
|
||||||
wl-clipboard
|
|
||||||
mako
|
|
||||||
];
|
|
||||||
|
|
||||||
waylandOnlyPackages = with pkgs; [
|
|
||||||
emacs-gtk
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.roles.desktop = {
|
options.roles.desktop = {
|
||||||
enable = mkEnableOption "Enable the desktop role";
|
enable = mkEnableOption "Enable the desktop role.";
|
||||||
x11Only = mkOption {
|
|
||||||
type = types.bool;
|
x11 = mkOption { type = types.bool; default = false; description = "Enable X11 support."; };
|
||||||
default = false;
|
wayland = mkOption { type = types.bool; default = false; description = "Enable Wayland support."; };
|
||||||
|
kde = mkOption { type = types.bool; default = false; description = "Enable KDE."; };
|
||||||
|
gaming = {
|
||||||
|
enable = mkOption { type = types.bool; default = false; description = "Enable gaming support."; };
|
||||||
};
|
};
|
||||||
|
sddm = mkOption { type = types.bool; default = false; description = "Enable SDDM greeter."; };
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
imports = [
|
||||||
{
|
./x11.nix
|
||||||
services.xserver.xkb = {
|
./wayland.nix
|
||||||
layout = "us";
|
./gaming.nix
|
||||||
variant = "";
|
./kde.nix
|
||||||
options = "caps:escape";
|
./programs.nix
|
||||||
};
|
./sddm.nix
|
||||||
services.xserver.enable = true;
|
./steamos.nix
|
||||||
|
|
||||||
services.displayManager.sddm = {
|
|
||||||
enable = true;
|
|
||||||
wayland.enable = !cfg.x11Only;
|
|
||||||
};
|
|
||||||
services.desktopManager.plasma6.enable = true;
|
|
||||||
|
|
||||||
services.xserver.windowManager.i3 = {
|
|
||||||
enable = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
dmenu
|
|
||||||
i3status
|
|
||||||
i3lock
|
|
||||||
];
|
];
|
||||||
};
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
services.gnome.gnome-keyring.enable = true;
|
|
||||||
|
|
||||||
programs.sway = mkIf (!cfg.x11Only) {
|
|
||||||
enable = true;
|
|
||||||
wrapperFeatures.gtk = true;
|
|
||||||
};
|
|
||||||
programs.light.enable = mkIf (!cfg.x11Only) true;
|
|
||||||
|
|
||||||
programs.kdeconnect.enable = true;
|
|
||||||
programs.java.enable = true;
|
|
||||||
programs.steam = {
|
|
||||||
enable = true;
|
|
||||||
remotePlay.openFirewall = true;
|
|
||||||
localNetworkGameTransfers.openFirewall = true;
|
|
||||||
#package = pkgs.steam.override {
|
|
||||||
#withJava = true;
|
|
||||||
#withPrimus = true;
|
|
||||||
#extraPkgs = pkgs: [ bumblebee glxinfo ];
|
|
||||||
#};
|
|
||||||
};
|
|
||||||
services.sunshine = {
|
|
||||||
enable = true;
|
|
||||||
autoStart = true;
|
|
||||||
capSysAdmin = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
users.extraGroups.docker.members = [ "johno" ];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; mkMerge [
|
|
||||||
basePackages
|
|
||||||
x11BasePackages
|
|
||||||
(mkIf cfg.x11Only x11OnlyPackages)
|
|
||||||
# TODO: Do we need a "wayland only" mode?
|
|
||||||
(mkIf (!cfg.x11Only) waylandBasePackages)
|
|
||||||
(mkIf (!cfg.x11Only) waylandOnlyPackages)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
32
roles/desktop/gaming.nix
Normal file
32
roles/desktop/gaming.nix
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkMerge [
|
||||||
|
(mkIf (cfg.enable && cfg.gaming.enable) {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
steam
|
||||||
|
lutris
|
||||||
|
moonlight
|
||||||
|
|
||||||
|
# Emulators
|
||||||
|
dolphin-emu
|
||||||
|
dolphin-emu-primehack
|
||||||
|
retroarch-full
|
||||||
|
ryubing
|
||||||
|
];
|
||||||
|
# TODO: Remove me once dolphin-emu and dolphin-emu-primehack update
|
||||||
|
# dependencies to mbedtls from mbedtls_2 (which is currently)
|
||||||
|
# unmaintained
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [ "mbedtls-2.28.10" ];
|
||||||
|
|
||||||
|
warnings = [
|
||||||
|
"Using insecure mbedtls-2.28.10 for Dolphin Emu - check for updates regularly"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
12
roles/desktop/kde.nix
Normal file
12
roles/desktop/kde.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.kde) {
|
||||||
|
services.desktopManager.plasma6.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
37
roles/desktop/programs.nix
Normal file
37
roles/desktop/programs.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
brightnessctl
|
||||||
|
emacs-nox
|
||||||
|
moonlight-qt
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
services.gnome.gnome-keyring.enable = true;
|
||||||
|
programs.kdeconnect.enable = true;
|
||||||
|
|
||||||
|
# XDG Desktop Portal for default application handling in non-KDE environments
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
extraPortals = with pkgs; [
|
||||||
|
kdePackages.xdg-desktop-portal-kde # For KDE application integration
|
||||||
|
xdg-desktop-portal-gtk # Fallback for GTK applications
|
||||||
|
];
|
||||||
|
config = {
|
||||||
|
common = {
|
||||||
|
default = "kde";
|
||||||
|
};
|
||||||
|
i3 = {
|
||||||
|
default = ["kde" "gtk"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
15
roles/desktop/sddm.nix
Normal file
15
roles/desktop/sddm.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.sddm) {
|
||||||
|
services.displayManager.sddm = {
|
||||||
|
enable = true;
|
||||||
|
wayland.enable = (!cfg.x11 && cfg.wayland);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
51
roles/desktop/steamos.nix
Normal file
51
roles/desktop/steamos.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.roles.desktop.steamos = {
|
||||||
|
enable = mkEnableOption "SteamOS (Jovian) configuration";
|
||||||
|
|
||||||
|
autoStart = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Automatically start Steam Deck UI on boot";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "johno";
|
||||||
|
description = "User to run Steam as";
|
||||||
|
};
|
||||||
|
|
||||||
|
desktopSession = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "Desktop session to launch when switching to Desktop Mode";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableDeckyLoader = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable Decky Loader plugin system";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.enable && cfg.steamos.enable) {
|
||||||
|
jovian.steam = {
|
||||||
|
enable = true;
|
||||||
|
autoStart = cfg.steamos.autoStart;
|
||||||
|
user = cfg.steamos.user;
|
||||||
|
desktopSession = cfg.steamos.desktopSession;
|
||||||
|
};
|
||||||
|
|
||||||
|
jovian.decky-loader.enable = cfg.steamos.enableDeckyLoader;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
maliit-keyboard
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
23
roles/desktop/wayland.nix
Normal file
23
roles/desktop/wayland.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.wayland) {
|
||||||
|
programs.sway = {
|
||||||
|
enable = true;
|
||||||
|
wrapperFeatures.gtk = true;
|
||||||
|
};
|
||||||
|
programs.light.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
grim
|
||||||
|
slurp
|
||||||
|
wl-clipboard
|
||||||
|
mako
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
38
roles/desktop/x11.nix
Normal file
38
roles/desktop/x11.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.x11) {
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
windowManager.i3 = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
dmenu
|
||||||
|
i3status
|
||||||
|
i3lock
|
||||||
|
polkit_gnome # GNOME polkit authentication agent (more stable with i3)
|
||||||
|
picom # Compositor for smooth rendering (important for Nvidia)
|
||||||
|
networkmanagerapplet # NetworkManager system tray applet
|
||||||
|
ddcutil # DDC/CI monitor control for brightness
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable DDC/CI support for monitor brightness control
|
||||||
|
boot.kernelModules = [ "i2c-dev" ];
|
||||||
|
|
||||||
|
# Add ddcutil udev rules and user permissions
|
||||||
|
hardware.i2c.enable = true;
|
||||||
|
|
||||||
|
# Install ddcutil system-wide
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
ddcutil
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
64
roles/jovian-compat.nix
Normal file
64
roles/jovian-compat.nix
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{ lib, config, ... }:
|
||||||
|
|
||||||
|
# Minimal Jovian compatibility layer for NixOS stable (25.05)
|
||||||
|
# Defines only the Jovian options used by roles/desktop/steamos.nix
|
||||||
|
# No actual implementation - just option definitions to prevent evaluation errors
|
||||||
|
# REMOVE THIS FILE when all systems are on NixOS 25.11+ or unstable
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
nixosVersion = config.system.nixos.release;
|
||||||
|
isCompatibleVersion = versionOlder nixosVersion "25.11";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.jovian = {
|
||||||
|
steam = {
|
||||||
|
enable = mkEnableOption "Steam (jovian-compat stub)";
|
||||||
|
|
||||||
|
autoStart = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Auto-start Steam (jovian-compat stub)";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "user";
|
||||||
|
description = "Steam user (jovian-compat stub)";
|
||||||
|
};
|
||||||
|
|
||||||
|
desktopSession = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "Desktop session (jovian-compat stub)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
decky-loader = {
|
||||||
|
enable = mkEnableOption "Decky Loader (jovian-compat stub)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = isCompatibleVersion;
|
||||||
|
message = ''
|
||||||
|
The Jovian compatibility shim (roles/jovian-compat.nix) is only needed for NixOS 25.05 and earlier.
|
||||||
|
You are running NixOS ${nixosVersion}.
|
||||||
|
Please remove 'roles/jovian-compat.nix' from your flake.nix nixosModules list.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
# No config implementation - these options do nothing on stable systems
|
||||||
|
# steamos role is only enabled on nix-deck which uses unstable anyway
|
||||||
|
(mkIf config.jovian.steam.enable {
|
||||||
|
warnings = [
|
||||||
|
"Jovian is enabled but you're using the compatibility stub. This won't work correctly. Use NixOS unstable for Jovian support."
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -14,6 +14,18 @@ in
|
|||||||
wayland = mkOption {
|
wayland = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
|
appLauncherServer = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable HTTP app launcher server for remote control";
|
||||||
|
};
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 8081;
|
||||||
|
description = "Port for the app launcher HTTP server";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -25,39 +37,47 @@ in
|
|||||||
steam-library
|
steam-library
|
||||||
youtube
|
youtube
|
||||||
]);
|
]);
|
||||||
in {
|
in mkIf cfg.enable
|
||||||
users.extraUsers.kodi.isNormalUser = true;
|
{
|
||||||
|
users.extraUsers.kodi = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
|
||||||
|
};
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPorts = [ 8080 ];
|
allowedTCPPorts = [ 8080 ] ++ optional cfg.appLauncherServer.enable cfg.appLauncherServer.port;
|
||||||
allowedUDPPorts = [ 8080 ];
|
allowedUDPPorts = [ 8080 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = mkIf cfg.autologin {
|
environment.systemPackages = with pkgs; [
|
||||||
cage = mkIf cfg.wayland {
|
kodiPkg
|
||||||
user = "kodi";
|
wget
|
||||||
program = "${kodiPkg}/bin/kodi-standalone";
|
firefox
|
||||||
enable = true;
|
] ++ optional cfg.appLauncherServer.enable pkgs.custom.app-launcher-server;
|
||||||
|
|
||||||
|
programs.kdeconnect.enable = true;
|
||||||
|
|
||||||
|
systemd.user.services = mkIf cfg.appLauncherServer.enable {
|
||||||
|
app-launcher-server = {
|
||||||
|
description = "HTTP App Launcher Server";
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
after = [ "graphical-session.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${pkgs.custom.app-launcher-server}/bin/app-launcher-server ${toString cfg.appLauncherServer.port}";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5s";
|
||||||
|
Environment = [
|
||||||
|
"PATH=${pkgs.firefox}/bin:${kodiPkg}/bin:/run/current-system/sw/bin"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xserver = mkIf (!cfg.wayland) {
|
services.displayManager = mkIf cfg.autologin {
|
||||||
enable = true;
|
|
||||||
desktopManager.kodi = {
|
|
||||||
enable = true;
|
|
||||||
package = kodiPkg;
|
|
||||||
};
|
|
||||||
displayManager.lightdm = {
|
|
||||||
enable = true;
|
|
||||||
greeter.enable = false;
|
|
||||||
};
|
|
||||||
displayManager.sddm.enable = mkForce false;
|
|
||||||
};
|
|
||||||
displayManager = mkIf (!cfg.wayland) {
|
|
||||||
autoLogin.enable = true;
|
autoLogin.enable = true;
|
||||||
autoLogin.user = "kodi";
|
autoLogin.user = "kodi";
|
||||||
defaultSession = "kodi";
|
defaultSession = "plasma";
|
||||||
sessionData.autologinSession = "kodi";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
|
{
|
||||||
fileSystems."/media" = {
|
fileSystems."/media" = {
|
||||||
device = "10.0.0.43:/media";
|
device = "10.0.0.43:/media";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
|
|||||||
20
roles/nvidia/default.nix
Normal file
20
roles/nvidia/default.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.nvidia;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.roles.nvidia = {
|
||||||
|
enable = mkEnableOption "Enable the nvidia role";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
libva-utils
|
||||||
|
nvidia-vaapi-driver
|
||||||
|
nvtopPackages.nvidia
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -2,12 +2,16 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.printing;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.roles.printing = {
|
options.roles.printing = {
|
||||||
enable = mkEnableOption "Enable default printing setup";
|
enable = mkEnableOption "Enable default printing setup";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
|
{
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
||||||
services.avahi = {
|
services.avahi = {
|
||||||
@@ -15,5 +19,18 @@ with lib;
|
|||||||
nssmdns4 = true;
|
nssmdns4 = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hardware.printers.ensurePrinters = [{
|
||||||
|
name = "MFC-L8900CDW_series";
|
||||||
|
deviceUri = "ipp://brother.oglehome/ipp/print";
|
||||||
|
model = "everywhere";
|
||||||
|
}];
|
||||||
|
hardware.printers.ensureDefaultPrinter = "MFC-L8900CDW_series";
|
||||||
|
|
||||||
|
# Fix ensure-printers service to wait for network availability
|
||||||
|
systemd.services.ensure-printers = {
|
||||||
|
after = [ "cups.service" "network-online.target" ];
|
||||||
|
wants = [ "cups.service" "network-online.target" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
132
roles/remote-build/default.nix
Normal file
132
roles/remote-build/default.nix
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.remote-build;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.roles.remote-build = {
|
||||||
|
enableBuilder = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable this machine as a remote build host for other machines";
|
||||||
|
};
|
||||||
|
|
||||||
|
builderUser = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "nix-builder";
|
||||||
|
description = "User account for remote builders to connect as";
|
||||||
|
};
|
||||||
|
|
||||||
|
builders = mkOption {
|
||||||
|
type = types.listOf (types.submodule {
|
||||||
|
options = {
|
||||||
|
hostName = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "Hostname or IP address of the build machine";
|
||||||
|
};
|
||||||
|
|
||||||
|
systems = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ "x86_64-linux" ];
|
||||||
|
description = "Supported systems";
|
||||||
|
};
|
||||||
|
|
||||||
|
maxJobs = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 8;
|
||||||
|
description = "Maximum number of parallel build jobs";
|
||||||
|
};
|
||||||
|
|
||||||
|
speedFactor = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 2;
|
||||||
|
description = "Speed factor compared to local building (higher = prefer remote)";
|
||||||
|
};
|
||||||
|
|
||||||
|
supportedFeatures = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||||
|
description = "Supported build features";
|
||||||
|
};
|
||||||
|
|
||||||
|
sshUser = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "nix-builder";
|
||||||
|
description = "SSH user for connecting to the builder";
|
||||||
|
};
|
||||||
|
|
||||||
|
sshKey = mkOption {
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
description = "Path to SSH private key for authentication";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = [];
|
||||||
|
description = "List of remote build machines to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
fallbackToLocalBuild = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Fallback to local building if remote builders are unavailable";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
# Builder host configuration
|
||||||
|
(mkIf cfg.enableBuilder {
|
||||||
|
# Create dedicated builder user
|
||||||
|
users.users.${cfg.builderUser} = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = cfg.builderUser;
|
||||||
|
description = "Nix remote build user";
|
||||||
|
home = "/var/lib/${cfg.builderUser}";
|
||||||
|
createHome = true;
|
||||||
|
shell = pkgs.bashInteractive;
|
||||||
|
openssh.authorizedKeys.keyFiles = []; # Will be populated by client machines
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.${cfg.builderUser} = {};
|
||||||
|
|
||||||
|
# Ensure home directory has correct permissions
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /var/lib/${cfg.builderUser} 0700 ${cfg.builderUser} ${cfg.builderUser} -"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Allow builder user to perform builds
|
||||||
|
nix.settings.trusted-users = [ cfg.builderUser ];
|
||||||
|
|
||||||
|
# Allow remote builds
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Ensure nix-daemon is accessible
|
||||||
|
nix.settings.allowed-users = [ "*" ];
|
||||||
|
})
|
||||||
|
|
||||||
|
# Client configuration (machines using remote builders)
|
||||||
|
(mkIf (cfg.builders != []) {
|
||||||
|
nix.buildMachines = map (builder: {
|
||||||
|
hostName = builder.hostName;
|
||||||
|
systems = builder.systems;
|
||||||
|
maxJobs = builder.maxJobs;
|
||||||
|
speedFactor = builder.speedFactor;
|
||||||
|
supportedFeatures = builder.supportedFeatures;
|
||||||
|
sshUser = builder.sshUser;
|
||||||
|
sshKey = builder.sshKey;
|
||||||
|
}) cfg.builders;
|
||||||
|
|
||||||
|
nix.distributedBuilds = true;
|
||||||
|
|
||||||
|
# Use substitutes from remote builders
|
||||||
|
nix.extraOptions = ''
|
||||||
|
builders-use-substitutes = true
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Fallback to local build if remote unavailable
|
||||||
|
nix.settings.fallback = cfg.fallbackToLocalBuild;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{ config, lib, pkgs, inputs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
sops.defaultSopsFile = ../../secrets/secrets.yaml;
|
|
||||||
sops.defaultSopsFormat = "yaml";
|
|
||||||
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" "/home/johno/.ssh/id_ed25519" ];
|
|
||||||
sops.secrets.example_key = {};
|
|
||||||
}
|
|
||||||
@@ -10,7 +10,8 @@ in
|
|||||||
enable = mkEnableOption "Enable the spotifyd role";
|
enable = mkEnableOption "Enable the spotifyd role";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
|
{
|
||||||
roles.audio.enable = true;
|
roles.audio.enable = true;
|
||||||
|
|
||||||
services.spotifyd = {
|
services.spotifyd = {
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ in
|
|||||||
kidsPackages = with pkgs; [
|
kidsPackages = with pkgs; [
|
||||||
firefox
|
firefox
|
||||||
];
|
];
|
||||||
in {
|
in mkIf cfg.enable {
|
||||||
users.users.johno = {
|
users.users.johno = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "John Ogle";
|
description = "John Ogle";
|
||||||
extraGroups = [ "wheel" "networkmanager" "audio" ] ++ cfg.extraGroups;
|
extraGroups = [ "wheel" "networkmanager" "audio" "video" ] ++ cfg.extraGroups;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.eli = mkIf cfg.kids {
|
users.users.eli = mkIf cfg.kids {
|
||||||
|
|||||||
@@ -2,13 +2,19 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.virtualisation;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.roles.virtualisation = {
|
options.roles.virtualisation = {
|
||||||
enable = mkEnableOption "Enable virtualisation";
|
enable = mkEnableOption "Enable virtualisation";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
|
{
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
users.extraGroups.docker.members = [ "johno" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
hello: ENC[AES256_GCM,data:5ZpbPx3D8gQc1fOhViUqiCr0zLWYotB+vIBixqTbqP9XLS52y6tr5DXus0aV9mTgka5deqc=,iv:yPJaCqDD9WD56swfBjSm7A62ZTTIQDqyAKOgP1ese+U=,tag:bo8+7Ne2f9aEZSvpkt1fzA==,type:str]
|
|
||||||
example_key: ENC[AES256_GCM,data:v15bEcb0H3vaj13blg==,iv:9P3IA7ChBamo41VE8G8tj46sZqeijsO1LcvwLtEPVPA=,tag:o/lAyAYYGNLP9EjQNa/K8Q==,type:str]
|
|
||||||
example_array:
|
|
||||||
- ENC[AES256_GCM,data:3Vwa7dfNfKzRc/xpk6I=,iv:IevBgxwWdaBvZY1ywteWcfWwDIA8lK3FTWs67lLBKxw=,tag:Mx5lzUeNZ/3wJBWAl5XSBw==,type:str]
|
|
||||||
- ENC[AES256_GCM,data:epkT6WPGW5Oe/S+4HtU=,iv:N0yoDuieAaEi+NuCoCL4zrkhaDDdkttboI89m+UccjQ=,tag:OoERRByb0OM4un9oGLJQgA==,type:str]
|
|
||||||
#ENC[AES256_GCM,data:YzMFXxn3sbbHpGB4jPRtRw==,iv:TN6ogQuH7c6xtDoWt0Ew9B2f7wuaipJynvscZmaJYoU=,tag:No0UwEktEyMNBg/46P+Zmg==,type:comment]
|
|
||||||
example_number: ENC[AES256_GCM,data:jmLoVC+8YIlB2A==,iv:u9GztD/aE9UN5zWq3Am2nhYwmYt3sf8sy65MHbhVoD0=,tag:wKuf1mMr5XBJveJrz0uHPA==,type:float]
|
|
||||||
example_booleans:
|
|
||||||
- ENC[AES256_GCM,data:ZacILA==,iv:xo+7aFFQXzbJzKDY0mYTeFLf10AlnHkywDRAMHeprEM=,tag:F/OnJdqjrZP02sTLWLmnbg==,type:bool]
|
|
||||||
- ENC[AES256_GCM,data:NaFrvrs=,iv:kKDmGs9u/w5qrZ/379Jlx8AotUVADvH+eHwHCqykmkE=,tag:nD9TsmkXUm4ABaT1ABWmcg==,type:bool]
|
|
||||||
sops:
|
|
||||||
kms: []
|
|
||||||
gcp_kms: []
|
|
||||||
azure_kv: []
|
|
||||||
hc_vault: []
|
|
||||||
age:
|
|
||||||
- recipient: age1ls6a033d4p4u8h4rwazjwt8w4c4xg73wq0mdnm64jajxzcz4k9asvjnks3
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBjak9vRVJtVmJoanhEZ0hQ
|
|
||||||
MFJwMEE4UDcrRkdPRmZ6R09FSDY1aTk3Y1dNClZJYXRLNU5senR3Qzh6VmZGMlhu
|
|
||||||
bnl6VjlaUEFISnBtSTVrcEd0ZjI5Q2MKLS0tIFl1b3A5ZWVqc1gvWVZnZis0ZHFk
|
|
||||||
bWhnNVB2TUJ4YzY4NHdSVXhPc3dReTgKWRYBbBE3+oGsRNw1CROhFY+btENbShfv
|
|
||||||
gw3IdW7OoZV6JpJBOcI82eOuOkIxrmgSGDGeyy10/a5MA/cB1umm+w==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
- recipient: age12l5u7sw59u5pkwp83qm8t3ff7uv0ld2c9k3zh5j4ame9k2szcynqu7ftqe
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBGcmV3TDlNL2Zxb0h5QTYx
|
|
||||||
QkVmczA0MDc2ZnpNNU1YeFVzSXJwc3RWUmk4CjF4bHIrVU9VM3htTUxGZ2FUR256
|
|
||||||
UEovdVV2cmNIbkloS1VobTNFSDVyRG8KLS0tIEFhUk5kL3hCNGs4MGJBTmNJaVFm
|
|
||||||
b2ZBUGJ1K0lKTitKYTRUMWszQzhBU0UKBaM6t6JmWfiG+wPorGea1gqvV5RSIPyw
|
|
||||||
6yb2PcH2oZ0HrjJM5sjfu7XOWY3KneiZZikR1BpD5KvevfagWTSR/w==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
- recipient: age1fa3zqavfmqk4ssa22yne9td90gyqv9q5a8y0s8jp3xak8q7p3yjqyn7rkg
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBaMFJiNjVOb0lTcmJ3VnhH
|
|
||||||
WlRKZERRZFM3TFZBZGNSZC9GdHlHakMza21zClJ3SDdFUkVRc3oyVVU3WEtDQzBu
|
|
||||||
OEFqS3NwbHZFUlpCYlN6RW84N0F1amcKLS0tIHFZK21aTHdwZ2dWbVRrWEZDWFZj
|
|
||||||
aU1IQzdTMVhnbHhsNENwMG05dXhOU2MK8fEJea9sL5JLgltVlTI6mRDb+Tl83Iz7
|
|
||||||
4wPYvo68cn8vimXqSk45ldHRrNa3zhYai3CalQaGtDT3fkWGvSq0zQ==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
lastmodified: "2024-09-28T15:44:39Z"
|
|
||||||
mac: ENC[AES256_GCM,data:YUi+AbS6DQTmrSyOXsbkZWfWaMyKGR8fYm/MHcxmqChi8hng+UWHBZjsLBe6ef/FLH3rnP6bhfwK8KYnVS6fHvHahoqIq/BHydTsqrclnSgRAGl8Lh0yuhwISNRvP1AuW5pd50sdQaS0uGOtzOCharI/pZ9H+cmt2SB5WOCdeLs=,iv:2nBG6it3tNSLSia8hGzCcesuK9QwzB9EzfjWegjQ2kw=,tag:RGGPAPw/rQKhWA2OqLjTJw==,type:str]
|
|
||||||
pgp: []
|
|
||||||
unencrypted_suffix: _unencrypted
|
|
||||||
version: 3.9.0
|
|
||||||
Reference in New Issue
Block a user