Compare commits
162 Commits
kodi-to-wa
...
btrfs-role
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 1a857399a6 | |||
| 4620288747 | |||
| b5f2e1738f | |||
| 8e27017aa4 | |||
| 4ca9804db8 | |||
| 6417540b51 | |||
| 3f1bdc7af0 | |||
| 4d39f8a635 | |||
| 736194b8b4 | |||
| 4096dc75b9 | |||
| 18afc61e33 | |||
| 9ba6006fca | |||
| 000db04502 | |||
| 42a34a6c40 | |||
| 5e029720ef | |||
| 5289d8847b | |||
| d9e5fdb0df | |||
| fb8431da2d | |||
| e9d14167aa | |||
| 3a9348730b | |||
| 1da9e92a24 | |||
| 75baf55d5b | |||
| 692cebc839 |
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.
|
||||
110
CLAUDE.md
Normal file
110
CLAUDE.md
Normal file
@@ -0,0 +1,110 @@
|
||||
# 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)
|
||||
- **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
|
||||
|
||||
Example role usage in machine configuration:
|
||||
```nix
|
||||
roles = {
|
||||
audio.enable = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
gaming = true;
|
||||
kde = true;
|
||||
wayland = true;
|
||||
};
|
||||
users.enable = true;
|
||||
};
|
||||
```
|
||||
|
||||
## Common Commands
|
||||
|
||||
### Building and Switching Configurations
|
||||
```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
|
||||
```
|
||||
|
||||
### Available Machine Configurations
|
||||
- `nix-book`: Uses `home/home-nix-book.nix`
|
||||
- `boxy`: Gaming desktop with AMD GPU, uses `home/home.nix`
|
||||
- `wixos`: WSL configuration, uses `home/home.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.
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Adding New Machines
|
||||
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
|
||||
|
||||
### 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
|
||||
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
|
||||
328
flake.lock
generated
328
flake.lock
generated
@@ -1,38 +1,41 @@
|
||||
{
|
||||
"nodes": {
|
||||
"aquamarine": {
|
||||
"inputs": {
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"hyprwayland-scanner": [
|
||||
"hyprland",
|
||||
"hyprwayland-scanner"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1725199881,
|
||||
"narHash": "sha256-jsmipf/u1GFZE5tBUkr56CHMN6VpUWCAjfLIhvQijU0=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "aquamarine",
|
||||
"rev": "f8a687dd29ff019657498f1bd14da2fbbf0e604b",
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "aquamarine",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"google-cookie-retrieval": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1752428473,
|
||||
"narHash": "sha256-IsE7fdAYbRlZuc0H5FtPfhhuHvlxnDGoAxdlnjpVNCU=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "1fad66b55144ab6beaecd900172a21ac3c34dc52",
|
||||
"revCount": 10,
|
||||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -40,11 +43,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1725694918,
|
||||
"narHash": "sha256-+HsjshXpqNiJHLaJaK0JnIicJ/a1NquKcfn4YZ3ILgg=",
|
||||
"lastModified": 1752402455,
|
||||
"narHash": "sha256-mCHfZhQKdTj2JhCFcqfOfa3uKZbwUkPQbd0/zPnhOE8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "aaebdea769a5c10f1c6e50ebdf5924c1a13f0cda",
|
||||
"rev": "bf893ad4cbf46610dd1b620c974f824e266cd1df",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -53,197 +56,49 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hy3": {
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"hyprland": [
|
||||
"hyprland"
|
||||
]
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1725573970,
|
||||
"narHash": "sha256-KJKO4b5Gl+7t3hF+X56Y0W/Lxf2OxWl/aLgzbiN3+hI=",
|
||||
"owner": "outfoxxed",
|
||||
"repo": "hy3",
|
||||
"rev": "e91460d63627cdad417cac2c09897be58094e2e0",
|
||||
"lastModified": 1752199438,
|
||||
"narHash": "sha256-xSBMmGtq8K4Qv80TMqREmESCAsRLJRHAbFH2T/2Bf1Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "d34d9412556d3a896e294534ccd25f53b6822e80",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "outfoxxed",
|
||||
"repo": "hy3",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprcursor": {
|
||||
"inputs": {
|
||||
"hyprlang": [
|
||||
"hyprland",
|
||||
"hyprlang"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722623071,
|
||||
"narHash": "sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprcursor",
|
||||
"rev": "912d56025f03d41b1ad29510c423757b4379eb1c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprcursor",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprland": {
|
||||
"inputs": {
|
||||
"aquamarine": "aquamarine",
|
||||
"hyprcursor": "hyprcursor",
|
||||
"hyprlang": "hyprlang",
|
||||
"hyprutils": "hyprutils",
|
||||
"hyprwayland-scanner": "hyprwayland-scanner",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems",
|
||||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1725738873,
|
||||
"narHash": "sha256-8OT3XRoPoAhiYHMT/hQ6uKE4o7Z99a1Y+711oEPV+dg=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "70add904c40924a761059e4009a8c0f1e43d76a3",
|
||||
"revCount": 5194,
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/hyprwm/Hyprland"
|
||||
},
|
||||
"original": {
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/hyprwm/Hyprland"
|
||||
}
|
||||
},
|
||||
"hyprland-protocols": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"xdph",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"xdph",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1721326555,
|
||||
"narHash": "sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-protocols",
|
||||
"rev": "5a11232266bf1a1f5952d5b179c3f4b2facaaa84",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-protocols",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprlang": {
|
||||
"inputs": {
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1725188252,
|
||||
"narHash": "sha256-yBH8c4GDaEAtBrh+BqIlrx5vp6gG/Gu8fQQK63KAQgs=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprlang",
|
||||
"rev": "c12ab785ce1982f82594aff03b3104c598186ddd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprlang",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprutils": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724966483,
|
||||
"narHash": "sha256-WXDgKIbzjYKczxSZOsJplCS1i1yrTUpsDPuJV/xpYLo=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprutils",
|
||||
"rev": "8976e3f6a5357da953a09511d0c7f6a890fb6ec2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprutils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprwayland-scanner": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1721324119,
|
||||
"narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprwayland-scanner",
|
||||
"rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprwayland-scanner",
|
||||
"owner": "nix-community",
|
||||
"ref": "main",
|
||||
"repo": "NixOS-WSL",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1725634671,
|
||||
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
|
||||
"lastModified": 1751792365,
|
||||
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1751984180,
|
||||
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
|
||||
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -253,58 +108,37 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"plasma-manager": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"hy3": "hy3",
|
||||
"hyprland": "hyprland",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"xdph": {
|
||||
"inputs": {
|
||||
"hyprland-protocols": "hyprland-protocols",
|
||||
"hyprlang": [
|
||||
"hyprland",
|
||||
"hyprlang"
|
||||
"home-manager": [
|
||||
"home-manager"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1725203932,
|
||||
"narHash": "sha256-VLULC/OnI+6R9KEP2OIGk+uLJJsfRlaLouZ5gyFd2+Y=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "xdg-desktop-portal-hyprland",
|
||||
"rev": "2425e8f541525fa7409d9f26a8ffaf92a3767251",
|
||||
"lastModified": 1748196248,
|
||||
"narHash": "sha256-1iHjsH6/5UOerJEoZKE+Gx1BgAoge/YcnUsOA4wQ/BU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"rev": "b7697abe89967839b273a863a3805345ea54ab56",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "xdg-desktop-portal-hyprland",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"google-cookie-retrieval": "google-cookie-retrieval",
|
||||
"home-manager": "home-manager",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"plasma-manager": "plasma-manager"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
109
flake.nix
109
flake.nix
@@ -3,68 +3,103 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
type = "git";
|
||||
url = "https://github.com/hyprwm/Hyprland";
|
||||
submodules = true;
|
||||
plasma-manager = {
|
||||
url = "github:nix-community/plasma-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
hy3 = {
|
||||
url = "github:outfoxxed/hy3";
|
||||
inputs.hyprland.follows = "hyprland";
|
||||
|
||||
google-cookie-retrieval = {
|
||||
url = "git+https://git.johnogle.info/johno/google-cookie-retrieval.git";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... } @ inputs: {
|
||||
nixosConfigurations.z790prors-nix = nixpkgs.lib.nixosSystem {
|
||||
outputs = { self, nixpkgs, nixos-wsl, ... } @ inputs: let
|
||||
baseModules = [
|
||||
./roles
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.sharedModules = [
|
||||
inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||
];
|
||||
home-manager.extraSpecialArgs = {
|
||||
globalInputs = inputs;
|
||||
};
|
||||
}
|
||||
];
|
||||
in {
|
||||
nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./machines/z790prors/configuration.nix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.users.johno = import ./home/home-z790prors.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
modules = baseModules ++ [
|
||||
./machines/nix-book/configuration.nix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.users.johno = import ./home/home-nix-book.nix;
|
||||
home-manager.extraSpecialArgs = { inherit system; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nixosConfigurations.boxy= nixpkgs.lib.nixosSystem {
|
||||
nixosConfigurations.boxy = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
modules = baseModules ++ [
|
||||
./machines/boxy/configuration.nix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.users.johno = import ./home/home-default.nix;
|
||||
home-manager.users.johno = import ./home/home.nix;
|
||||
home-manager.extraSpecialArgs = { inherit system; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nixosConfigurations.wixos = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = baseModules ++ [
|
||||
nixos-wsl.nixosModules.default
|
||||
./machines/wixos/configuration.nix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users.johno = import ./home/home.nix;
|
||||
home-manager.extraSpecialArgs = { inherit system; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Live USB ISO configuration
|
||||
nixosConfigurations.live-usb = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = baseModules ++ [
|
||||
./machines/live-usb/configuration.nix
|
||||
{
|
||||
home-manager.users.nixos = { ... }: {
|
||||
imports = [ ./home/home.nix ];
|
||||
home.username = nixpkgs.lib.mkForce "nixos";
|
||||
home.homeDirectory = nixpkgs.lib.mkForce "/home/nixos";
|
||||
};
|
||||
home-manager.extraSpecialArgs = { inherit system; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
homeConfigurations."johno" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
|
||||
modules = [
|
||||
inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||
./home/home.nix
|
||||
];
|
||||
extraSpecialArgs = {
|
||||
system = "x86_64-linux";
|
||||
globalInputs = inputs;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
{
|
||||
imports = [
|
||||
./home-default.nix
|
||||
./modules/window_managers/hyprland/nix-book.nix
|
||||
./home.nix
|
||||
];
|
||||
|
||||
home.i3_sway.extraSwayConfig = {
|
||||
output.eDP-1.scale = "1.75";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./home-default.nix
|
||||
./modules/window_managers/hyprland/z790prors.nix
|
||||
];
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ pkgs, customPkgs, globalInputs, system, ... }:
|
||||
|
||||
with import <nixpkgs> {};
|
||||
let
|
||||
nextcloudTalkDesktop = pkgs.callPackage ./modules/applications/nextcloud-talk-desktop/package.nix {};
|
||||
customPkgs = pkgs.callPackage ../packages {};
|
||||
in
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
@@ -40,10 +39,13 @@ in
|
||||
# '')
|
||||
|
||||
pkgs.bitwarden
|
||||
pkgs.claude-code
|
||||
pkgs.codex
|
||||
pkgs.dunst
|
||||
pkgs.element-desktop
|
||||
pkgs.fd
|
||||
#pkgs.fluffychat # security vulnerability in current version
|
||||
pkgs.goose-cli
|
||||
pkgs.gzip
|
||||
pkgs.htop
|
||||
pkgs.jellyfin-media-player
|
||||
@@ -53,17 +55,24 @@ in
|
||||
pkgs.less
|
||||
pkgs.moonlight-qt
|
||||
pkgs.ncdu
|
||||
pkgs.nextcloud-talk-desktop
|
||||
pkgs.openscad-unstable
|
||||
pkgs.pandoc
|
||||
pkgs.pinentry-qt
|
||||
#pkgs.pinentry-qt
|
||||
#pkgs.pytest
|
||||
pkgs.shellcheck
|
||||
pkgs.solaar # Logitech management software
|
||||
(pkgs.snapcast.override { pulseaudioSupport = true; })
|
||||
pkgs.tmux
|
||||
pkgs.waybar
|
||||
pkgs.wofi
|
||||
pkgs.vlc
|
||||
|
||||
nextcloudTalkDesktop
|
||||
## Kubernetes cluster management
|
||||
pkgs.kubectl
|
||||
pkgs.kubernetes-helm
|
||||
|
||||
globalInputs.google-cookie-retrieval.packages.${system}.default
|
||||
];
|
||||
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||
@@ -79,9 +88,10 @@ in
|
||||
# org.gradle.console=verbose
|
||||
# org.gradle.daemon.idletimeout=3600000
|
||||
# '';
|
||||
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
|
||||
# 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
|
||||
@@ -104,21 +114,22 @@ in
|
||||
home.sessionPath = [
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
imports = [
|
||||
./modules/applications/emacs/default.nix
|
||||
./modules/games/lutris/default.nix
|
||||
./modules/window_managers/hyprland/default.nix
|
||||
./modules/window_managers/i3/default.nix
|
||||
./modules/emacs
|
||||
./modules/i3+sway
|
||||
./modules/plasma-manager
|
||||
./modules/tmux
|
||||
];
|
||||
|
||||
programs.bash.enable = true;
|
||||
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
};
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
codex() {
|
||||
local key
|
||||
key="$(rbw get openai-api-key-codex)"
|
||||
OPENAI_API_KEY="$key" command codex "$@"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
@@ -139,15 +150,6 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -180,24 +182,14 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
services.home-manager.autoUpgrade = {
|
||||
enable = true;
|
||||
frequency = "weekly";
|
||||
};
|
||||
|
||||
services.kdeconnect = {
|
||||
enable = true;
|
||||
indicator = true;
|
||||
package = pkgs.kdePackages.kdeconnect-kde;
|
||||
};
|
||||
|
||||
services.spotifyd = {
|
||||
services.gnome-keyring = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
username = "johnogle222";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.syncthing = {
|
||||
@@ -1,69 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
emacs = pkgs.emacs29;
|
||||
doomSync = (let
|
||||
git = pkgs.git;
|
||||
in ''
|
||||
export PATH=${emacs}/bin:${git}/bin:$PATH
|
||||
${config.xdg.configHome}/emacs/bin/doom sync -u -j $((`nproc`/4*3))
|
||||
'');
|
||||
in {
|
||||
home.packages = [
|
||||
pkgs.emacs-all-the-icons-fonts
|
||||
pkgs.fontconfig
|
||||
pkgs.graphviz
|
||||
pkgs.isort
|
||||
pkgs.nerdfonts
|
||||
pkgs.nil # nix lsp language server
|
||||
pkgs.nixfmt-rfc-style
|
||||
(pkgs.ripgrep.override {withPCRE2 = true;})
|
||||
pkgs.pipenv
|
||||
pkgs.poetry
|
||||
pkgs.python3
|
||||
];
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.file = {
|
||||
".config/emacs" = {
|
||||
source = fetchGit {
|
||||
url = "https://github.com/doomemacs/doomemacs.git";
|
||||
# When updating me, remember to run `doom sync`
|
||||
rev = "ac1122ae67d762e09fc6684945b52adff96cf1dc";
|
||||
};
|
||||
# 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 = [
|
||||
"${config.xdg.configHome}/emacs/bin"
|
||||
];
|
||||
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = emacs;
|
||||
};
|
||||
|
||||
xdg.configFile."doom" = {
|
||||
source = ./doom;
|
||||
# Sync doom if we updated the config
|
||||
onChange = doomSync;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
})
|
||||
47
home/modules/emacs/default.nix
Normal file
47
home/modules/emacs/default.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
doomEmacs = pkgs.fetchFromGitHub {
|
||||
owner = "doomemacs";
|
||||
repo = "doomemacs";
|
||||
rev = "8406c1ff22b95bd0f816de4a0223fa3ce3c82568";
|
||||
sha256 = "sha256-rOkgOdmLESVAbOeEM9nJTzxyI+akdk48Ed2VlktOy3Q=";
|
||||
};
|
||||
in
|
||||
{
|
||||
config = {
|
||||
home.packages = [
|
||||
pkgs.emacs
|
||||
|
||||
pkgs.emacs-all-the-icons-fonts
|
||||
pkgs.fira-code
|
||||
pkgs.fontconfig
|
||||
pkgs.graphviz
|
||||
pkgs.isort
|
||||
pkgs.nerd-fonts.fira-code
|
||||
pkgs.nerd-fonts.droid-sans-mono
|
||||
pkgs.nil # nix lsp language server
|
||||
pkgs.nixfmt-rfc-style
|
||||
(pkgs.ripgrep.override {withPCRE2 = true;})
|
||||
pkgs.pipenv
|
||||
pkgs.poetry
|
||||
pkgs.python3
|
||||
];
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.file."${config.xdg.configHome}/emacs".source = doomEmacs;
|
||||
home.sessionPath = [
|
||||
"${config.xdg.configHome}/emacs/bin"
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
DOOMDIR = "${config.xdg.configHome}/doom";
|
||||
DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
|
||||
};
|
||||
|
||||
home.file."${config.xdg.configHome}/doom".source = ./doom;
|
||||
};
|
||||
}
|
||||
@@ -28,6 +28,7 @@
|
||||
;; 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
|
||||
;; wasn't installed correctly. Font issues are rarely Doom issues!
|
||||
(setq doom-font (font-spec :family "Fira Code"))
|
||||
|
||||
;; 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
|
||||
@@ -43,7 +44,11 @@
|
||||
(setq org-directory "~/org/")
|
||||
(after! org
|
||||
(setq org-agenda-span 'week
|
||||
org-agenda-files `(,org-directory ,(concat org-directory "roam/"))
|
||||
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-agenda-custom-commands '(("n" "Agenda"
|
||||
((agenda "")
|
||||
@@ -67,6 +72,16 @@
|
||||
;; org-caldav-files nil
|
||||
;; 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)))
|
||||
|
||||
(use-package! gptel
|
||||
:defer t
|
||||
:config
|
||||
(setq! gptel-api-key (my/get-rbw-password "openai-api-key-chatgpt-el")))
|
||||
|
||||
;; 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.
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
:os
|
||||
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
|
||||
;;tty ; improve the terminal Emacs experience
|
||||
tty ; improve the terminal Emacs experience
|
||||
|
||||
:lang
|
||||
;;agda ; types of types of types of types...
|
||||
@@ -149,7 +149,7 @@
|
||||
;;lua ; one-based indices? one-based indices
|
||||
markdown ; writing docs for people to ignore
|
||||
;;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
|
||||
(org +roam2) ; organize your plain life in plain text
|
||||
;;php ; perl's insecure younger brother
|
||||
@@ -50,3 +50,5 @@
|
||||
;; (unpin! t)
|
||||
|
||||
;; (package! org-caldav)
|
||||
|
||||
(package! gptel :recipe (:nonrecursive t))
|
||||
@@ -1,9 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.gamescope
|
||||
pkgs.lutris
|
||||
pkgs.mangohud
|
||||
];
|
||||
}
|
||||
146
home/modules/i3+sway/default.nix
Normal file
146
home/modules/i3+sway/default.nix
Normal file
@@ -0,0 +1,146 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.i3_sway;
|
||||
i3_cfg = config.xsession.windowManager.i3.config;
|
||||
|
||||
shared_config = recursiveUpdate rec {
|
||||
modifier = "Mod4";
|
||||
terminal = "kitty";
|
||||
defaultWorkspace = "workspace number 1";
|
||||
|
||||
keybindings = {
|
||||
"${shared_config.modifier}+Return" = "exec ${terminal}";
|
||||
"${shared_config.modifier}+Shift+q" = "kill";
|
||||
"${shared_config.modifier}+d" = "exec ${i3_cfg.menu}";
|
||||
|
||||
"${shared_config.modifier}+h" = "focus left";
|
||||
"${shared_config.modifier}+j" = "focus down";
|
||||
"${shared_config.modifier}+k" = "focus up";
|
||||
"${shared_config.modifier}+l" = "focus right";
|
||||
|
||||
"${shared_config.modifier}+Shift+h" = "move left";
|
||||
"${shared_config.modifier}+Shift+j" = "move down";
|
||||
"${shared_config.modifier}+Shift+k" = "move up";
|
||||
"${shared_config.modifier}+Shift+l" = "move right";
|
||||
|
||||
"${shared_config.modifier}+Left" = "focus left";
|
||||
"${shared_config.modifier}+Down" = "focus down";
|
||||
"${shared_config.modifier}+Up" = "focus up";
|
||||
"${shared_config.modifier}+Right" = "focus right";
|
||||
|
||||
"${shared_config.modifier}+Shift+Left" = "move left";
|
||||
"${shared_config.modifier}+Shift+Down" = "move down";
|
||||
"${shared_config.modifier}+Shift+Up" = "move up";
|
||||
"${shared_config.modifier}+Shift+Right" = "move right";
|
||||
|
||||
#"${shared_config.modifier}+h" = "split h";
|
||||
"${shared_config.modifier}+v" = "split v";
|
||||
"${shared_config.modifier}+f" = "fullscreen toggle";
|
||||
|
||||
"${shared_config.modifier}+s" = "layout stacking";
|
||||
"${shared_config.modifier}+w" = "layout tabbed";
|
||||
"${shared_config.modifier}+e" = "layout toggle split";
|
||||
|
||||
"${shared_config.modifier}+Shift+space" = "floating toggle";
|
||||
"${shared_config.modifier}+space" = "focus mode_toggle";
|
||||
|
||||
"${shared_config.modifier}+a" = "focus parent";
|
||||
|
||||
"${shared_config.modifier}+Shift+minus" = "move scratchpad";
|
||||
"${shared_config.modifier}+minus" = "scratchpad show";
|
||||
|
||||
"${shared_config.modifier}+1" = "workspace number 1";
|
||||
"${shared_config.modifier}+2" = "workspace number 2";
|
||||
"${shared_config.modifier}+3" = "workspace number 3";
|
||||
"${shared_config.modifier}+4" = "workspace number 4";
|
||||
"${shared_config.modifier}+5" = "workspace number 5";
|
||||
"${shared_config.modifier}+6" = "workspace number 6";
|
||||
"${shared_config.modifier}+7" = "workspace number 7";
|
||||
"${shared_config.modifier}+8" = "workspace number 8";
|
||||
"${shared_config.modifier}+9" = "workspace number 9";
|
||||
"${shared_config.modifier}+0" = "workspace number 10";
|
||||
|
||||
"${shared_config.modifier}+Shift+1" =
|
||||
"move container to workspace number 1";
|
||||
"${shared_config.modifier}+Shift+2" =
|
||||
"move container to workspace number 2";
|
||||
"${shared_config.modifier}+Shift+3" =
|
||||
"move container to workspace number 3";
|
||||
"${shared_config.modifier}+Shift+4" =
|
||||
"move container to workspace number 4";
|
||||
"${shared_config.modifier}+Shift+5" =
|
||||
"move container to workspace number 5";
|
||||
"${shared_config.modifier}+Shift+6" =
|
||||
"move container to workspace number 6";
|
||||
"${shared_config.modifier}+Shift+7" =
|
||||
"move container to workspace number 7";
|
||||
"${shared_config.modifier}+Shift+8" =
|
||||
"move container to workspace number 8";
|
||||
"${shared_config.modifier}+Shift+9" =
|
||||
"move container to workspace number 9";
|
||||
"${shared_config.modifier}+Shift+0" =
|
||||
"move container to workspace number 10";
|
||||
|
||||
"${shared_config.modifier}+Shift+c" = "reload";
|
||||
"${shared_config.modifier}+Shift+r" = "restart";
|
||||
|
||||
"${shared_config.modifier}+r" = "mode resize";
|
||||
|
||||
"XF86MonBrightnessUp" = "exec brightnessctl s +5%";
|
||||
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
|
||||
};
|
||||
} cfg.extraSharedConfig;
|
||||
in {
|
||||
options.home.i3_sway = {
|
||||
extraSharedConfig = mkOption {
|
||||
default = {};
|
||||
};
|
||||
extraI3Config = mkOption {
|
||||
default = {};
|
||||
};
|
||||
extraSwayConfig = mkOption {
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
xsession.windowManager.i3 = let
|
||||
base_i3_config = recursiveUpdate shared_config {
|
||||
keybindings = {
|
||||
"${shared_config.modifier}+Shift+e" =
|
||||
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||
};
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
config = recursiveUpdate base_i3_config cfg.extraI3Config;
|
||||
};
|
||||
|
||||
wayland.windowManager.sway = let
|
||||
base_sway_config = recursiveUpdate shared_config {
|
||||
keybindings = {
|
||||
"${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'";
|
||||
};
|
||||
input = {
|
||||
"type:keyboard" = {
|
||||
xkb_options = "caps:escape";
|
||||
};
|
||||
"type:touchpad" = {
|
||||
tap = "enabled";
|
||||
tap_button_map = "lrm";
|
||||
drag = "enabled";
|
||||
natural_scroll = "disabled";
|
||||
dwt = "enabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
config = recursiveUpdate base_sway_config cfg.extraSwayConfig;
|
||||
};
|
||||
};
|
||||
}
|
||||
127
home/modules/plasma-manager/default.nix
Normal file
127
home/modules/plasma-manager/default.nix
Normal file
@@ -0,0 +1,127 @@
|
||||
{ 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-konsole" = {
|
||||
name = "Launch Konsole";
|
||||
key = "Meta+Return";
|
||||
command = "konsole";
|
||||
};
|
||||
|
||||
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+W";
|
||||
"Grid View" = "Meta+G";
|
||||
"Edit Tiles" = "Meta+T";
|
||||
|
||||
"Activate Window Demanding Attention" = "Meta+Ctrl+A";
|
||||
|
||||
"Show Desktop" = "Meta+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 Fullscreen" = "Meta+Shift+F,,Make Window Fullscreen";
|
||||
|
||||
"Window Quick Tile Bottom" = "Meta+Down";
|
||||
"Window Quick Tile Left" = "Meta+Left";
|
||||
"Window Quick Tile Right" = "Meta+Right";
|
||||
"Window Quick Tile Top" = "Meta+Up";
|
||||
|
||||
"view_actual_size" = "Meta+0";
|
||||
"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;
|
||||
};
|
||||
|
||||
kcminputrc.Libinput = {
|
||||
AccelerationProfile = "adaptive";
|
||||
PointerAcceleration = 0.5;
|
||||
};
|
||||
|
||||
kcminputrc.Mouse = {
|
||||
X11LibInputXAccelProfileFlat = false;
|
||||
XLbInptAccelProfileFlat = false;
|
||||
};
|
||||
|
||||
kdeglobals.KDE.LookAndFeelPackage = "org.kde.breezedark.desktop";
|
||||
};
|
||||
};
|
||||
}
|
||||
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
|
||||
];
|
||||
}
|
||||
@@ -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,10 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -2,25 +2,49 @@
|
||||
# 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`).
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../../roles/common/default.nix
|
||||
../../roles/nix/default.nix
|
||||
(import ../../roles/kodi/default.nix { autologin = true; wayland = true; inherit lib; inherit pkgs; })
|
||||
(import ../../roles/users/default.nix { extraGroups = []; })
|
||||
];
|
||||
|
||||
roles = {
|
||||
audio.enable = true;
|
||||
bluetooth.enable = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
gaming = true;
|
||||
kde = true;
|
||||
sddm = true;
|
||||
wayland = true;
|
||||
};
|
||||
kodi = {
|
||||
enable = true;
|
||||
autologin = false;
|
||||
wayland = true;
|
||||
};
|
||||
users.enable = true;
|
||||
};
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "boxy"; # Define your hostname.
|
||||
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
hardware.graphics.enable = true;
|
||||
hardware.graphics.enable32Bit = true;
|
||||
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,
|
||||
# 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.kernelModules = [ ];
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
|
||||
89
machines/live-usb/configuration.nix
Normal file
89
machines/live-usb/configuration.nix
Normal file
@@ -0,0 +1,89 @@
|
||||
# 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;
|
||||
|
||||
# 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;
|
||||
}
|
||||
@@ -2,21 +2,33 @@
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../../roles/common/default.nix
|
||||
(import ../../roles/desktop/default.nix { x11Only = false; inherit inputs; inherit pkgs; })
|
||||
../../roles/nfs-mounts/default.nix
|
||||
../../roles/nix/default.nix
|
||||
../../roles/printing/default.nix
|
||||
(import ../../roles/users/default.nix { extraGroups = []; })
|
||||
../../roles/virtualisation/default.nix
|
||||
];
|
||||
|
||||
roles = {
|
||||
audio.enable = true;
|
||||
bluetooth.enable = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
gaming = false;
|
||||
kde = true;
|
||||
sddm = true;
|
||||
};
|
||||
nfs-mounts.enable = true;
|
||||
printing.enable = true;
|
||||
spotifyd.enable = true;
|
||||
users = {
|
||||
enable = true;
|
||||
extraGroups = [ "video" ];
|
||||
};
|
||||
virtualisation.enable = true;
|
||||
};
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
@@ -27,6 +39,7 @@
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
|
||||
@@ -10,15 +10,27 @@
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "sdhci_pci" ];
|
||||
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.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/bd396529-e2c4-47cb-b844-8d6ed841f81a";
|
||||
fsType = "ext4";
|
||||
roles.btrfs = {
|
||||
enable = true;
|
||||
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" =
|
||||
{ device = "/dev/disk/by-uuid/7A0B-CF88";
|
||||
@@ -29,6 +41,7 @@
|
||||
swapDevices =
|
||||
[ { 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
|
||||
# (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.
|
||||
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,54 +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’).
|
||||
|
||||
{ inputs, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../../roles/common/default.nix
|
||||
(import ../../roles/desktop/default.nix { x11Only = true; inherit inputs; inherit pkgs; })
|
||||
../../roles/kids/default.nix
|
||||
(import ../../roles/kodi/default.nix { autologin = false; wayland = false; inherit lib; inherit pkgs; })
|
||||
../../roles/nfs-mounts/default.nix
|
||||
../../roles/nix/default.nix
|
||||
../../roles/printing/default.nix
|
||||
(import ../../roles/users/default.nix { extraGroups = ["input" "libvirtd"]; })
|
||||
../../roles/virtualisation/default.nix
|
||||
];
|
||||
|
||||
# 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,51 +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"];
|
||||
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;
|
||||
}
|
||||
4
packages/default.nix
Normal file
4
packages/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
vulkanHDRLayer = pkgs.callPackage ./vulkan-hdr-layer {};
|
||||
}
|
||||
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;
|
||||
};
|
||||
}
|
||||
40
roles/audio/default.nix
Normal file
40
roles/audio/default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.audio;
|
||||
in
|
||||
{
|
||||
options.roles.audio = {
|
||||
enable = mkEnableOption "Enable the audio role";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
paprefs
|
||||
pavucontrol
|
||||
pulsemixer
|
||||
];
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
services.pulseaudio = {
|
||||
package = pkgs.pulseaudioFull;
|
||||
extraConfig = ''
|
||||
load-module module-combine-sink
|
||||
load-module module-switch-on-connect
|
||||
'';
|
||||
};
|
||||
|
||||
services.squeezelite = {
|
||||
#enable = true;
|
||||
pulseAudio = true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
26
roles/bluetooth/default.nix
Normal file
26
roles/bluetooth/default.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.bluetooth;
|
||||
in
|
||||
{
|
||||
options.roles.bluetooth = {
|
||||
enable = mkEnableOption "Enable the bluetooth role";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = true;
|
||||
hardware.bluetooth.settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
|
||||
services.blueman.enable = true;
|
||||
};
|
||||
|
||||
}
|
||||
168
roles/btrfs/default.nix
Normal file
168
roles/btrfs/default.nix
Normal file
@@ -0,0 +1,168 @@
|
||||
{ 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 {
|
||||
# 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);
|
||||
};
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
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
|
||||
];
|
||||
}
|
||||
88
roles/default.nix
Normal file
88
roles/default.nix
Normal file
@@ -0,0 +1,88 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [
|
||||
./audio
|
||||
./bluetooth
|
||||
./btrfs
|
||||
./desktop
|
||||
./kodi
|
||||
./nfs-mounts
|
||||
./printing
|
||||
./spotifyd
|
||||
./users
|
||||
./virtualisation
|
||||
];
|
||||
|
||||
config = {
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
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.
|
||||
services.openssh.enable = true;
|
||||
|
||||
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;
|
||||
randomizedDelaySec = "14m";
|
||||
options = "--delete-older-than 10d";
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
};
|
||||
}
|
||||
@@ -1,50 +1,24 @@
|
||||
{ inputs, x11Only ? false, pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
options = "caps:escape";
|
||||
};
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager = {
|
||||
lightdm.enable = true;
|
||||
};
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
programs.hyprland = {
|
||||
enable = !x11Only;
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
};
|
||||
services.xserver.windowManager.i3 = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
dmenu
|
||||
i3status
|
||||
i3lock
|
||||
];
|
||||
};
|
||||
# Helps with i3. Not sure what dconf is though honestly
|
||||
programs.dconf.enable = true;
|
||||
options.roles.desktop = {
|
||||
enable = mkEnableOption "Enable the desktop role.";
|
||||
|
||||
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;
|
||||
x11 = mkOption { type = types.bool; default = false; description = "Enable X11 support."; };
|
||||
wayland = mkOption { type = types.bool; default = false; description = "Enable Wayland support."; };
|
||||
kde = mkOption { type = types.bool; default = false; description = "Enable KDE."; };
|
||||
gaming = mkOption { type = types.bool; default = false; description = "Enable gaming support."; };
|
||||
sddm = mkOption { type = types.bool; default = false; description = "Enable SDDM greeter."; };
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
users.extraGroups.docker.members = [ "johno" ];
|
||||
imports = [
|
||||
./x11.nix
|
||||
./wayland.nix
|
||||
./gaming.nix
|
||||
./kde.nix
|
||||
./programs.nix
|
||||
./sddm.nix
|
||||
];
|
||||
}
|
||||
|
||||
18
roles/desktop/gaming.nix
Normal file
18
roles/desktop/gaming.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.desktop;
|
||||
in
|
||||
{
|
||||
config = mkIf (cfg.enable && cfg.gaming) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
steam
|
||||
lutris
|
||||
moonlight
|
||||
];
|
||||
|
||||
# Possibly other gaming specific services or settings
|
||||
};
|
||||
}
|
||||
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;
|
||||
};
|
||||
}
|
||||
20
roles/desktop/programs.nix
Normal file
20
roles/desktop/programs.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ 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;
|
||||
};
|
||||
}
|
||||
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);
|
||||
};
|
||||
};
|
||||
}
|
||||
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
|
||||
];
|
||||
};
|
||||
}
|
||||
19
roles/desktop/x11.nix
Normal file
19
roles/desktop/x11.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ 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 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
kidsPackages = with pkgs; [
|
||||
firefox
|
||||
];
|
||||
in
|
||||
{
|
||||
users.users.eli = {
|
||||
isNormalUser = true;
|
||||
description = "Eli";
|
||||
home = "/home/eli";
|
||||
packages = kidsPackages;
|
||||
};
|
||||
|
||||
users.users.andrew = {
|
||||
isNormalUser = true;
|
||||
description = "Andrew";
|
||||
home = "/home/andrew";
|
||||
packages = kidsPackages;
|
||||
};
|
||||
|
||||
users.users.jules = {
|
||||
isNormalUser = true;
|
||||
description = "Jules";
|
||||
home = "/home/jules";
|
||||
packages = kidsPackages;
|
||||
};
|
||||
}
|
||||
@@ -1,47 +1,56 @@
|
||||
{ autologin ? false, wayland ? false, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
kodiBasePkg = if wayland then pkgs.kodi-wayland else pkgs.kodi;
|
||||
kodiPkg = kodiBasePkg.withPackages (pkgs: with pkgs; [
|
||||
jellyfin
|
||||
steam-launcher
|
||||
steam-library
|
||||
youtube
|
||||
]);
|
||||
cfg = config.roles.kodi;
|
||||
in
|
||||
{
|
||||
users.extraUsers.kodi.isNormalUser = true;
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 8080 ];
|
||||
allowedUDPPorts = [ 8080 ];
|
||||
};
|
||||
|
||||
services = mkIf autologin {
|
||||
cage = mkIf wayland {
|
||||
user = "kodi";
|
||||
program = "${kodiPkg}/bin/kodi-standalone";
|
||||
enable = true;
|
||||
options.roles.kodi = {
|
||||
enable = mkEnableOption "Enable Kodi";
|
||||
autologin = mkOption {
|
||||
default = false;
|
||||
};
|
||||
|
||||
xserver = mkIf (!wayland) {
|
||||
enable = true;
|
||||
desktopManager.kodi = {
|
||||
enable = true;
|
||||
package = kodiPkg;
|
||||
};
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
greeter.enable = false;
|
||||
};
|
||||
};
|
||||
displayManager = mkIf (!wayland) {
|
||||
autoLogin.enable = true;
|
||||
autoLogin.user = "kodi";
|
||||
defaultSession = "kodi";
|
||||
sessionData.autologinSession = "kodi";
|
||||
wayland = mkOption {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = let
|
||||
kodiBasePkg = if cfg.wayland then pkgs.kodi-wayland else pkgs.kodi;
|
||||
kodiPkg = kodiBasePkg.withPackages (pkgs: with pkgs; [
|
||||
jellyfin
|
||||
steam-launcher
|
||||
steam-library
|
||||
youtube
|
||||
]);
|
||||
in mkIf cfg.enable
|
||||
{
|
||||
users.extraUsers.kodi = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 8080 ];
|
||||
allowedUDPPorts = [ 8080 ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
kodiPkg
|
||||
wget
|
||||
];
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
services = if cfg.autologin then {
|
||||
displayManager = {
|
||||
autoLogin.enable = true;
|
||||
autoLogin.user = "kodi";
|
||||
defaultSession = "kodi";
|
||||
sessionData.autologinSession = "plasma";
|
||||
};
|
||||
} else {};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,14 +1,31 @@
|
||||
# TODO: implement requireMount
|
||||
{ requireMount ? false, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.nfs-mounts;
|
||||
in
|
||||
{
|
||||
fileSystems."/media" = {
|
||||
device = "10.0.0.43:/media";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"defaults"
|
||||
"nofail"
|
||||
"softreval"
|
||||
];
|
||||
options.roles.nfs-mounts = {
|
||||
enable = mkEnableOption "Enable default NFS mounts";
|
||||
# TODO: implement requireMount
|
||||
requireMount = mkOption {
|
||||
type = types.bool;
|
||||
description = "Hard fail if the NFS mounts are not available";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
fileSystems."/media" = {
|
||||
device = "10.0.0.43:/media";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"defaults"
|
||||
"nofail"
|
||||
"softreval"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
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 = [
|
||||
"https://hyprland.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
];
|
||||
};
|
||||
};
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
}
|
||||
@@ -1,4 +1,30 @@
|
||||
{ ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.printing;
|
||||
in
|
||||
{
|
||||
services.printing.enable = true;
|
||||
options.roles.printing = {
|
||||
enable = mkEnableOption "Enable default printing setup";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
services.printing.enable = true;
|
||||
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
hardware.printers.ensurePrinters = [{
|
||||
name = "MFC-L8900CDW_series";
|
||||
deviceUri = "dnssd://Brother%20MFC-L8900CDW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-b422006699d8";
|
||||
model = "everywhere";
|
||||
}];
|
||||
hardware.printers.ensureDefaultPrinter = "MFC-L8900CDW_series";
|
||||
};
|
||||
}
|
||||
|
||||
40
roles/spotifyd/default.nix
Normal file
40
roles/spotifyd/default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.spotifyd;
|
||||
in
|
||||
{
|
||||
options.roles.spotifyd = {
|
||||
enable = mkEnableOption "Enable the spotifyd role";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
roles.audio.enable = true;
|
||||
|
||||
services.spotifyd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
use_mpris = false;
|
||||
backend = "alsa";
|
||||
device = "sysdefault";
|
||||
bitrate = 320;
|
||||
cache_path = "";
|
||||
zeroconf_port = 1234;
|
||||
autoplay = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
1234
|
||||
57621
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
5353
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,8 +1,52 @@
|
||||
{ extraGroups ? [], ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.users;
|
||||
in
|
||||
{
|
||||
users.users.johno = {
|
||||
isNormalUser = true;
|
||||
description = "John Ogle";
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" ] ++ extraGroups;
|
||||
options.roles.users = {
|
||||
enable = mkEnableOption "Enable default users";
|
||||
extraGroups = mkOption {
|
||||
default = [];
|
||||
};
|
||||
kids = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
kidsPackages = with pkgs; [
|
||||
firefox
|
||||
];
|
||||
in mkIf cfg.enable {
|
||||
users.users.johno = {
|
||||
isNormalUser = true;
|
||||
description = "John Ogle";
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" ] ++ cfg.extraGroups;
|
||||
};
|
||||
|
||||
users.users.eli = mkIf cfg.kids {
|
||||
isNormalUser = true;
|
||||
description = "Eli";
|
||||
home = "/home/eli";
|
||||
packages = kidsPackages;
|
||||
};
|
||||
|
||||
users.users.andrew = mkIf cfg.kids {
|
||||
isNormalUser = true;
|
||||
description = "Andrew";
|
||||
home = "/home/andrew";
|
||||
packages = kidsPackages;
|
||||
};
|
||||
|
||||
users.users.jules = mkIf cfg.kids {
|
||||
isNormalUser = true;
|
||||
description = "Jules";
|
||||
home = "/home/jules";
|
||||
packages = kidsPackages;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.virtualisation;
|
||||
in
|
||||
{
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
options.roles.virtualisation = {
|
||||
enable = mkEnableOption "Enable virtualisation";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
virtualisation.docker.enable = true;
|
||||
users.extraGroups.docker.members = [ "johno" ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user