Compare commits
1 Commits
main
...
bead/nixos
| Author | SHA1 | Date | |
|---|---|---|---|
| aee77e91c7 |
@@ -9,7 +9,7 @@ Directory Structure:
|
|||||||
----------------------
|
----------------------
|
||||||
• packages/ - Custom Nix packages leveraged across various configurations.
|
• 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.
|
• 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.
|
• machines/ - Machine-specific configurations (e.g., nix-book, zix790prors, boxy) 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).
|
• home/ - Home-manager configurations for personal environments and application settings (e.g., home-nix-book.nix, home-z790prors.nix).
|
||||||
|
|
||||||
Design Principles:
|
Design Principles:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ This is a NixOS configuration repository using flakes, managing multiple machine
|
|||||||
|
|
||||||
### Flake Structure
|
### Flake Structure
|
||||||
- **flake.nix**: Main entry point defining inputs (nixpkgs, home-manager, plasma-manager, etc.) and outputs for multiple NixOS configurations
|
- **flake.nix**: Main entry point defining inputs (nixpkgs, home-manager, plasma-manager, etc.) and outputs for multiple NixOS configurations
|
||||||
- **Machines**: `nix-book`, `boxy`, `wixos` (WSL configuration), `zix790prors`, `live-usb`, `johno-macbookpro` (Darwin/macOS)
|
- **Machines**: `nix-book`, `boxy`, `zix790prors`, `live-usb`, `johno-macbookpro` (Darwin/macOS)
|
||||||
- **Home configurations**: Standalone home-manager configuration for user `johno`
|
- **Home configurations**: Standalone home-manager configuration for user `johno`
|
||||||
|
|
||||||
### Directory Structure
|
### Directory Structure
|
||||||
@@ -74,7 +74,6 @@ The repository also uses a modular home-manager role system for user-space confi
|
|||||||
- **nix-book**: Compact laptop → excludes office/media roles due to SSD space constraints
|
- **nix-book**: Compact laptop → excludes office/media roles due to SSD space constraints
|
||||||
- **boxy**: Living room media center → optimized for media consumption, excludes sync/office (shared machine)
|
- **boxy**: Living room media center → optimized for media consumption, excludes sync/office (shared machine)
|
||||||
- **zix790prors**: All-purpose workstation → full desktop experience with all roles enabled
|
- **zix790prors**: All-purpose workstation → full desktop experience with all roles enabled
|
||||||
- **wixos**: WSL2 development → full desktop experience, inherits from zix790prors Windows host
|
|
||||||
- **live-usb**: Temporary environment → only base + desktop roles, no persistent services
|
- **live-usb**: Temporary environment → only base + desktop roles, no persistent services
|
||||||
- **johno-macbookpro**: macOS work laptop → Darwin-specific configuration with development tools
|
- **johno-macbookpro**: macOS work laptop → Darwin-specific configuration with development tools
|
||||||
|
|
||||||
@@ -107,7 +106,6 @@ darwin-rebuild build --flake .#johno-macbookpro
|
|||||||
- `nix-book`: Compact laptop with storage constraints, uses `home/home-laptop-compact.nix`
|
- `nix-book`: Compact laptop with storage constraints, uses `home/home-laptop-compact.nix`
|
||||||
- `boxy`: Shared living room media center/gaming desktop with AMD GPU, uses `home/home-media-center.nix`
|
- `boxy`: Shared living room media center/gaming desktop with AMD GPU, uses `home/home-media-center.nix`
|
||||||
- `zix790prors`: Powerful all-purpose workstation (gaming, 3D modeling, development), dual-boots Windows 11 with shared btrfs /games partition, uses `home/home-desktop.nix`
|
- `zix790prors`: Powerful all-purpose workstation (gaming, 3D modeling, development), dual-boots Windows 11 with shared btrfs /games partition, uses `home/home-desktop.nix`
|
||||||
- `wixos`: WSL2 development environment running in Windows partition of zix790prors, uses `home/home-desktop.nix`
|
|
||||||
- `live-usb`: Bootable ISO configuration, uses `home/home-live-usb.nix`
|
- `live-usb`: Bootable ISO configuration, uses `home/home-live-usb.nix`
|
||||||
- `johno-macbookpro`: macOS work laptop, uses `home/home-darwin-work.nix`
|
- `johno-macbookpro`: macOS work laptop, uses `home/home-darwin-work.nix`
|
||||||
|
|
||||||
|
|||||||
67
flake.lock
generated
67
flake.lock
generated
@@ -60,22 +60,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1765121682,
|
|
||||||
"narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
@@ -241,38 +225,18 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixos-wsl": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1765841014,
|
|
||||||
"narHash": "sha256-55V0AJ36V5Egh4kMhWtDh117eE3GOjwq5LhwxDn9eHg=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "NixOS-WSL",
|
|
||||||
"rev": "be4af8042e7a61fa12fda58fe9a3b3babdefe17b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"ref": "main",
|
|
||||||
"repo": "NixOS-WSL",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765472234,
|
"lastModified": 1767480499,
|
||||||
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
|
"narHash": "sha256-8IQQUorUGiSmFaPnLSo2+T+rjHtiNWc+OAzeHck7N48=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
|
"rev": "30a3c519afcf3f99e2c6df3b359aec5692054d92",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-25.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -293,22 +257,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1767480499,
|
|
||||||
"narHash": "sha256-8IQQUorUGiSmFaPnLSo2+T+rjHtiNWc+OAzeHck7N48=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "30a3c519afcf3f99e2c6df3b359aec5692054d92",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-25.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plasma-manager": {
|
"plasma-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": [
|
"home-manager": [
|
||||||
@@ -364,8 +312,7 @@
|
|||||||
"jovian": "jovian",
|
"jovian": "jovian",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
|
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
|
||||||
"nixos-wsl": "nixos-wsl",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs": "nixpkgs_2",
|
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"plasma-manager": "plasma-manager",
|
"plasma-manager": "plasma-manager",
|
||||||
"plasma-manager-unstable": "plasma-manager-unstable"
|
"plasma-manager-unstable": "plasma-manager-unstable"
|
||||||
|
|||||||
19
flake.nix
19
flake.nix
@@ -4,8 +4,7 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
|
||||||
|
|
||||||
nix-darwin = {
|
nix-darwin = {
|
||||||
url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
|
url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -55,7 +54,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixpkgs-unstable, nixos-wsl, ... } @ inputs: let
|
outputs = { self, nixpkgs, nixpkgs-unstable, ... } @ inputs: let
|
||||||
# Shared overlay function to reduce duplication across module sets
|
# Shared overlay function to reduce duplication across module sets
|
||||||
# Parameters:
|
# Parameters:
|
||||||
# unstableOverlays: Additional overlays to apply when importing nixpkgs-unstable
|
# unstableOverlays: Additional overlays to apply when importing nixpkgs-unstable
|
||||||
@@ -84,6 +83,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
nixosModules = [
|
nixosModules = [
|
||||||
./roles
|
./roles
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
@@ -157,19 +157,6 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.wixos = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = nixosModules ++ [
|
|
||||||
nixos-wsl.nixosModules.default
|
|
||||||
./machines/wixos/configuration.nix
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.users.johno = import ./home/home-desktop.nix;
|
|
||||||
home-manager.extraSpecialArgs = { inherit system; };
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.zix790prors = nixpkgs.lib.nixosSystem rec {
|
nixosConfigurations.zix790prors = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = nixosModules ++ [
|
modules = nixosModules ++ [
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
base.enable = true;
|
base.enable = true;
|
||||||
development.enable = true;
|
development.enable = true;
|
||||||
emacs.enable = true;
|
emacs.enable = true;
|
||||||
kubectl.enable = true;
|
|
||||||
starship.enable = true;
|
starship.enable = true;
|
||||||
tmux.enable = true;
|
tmux.enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ in
|
|||||||
|
|
||||||
# Custom packages
|
# Custom packages
|
||||||
pkgs.custom.tea-rbw
|
pkgs.custom.tea-rbw
|
||||||
|
pkgs.custom.perles
|
||||||
];
|
];
|
||||||
|
|
||||||
# Install Claude Code humanlayer command and agent plugins
|
# Install Claude Code humanlayer command and agent plugins
|
||||||
|
|||||||
@@ -167,20 +167,6 @@
|
|||||||
claude-code-ide-window-side 'right
|
claude-code-ide-window-side 'right
|
||||||
claude-code-ide-window-width 90))
|
claude-code-ide-window-width 90))
|
||||||
|
|
||||||
(use-package! beads
|
|
||||||
:commands (beads)
|
|
||||||
:init
|
|
||||||
(map! :leader
|
|
||||||
(:prefix ("o" . "open")
|
|
||||||
(:prefix ("B" . "beads")
|
|
||||||
:desc "List issues" "B" (cmd! (require 'beads) (beads-list))
|
|
||||||
:desc "Project issues" "p" (cmd! (require 'beads) (beads-project-list))
|
|
||||||
:desc "Activity feed" "a" (cmd! (require 'beads) (beads-activity))
|
|
||||||
:desc "Stale issues" "s" (cmd! (require 'beads) (beads-stale))
|
|
||||||
:desc "Orphaned issues" "o" (cmd! (require 'beads) (beads-orphans))
|
|
||||||
:desc "Find duplicates" "d" (cmd! (require 'beads) (beads-duplicates))
|
|
||||||
:desc "Lint issues" "l" (cmd! (require 'beads) (beads-lint))))))
|
|
||||||
|
|
||||||
(after! gptel
|
(after! gptel
|
||||||
(require 'gptel-tool-library)
|
(require 'gptel-tool-library)
|
||||||
(setq gptel-tool-library-use-maybe-safe t
|
(setq gptel-tool-library-use-maybe-safe t
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ with lib;
|
|||||||
enable = true;
|
enable = true;
|
||||||
autologin = true;
|
autologin = true;
|
||||||
wayland = true;
|
wayland = true;
|
||||||
appLauncherServer = true;
|
|
||||||
jellyfinScaleFactor = 1.0;
|
jellyfinScaleFactor = 1.0;
|
||||||
};
|
};
|
||||||
nfs-mounts.enable = true;
|
nfs-mounts.enable = true;
|
||||||
|
|||||||
@@ -104,23 +104,6 @@ with lib;
|
|||||||
# User configuration
|
# User configuration
|
||||||
roles.users.enable = true;
|
roles.users.enable = true;
|
||||||
|
|
||||||
# k3s agent configuration
|
|
||||||
roles.k3s-node = {
|
|
||||||
enable = true;
|
|
||||||
role = "agent";
|
|
||||||
# serverAddr defaults to https://10.0.0.222:6443
|
|
||||||
# tokenFile defaults to /etc/k3s/token
|
|
||||||
extraFlags = [
|
|
||||||
# Node labels for workload scheduling
|
|
||||||
# fast-cpu: This node has a faster CPU than other cluster nodes
|
|
||||||
"--node-label=fast-cpu=true"
|
|
||||||
# fast-storage: This node is the NFS host with fast local storage access
|
|
||||||
"--node-label=fast-storage=true"
|
|
||||||
# k3s-upgrade=disabled: NixOS manages k3s upgrades via Nix, not system-upgrade-controller
|
|
||||||
"--node-label=k3s-upgrade=disabled"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Time zone
|
# Time zone
|
||||||
time.timeZone = "America/Los_Angeles"; # Adjust as needed
|
time.timeZone = "America/Los_Angeles"; # Adjust as needed
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,14 @@
|
|||||||
boot.initrd.luks.devices."luks-b614167b-9045-4234-a441-ac6f60a96d81".device = "/dev/disk/by-uuid/b614167b-9045-4234-a441-ac6f60a96d81";
|
boot.initrd.luks.devices."luks-b614167b-9045-4234-a441-ac6f60a96d81".device = "/dev/disk/by-uuid/b614167b-9045-4234-a441-ac6f60a96d81";
|
||||||
|
|
||||||
services.logind.settings.Login = {
|
services.logind.settings.Login = {
|
||||||
|
HandleLidSwitch = "suspend-then-hibernate";
|
||||||
HandlePowerKey = "hibernate";
|
HandlePowerKey = "hibernate";
|
||||||
HandlePowerKeyLongPress = "poweroff";
|
HandlePowerKeyLongPress = "poweroff";
|
||||||
};
|
};
|
||||||
|
systemd.sleep.extraConfig = ''
|
||||||
|
HibernateDelaySec=30m
|
||||||
|
SuspendState=mem
|
||||||
|
'';
|
||||||
|
|
||||||
networking.hostName = "nix-book"; # Define your hostname.
|
networking.hostName = "nix-book"; # Define your hostname.
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|||||||
@@ -1,56 +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, 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;
|
|
||||||
};
|
|
||||||
nvidia = {
|
|
||||||
enable = true;
|
|
||||||
package = "latest";
|
|
||||||
graphics.extraPackages = with pkgs; [
|
|
||||||
mesa
|
|
||||||
libvdpau-va-gl
|
|
||||||
libva-vdpau-driver
|
|
||||||
];
|
|
||||||
};
|
|
||||||
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";
|
|
||||||
|
|
||||||
# WSL-specific environment variables for graphics
|
|
||||||
environment.sessionVariables = {
|
|
||||||
LD_LIBRARY_PATH = [
|
|
||||||
"/usr/lib/wsl/lib"
|
|
||||||
"/run/opengl-driver/lib"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# 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?
|
|
||||||
}
|
|
||||||
@@ -25,7 +25,6 @@ with lib;
|
|||||||
wayland = true;
|
wayland = true;
|
||||||
x11 = true;
|
x11 = true;
|
||||||
};
|
};
|
||||||
kodi.enable = true;
|
|
||||||
nfs-mounts.enable = true;
|
nfs-mounts.enable = true;
|
||||||
nvidia = {
|
nvidia = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -3,4 +3,5 @@
|
|||||||
tea-rbw = pkgs.callPackage ./tea-rbw {};
|
tea-rbw = pkgs.callPackage ./tea-rbw {};
|
||||||
app-launcher-server = pkgs.callPackage ./app-launcher-server {};
|
app-launcher-server = pkgs.callPackage ./app-launcher-server {};
|
||||||
claude-code = pkgs.callPackage ./claude-code {};
|
claude-code = pkgs.callPackage ./claude-code {};
|
||||||
|
perles = pkgs.callPackage ./perles {};
|
||||||
}
|
}
|
||||||
|
|||||||
26
packages/perles/default.nix
Normal file
26
packages/perles/default.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ lib, buildGoModule, fetchFromGitHub }:
|
||||||
|
|
||||||
|
buildGoModule rec {
|
||||||
|
pname = "perles";
|
||||||
|
version = "unstable-2025-01-09";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "zjrosen";
|
||||||
|
repo = "perles";
|
||||||
|
rev = "main";
|
||||||
|
hash = "sha256-JgRayb4+mJ1r0AtdnQfqAw2+QRte+licsfZOaRgYqcs=";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendorHash = "sha256-R7UWTdBuPteneRqxrWK51nqLtZwDsqQoMAcohN4fyak=";
|
||||||
|
|
||||||
|
# Tests require a real git repository context
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A TUI for the Beads issue tracking system with BQL query language";
|
||||||
|
homepage = "https://github.com/zjrosen/perles";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = [ ];
|
||||||
|
mainProgram = "perles";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -9,7 +9,6 @@ with lib;
|
|||||||
./bluetooth
|
./bluetooth
|
||||||
./btrfs
|
./btrfs
|
||||||
./desktop
|
./desktop
|
||||||
./k3s-node
|
|
||||||
./kodi
|
./kodi
|
||||||
./nfs-mounts
|
./nfs-mounts
|
||||||
./nvidia
|
./nvidia
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.roles.k3s-node;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.roles.k3s-node = {
|
|
||||||
enable = mkEnableOption "Enable k3s node";
|
|
||||||
|
|
||||||
role = mkOption {
|
|
||||||
type = types.enum [ "server" "agent" ];
|
|
||||||
default = "agent";
|
|
||||||
description = "k3s role: server (control plane) or agent (worker)";
|
|
||||||
};
|
|
||||||
|
|
||||||
serverAddr = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "https://10.0.0.222:6443";
|
|
||||||
description = "URL of k3s server to join (required for agents, used for HA servers)";
|
|
||||||
};
|
|
||||||
|
|
||||||
tokenFile = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
default = "/etc/k3s/token";
|
|
||||||
description = "Path to file containing the cluster join token";
|
|
||||||
};
|
|
||||||
|
|
||||||
clusterInit = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Initialize a new cluster (first server only)";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraFlags = mkOption {
|
|
||||||
type = types.listOf types.str;
|
|
||||||
default = [];
|
|
||||||
description = "Additional flags to pass to k3s";
|
|
||||||
};
|
|
||||||
|
|
||||||
gracefulNodeShutdown = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Enable graceful node shutdown";
|
|
||||||
};
|
|
||||||
|
|
||||||
openFirewall = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Open firewall ports for k3s";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
# k3s service configuration
|
|
||||||
services.k3s = {
|
|
||||||
enable = true;
|
|
||||||
role = cfg.role;
|
|
||||||
tokenFile = cfg.tokenFile;
|
|
||||||
extraFlags = cfg.extraFlags;
|
|
||||||
gracefulNodeShutdown.enable = cfg.gracefulNodeShutdown;
|
|
||||||
serverAddr = if (cfg.role == "agent" || !cfg.clusterInit) then cfg.serverAddr else "";
|
|
||||||
clusterInit = cfg.role == "server" && cfg.clusterInit;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Firewall rules for k3s
|
|
||||||
networking.firewall = mkIf cfg.openFirewall {
|
|
||||||
allowedTCPPorts = [
|
|
||||||
6443 # k3s API server
|
|
||||||
10250 # kubelet metrics
|
|
||||||
] ++ optionals (cfg.role == "server") [
|
|
||||||
2379 # etcd clients (HA)
|
|
||||||
2380 # etcd peers (HA)
|
|
||||||
];
|
|
||||||
allowedUDPPorts = [
|
|
||||||
8472 # flannel VXLAN
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -22,7 +22,7 @@ in
|
|||||||
appLauncherServer = {
|
appLauncherServer = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = true;
|
||||||
description = "Enable HTTP app launcher server for remote control";
|
description = "Enable HTTP app launcher server for remote control";
|
||||||
};
|
};
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
|
|||||||
Reference in New Issue
Block a user