Compare commits
71 Commits
1f4a72d28c
...
add-steam-
| Author | SHA1 | Date | |
|---|---|---|---|
| 24a09a9922 | |||
| 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 |
21
.goosehints
Normal file
21
.goosehints
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
NixOS Configurations Repository
|
||||||
|
================================
|
||||||
|
|
||||||
|
Overview:
|
||||||
|
---------
|
||||||
|
This repository hosts modular and reproducible NixOS configurations managed via Nix flakes. It is structured to separate concerns across machine-specific setups, common roles, and custom packages.
|
||||||
|
|
||||||
|
Directory Structure:
|
||||||
|
----------------------
|
||||||
|
• packages/ - Custom Nix packages leveraged across various configurations.
|
||||||
|
• roles/ - Role-based configurations (e.g., kodi, bluetooth) each with its own module (default.nix) for inclusion in machine setups.
|
||||||
|
• machines/ - Machine-specific configurations (e.g., nix-book, z790prors, boxy, wixos) including configuration.nix and hardware-configuration.nix tailored for each hardware.
|
||||||
|
• home/ - Home-manager configurations for personal environments and application settings (e.g., home-nix-book.nix, home-z790prors.nix).
|
||||||
|
|
||||||
|
Design Principles:
|
||||||
|
------------------
|
||||||
|
• Modularity: Clear separation between roles, machines, and packages allows for flexible and reusable configurations.
|
||||||
|
• Declarative & Reproducible: Using Nix flakes guarantees a fully declarative setup that can be effortlessly reproduced across systems.
|
||||||
|
• Scalability: The structure is designed to accommodate adding new roles or machines with minimal disruption to existing configurations.
|
||||||
|
|
||||||
|
This file serves as a concise guide for navigating and understanding the repository from an advanced Nix perspective. Further documentation can be found within the respective directories or individual README files where applicable.
|
||||||
11
.sops.yaml
11
.sops.yaml
@@ -1,11 +0,0 @@
|
|||||||
keys:
|
|
||||||
- &admin_johno age1ls6a033d4p4u8h4rwazjwt8w4c4xg73wq0mdnm64jajxzcz4k9asvjnks3
|
|
||||||
- &host_z790prors age12l5u7sw59u5pkwp83qm8t3ff7uv0ld2c9k3zh5j4ame9k2szcynqu7ftqe
|
|
||||||
- &host_nixbook age1fa3zqavfmqk4ssa22yne9td90gyqv9q5a8y0s8jp3xak8q7p3yjqyn7rkg
|
|
||||||
creation_rules:
|
|
||||||
- path_regex: secrets/[^/]+\.(yaml|json|env|ini)$
|
|
||||||
key_groups:
|
|
||||||
- age:
|
|
||||||
- *admin_johno
|
|
||||||
- *host_z790prors
|
|
||||||
- *host_nixbook
|
|
||||||
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"
|
||||||
|
|
||||||
143
flake.lock
generated
143
flake.lock
generated
@@ -1,42 +1,39 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"doomemacs": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733434763,
|
"lastModified": 1747046372,
|
||||||
"narHash": "sha256-sebujw5VvBWMS+wXyjiGF81iyjPM/QQDnw5l7tDJCvk=",
|
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||||
"owner": "doomemacs",
|
"owner": "edolstra",
|
||||||
"repo": "doomemacs",
|
"repo": "flake-compat",
|
||||||
"rev": "ba1dca322f9a07bc2b7bec6a98f2c3c55c0bbd77",
|
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "doomemacs",
|
"owner": "edolstra",
|
||||||
"repo": "doomemacs",
|
"repo": "flake-compat",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"emacs-overlay": {
|
"google-cookie-retrieval": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nix-doom-emacs-unstraightened"
|
"nixpkgs"
|
||||||
],
|
|
||||||
"nixpkgs-stable": [
|
|
||||||
"nix-doom-emacs-unstraightened"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734315266,
|
"lastModified": 1752428473,
|
||||||
"narHash": "sha256-k6ekQwIK/TASoPwTyeY2JiBHzwmPZSLGrYNXF+fLhC8=",
|
"narHash": "sha256-IsE7fdAYbRlZuc0H5FtPfhhuHvlxnDGoAxdlnjpVNCU=",
|
||||||
"owner": "nix-community",
|
"ref": "refs/heads/main",
|
||||||
"repo": "emacs-overlay",
|
"rev": "1fad66b55144ab6beaecd900172a21ac3c34dc52",
|
||||||
"rev": "fce2b6224adae5f9b6d43d74ecb996a3133a63f4",
|
"revCount": 10,
|
||||||
"type": "github"
|
"type": "git",
|
||||||
|
"url": "https://git.johnogle.info/johno/google-cookie-retrieval.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"type": "git",
|
||||||
"repo": "emacs-overlay",
|
"url": "https://git.johnogle.info/johno/google-cookie-retrieval.git"
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
@@ -46,11 +43,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734344598,
|
"lastModified": 1752402455,
|
||||||
"narHash": "sha256-wNX3hsScqDdqKWOO87wETUEi7a/QlPVgpC/Lh5rFOuA=",
|
"narHash": "sha256-mCHfZhQKdTj2JhCFcqfOfa3uKZbwUkPQbd0/zPnhOE8=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "83ecd50915a09dca928971139d3a102377a8d242",
|
"rev": "bf893ad4cbf46610dd1b620c974f824e266cd1df",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -59,36 +56,49 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nix-doom-emacs-unstraightened": {
|
"nixos-wsl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"doomemacs": "doomemacs",
|
"flake-compat": "flake-compat",
|
||||||
"emacs-overlay": "emacs-overlay",
|
"nixpkgs": "nixpkgs"
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734338553,
|
"lastModified": 1752199438,
|
||||||
"narHash": "sha256-KEuh2nsgl8iiPWMg4wfrnCoZqPssw6dbMCy9MheLJZg=",
|
"narHash": "sha256-xSBMmGtq8K4Qv80TMqREmESCAsRLJRHAbFH2T/2Bf1Y=",
|
||||||
"owner": "marienz",
|
"owner": "nix-community",
|
||||||
"repo": "nix-doom-emacs-unstraightened",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "728040b0b7c2c0baa47fb3365b57bd3e1658207a",
|
"rev": "d34d9412556d3a896e294534ccd25f53b6822e80",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "marienz",
|
"owner": "nix-community",
|
||||||
"repo": "nix-doom-emacs-unstraightened",
|
"ref": "main",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734119587,
|
"lastModified": 1751792365,
|
||||||
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
|
"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",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
|
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -108,11 +118,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733858086,
|
"lastModified": 1748196248,
|
||||||
"narHash": "sha256-h2BDIDKiqgMpA6E+mu0RgMGy3FeM6k+EuJ9xgOQ1+zw=",
|
"narHash": "sha256-1iHjsH6/5UOerJEoZKE+Gx1BgAoge/YcnUsOA4wQ/BU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "plasma-manager",
|
"repo": "plasma-manager",
|
||||||
"rev": "7e2010249529931a3848054d5ff0dbf24675ab68",
|
"rev": "b7697abe89967839b273a863a3805345ea54ab56",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -123,46 +133,11 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"google-cookie-retrieval": "google-cookie-retrieval",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
|
"nixos-wsl": "nixos-wsl",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"plasma-manager": "plasma-manager",
|
"plasma-manager": "plasma-manager"
|
||||||
"sops-nix": "sops-nix"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sops-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1733965552,
|
|
||||||
"narHash": "sha256-GZ4YtqkfyTjJFVCub5yAFWsHknG1nS/zfk7MuHht4Fs=",
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "sops-nix",
|
|
||||||
"rev": "2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "sops-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
57
flake.nix
57
flake.nix
@@ -3,11 +3,7 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
||||||
sops-nix = {
|
|
||||||
url = "github:Mic92/sops-nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
@@ -20,44 +16,35 @@
|
|||||||
inputs.home-manager.follows = "home-manager";
|
inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-doom-emacs-unstraightened = {
|
google-cookie-retrieval = {
|
||||||
url = "github:marienz/nix-doom-emacs-unstraightened";
|
url = "git+https://git.johnogle.info/johno/google-cookie-retrieval.git";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... } @ inputs: let
|
outputs = { self, nixpkgs, nixos-wsl, ... } @ inputs: let
|
||||||
baseModules = [
|
baseModules = [
|
||||||
./roles
|
./roles
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.sharedModules = [
|
home-manager.sharedModules = [
|
||||||
inputs.plasma-manager.homeManagerModules.plasma-manager
|
inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||||
inputs.nix-doom-emacs-unstraightened.hmModule
|
|
||||||
];
|
];
|
||||||
|
home-manager.extraSpecialArgs = {
|
||||||
|
globalInputs = inputs;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
nixosConfigurations.z790prors-nix = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
modules = baseModules ++ [
|
|
||||||
./machines/z790prors/configuration.nix
|
|
||||||
{
|
|
||||||
home-manager.users.johno = import ./home/home-z790prors.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem rec {
|
nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = baseModules ++ [
|
modules = baseModules ++ [
|
||||||
./machines/nix-book/configuration.nix
|
./machines/nix-book/configuration.nix
|
||||||
{
|
{
|
||||||
home-manager.users.johno = import ./home/home-nix-book.nix;
|
home-manager.users.johno = import ./home/home-nix-book.nix;
|
||||||
|
home-manager.extraSpecialArgs = { inherit system; };
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -68,9 +55,35 @@
|
|||||||
./machines/boxy/configuration.nix
|
./machines/boxy/configuration.nix
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager.users.johno = import ./home/home-default.nix;
|
home-manager.users.johno = import ./home/home.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; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
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,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./home-default.nix
|
./home.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home.i3_sway.extraSwayConfig = {
|
home.i3_sway.extraSwayConfig = {
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./home-default.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ pkgs, customPkgs, ... }:
|
{ pkgs, customPkgs, globalInputs, system, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
customPkgs = pkgs.callPackage ../packages {};
|
customPkgs = pkgs.callPackage ../packages {};
|
||||||
@@ -39,10 +39,13 @@ in
|
|||||||
# '')
|
# '')
|
||||||
|
|
||||||
pkgs.bitwarden
|
pkgs.bitwarden
|
||||||
|
pkgs.claude-code
|
||||||
|
pkgs.codex
|
||||||
pkgs.dunst
|
pkgs.dunst
|
||||||
pkgs.element-desktop
|
pkgs.element-desktop
|
||||||
pkgs.fd
|
pkgs.fd
|
||||||
#pkgs.fluffychat # security vulnerability in current version
|
#pkgs.fluffychat # security vulnerability in current version
|
||||||
|
pkgs.goose-cli
|
||||||
pkgs.gzip
|
pkgs.gzip
|
||||||
pkgs.htop
|
pkgs.htop
|
||||||
pkgs.jellyfin-media-player
|
pkgs.jellyfin-media-player
|
||||||
@@ -52,17 +55,24 @@ in
|
|||||||
pkgs.less
|
pkgs.less
|
||||||
pkgs.moonlight-qt
|
pkgs.moonlight-qt
|
||||||
pkgs.ncdu
|
pkgs.ncdu
|
||||||
|
pkgs.nextcloud-talk-desktop
|
||||||
|
pkgs.openscad-unstable
|
||||||
pkgs.pandoc
|
pkgs.pandoc
|
||||||
pkgs.pinentry-qt
|
#pkgs.pinentry-qt
|
||||||
#pkgs.pytest
|
#pkgs.pytest
|
||||||
pkgs.shellcheck
|
pkgs.shellcheck
|
||||||
pkgs.solaar # Logitech management software
|
pkgs.solaar # Logitech management software
|
||||||
|
(pkgs.snapcast.override { pulseaudioSupport = true; })
|
||||||
pkgs.tmux
|
pkgs.tmux
|
||||||
pkgs.waybar
|
pkgs.waybar
|
||||||
pkgs.wofi
|
pkgs.wofi
|
||||||
pkgs.vlc
|
pkgs.vlc
|
||||||
|
|
||||||
customPkgs.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
|
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||||
@@ -78,9 +88,10 @@ in
|
|||||||
# org.gradle.console=verbose
|
# org.gradle.console=verbose
|
||||||
# org.gradle.daemon.idletimeout=3600000
|
# org.gradle.daemon.idletimeout=3600000
|
||||||
# '';
|
# '';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
|
||||||
# Home Manager can also manage your environment variables through
|
# Home Manager can also manage your environment variables through
|
||||||
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
||||||
# shell provided by Home Manager. If you don't want to manage your shell
|
# shell provided by Home Manager. If you don't want to manage your shell
|
||||||
@@ -98,28 +109,27 @@ in
|
|||||||
# /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh
|
# /etc/profiles/per-user/johno/etc/profile.d/hm-session-vars.sh
|
||||||
#
|
#
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
ENABLE_GAMESCOPE_WSI = "1";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home.sessionPath = [
|
home.sessionPath = [
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./modules/emacs
|
./modules/emacs
|
||||||
./modules/i3+sway
|
./modules/i3+sway
|
||||||
./modules/lutris
|
|
||||||
./modules/plasma-manager
|
./modules/plasma-manager
|
||||||
./modules/tmux
|
./modules/tmux
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.bash.enable = true;
|
programs.bash = {
|
||||||
|
enable = true;
|
||||||
nix = {
|
initExtra = ''
|
||||||
gc = {
|
codex() {
|
||||||
automatic = true;
|
local key
|
||||||
};
|
key="$(rbw get openai-api-key-codex)"
|
||||||
|
OPENAI_API_KEY="$key" command codex "$@"
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
@@ -140,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.jq.enable = true;
|
||||||
|
|
||||||
programs.k9s.enable = true;
|
programs.k9s.enable = true;
|
||||||
@@ -181,17 +182,16 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.home-manager.autoUpgrade = {
|
|
||||||
enable = true;
|
|
||||||
frequency = "weekly";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.kdeconnect = {
|
services.kdeconnect = {
|
||||||
enable = true;
|
enable = true;
|
||||||
indicator = true;
|
indicator = true;
|
||||||
package = pkgs.kdePackages.kdeconnect-kde;
|
package = pkgs.kdePackages.kdeconnect-kde;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.gnome-keyring = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
tray = {
|
tray = {
|
||||||
@@ -2,10 +2,21 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
doomEmacs = pkgs.fetchFromGitHub {
|
||||||
|
owner = "doomemacs";
|
||||||
|
repo = "doomemacs";
|
||||||
|
rev = "8406c1ff22b95bd0f816de4a0223fa3ce3c82568";
|
||||||
|
sha256 = "sha256-rOkgOdmLESVAbOeEM9nJTzxyI+akdk48Ed2VlktOy3Q=";
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
|
pkgs.emacs
|
||||||
|
|
||||||
pkgs.emacs-all-the-icons-fonts
|
pkgs.emacs-all-the-icons-fonts
|
||||||
|
pkgs.fira-code
|
||||||
pkgs.fontconfig
|
pkgs.fontconfig
|
||||||
pkgs.graphviz
|
pkgs.graphviz
|
||||||
pkgs.isort
|
pkgs.isort
|
||||||
@@ -19,15 +30,18 @@ with lib;
|
|||||||
pkgs.python3
|
pkgs.python3
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.doom-emacs = {
|
|
||||||
enable = true;
|
|
||||||
doomDir = ./doom;
|
|
||||||
};
|
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
home.file."${config.xdg.configHome}/emacs".source = doomEmacs;
|
||||||
|
home.sessionPath = [
|
||||||
|
"${config.xdg.configHome}/emacs/bin"
|
||||||
|
];
|
||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "emacs -nw";
|
DOOMDIR = "${config.xdg.configHome}/doom";
|
||||||
|
DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.file."${config.xdg.configHome}/doom".source = ./doom;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,16 @@
|
|||||||
;; org-caldav-files nil
|
;; org-caldav-files nil
|
||||||
;; org-caldav-sync-direction 'cal->org))
|
;; org-caldav-sync-direction 'cal->org))
|
||||||
|
|
||||||
|
(defun my/get-rbw-password (alias)
|
||||||
|
"Return the password for ALIAS via rbw, unlocking the vault only if needed."
|
||||||
|
(let* ((cmd (format "rbw get %s 2>&1" alias))
|
||||||
|
(output (shell-command-to-string cmd)))
|
||||||
|
(string-trim output)))
|
||||||
|
|
||||||
|
(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
|
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
||||||
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
|
|
||||||
:os
|
:os
|
||||||
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
|
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
|
||||||
;;tty ; improve the terminal Emacs experience
|
tty ; improve the terminal Emacs experience
|
||||||
|
|
||||||
:lang
|
:lang
|
||||||
;;agda ; types of types of types of types...
|
;;agda ; types of types of types of types...
|
||||||
|
|||||||
@@ -50,3 +50,5 @@
|
|||||||
;; (unpin! t)
|
;; (unpin! t)
|
||||||
|
|
||||||
;; (package! org-caldav)
|
;; (package! org-caldav)
|
||||||
|
|
||||||
|
(package! gptel :recipe (:nonrecursive t))
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = [
|
|
||||||
pkgs.gamescope
|
|
||||||
pkgs.lutris
|
|
||||||
pkgs.mangohud
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -15,21 +15,15 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.tmux.enable = true;
|
programs.tmux.enable = true;
|
||||||
|
programs.tmux.terminal = "tmux-direct";
|
||||||
|
programs.tmux.keyMode = "vi";
|
||||||
programs.tmux.escapeTime = 0;
|
programs.tmux.escapeTime = 0;
|
||||||
programs.tmux.mouse = true;
|
programs.tmux.mouse = true;
|
||||||
programs.tmux.newSession = true;
|
programs.tmux.newSession = true;
|
||||||
programs.tmux.historyLimit = 50000;
|
programs.tmux.historyLimit = 50000;
|
||||||
programs.tmux.clock24 = true;
|
programs.tmux.clock24 = true;
|
||||||
programs.tmux.baseIndex = 1;
|
programs.tmux.baseIndex = 1;
|
||||||
programs.tmux.prefix = "`";
|
programs.tmux.prefix = "M-\\\\";
|
||||||
|
|
||||||
programs.tmux.extraConfig = ''
|
|
||||||
set -g mouse on
|
|
||||||
set -g default-terminal "screen-256color"
|
|
||||||
|
|
||||||
bind -n S-Left previous-window
|
|
||||||
bind -n S-Right next-window
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.tmux.plugins = with pkgs; [
|
programs.tmux.plugins = with pkgs; [
|
||||||
tmuxPlugins.cpu
|
tmuxPlugins.cpu
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
{ lib, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
@@ -14,9 +14,17 @@ with lib;
|
|||||||
|
|
||||||
roles = {
|
roles = {
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
gaming = true;
|
||||||
|
kde = true;
|
||||||
|
sddm = true;
|
||||||
|
wayland = true;
|
||||||
|
};
|
||||||
kodi = {
|
kodi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autologin = true;
|
autologin = false;
|
||||||
wayland = true;
|
wayland = true;
|
||||||
};
|
};
|
||||||
users.enable = true;
|
users.enable = true;
|
||||||
@@ -28,9 +36,15 @@ with lib;
|
|||||||
|
|
||||||
networking.hostName = "boxy"; # Define your hostname.
|
networking.hostName = "boxy"; # Define your hostname.
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
hardware.graphics.enable = true;
|
hardware.graphics.enable = true;
|
||||||
|
hardware.graphics.enable32Bit = true;
|
||||||
services.displayManager.enable = mkForce false;
|
hardware.graphics.extraPackages = with pkgs; [
|
||||||
|
amdvlk
|
||||||
|
];
|
||||||
|
hardware.graphics.extraPackages32 = with pkgs; [
|
||||||
|
driversi686Linux.amdvlk
|
||||||
|
];
|
||||||
|
|
||||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,10 @@
|
|||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
desktop = {
|
desktop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
waylandOnly = true;
|
wayland = true;
|
||||||
|
gaming = false;
|
||||||
|
kde = true;
|
||||||
|
sddm = true;
|
||||||
};
|
};
|
||||||
nfs-mounts.enable = true;
|
nfs-mounts.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
|
|||||||
62
machines/wixos/configuration.nix
Normal file
62
machines/wixos/configuration.nix
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
|
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
|
||||||
|
# https://github.com/nix-community/NixOS-WSL
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
];
|
||||||
|
|
||||||
|
roles = {
|
||||||
|
audio.enable = true;
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
wayland = true;
|
||||||
|
};
|
||||||
|
users.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hostName = "wixos";
|
||||||
|
|
||||||
|
wsl.enable = true;
|
||||||
|
wsl.defaultUser = "johno";
|
||||||
|
wsl.startMenuLaunchers = true;
|
||||||
|
wsl.useWindowsDriver = true;
|
||||||
|
wsl.wslConf.network.hostname = "wixos";
|
||||||
|
wsl.wslConf.user.default = "johno";
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
hardware.graphics = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
mesa
|
||||||
|
libvdpau-va-gl
|
||||||
|
vaapiVdpau
|
||||||
|
];
|
||||||
|
};
|
||||||
|
environment.sessionVariables = {
|
||||||
|
LD_LIBRARY_PATH = [
|
||||||
|
"/usr/lib/wsl/lib"
|
||||||
|
"/run/opengl-driver/lib"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
hardware.nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
open = true;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||||
|
};
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It's perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "24.05"; # Did you read the comment?
|
||||||
|
}
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
||||||
|
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ # Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
roles = {
|
|
||||||
audio.enable = true;
|
|
||||||
desktop = {
|
|
||||||
enable = true;
|
|
||||||
x11Only = true;
|
|
||||||
};
|
|
||||||
kodi.enable = true;
|
|
||||||
nfs-mounts.enable = true;
|
|
||||||
printing.enable = true;
|
|
||||||
spotifyd.enable = true;
|
|
||||||
users = {
|
|
||||||
enable = true;
|
|
||||||
extraGroups = [ "input" "libvirtd" ];
|
|
||||||
kids = true;
|
|
||||||
};
|
|
||||||
virtualisation.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
boot.loader.grub.useOSProber = true;
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "z790prors-nix"; # Define your hostname.
|
|
||||||
domain = "oglehome";
|
|
||||||
defaultGateway = "10.0.0.1";
|
|
||||||
nameservers = [ "10.0.0.1" ];
|
|
||||||
|
|
||||||
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
||||||
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
||||||
# replicates the default behaviour.
|
|
||||||
useDHCP = false;
|
|
||||||
|
|
||||||
interfaces.enp3s0.ipv4.addresses = [{
|
|
||||||
address = "10.0.0.37";
|
|
||||||
prefixLength = 24;
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: Figure out something with this
|
|
||||||
nix.settings.secret-key-files = /root/cache-priv-key.pem;
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "21.11"; # Did you read the comment?
|
|
||||||
}
|
|
||||||
@@ -1,73 +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, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
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.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
boot.kernelParams = [
|
|
||||||
"nvidia_drm.fbdev=1"
|
|
||||||
"nvidia_drm.modeset=1"
|
|
||||||
];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
hardware.graphics.enable = true;
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
services.xserver.screenSection = ''Option "metamodes" "3440x1440_165 +0+0"'';
|
|
||||||
services.xserver.enableTearFree = true;
|
|
||||||
hardware.nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = false;
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
open = false;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
|
||||||
#package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
|
|
||||||
#version = "555.58";
|
|
||||||
|
|
||||||
#sha256_64bit = "sha256-bXvcXkg2kQZuCNKRZM5QoTaTjF4l2TtrsKUvyicj5ew=";
|
|
||||||
#sha256_aarch64 = lib.fakeSha256;
|
|
||||||
#openSha256 = lib.fakeSha256;
|
|
||||||
#settingsSha256 = "sha256-vWnrXlBCb3K5uVkDFmJDVq51wrCoqgPF03lSjZOuU8M=";
|
|
||||||
#persistencedSha256 = lib.fakeSha256;
|
|
||||||
#};
|
|
||||||
};
|
|
||||||
environment.sessionVariables = {
|
|
||||||
KWIN_DRM_ALLOW_NVIDIA_COLORSPACE = "1";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/8d996d13-6d55-4524-83a2-6f6fb47a09ea";
|
|
||||||
fsType = "btrfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/7445-C336";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
services.beesd.filesystems = {
|
|
||||||
root = {
|
|
||||||
spec = "LABEL=nixos";
|
|
||||||
hashTableSizeMB = 4096;
|
|
||||||
verbosity = "crit";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
nextcloudTalkDesktop = pkgs.callPackage ./nextcloud-talk-desktop {};
|
|
||||||
modrinthNvidia = pkgs.callPackage ./modrinth-nvidia {};
|
|
||||||
vulkanHDRLayer = pkgs.callPackage ./vulkan-hdr-layer {};
|
vulkanHDRLayer = pkgs.callPackage ./vulkan-hdr-layer {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
pkgs.stdenv.mkDerivation {
|
|
||||||
pname = "modrinth-nvidia";
|
|
||||||
version = "0.1.0";
|
|
||||||
src = null;
|
|
||||||
dontUnpack = true;
|
|
||||||
dontBuild = true;
|
|
||||||
dontConfigure = true;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.makeWrapper
|
|
||||||
pkgs.modrinth-app ];
|
|
||||||
|
|
||||||
# Propagate the required Java versions so they are available at runtime
|
|
||||||
propagatedBuildInputs = [
|
|
||||||
pkgs.openjdk8
|
|
||||||
pkgs.openjdk17
|
|
||||||
pkgs.openjdk21
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
# Copy the original binary
|
|
||||||
cp ${pkgs.modrinth-app}/bin/ModrinthApp $out/bin/modrinth-nvidia-real
|
|
||||||
chmod +x $out/bin/modrinth-nvidia-real
|
|
||||||
|
|
||||||
# Wrap the binary with makeWrapper, producing a new script at 'modrinth-nvidia'
|
|
||||||
makeWrapper $out/bin/modrinth-nvidia-real $out/bin/modrinth-nvidia \
|
|
||||||
--set WEBKIT_DISABLE_DMABUF_RENDERER 1 \
|
|
||||||
--set WEBKIT_DISABLE_COMPOSITING_MODE 1
|
|
||||||
|
|
||||||
mkdir -p $out/share/applications
|
|
||||||
cat > $out/share/applications/modrinth-nvidia.desktop <<EOF
|
|
||||||
[Desktop Entry]
|
|
||||||
Name=Modrinth (NVIDIA)
|
|
||||||
Comment=Launch Modrinth with environment variables tuned for NVIDIA systems
|
|
||||||
Exec=$out/bin/modrinth-nvidia
|
|
||||||
Icon=modrinth-app
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Categories=Game;
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,86 +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: rec {
|
|
||||||
pname = "nextcloud-talk-desktop";
|
|
||||||
version = "0.39.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-f8X6I2Je9wgstMTuYGaX7AXAqpZC92RUAltDVsHr9Vo=";
|
|
||||||
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" $out/bin/nextcloud-talk-desktop
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Nextcloud Talk Desktop Client";
|
|
||||||
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 = "nextcloud-talk-desktop";
|
|
||||||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
|
||||||
};
|
|
||||||
})
|
|
||||||
@@ -22,11 +22,19 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
|
||||||
hardware.pulseaudio.extraConfig = "
|
services.pulseaudio = {
|
||||||
|
package = pkgs.pulseaudioFull;
|
||||||
|
extraConfig = ''
|
||||||
load-module module-combine-sink
|
load-module module-combine-sink
|
||||||
load-module module-switch-on-connect
|
load-module module-switch-on-connect
|
||||||
";
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.squeezelite = {
|
||||||
|
#enable = true;
|
||||||
|
pulseAudio = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ with lib;
|
|||||||
./kodi
|
./kodi
|
||||||
./nfs-mounts
|
./nfs-mounts
|
||||||
./printing
|
./printing
|
||||||
./secrets
|
|
||||||
./spotifyd
|
./spotifyd
|
||||||
./users
|
./users
|
||||||
./virtualisation
|
./virtualisation
|
||||||
@@ -31,6 +30,12 @@ with lib;
|
|||||||
};
|
};
|
||||||
time.timeZone = "America/Los_Angeles";
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us";
|
||||||
|
variant = "";
|
||||||
|
options = "caps:escape";
|
||||||
|
};
|
||||||
|
|
||||||
# Don't go to emergency mode if we aren't able to mount filesystems.
|
# 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
|
# This is silly if you have multiple hard drives or partitions
|
||||||
# configured on a machine and then one goes away intentionally or
|
# configured on a machine and then one goes away intentionally or
|
||||||
@@ -43,6 +48,7 @@ with lib;
|
|||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
git
|
||||||
|
glances
|
||||||
pciutils
|
pciutils
|
||||||
tree
|
tree
|
||||||
usbutils
|
usbutils
|
||||||
@@ -51,16 +57,16 @@ with lib;
|
|||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nix;
|
package = pkgs.nix;
|
||||||
distributedBuilds = true;
|
# distributedBuilds = true;
|
||||||
buildMachines = [{
|
# buildMachines = [{
|
||||||
hostName = "z790prors.oglehome";
|
# hostName = "z790prors.oglehome";
|
||||||
system = "x86_64-linux";
|
# system = "x86_64-linux";
|
||||||
protocol = "ssh-ng";
|
# protocol = "ssh-ng";
|
||||||
sshUser = "johno";
|
# sshUser = "johno";
|
||||||
sshKey = "/root/.ssh/id_ed25519";
|
# sshKey = "/root/.ssh/id_ed25519";
|
||||||
maxJobs = 3;
|
# maxJobs = 3;
|
||||||
speedFactor = 2;
|
# speedFactor = 2;
|
||||||
}];
|
# }];
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
max-jobs = "auto";
|
max-jobs = "auto";
|
||||||
|
|||||||
@@ -2,146 +2,24 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.roles.desktop;
|
|
||||||
|
|
||||||
customPackages = pkgs.callPackage ../../packages {};
|
|
||||||
|
|
||||||
basePackages = with pkgs; [
|
|
||||||
bambu-studio
|
|
||||||
blender
|
|
||||||
brightnessctl
|
|
||||||
mangohud # Should probably get refactored with steam/gamescope out to a gaming role
|
|
||||||
modrinth-app
|
|
||||||
protonup-qt
|
|
||||||
|
|
||||||
#customPackages.vulkanHDRLayer
|
|
||||||
];
|
|
||||||
|
|
||||||
x11BasePackages = with pkgs; [
|
|
||||||
customPackages.modrinthNvidia
|
|
||||||
];
|
|
||||||
|
|
||||||
x11OnlyPackages = with pkgs; [
|
|
||||||
emacs
|
|
||||||
];
|
|
||||||
|
|
||||||
waylandBasePackages = with pkgs; [
|
|
||||||
grim
|
|
||||||
slurp
|
|
||||||
wl-clipboard
|
|
||||||
mako
|
|
||||||
];
|
|
||||||
|
|
||||||
waylandOnlyPackages = with pkgs; [
|
|
||||||
emacs-gtk
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.roles.desktop = {
|
options.roles.desktop = {
|
||||||
enable = mkEnableOption "Enable the desktop role";
|
enable = mkEnableOption "Enable the desktop role.";
|
||||||
x11Only = mkOption {
|
|
||||||
type = types.bool;
|
x11 = mkOption { type = types.bool; default = false; description = "Enable X11 support."; };
|
||||||
default = false;
|
wayland = mkOption { type = types.bool; default = false; description = "Enable Wayland support."; };
|
||||||
};
|
kde = mkOption { type = types.bool; default = false; description = "Enable KDE."; };
|
||||||
waylandOnly = mkOption {
|
gaming = mkOption { type = types.bool; default = false; description = "Enable gaming support."; };
|
||||||
type = types.bool;
|
sddm = mkOption { type = types.bool; default = false; description = "Enable SDDM greeter."; };
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable
|
imports = [
|
||||||
{
|
./x11.nix
|
||||||
services.xserver.xkb = {
|
./wayland.nix
|
||||||
layout = "us";
|
./gaming.nix
|
||||||
variant = "";
|
./kde.nix
|
||||||
options = "caps:escape";
|
./programs.nix
|
||||||
};
|
./sddm.nix
|
||||||
services.xserver.enable = true;
|
./steam-sleep-inhibitor.nix
|
||||||
|
|
||||||
services.displayManager.sddm = {
|
|
||||||
enable = true;
|
|
||||||
wayland.enable = !cfg.x11Only;
|
|
||||||
};
|
|
||||||
services.desktopManager.plasma6.enable = true;
|
|
||||||
|
|
||||||
services.xserver.windowManager.i3 = {
|
|
||||||
enable = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
dmenu
|
|
||||||
i3status
|
|
||||||
i3lock
|
|
||||||
];
|
];
|
||||||
};
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
services.gnome.gnome-keyring.enable = true;
|
|
||||||
|
|
||||||
programs.sway = mkIf (!cfg.x11Only) {
|
|
||||||
enable = true;
|
|
||||||
wrapperFeatures.gtk = true;
|
|
||||||
};
|
|
||||||
programs.light.enable = mkIf (!cfg.x11Only) true;
|
|
||||||
|
|
||||||
programs.kdeconnect.enable = true;
|
|
||||||
programs.java.enable = true;
|
|
||||||
programs.gamemode = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
};
|
|
||||||
programs.gamescope = {
|
|
||||||
enable = true;
|
|
||||||
#capSysNice = true;
|
|
||||||
args = [
|
|
||||||
#"--adaptive-sync"
|
|
||||||
#"--nested-refresh 165"
|
|
||||||
#"--backend wayland"
|
|
||||||
"--hdr-enabled"
|
|
||||||
"--hdr-itm-enable"
|
|
||||||
"--hdr-debug-force-output"
|
|
||||||
"--mangoapp"
|
|
||||||
"--rt"
|
|
||||||
"--steam"
|
|
||||||
#"--xwayland-count 2"
|
|
||||||
];
|
|
||||||
env = {
|
|
||||||
#PROTON_DISABLE_NVAPI = "1";
|
|
||||||
MANGOHUD = "1";
|
|
||||||
#MANGOHUD_CONFIG = "cpu_temp gpu_temp ram vram";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
programs.steam = {
|
|
||||||
enable = true;
|
|
||||||
remotePlay.openFirewall = true;
|
|
||||||
localNetworkGameTransfers.openFirewall = true;
|
|
||||||
gamescopeSession = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
extraCompatPackages = with pkgs; [
|
|
||||||
proton-ge-bin
|
|
||||||
];
|
|
||||||
#package = pkgs.steam.override {
|
|
||||||
#withJava = true;
|
|
||||||
#withPrimus = true;
|
|
||||||
#extraPkgs = pkgs: [ bumblebee glxinfo ];
|
|
||||||
#};
|
|
||||||
};
|
|
||||||
services.sunshine = {
|
|
||||||
enable = true;
|
|
||||||
autoStart = false;
|
|
||||||
capSysAdmin = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
users.extraGroups.docker.members = [ "johno" ];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; mkMerge [
|
|
||||||
basePackages
|
|
||||||
(mkIf (!cfg.waylandOnly) x11BasePackages)
|
|
||||||
(mkIf cfg.x11Only x11OnlyPackages)
|
|
||||||
(mkIf (!cfg.x11Only) waylandBasePackages)
|
|
||||||
(mkIf (cfg.waylandOnly) waylandOnlyPackages)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
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);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
116
roles/desktop/steam-sleep-inhibitor.nix
Normal file
116
roles/desktop/steam-sleep-inhibitor.nix
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
|
||||||
|
steamSleepInhibitor = pkgs.writeShellScript "steam-sleep-inhibitor" ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Steam log path - adjust if different
|
||||||
|
STEAM_LOG="$HOME/.local/share/Steam/logs/streaming_log.txt"
|
||||||
|
FALLBACK_LOG="$HOME/.steam/steam/logs/streaming_log.txt"
|
||||||
|
|
||||||
|
# Find Steam log file
|
||||||
|
if [[ -f "$STEAM_LOG" ]]; then
|
||||||
|
LOG_FILE="$STEAM_LOG"
|
||||||
|
elif [[ -f "$FALLBACK_LOG" ]]; then
|
||||||
|
LOG_FILE="$FALLBACK_LOG"
|
||||||
|
else
|
||||||
|
# Monitor Steam process for streaming activity
|
||||||
|
LOG_FILE=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
INHIBITOR_PID=""
|
||||||
|
MONITORING=false
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
if [[ -n "$INHIBITOR_PID" ]]; then
|
||||||
|
echo "Stopping sleep inhibitor (PID: $INHIBITOR_PID)"
|
||||||
|
kill "$INHIBITOR_PID" 2>/dev/null
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
start_inhibitor() {
|
||||||
|
if [[ -z "$INHIBITOR_PID" ]]; then
|
||||||
|
echo "Starting sleep inhibitor for Steam Remote Play session"
|
||||||
|
${pkgs.systemd}/bin/systemd-inhibit \
|
||||||
|
--what=sleep \
|
||||||
|
--who="Steam Remote Play" \
|
||||||
|
--why="Active streaming session detected" \
|
||||||
|
--mode=block \
|
||||||
|
sleep infinity &
|
||||||
|
INHIBITOR_PID=$!
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_inhibitor() {
|
||||||
|
if [[ -n "$INHIBITOR_PID" ]]; then
|
||||||
|
echo "Stopping sleep inhibitor - streaming session ended"
|
||||||
|
kill "$INHIBITOR_PID" 2>/dev/null
|
||||||
|
INHIBITOR_PID=""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if Steam Remote Play is active by looking for streaming processes
|
||||||
|
check_streaming_active() {
|
||||||
|
# Check for Steam streaming processes
|
||||||
|
if pgrep -f "streaming_client" >/dev/null || \
|
||||||
|
pgrep -f "steamremoteplay" >/dev/null || \
|
||||||
|
${pkgs.procps}/bin/pgrep -f "Remote Play" >/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for active network connections on Steam streaming ports
|
||||||
|
if ${pkgs.nettools}/bin/netstat -an 2>/dev/null | grep -E ":(27036|27037)" | grep ESTABLISHED >/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
|
echo "Steam sleep inhibitor monitoring started"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
if check_streaming_active; then
|
||||||
|
if [[ "$MONITORING" == "false" ]]; then
|
||||||
|
MONITORING=true
|
||||||
|
start_inhibitor
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ "$MONITORING" == "true" ]]; then
|
||||||
|
MONITORING=false
|
||||||
|
stop_inhibitor
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.kde && cfg.gaming) {
|
||||||
|
# Steam streaming sleep inhibitor service
|
||||||
|
systemd.user.services.steam-sleep-inhibitor = {
|
||||||
|
description = "Steam Remote Play Sleep Inhibitor";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
after = [ "graphical-session.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${steamSleepInhibitor}";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Steam-specific environment variables to prevent sleep interference
|
||||||
|
environment.sessionVariables = {
|
||||||
|
SDL_VIDEO_ALLOW_SCREENSAVER = "1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
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 ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -27,45 +27,30 @@ in
|
|||||||
]);
|
]);
|
||||||
in mkIf cfg.enable
|
in mkIf cfg.enable
|
||||||
{
|
{
|
||||||
users.extraUsers.kodi.isNormalUser = true;
|
users.extraUsers.kodi = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
|
||||||
|
};
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPorts = [ 8080 ];
|
allowedTCPPorts = [ 8080 ];
|
||||||
allowedUDPPorts = [ 8080 ];
|
allowedUDPPorts = [ 8080 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = if cfg.autologin then mkMerge [
|
environment.systemPackages = with pkgs; [
|
||||||
(mkIf cfg.wayland {
|
kodiPkg
|
||||||
cage = mkIf cfg.wayland {
|
wget
|
||||||
user = "kodi";
|
];
|
||||||
program = "${kodiPkg}/bin/kodi-standalone";
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
xserver = {
|
|
||||||
enable = false;
|
|
||||||
autorun = false;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf (!cfg.wayland) {
|
programs.kdeconnect.enable = true;
|
||||||
xserver = {
|
|
||||||
enable = true;
|
services = if cfg.autologin then {
|
||||||
desktopManager.kodi = {
|
|
||||||
enable = true;
|
|
||||||
package = kodiPkg;
|
|
||||||
};
|
|
||||||
displayManager.lightdm = {
|
|
||||||
enable = true;
|
|
||||||
greeter.enable = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
displayManager = {
|
displayManager = {
|
||||||
autoLogin.enable = true;
|
autoLogin.enable = true;
|
||||||
autoLogin.user = "kodi";
|
autoLogin.user = "kodi";
|
||||||
defaultSession = "kodi";
|
defaultSession = "kodi";
|
||||||
sessionData.autologinSession = "kodi";
|
sessionData.autologinSession = "plasma";
|
||||||
};
|
};
|
||||||
})
|
} else {};
|
||||||
] else {};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{ config, lib, pkgs, inputs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
sops.defaultSopsFile = ../../secrets/secrets.yaml;
|
|
||||||
sops.defaultSopsFormat = "yaml";
|
|
||||||
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" "/home/johno/.ssh/id_ed25519" ];
|
|
||||||
sops.secrets.example_key = {};
|
|
||||||
}
|
|
||||||
@@ -14,5 +14,7 @@ in
|
|||||||
{
|
{
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
users.extraGroups.docker.members = [ "johno" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
hello: ENC[AES256_GCM,data:5ZpbPx3D8gQc1fOhViUqiCr0zLWYotB+vIBixqTbqP9XLS52y6tr5DXus0aV9mTgka5deqc=,iv:yPJaCqDD9WD56swfBjSm7A62ZTTIQDqyAKOgP1ese+U=,tag:bo8+7Ne2f9aEZSvpkt1fzA==,type:str]
|
|
||||||
example_key: ENC[AES256_GCM,data:v15bEcb0H3vaj13blg==,iv:9P3IA7ChBamo41VE8G8tj46sZqeijsO1LcvwLtEPVPA=,tag:o/lAyAYYGNLP9EjQNa/K8Q==,type:str]
|
|
||||||
example_array:
|
|
||||||
- ENC[AES256_GCM,data:3Vwa7dfNfKzRc/xpk6I=,iv:IevBgxwWdaBvZY1ywteWcfWwDIA8lK3FTWs67lLBKxw=,tag:Mx5lzUeNZ/3wJBWAl5XSBw==,type:str]
|
|
||||||
- ENC[AES256_GCM,data:epkT6WPGW5Oe/S+4HtU=,iv:N0yoDuieAaEi+NuCoCL4zrkhaDDdkttboI89m+UccjQ=,tag:OoERRByb0OM4un9oGLJQgA==,type:str]
|
|
||||||
#ENC[AES256_GCM,data:YzMFXxn3sbbHpGB4jPRtRw==,iv:TN6ogQuH7c6xtDoWt0Ew9B2f7wuaipJynvscZmaJYoU=,tag:No0UwEktEyMNBg/46P+Zmg==,type:comment]
|
|
||||||
example_number: ENC[AES256_GCM,data:jmLoVC+8YIlB2A==,iv:u9GztD/aE9UN5zWq3Am2nhYwmYt3sf8sy65MHbhVoD0=,tag:wKuf1mMr5XBJveJrz0uHPA==,type:float]
|
|
||||||
example_booleans:
|
|
||||||
- ENC[AES256_GCM,data:ZacILA==,iv:xo+7aFFQXzbJzKDY0mYTeFLf10AlnHkywDRAMHeprEM=,tag:F/OnJdqjrZP02sTLWLmnbg==,type:bool]
|
|
||||||
- ENC[AES256_GCM,data:NaFrvrs=,iv:kKDmGs9u/w5qrZ/379Jlx8AotUVADvH+eHwHCqykmkE=,tag:nD9TsmkXUm4ABaT1ABWmcg==,type:bool]
|
|
||||||
sops:
|
|
||||||
kms: []
|
|
||||||
gcp_kms: []
|
|
||||||
azure_kv: []
|
|
||||||
hc_vault: []
|
|
||||||
age:
|
|
||||||
- recipient: age1ls6a033d4p4u8h4rwazjwt8w4c4xg73wq0mdnm64jajxzcz4k9asvjnks3
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBjak9vRVJtVmJoanhEZ0hQ
|
|
||||||
MFJwMEE4UDcrRkdPRmZ6R09FSDY1aTk3Y1dNClZJYXRLNU5senR3Qzh6VmZGMlhu
|
|
||||||
bnl6VjlaUEFISnBtSTVrcEd0ZjI5Q2MKLS0tIFl1b3A5ZWVqc1gvWVZnZis0ZHFk
|
|
||||||
bWhnNVB2TUJ4YzY4NHdSVXhPc3dReTgKWRYBbBE3+oGsRNw1CROhFY+btENbShfv
|
|
||||||
gw3IdW7OoZV6JpJBOcI82eOuOkIxrmgSGDGeyy10/a5MA/cB1umm+w==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
- recipient: age12l5u7sw59u5pkwp83qm8t3ff7uv0ld2c9k3zh5j4ame9k2szcynqu7ftqe
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBGcmV3TDlNL2Zxb0h5QTYx
|
|
||||||
QkVmczA0MDc2ZnpNNU1YeFVzSXJwc3RWUmk4CjF4bHIrVU9VM3htTUxGZ2FUR256
|
|
||||||
UEovdVV2cmNIbkloS1VobTNFSDVyRG8KLS0tIEFhUk5kL3hCNGs4MGJBTmNJaVFm
|
|
||||||
b2ZBUGJ1K0lKTitKYTRUMWszQzhBU0UKBaM6t6JmWfiG+wPorGea1gqvV5RSIPyw
|
|
||||||
6yb2PcH2oZ0HrjJM5sjfu7XOWY3KneiZZikR1BpD5KvevfagWTSR/w==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
- recipient: age1fa3zqavfmqk4ssa22yne9td90gyqv9q5a8y0s8jp3xak8q7p3yjqyn7rkg
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBaMFJiNjVOb0lTcmJ3VnhH
|
|
||||||
WlRKZERRZFM3TFZBZGNSZC9GdHlHakMza21zClJ3SDdFUkVRc3oyVVU3WEtDQzBu
|
|
||||||
OEFqS3NwbHZFUlpCYlN6RW84N0F1amcKLS0tIHFZK21aTHdwZ2dWbVRrWEZDWFZj
|
|
||||||
aU1IQzdTMVhnbHhsNENwMG05dXhOU2MK8fEJea9sL5JLgltVlTI6mRDb+Tl83Iz7
|
|
||||||
4wPYvo68cn8vimXqSk45ldHRrNa3zhYai3CalQaGtDT3fkWGvSq0zQ==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
lastmodified: "2024-09-28T15:44:39Z"
|
|
||||||
mac: ENC[AES256_GCM,data:YUi+AbS6DQTmrSyOXsbkZWfWaMyKGR8fYm/MHcxmqChi8hng+UWHBZjsLBe6ef/FLH3rnP6bhfwK8KYnVS6fHvHahoqIq/BHydTsqrclnSgRAGl8Lh0yuhwISNRvP1AuW5pd50sdQaS0uGOtzOCharI/pZ9H+cmt2SB5WOCdeLs=,iv:2nBG6it3tNSLSia8hGzCcesuK9QwzB9EzfjWegjQ2kw=,tag:RGGPAPw/rQKhWA2OqLjTJw==,type:str]
|
|
||||||
pgp: []
|
|
||||||
unencrypted_suffix: _unencrypted
|
|
||||||
version: 3.9.0
|
|
||||||
Reference in New Issue
Block a user