1
0
Fork 0

Modularize K8s and gaming configs

This commit is contained in:
Aires 2024-03-11 12:27:30 -04:00
parent 5fca149b6c
commit 330bcc0360
6 changed files with 41 additions and 40 deletions

View file

@ -117,11 +117,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709904018, "lastModified": 1710164657,
"narHash": "sha256-fVp/89wNjWg7OQ/Gj3eSK2IXKDk9mXSj5ltOz98Ce2w=", "narHash": "sha256-l64+ZjaQAVkHDVaK0VHwtXBdjcBD6nLBD+p7IfyBp/w=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "8b07ca541939211d3cc437ddfd74ebdef3d72471", "rev": "017b12de5b899ef9b64e2c035ce257bfe95b8ae2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -174,11 +174,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1709410583, "lastModified": 1710123225,
"narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=", "narHash": "sha256-j3oWlxRZxB7cFsgEntpH3rosjFHRkAo/dhX9H3OfxtY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc", "rev": "ad2fd7b978d5e462048729a6c635c45d3d33c9ba",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -222,11 +222,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1709703039, "lastModified": 1709961763,
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -15,6 +15,7 @@ in
host = { host = {
role = "server"; role = "server";
development.kubernetes.enable = true;
services = { services = {
apcupsd.enable = true; apcupsd.enable = true;
duplicacy-web = { duplicacy-web = {

View file

@ -23,7 +23,10 @@ in
host = { host = {
role = "workstation"; role = "workstation";
apps = { apps = {
development.enable = true; development = {
enable = true;
kubernetes.enable = true;
};
dj.enable = true; dj.enable = true;
gaming.enable = true; gaming.enable = true;
hugo.enable = true; hugo.enable = true;
@ -54,23 +57,6 @@ in
}; };
}; };
# Configure users
users.users = {
aires = {
extraGroups = [ "libvirt" "gremlin" ];
};
gremlin = {
extraGroups = [ "libvirt" ];
};
};
# Add packages specific to Shura
environment.systemPackages = with pkgs; [
kubectl
kubevirt # Virtctl command-line tool
linuxKernel.packages.linux_zen.xpadneo # Xbox controller driver
];
# Move files into target system # Move files into target system
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
# Use gremlin user's monitor config for GDM (defined above) # Use gremlin user's monitor config for GDM (defined above)

View file

@ -29,12 +29,8 @@
kernelModules = [ kernelModules = [
"kvm-amd" "kvm-amd"
"hid_xpadneo"
]; ];
# Add XPadNeo
extraModulePackages = with config.boot.kernelPackages; [ xpadneo ];
# Add kernel patch to enable sound over the speakers. # Add kernel patch to enable sound over the speakers.
# This might not be necessary for long - see https://forums.lenovo.com/topic/findpost/27/5258964/6212600 # This might not be necessary for long - see https://forums.lenovo.com/topic/findpost/27/5258964/6212600
#kernelPatches = [{ #kernelPatches = [{

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.host.apps.development; cfg = config.host.apps.development;
@ -6,15 +6,27 @@ in
with lib; with lib;
{ {
options = { options = {
host.apps.development.enable = mkEnableOption (mdDoc "Enables development tools"); host.apps.development = {
enable = mkEnableOption (mdDoc "Enables development tools");
kubernetes.enable = mkEnableOption (mdDoc "Enables kubectl, virtctl, and similar tools.");
};
}; };
config = mkIf cfg.enable { config = mkMerge [
host.ui.flatpak.enable = true; (mkIf cfg.enable {
host.ui.flatpak.enable = true;
services.flatpak.packages = [ services.flatpak.packages = [
"com.vscodium.codium" "com.vscodium.codium"
"dev.k8slens.OpenLens" "dev.k8slens.OpenLens"
]; ];
}; })
(mkIf (cfg.kubernetes.enable) {
environment.systemPackages = with pkgs; [
kubectl
kubernetes-helm
kubevirt # Virtctl command-line tool
];
})
];
} }

View file

@ -16,5 +16,11 @@ with lib;
"com.valvesoftware.Steam" "com.valvesoftware.Steam"
"org.firestormviewer.FirestormViewer" "org.firestormviewer.FirestormViewer"
]; ];
# Enable Xbox controller driver (XPadNeo)
boot = {
extraModulePackages = with config.boot.kernelPackages; [ xpadneo ];
kernelModules = [ "hid_xpadneo" ];
};
}; };
} }