Compare commits
38 Commits
5650125d7e
...
add-liveus
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
@@ -7,7 +7,6 @@ This repository hosts modular and reproducible NixOS configurations managed via
|
||||
|
||||
Directory Structure:
|
||||
----------------------
|
||||
• secrets/ - Confidential data (passwords, keys, etc.) required for system configuration.
|
||||
• 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.
|
||||
|
||||
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"
|
||||
|
||||
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
|
||||
147
flake.lock
generated
147
flake.lock
generated
@@ -1,52 +1,13 @@
|
||||
{
|
||||
"nodes": {
|
||||
"doomemacs": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1736881038,
|
||||
"narHash": "sha256-i0GVHWoIqDcFB9JmEdd9T+qxrEx3ckBlPfTD/yLoNyg=",
|
||||
"owner": "doomemacs",
|
||||
"repo": "doomemacs",
|
||||
"rev": "2bc052425ca45a41532be0648ebd976d1bd2e6c1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "doomemacs",
|
||||
"repo": "doomemacs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"emacs-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nix-doom-emacs-unstraightened"
|
||||
],
|
||||
"nixpkgs-stable": [
|
||||
"nix-doom-emacs-unstraightened"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739673654,
|
||||
"narHash": "sha256-J4+OtlyTMcZfVPXkn1ef/hew80KqoOuorp1iUwJqiso=",
|
||||
"owner": "nix-community",
|
||||
"repo": "emacs-overlay",
|
||||
"rev": "9ab982da8f82359a7619f25718fb6bd838ca34ce",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "emacs-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1733328505,
|
||||
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -62,11 +23,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739823862,
|
||||
"narHash": "sha256-h08hlS0ImlONZfeemVMzo29PUC3/abdSb9muYO9E048=",
|
||||
"lastModified": 1752428473,
|
||||
"narHash": "sha256-IsE7fdAYbRlZuc0H5FtPfhhuHvlxnDGoAxdlnjpVNCU=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "675f98b0145f908897c4d899836bcb3dad9da79a",
|
||||
"revCount": 9,
|
||||
"rev": "1fad66b55144ab6beaecd900172a21ac3c34dc52",
|
||||
"revCount": 10,
|
||||
"type": "git",
|
||||
"url": "https://git.johnogle.info/johno/google-cookie-retrieval.git"
|
||||
},
|
||||
@@ -82,11 +43,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739724290,
|
||||
"narHash": "sha256-dvByZPuVmBgOBLq8GohBy9hEd0/JXj5goXK2OY1Pvgk=",
|
||||
"lastModified": 1752402455,
|
||||
"narHash": "sha256-mCHfZhQKdTj2JhCFcqfOfa3uKZbwUkPQbd0/zPnhOE8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "ec130e700959ee10b63eedbc87758d20264a9588",
|
||||
"rev": "bf893ad4cbf46610dd1b620c974f824e266cd1df",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -95,40 +56,17 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-doom-emacs-unstraightened": {
|
||||
"inputs": {
|
||||
"doomemacs": "doomemacs",
|
||||
"emacs-overlay": "emacs-overlay",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739694785,
|
||||
"narHash": "sha256-Ks7hzuFsxAAseVpUQssvbMvDCOrH4evVVU45Vx6wE3E=",
|
||||
"owner": "marienz",
|
||||
"repo": "nix-doom-emacs-unstraightened",
|
||||
"rev": "b8e20ff378f107c03d65d2b1dd849ebfe58fefd5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "marienz",
|
||||
"repo": "nix-doom-emacs-unstraightened",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739718817,
|
||||
"narHash": "sha256-J3tgc57E41sEVHQtQeCPNAh62NDnZrJCkSlaAj2gYs8=",
|
||||
"lastModified": 1752199438,
|
||||
"narHash": "sha256-xSBMmGtq8K4Qv80TMqREmESCAsRLJRHAbFH2T/2Bf1Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "c084e05fff6b2601de351e1bbee00485bf003f35",
|
||||
"rev": "d34d9412556d3a896e294534ccd25f53b6822e80",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -140,27 +78,27 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1739357830,
|
||||
"narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=",
|
||||
"lastModified": 1751792365,
|
||||
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a",
|
||||
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.11",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1739580444,
|
||||
"narHash": "sha256-+/bSz4EAVbqz8/HsIGLroF8aNaO8bLRL7WfACN+24g4=",
|
||||
"lastModified": 1751984180,
|
||||
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8bb37161a0488b89830168b81c48aed11569cb93",
|
||||
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -180,11 +118,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739557722,
|
||||
"narHash": "sha256-XikzLpPUDYiNyJ4w2SfRShdbSkIgE3btYdxCGInmtc4=",
|
||||
"lastModified": 1748196248,
|
||||
"narHash": "sha256-1iHjsH6/5UOerJEoZKE+Gx1BgAoge/YcnUsOA4wQ/BU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"rev": "1f3e1f38dedbbb8aad77e184fb54ec518e2d9522",
|
||||
"rev": "b7697abe89967839b273a863a3805345ea54ab56",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -197,46 +135,9 @@
|
||||
"inputs": {
|
||||
"google-cookie-retrieval": "google-cookie-retrieval",
|
||||
"home-manager": "home-manager",
|
||||
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"plasma-manager": "plasma-manager",
|
||||
"sops-nix": "sops-nix"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739262228,
|
||||
"narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975",
|
||||
"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"
|
||||
"plasma-manager": "plasma-manager"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
25
flake.nix
25
flake.nix
@@ -5,11 +5,6 @@
|
||||
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 = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -21,11 +16,6 @@
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
|
||||
nix-doom-emacs-unstraightened = {
|
||||
url = "github:marienz/nix-doom-emacs-unstraightened";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
google-cookie-retrieval = {
|
||||
url = "git+https://git.johnogle.info/johno/google-cookie-retrieval.git";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -35,14 +25,12 @@
|
||||
outputs = { self, nixpkgs, nixos-wsl, ... } @ inputs: let
|
||||
baseModules = [
|
||||
./roles
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.sharedModules = [
|
||||
inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||
inputs.nix-doom-emacs-unstraightened.hmModule
|
||||
];
|
||||
home-manager.extraSpecialArgs = {
|
||||
globalInputs = inputs;
|
||||
@@ -86,11 +74,22 @@
|
||||
];
|
||||
};
|
||||
|
||||
# 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.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
|
||||
inputs.nix-doom-emacs-unstraightened.hmModule
|
||||
./home/home.nix
|
||||
];
|
||||
extraSpecialArgs = {
|
||||
|
||||
@@ -39,6 +39,8 @@ in
|
||||
# '')
|
||||
|
||||
pkgs.bitwarden
|
||||
pkgs.claude-code
|
||||
pkgs.codex
|
||||
pkgs.dunst
|
||||
pkgs.element-desktop
|
||||
pkgs.fd
|
||||
@@ -54,16 +56,22 @@ in
|
||||
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
|
||||
|
||||
## Kubernetes cluster management
|
||||
pkgs.kubectl
|
||||
pkgs.kubernetes-helm
|
||||
|
||||
globalInputs.google-cookie-retrieval.packages.${system}.default
|
||||
];
|
||||
|
||||
@@ -80,11 +88,6 @@ in
|
||||
# org.gradle.console=verbose
|
||||
# org.gradle.daemon.idletimeout=3600000
|
||||
# '';
|
||||
|
||||
".profile".text = ''
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
[ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ] && . "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
'';
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
@@ -111,8 +114,6 @@ in
|
||||
home.sessionPath = [
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
imports = [
|
||||
./modules/emacs
|
||||
./modules/i3+sway
|
||||
@@ -120,7 +121,16 @@ in
|
||||
./modules/tmux
|
||||
];
|
||||
|
||||
programs.bash.enable = 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.
|
||||
programs.home-manager.enable = true;
|
||||
@@ -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.k9s.enable = true;
|
||||
@@ -187,6 +188,10 @@ in
|
||||
package = pkgs.kdePackages.kdeconnect-kde;
|
||||
};
|
||||
|
||||
services.gnome-keyring = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
tray = {
|
||||
|
||||
@@ -2,10 +2,21 @@
|
||||
|
||||
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
|
||||
@@ -19,15 +30,18 @@ with lib;
|
||||
pkgs.python3
|
||||
];
|
||||
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
doomDir = ./doom;
|
||||
};
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.file."${config.xdg.configHome}/emacs".source = doomEmacs;
|
||||
home.sessionPath = [
|
||||
"${config.xdg.configHome}/emacs/bin"
|
||||
];
|
||||
|
||||
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-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...
|
||||
|
||||
@@ -50,3 +50,5 @@
|
||||
;; (unpin! t)
|
||||
|
||||
;; (package! org-caldav)
|
||||
|
||||
(package! gptel :recipe (:nonrecursive t))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# your system. Help is available in the configuration.nix(5) man page, on
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{ lib, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
@@ -14,9 +14,17 @@ with lib;
|
||||
|
||||
roles = {
|
||||
audio.enable = true;
|
||||
bluetooth.enable = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
gaming = true;
|
||||
kde = true;
|
||||
sddm = true;
|
||||
wayland = true;
|
||||
};
|
||||
kodi = {
|
||||
enable = true;
|
||||
autologin = true;
|
||||
autologin = false;
|
||||
wayland = true;
|
||||
};
|
||||
users.enable = true;
|
||||
@@ -28,9 +36,15 @@ with lib;
|
||||
|
||||
networking.hostName = "boxy"; # Define your hostname.
|
||||
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
hardware.graphics.enable = true;
|
||||
|
||||
services.displayManager.enable = mkForce false;
|
||||
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 = [ ];
|
||||
|
||||
|
||||
95
machines/live-usb/configuration.nix
Normal file
95
machines/live-usb/configuration.nix
Normal file
@@ -0,0 +1,95 @@
|
||||
# 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;
|
||||
users = {
|
||||
enable = true;
|
||||
extraGroups = [ "video" "wheel" "networkmanager" ];
|
||||
};
|
||||
};
|
||||
|
||||
# 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;
|
||||
};
|
||||
};
|
||||
|
||||
# Override default nixos user, set johno as the main user with password
|
||||
users.users.nixos.enable = false;
|
||||
users.users.johno = {
|
||||
isNormalUser = true;
|
||||
description = "John Ogle";
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
|
||||
password = "nixos"; # Simple password for live environment
|
||||
};
|
||||
|
||||
# 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;
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
desktop = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
gaming = true;
|
||||
gaming = false;
|
||||
kde = true;
|
||||
sddm = true;
|
||||
};
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
enable = true;
|
||||
wayland = true;
|
||||
};
|
||||
users.enable = true;
|
||||
};
|
||||
|
||||
networking.hostName = "wixos";
|
||||
@@ -33,7 +34,7 @@
|
||||
enable = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
mesa.drivers
|
||||
mesa
|
||||
libvdpau-va-gl
|
||||
vaapiVdpau
|
||||
];
|
||||
|
||||
@@ -10,7 +10,6 @@ with lib;
|
||||
./kodi
|
||||
./nfs-mounts
|
||||
./printing
|
||||
./secrets
|
||||
./spotifyd
|
||||
./users
|
||||
./virtualisation
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.desktop;
|
||||
in
|
||||
{
|
||||
options.roles.desktop = {
|
||||
enable = mkEnableOption "Enable the desktop role.";
|
||||
|
||||
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."; };
|
||||
@@ -20,17 +18,7 @@ in
|
||||
./wayland.nix
|
||||
./gaming.nix
|
||||
./kde.nix
|
||||
./programs.nix
|
||||
./sddm.nix
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
brightnessctl
|
||||
emacs-nox
|
||||
];
|
||||
|
||||
programs.dconf.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
programs.kdeconnect.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ in
|
||||
environment.systemPackages = with pkgs; [
|
||||
steam
|
||||
lutris
|
||||
moonlight
|
||||
];
|
||||
|
||||
# Possibly other gaming specific services or settings
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.desktop;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
brightnessctl
|
||||
emacs-nox
|
||||
moonlight-qt
|
||||
];
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
@@ -27,45 +27,30 @@ in
|
||||
]);
|
||||
in mkIf cfg.enable
|
||||
{
|
||||
users.extraUsers.kodi.isNormalUser = true;
|
||||
users.extraUsers.kodi = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 8080 ];
|
||||
allowedUDPPorts = [ 8080 ];
|
||||
};
|
||||
|
||||
services = if cfg.autologin then mkMerge [
|
||||
(mkIf cfg.wayland {
|
||||
cage = mkIf cfg.wayland {
|
||||
user = "kodi";
|
||||
program = "${kodiPkg}/bin/kodi-standalone";
|
||||
enable = true;
|
||||
};
|
||||
xserver = {
|
||||
enable = false;
|
||||
autorun = false;
|
||||
};
|
||||
})
|
||||
environment.systemPackages = with pkgs; [
|
||||
kodiPkg
|
||||
wget
|
||||
];
|
||||
|
||||
(mkIf (!cfg.wayland) {
|
||||
xserver = {
|
||||
enable = true;
|
||||
desktopManager.kodi = {
|
||||
enable = true;
|
||||
package = kodiPkg;
|
||||
};
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
greeter.enable = false;
|
||||
};
|
||||
};
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
services = if cfg.autologin then {
|
||||
displayManager = {
|
||||
autoLogin.enable = true;
|
||||
autoLogin.user = "kodi";
|
||||
defaultSession = "kodi";
|
||||
sessionData.autologinSession = "kodi";
|
||||
sessionData.autologinSession = "plasma";
|
||||
};
|
||||
})
|
||||
] else {};
|
||||
} else {};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,5 +19,12 @@ in
|
||||
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";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 = {};
|
||||
}
|
||||
@@ -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