This commit is contained in:
ari committed 2024-08-21 14:54:51 -04:00
commit 1cfb7410a8
63 files changed
+712 -475

No files matched your search

+1
View File
@@ -153,6 +153,7 @@
localNixCaches = localNixCaches; localNixCaches = localNixCaches;
localDockerRegistries = localDockerRegistries; localDockerRegistries = localDockerRegistries;
homeManagerVersion = homeManagerVersion; homeManagerVersion = homeManagerVersion;
enableNetworkDrives = true;
desktop = { desktop = {
enable = true; enable = true;
user = user; user = user;
+7 -13
View File
@@ -29,20 +29,14 @@
options = [ "users" "nofail" ]; options = [ "users" "nofail" ];
}; };
fileSystems."/mnt/EightTerra/DownloadedTorrents" = {
device = "tnas1.lab.internal:/mnt/EightTerra/DownloadedTorrents";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
fileSystems."/mnt/EightTerra/k3s-cluster" = {
device = "tnas1.lab.internal:/mnt/EightTerra/k3s-cluster";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
swapDevices = swapDevices =
[{ device = "/dev/disk/by-uuid/5175a4b0-0067-47c6-b7da-35acb247f134"; }]; [
{ device = "/dev/disk/by-uuid/5175a4b0-0067-47c6-b7da-35acb247f134"; }
{
device = "/swapfile";
size = 16 * 1024; # 16GB
}
];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+16
View File
@@ -6,7 +6,15 @@ let
in in
{ {
imports = [ ./fwbook.hardware-configuration.nix ]; imports = [ ./fwbook.hardware-configuration.nix ];
# Skyg
skyg.user.enabled = true; skyg.user.enabled = true;
skyg.server.admin.enable = true;
skyg.nixos.desktop = {
enabled = true;
kde.enabled = true;
};
skyg.nixos.common.hardware.sound.enable = true;
# Firmware updater
services.fwupd.enable = true; services.fwupd.enable = true;
services.fwupd.package = (import services.fwupd.package = (import
(builtins.fetchTarball { (builtins.fetchTarball {
@@ -16,7 +24,15 @@ in
}) })
{ inherit (pkgs) system; }).fwupd; { inherit (pkgs) system; }).fwupd;
services.fprintd.enable = true; services.fprintd.enable = true;
# Yubikey
services.yubikey-agent.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Bluetooth
hardware.bluetooth.settings.General = { ControllerMode = "bredr"; }; hardware.bluetooth.settings.General = { ControllerMode = "bredr"; };
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
+12 -41
View File
@@ -1,7 +1,12 @@
{ user }: { user }:
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }:
{
imports = [ ./hl-bigbox1.hardware-configuration.nix ]; imports = [ ./hl-bigbox1.hardware-configuration.nix ];
skyg.user.enabled = true; skyg.user.enabled = true;
skyg.nixos.common.ssh-server.enabled = true;
skyg.nixos.server.services.ai.enable = true;
skyg.nixos.server.services.jellyfin.enable = true;
skyg.server.admin.enable = true;
# firmware updater # firmware updater
services.fwupd.enable = true; services.fwupd.enable = true;
virtualisation.docker.enableNvidia = true; virtualisation.docker.enableNvidia = true;
@@ -11,40 +16,6 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
# Containers
virtualisation.oci-containers = {
containers = {
ollama = {
autoStart = true;
image = "ollama/ollama";
extraOptions = [ "--gpus" "all" ];
ports = [ "11434:11434" ];
volumes = [ "ollama:/root/.ollama" ];
};
openwakeword = {
autoStart = true;
image = "rhasspy/wyoming-openwakeword";
cmd = [ "--preload-model" "ok_nabu" ];
ports = [ "10400:10400" ];
};
};
};
# Wyoming Service
services.wyoming = {
faster-whisper.servers.main-eng = {
enable = true;
device = "cpu";
model = "medium.en";
language = "en";
uri = "tcp://0.0.0.0:10300";
};
piper.servers.pier = {
enable = true;
uri = "tcp://0.0.0.0:10200";
voice = "en_GB-alan-medium";
};
};
# Nvidia Settings # Nvidia Settings
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.enable = true; services.xserver.enable = true;
@@ -60,12 +31,12 @@
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.stable;
}; };
# Steam Settings # Steam Settings
users.users.steam = { users.users.steam = {
shell = pkgs.zsh; shell = pkgs.zsh;
isNormalUser = true; isNormalUser = true;
description = "Steam User"; description = "Steam User";
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
}; };
programs.steam = { programs.steam = {
enable = true; enable = true;
remotePlay.openFirewall = true; remotePlay.openFirewall = true;
+2
View File
@@ -2,6 +2,8 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
imports = [ ./hl-minipc1.hardware-configuration.nix ]; imports = [ ./hl-minipc1.hardware-configuration.nix ];
skyg.user.enabled = true; skyg.user.enabled = true;
skyg.nixos.common.ssh-server.enabled = true;
skyg.server.admin.enable = true;
# firmware updater # firmware updater
services.fwupd.enable = true; services.fwupd.enable = true;
+17 -2
View File
@@ -1,12 +1,24 @@
{ user }: { user }:
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }:
let
openPorts = [
5000
5001
8000
22
];
in
{
imports = [ ./hl-minipc1.hardware-configuration.nix ]; imports = [ ./hl-minipc1.hardware-configuration.nix ];
skyg.user.enabled = true; skyg.user.enabled = true;
skyg.nixos.common.ssh-server.enabled = true;
skyg.server.admin.enable = true;
# Nix Stores # Nix Stores
services.nix-serve = { services.nix-serve = {
enable = true; enable = true;
secretKeyFile = "/var/keys/cache-priv-key.pem"; secretKeyFile = "/var/keys/cache-priv-key.pem";
port = 5000;
}; };
# firmware updater # firmware updater
services.fwupd.enable = true; services.fwupd.enable = true;
@@ -21,7 +33,7 @@
options = [ "nofail" ]; options = [ "nofail" ];
}; };
# Services # Services
skyg.homelab.services.audiobookshelf = { skyg.nixos.server.services.audiobookshelf = {
enable = true; enable = true;
host = "0.0.0.0"; host = "0.0.0.0";
openFirewall = true; openFirewall = true;
@@ -37,5 +49,8 @@
listenAddress = "0.0.0.0"; listenAddress = "0.0.0.0";
enableDelete = true; enableDelete = true;
}; };
# Firewall
networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts;
} }
+4 -2
View File
@@ -2,14 +2,16 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
imports = [ ./hl-minipc2.hardware-configuration.nix ]; imports = [ ./hl-minipc2.hardware-configuration.nix ];
skyg.user.enabled = true; skyg.user.enabled = true;
skyg.nixos.common.ssh-server.enabled = true;
# firmware updater # firmware updater
services.fwupd.enable = true; services.fwupd.enable = true;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# Disable firewall
networking.firewall.enable = false;
# Special udev rule for google's coral tpu # Special udev rule for google's coral tpu
skyg.homelab.udevrules.coraltpu.enable = true; skyg.nixos.server.udevrules.coraltpu.enable = true;
# Containers # Containers
virtualisation.oci-containers = { virtualisation.oci-containers = {
+5 -4
View File
@@ -1,6 +1,3 @@
# 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, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let let
kernel = config.boot.kernelPackages.kernel; kernel = config.boot.kernelPackages.kernel;
@@ -60,7 +57,11 @@ in
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };
fileSystems."/mnt/Data" =
{
device = "/dev/sda1";
fsType = "btrfs";
};
swapDevices = [ ]; swapDevices = [ ];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+32
View File
@@ -1,12 +1,44 @@
{ user }: { user }:
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
let
openPorts = [
# nfs
111
2049
4000
4001
4002
20048
# ssh
22
];
in
{ {
imports = [ ./hl-terra1.hardware-configuration.nix ]; imports = [ ./hl-terra1.hardware-configuration.nix ];
skyg.user.enabled = true; skyg.user.enabled = true;
skyg.nixos.common.ssh-server.enabled = true;
skyg.server.admin.enable = true;
# firmware updater # firmware updater
services.fwupd.enable = true; services.fwupd.enable = true;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
environment.systemPackages = with pkgs; [
btrfs-progs
];
# Firewall
networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts;
# NFS
services.nfs.server = {
enable = true;
lockdPort = 4001;
mountdPort = 4002;
statdPort = 4000;
extraNfsdConfig = '''';
exports = ''
/mnt/Data/apps 10.0.0.0/16(rw,wdelay,insecure,no_root_squash,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash)
'';
};
} }
@@ -1,7 +1,6 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./core.nix
./user.nix ./user.nix
./macos.nix ./macos.nix
./nix-substituters.nix ./nix-substituters.nix
File renamed without changes.
File renamed without changes.
File renamed without changes.
-23
View File
@@ -1,23 +0,0 @@
{ user
, enableX11 ? false
, enableGnome ? false
, enableKDE ? false
, enableHypr ? false
, enableWine ? false
, ...
}:
{ pkgs, ... }: {
imports = [ ./wayland.nix ] ++ (if enableX11 then [ ./x11.nix ] else [ ])
++ (if enableGnome then [ ./gnome.nix ] else [ ])
++ (if enableWine then [ ./wine.nix ] else [ ])
++ (if enableKDE then [ ./kde.nix ] else [ ]) ++ (if enableHypr then
[ (import ./hyprland.nix { user = user; }) ]
else
[ ]);
# Flatpak
services.flatpak.enable = true;
# Mobile Connect
programs.kdeconnect.enable = true;
# Web
}
-12
View File
@@ -1,12 +0,0 @@
{ pkgs, ... }:
{
services.xserver.desktopManager.gnome.enable = true;
environment.systemPackages = with pkgs; [
gnomeExtensions.vitals
];
# Exclude Gnome packages
environment.gnome.excludePackages = [
pkgs.gnome-tour
pkgs.gnome-console
];
}
-55
View File
@@ -1,55 +0,0 @@
{ user }:
{ pkgs, ... }: {
programs.hyprland = { enable = true; };
environment.sessionVariables = { NIXOS_OZONE_WL = "1"; };
programs.waybar.enable = false;
environment.systemPackages = with pkgs; [
# common utilities
busybox
scdoc
mpv
gcc
xdg-desktop-portal
# sound
pavucontrol
# notification daemon
dunst
libnotify
# hyprland
lxqt.lxqt-policykit
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
hyprlock
hypridle
hyprpaper
# color picker
hyprpicker
# nwg-shell
nwg-dock
nwg-dock-hyprland
nwg-launchers
nwg-displays
nwg-drawer
nwg-panel
gopsuinfo
nwg-look
nwg-menu
nwg-bar
# screenshots
swappy
hyprshot
# networking
networkmanagerapplet
meson
wl-clipboard
wlroots
cliphist
xdg-desktop-portal-wlr
# app launchers
rofi-wayland
wofi
];
services.mpd.enable = true;
services.pipewire.wireplumber.enable = true;
users.users.${user.name}.extraGroups = [ "input" ];
}
-15
View File
@@ -1,15 +0,0 @@
{ pkgs, ... }: {
services.desktopManager.plasma6.enable = true;
services.desktopManager.plasma6.notoPackage = pkgs.fira-code;
services.desktopManager.plasma6.enableQt5Integration = true;
environment.plasma6.excludePackages = with pkgs.kdePackages; [
konsole # terminal
elisa # media player
kate # text editor
gwenview # image viewer
];
environment.systemPackages = with pkgs; [
kdePackages.plasma-browser-integration
konsave # save configs
];
}
-11
View File
@@ -1,11 +0,0 @@
{ pkgs, ... }:
{
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
programs.xwayland.enable = true;
environment.systemPackages = with pkgs; [
wayland
wayland-protocols
wayland-utils
];
}
-8
View File
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
wineWowPackages.stable
winetricks
wineWowPackages.waylandFull
];
}
-8
View File
@@ -1,8 +0,0 @@
{ ... }:
{
services.xserver = {
enable = true;
xkb.layout = "us";
xkb.variant = "";
};
}
+11 -35
View File
@@ -3,6 +3,7 @@ let
makeCommonGitConfigs = (import ./git.nix).makeCommonGitConfigs; makeCommonGitConfigs = (import ./git.nix).makeCommonGitConfigs;
programsModule = (import ./programs.nix); programsModule = (import ./programs.nix);
servicesModule = (import ./services.nix); servicesModule = (import ./services.nix);
fontsModule = (import ./fonts.nix);
homeModule = { homeModule = {
stateVersion = stateVersion; stateVersion = stateVersion;
shellAliases = { shellAliases = {
@@ -21,6 +22,7 @@ in
}); });
}; };
services = servicesModule { pkgs = pkgs; }; services = servicesModule { pkgs = pkgs; };
fonts = fontsModule;
}; };
makeCommonUser = makeCommonUser =
@@ -31,49 +33,23 @@ in
, name , name
, ... , ...
}: { pkgs, ... }: { }: { pkgs, ... }: {
fonts = fontsModule;
home = homeModule // { home = homeModule // {
username = name; username = name;
homeDirectory = "/home/${name}"; homeDirectory = "/home/${name}";
packages = with pkgs; packages = with pkgs;
[ jq nixpkgs-fmt ipfetch nixd ] [
++ (if enableDevelopmentKit then [ jq
nixpkgs-fmt
ipfetch
nixd
htop
]
++ (if enableDevelopmentKit then [
devenv devenv
devbox devbox
terraform terraform
kubectl kubectl
# socials
slack
zoom-us
betterdiscordctl
discord
signal-desktop
whatsapp-for-linux
caprine-bin # facebook messenger
# development
vscode
# web
brave
# mail
thunderbird
# password
bitwarden-desktop
# documents
onlyoffice-bin_latest
# video
vlc
vlc-bittorrent
# terminal
alacritty
alacritty-theme
] else ] else
[ ]); [ ]);
}; };
+10
View File
@@ -0,0 +1,10 @@
{
fontconfig = {
enable = true;
defaultFonts = {
serif = [ "Fira Code" "DroidSansMono" ];
sansSerif = [ "Fira Code" "DroidSansMono" ];
monospace = [ "Fira Code" ];
};
};
}
+1 -1
View File
@@ -1,4 +1,4 @@
{ pkgs, ... }: { ... }:
{ {
gpg-agent = { gpg-agent = {
enable = true; enable = true;
+5 -15
View File
@@ -17,27 +17,17 @@
}: }:
{ pkgs, ... }: { { pkgs, ... }: {
imports = [ imports = [
(import ./skyg) (import ./core)
(import ./nixos) (import ./nixos)
] ++ (if desktop.enable then (import ./network-drives.nix)
[ (import ./desktop ({ user = user; } // desktop)) ] ];
else
[ ]) ++ (if os.enable then
[
(import ./os ({
user = user;
hostName = hostName;
} // os))
]
else
[ ])
++ (if enableNetworkDrives then [ (import ./network-drives.nix) ] else [ ])
;
# Share defaults # Share defaults
skyg.user = user; skyg.user = user;
skyg.core.hostName = hostName; skyg.core.hostName = hostName;
skyg.home-manager.version = homeManagerVersion; skyg.home-manager.version = homeManagerVersion;
skyg.core.substituters = localNixCaches; skyg.core.substituters = localNixCaches;
skyg.networkDrives.enabled = enableNetworkDrives;
skyg.nixos.common.containers = (if os.enable then os.containers else { });
system.stateVersion = systemStateVersion; system.stateVersion = systemStateVersion;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix = { nix = {
+36 -14
View File
@@ -1,19 +1,41 @@
{ ... }: { { lib
fileSystems."/mnt/EightTerra/DownloadedTorrents" = { , config
device = "tnas1.lab.internal:/mnt/EightTerra/DownloadedTorrents"; , ...
fsType = "nfs"; }:
options = [ "x-systemd.automount" "noauto" ]; with lib;
let
cfg = config.skyg.networkDrives;
in
{
options = {
skyg.networkDrives = {
enabled = mkEnableOption
"Network Drives";
};
}; };
config = mkIf cfg.enabled {
fileSystems."/torrents" = {
device = "tnas1.lab.internal:/mnt/EightTerra/DownloadedTorrents";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
fileSystems."/mnt/EightTerra/k3s-cluster" = { fileSystems."/mnt/EightTerra/k3s-cluster" = {
device = "tnas1.lab.internal:/mnt/EightTerra/k3s-cluster"; device = "tnas1.lab.internal:/mnt/EightTerra/k3s-cluster";
fsType = "nfs"; fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ]; options = [ "x-systemd.automount" "noauto" ];
}; };
fileSystems."/mnt/EightTerra/NVR" = { fileSystems."/mnt/EightTerra/NVR" = {
device = "tnas1.lab.internal:/mnt/EightTerra/NVR"; device = "tnas1.lab.internal:/mnt/EightTerra/NVR";
fsType = "nfs"; fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ]; options = [ "x-systemd.automount" "noauto" ];
};
fileSystems."/mnt/terra1/Data/apps" = {
device = "terra1.lab.internal:/mnt/Data/apps";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
}; };
} }
@@ -0,0 +1,26 @@
{ lib, ... }:
with lib;
{
imports = [
./docker.nix
./podman.nix
];
options = {
skyg.nixos.common.containers = {
runtime = mkOption {
description = "Docker vs podman";
type = types.str;
default = "docker";
};
enableOnBoot = mkOption {
type = types.bool;
default = false;
};
localDockerRegistries = mkOption {
type = types.listOf types.str;
};
};
};
}
@@ -0,0 +1,21 @@
{ config, pkgs, lib, ... }:
let
cfg = config.skyg.nixos.common.containers;
in
{
config = lib.mkIf (cfg.runtime == "docker") {
virtualisation.docker = {
enable = true;
autoPrune.enable = true;
enableOnBoot = cfg.enableOnBoot;
liveRestore = false;
daemon.settings = {
insecure-registries = cfg.localDockerRegistries;
};
};
environment.systemPackages = with pkgs; [ docker-compose ];
users.users.${config.skyg.user.name}.extraGroups = [ "docker" ];
virtualisation.oci-containers.backend = "docker";
};
}
@@ -0,0 +1,19 @@
{ config, pkgs, lib, ... }:
let
cfg = config.skyg.nixos.common.containers;
in
{
config = lib.mkIf (cfg.runtime == "podman") {
virtualisation.oci-containers.backend = "podman";
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
dockerSocket.enable = true;
autoPrune.enable = true;
};
};
environment.systemPackages = with pkgs; [ podman-compose podman-tui ];
};
}
@@ -1,12 +1,7 @@
{ user }: { pkgs, config, ... }:
{ pkgs, ... }:
{ {
# System Packages # System Packages
services.hydra.useSubstitutes = true; services.hydra.useSubstitutes = true;
services.nix-serve = {
enable = true;
port = 5000;
};
programs.dconf.enable = true; programs.dconf.enable = true;
programs.nix-ld.enable = true; programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@@ -16,7 +11,6 @@
# shell tools # shell tools
git git
usbutils usbutils
htop
# system utils # system utils
nfs-utils nfs-utils
@@ -43,7 +37,7 @@
enable = true; enable = true;
systemCronJobs = [ systemCronJobs = [
"* 23 * * * root nix-collect-garbage --delete-older-than 1d" "* 23 * * * root nix-collect-garbage --delete-older-than 1d"
"* 23 * * * ${user.name} nix-collect-garbage --delete-older-than 1d" "* 23 * * * ${config.skyg.user.name} nix-collect-garbage --delete-older-than 1d"
]; ];
}; };
} }
+6
View File
@@ -2,5 +2,11 @@
{ {
imports = [ imports = [
./hardware ./hardware
./containers
./core.nix
./networking.nix
./user.nix
./fonts.nix
./ssh-server.nix
]; ];
} }
@@ -1,6 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
# Fonts
fonts = { fonts = {
packages = with pkgs; [ packages = with pkgs; [
fira-code fira-code
@@ -3,5 +3,10 @@
imports = [ imports = [
./fan2go.nix ./fan2go.nix
./fancontrol.nix ./fancontrol.nix
./sound.nix
]; ];
# Firmware Updater
services.fwupd.enable = true;
# Enable all license firmware
hardware.enableAllFirmware = true;
} }
+2 -2
View File
@@ -5,7 +5,7 @@
, ... , ...
}: }:
let let
cfg = config.skyg.hardware.fan2go; cfg = config.skyg.nixos.common.hardware.fan2go;
fan2goConfig = pkgs.writeText "fan2go.yaml" '' fan2goConfig = pkgs.writeText "fan2go.yaml" ''
dbPath: ${cfg.dbPath} dbPath: ${cfg.dbPath}
@@ -65,7 +65,7 @@ let
''; '';
in in
{ {
options.skyg.hardware.fan2go = with lib; { options.skyg.nixos.common.hardware.fan2go = with lib; {
enable = mkEnableOption "fan2go"; enable = mkEnableOption "fan2go";
dbPath = mkOption { dbPath = mkOption {
+2 -2
View File
@@ -4,10 +4,10 @@
, ... , ...
}: }:
let let
cfg = config.skyg.hardware.fancontrol; cfg = config.skyg.nixos.common.hardware.fancontrol;
in in
{ {
options.skyg.hardware.fancontrol = with lib; { options.skyg.nixos.common.hardware.fancontrol = with lib; {
enable = mkEnableOption "fancontrol"; enable = mkEnableOption "fancontrol";
configName = mkOption { configName = mkOption {
type = types.str; type = types.str;
+25
View File
@@ -0,0 +1,25 @@
{ lib
, config
, ...
}:
let
cfg = config.skyg.nixos.common.hardware.sound;
in
{
options.skyg.nixos.common.hardware.sound = with lib; {
enable = mkEnableOption "sound";
};
config = lib.mkIf cfg.enable {
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
}
+34
View File
@@ -0,0 +1,34 @@
{ config, lib, ... }:
with lib;
let
cfg = config.skyg.core;
in
{
options = {
skyg.core = {
hostName = mkOption {
description = "Machine Hostname";
type = types.str;
};
};
};
config = {
# Define hostname.
networking.hostName = cfg.hostName;
# Enable networking
networking.networkmanager.enable = true;
# NFS Support
services.nfs.server.enable = true;
# Tailscale
services.tailscale.enable = true;
services.tailscale.useRoutingFeatures = "client";
# Disable the flaky nm service
systemd.services.NetworkManager-wait-online.enable = false;
};
}
+34
View File
@@ -0,0 +1,34 @@
{ config, lib, ... }:
with lib;
let
cfg = config.skyg.nixos.common.ssh-server;
in
{
options = {
skyg.nixos.common.ssh-server = {
enabled = mkEnableOption
"enable ssh server";
masterPubKey = mkOption {
type = types.str;
default = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared";
};
};
};
config = mkIf cfg.enabled {
services.openssh = {
enable = true;
openFirewall = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "yes";
};
users.users.${config.skyg.user.name}.openssh.authorizedKeys.keys = [
cfg.masterPubKey
];
users.users.root.openssh.authorizedKeys.keys = [
cfg.masterPubKey
];
};
}
+15
View File
@@ -0,0 +1,15 @@
{ config, pkgs, ... }:
{
users.users.root = {
shell = pkgs.zsh;
};
users.users.${config.skyg.user.name} = {
shell = pkgs.zsh;
isNormalUser = true;
description = config.skyg.user.name;
extraGroups = [
"networkmanager"
"wheel"
];
};
}
+1
View File
@@ -3,5 +3,6 @@
imports = [ imports = [
./common ./common
./server ./server
./desktop
]; ];
} }
+25
View File
@@ -1 +1,26 @@
{ config, lib, ... }:
with lib;
let
cfg = config.skyg.nixos.desktop;
in
{
imports = [
./kde.nix
./hyprland.nix
./wayland.nix
./x11.nix
./packages.nix
];
options = {
skyg.nixos.desktop = {
enabled = mkEnableOption
"Enable Desktop";
};
};
config = mkIf cfg.enabled {
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
};
}
+68
View File
@@ -0,0 +1,68 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.skyg.nixos.desktop.hyprland;
in
{
options = {
skyg.nixos.desktop.hyprland = {
enabled = mkEnableOption
"Hyprland";
};
};
config = mkIf cfg.enabled {
programs.hyprland = { enable = true; };
environment.sessionVariables = { NIXOS_OZONE_WL = "1"; };
programs.waybar.enable = false;
environment.systemPackages = with pkgs; [
# common utilities
busybox
scdoc
mpv
gcc
xdg-desktop-portal
# sound
pavucontrol
# notification daemon
dunst
libnotify
# hyprland
lxqt.lxqt-policykit
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
hyprlock
hypridle
hyprpaper
# color picker
hyprpicker
# nwg-shell
nwg-dock
nwg-dock-hyprland
nwg-launchers
nwg-displays
nwg-drawer
nwg-panel
gopsuinfo
nwg-look
nwg-menu
nwg-bar
# screenshots
swappy
hyprshot
# networking
networkmanagerapplet
meson
wl-clipboard
wlroots
cliphist
xdg-desktop-portal-wlr
# app launchers
rofi-wayland
wofi
];
services.mpd.enable = true;
services.pipewire.wireplumber.enable = true;
users.users.${config.skyg.user.name}.extraGroups = [ "input" ];
};
}
+29
View File
@@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.skyg.nixos.desktop.kde;
in
{
options = {
skyg.nixos.desktop.kde = {
enabled = mkEnableOption
"KDE";
};
};
config = mkIf cfg.enabled {
services.desktopManager.plasma6.enable = true;
services.desktopManager.plasma6.enableQt5Integration = true;
environment.plasma6.excludePackages = with pkgs.kdePackages; [
konsole # terminal
elisa # media player
kate # text editor
gwenview # image viewer
];
environment.systemPackages = with pkgs; [
kdePackages.plasma-browser-integration
konsave # save configs
];
services.desktopManager.plasma6.notoPackage = pkgs.fira-code;
};
}
+53
View File
@@ -0,0 +1,53 @@
{ config, lib, pkgs, ... }:
let
cfg = config.skyg.nixos.desktop;
in
{
config = lib.mkIf cfg.enabled {
# Flatpak
services.flatpak.enable = true;
# Mobile Connect
programs.kdeconnect.enable = true;
environment.systemPackages = with pkgs; [
# copy to clipboard
wl-clipboard-x11
xclip
# socials
slack
zoom-us
betterdiscordctl
discord
signal-desktop
whatsapp-for-linux
caprine-bin # facebook messenger
# development
vscode
# web
brave
# mail
thunderbird
# password
bitwarden-desktop
# documents
onlyoffice-bin_latest
# video
vlc
vlc-bittorrent
# terminal
alacritty
alacritty-theme
# wine
wineWowPackages.stable
winetricks
wineWowPackages.waylandFull
];
};
}
+15
View File
@@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
let
cfg = config.skyg.nixos.desktop;
in
{
config = lib.mkIf cfg.enabled {
# Flatpak
environment.systemPackages = with pkgs; [
wayland
wayland-protocols
wayland-utils
];
programs.xwayland.enable = true;
};
}
+13
View File
@@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.skyg.nixos.desktop;
in
{
config = lib.mkIf cfg.enabled {
services.xserver = {
enable = true;
xkb.layout = "us";
xkb.variant = "";
};
};
}
+19
View File
@@ -0,0 +1,19 @@
{ config, lib, ... }:
with lib;
let cfg = config.skyg.server.admin;
in {
options = {
skyg.server.admin = {
enable = mkEnableOption
"Enable special linux user & groups";
};
};
config = mkIf cfg.enable {
users.groups.shared-files = {
gid = 6660;
members = [
config.skyg.user.name
];
};
};
}
+57
View File
@@ -0,0 +1,57 @@
{ config, lib, ... }:
with lib;
let
cfg = config.skyg.nixos.server.services.ai;
openPorts = [
11434
10400
10300
10200
];
in
{
options = {
skyg.nixos.server.services.ai = {
enable = mkEnableOption
"Enable AI Services";
};
};
config = mkIf cfg.enable {
networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts;
virtualisation.oci-containers = {
containers = {
ollama = {
autoStart = true;
image = "ollama/ollama";
extraOptions = [ "--gpus" "all" ];
ports = [ "11434:11434" ];
volumes = [ "ollama:/root/.ollama" ];
};
openwakeword = {
autoStart = true;
image = "rhasspy/wyoming-openwakeword";
cmd = [ "--preload-model" "ok_nabu" ];
ports = [ "10400:10400" ];
};
};
};
services.wyoming = {
faster-whisper.servers.main-eng = {
enable = true;
device = "cpu";
model = "medium.en";
language = "en";
uri = "tcp://0.0.0.0:10300";
};
piper.servers.pier = {
enable = true;
uri = "tcp://0.0.0.0:10200";
voice = "en_GB-alan-medium";
};
};
};
}
+2 -2
View File
@@ -2,10 +2,10 @@
with lib; with lib;
let cfg = config.skyg.homelab.services.audiobookshelf; let cfg = config.skyg.nixos.server.services.audiobookshelf;
in { in {
options = { options = {
skyg.homelab.services.audiobookshelf = { skyg.nixos.server.services.audiobookshelf = {
enable = mkEnableOption enable = mkEnableOption
"Audiobookshelf, self-hosted audiobook and podcast server."; "Audiobookshelf, self-hosted audiobook and podcast server.";
+2 -2
View File
@@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
with lib; with lib;
let cfg = config.skyg.homelab.udevrules.coraltpu; let cfg = config.skyg.nixos.server.udevrules.coraltpu;
in { in {
options = { options = {
skyg.homelab.udevrules.coraltpu = { skyg.nixos.server.udevrules.coraltpu = {
enable = mkEnableOption enable = mkEnableOption
"Enable Coral TPU Udev rules"; "Enable Coral TPU Udev rules";
symlinkName = mkOption { symlinkName = mkOption {
+4
View File
@@ -3,5 +3,9 @@
imports = [ imports = [
./audiobookshelf.nix ./audiobookshelf.nix
./coral-tpu-udev.nix ./coral-tpu-udev.nix
./exporters.nix
./ai-services.nix
./jellyfin.nix
./admin.nix
]; ];
} }
+21
View File
@@ -0,0 +1,21 @@
{ config, lib, ... }:
with lib;
let cfg = config.skyg.server.exporters;
in {
options = {
skyg.server.exporters = {
enable = mkEnableOption
"Enable Special prom exporters for servers";
};
};
config = mkIf cfg.enable {
services.prometheus.exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
openFirewall = true;
port = 9100;
};
};
};
}
+52
View File
@@ -0,0 +1,52 @@
{ config, lib, ... }:
with lib;
let
cfg = config.skyg.nixos.server.services.jellyfin;
user = "jellyfin";
group = "jellyfin";
in
{
options = {
skyg.nixos.server.services.jellyfin = {
enable = mkEnableOption
"Enable Jellyfish";
};
};
config = mkIf cfg.enable {
users.users.${user} = {
uid = 7777;
isSystemUser = true;
};
users.groups.${group} = {
gid = 7777;
members = [
user
config.skyg.user.name
];
};
users.groups.shared-files.members = [
user
];
services.jellyfin = {
inherit user group;
enable = true;
dataDir = "/mnt/apps/jellyfin/data";
cacheDir = "/mnt/apps/jellyfin/cache";
configDir = "/mnt/apps/jellyfin/config";
openFirewall = true;
};
fileSystems."/mnt/apps/jellyfin" = {
device = "terra1.lab.internal:/mnt/Data/apps/jellyfin";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
fileSystems."/family-videos" = {
device = "tnas1.lab.internal:/mnt/EightTerra/FamilyStorage/Video";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
};
}
-17
View File
@@ -1,17 +0,0 @@
{ user, runtime ? null, enableOnBoot ? false, localDockerRegistries ? [ ] }:
{ pkgs, ... }: {
virtualisation.containers.enable = true;
environment.systemPackages = with pkgs; [ dive ];
imports = (if runtime == "podman" then
[ (import ./podman.nix { user = user; localDockerRegistries = localDockerRegistries; }) ]
else if runtime == "docker" then
[
(import ./docker.nix {
user = user;
enableOnBoot = enableOnBoot;
localDockerRegistries = localDockerRegistries;
})
]
else
[ ]);
}
-15
View File
@@ -1,15 +0,0 @@
{ user, enableOnBoot ? false, localDockerRegistries ? [ ], ... }:
{ pkgs, ... }: {
virtualisation.docker = {
enable = true;
autoPrune.enable = true;
enableOnBoot = enableOnBoot;
liveRestore = false;
daemon.settings = {
insecure-registries = localDockerRegistries;
};
};
environment.systemPackages = with pkgs; [ docker-compose ];
users.users.${user.name}.extraGroups = [ "docker" ];
virtualisation.oci-containers.backend = "docker";
}
-14
View File
@@ -1,14 +0,0 @@
{ user, ... }:
{ pkgs, ... }: {
virtualisation.oci-containers.backend = "podman";
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
dockerSocket.enable = true;
autoPrune.enable = true;
};
};
environment.systemPackages = with pkgs; [ podman-compose podman-tui ];
}
-39
View File
@@ -1,39 +0,0 @@
{ user
, hostName
, firewall
, enableFonts ? true
, enableNetworking ? true
, enableSSH ? true
, containers ? { runtime = null; }
, hardware ? { enable = false; }
, enablePrometheusExporters ? false
, ...
}:
{ pkgs, ... }: {
imports = [
(import ./core.nix { user = user; })
(import ./user.nix { user = user; })
(import ./containers/default.nix ({
user = user;
} // containers))
] ++ (if enableFonts then [ ./fonts.nix ] else [ ])
++ (if hardware.enable then [ ./hardware.nix ] else [ ])
++ (if enableNetworking then
[
(import ./networking.nix {
hostName = hostName;
firewall = firewall;
})
]
else
[ ]) ++ (if enableSSH then
[
(import ./ssh.nix {
enableSSHServer = true;
user = user;
})
]
else
[ ])
++ (if enablePrometheusExporters then [ ./exporters.nix ] else [ ]);
}
-10
View File
@@ -1,10 +0,0 @@
{ ... }: {
services.prometheus.exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
openFirewall = true;
port = 9100;
};
};
}
-27
View File
@@ -1,27 +0,0 @@
{ ... }: {
# Firmware Updater
services.fwupd.enable = true;
# Enable all license firmware
hardware.enableAllFirmware = true;
# enables support for Bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Yubikey
services.yubikey-agent.enable = true;
}
-20
View File
@@ -1,20 +0,0 @@
{ hostName, firewall }:
{ pkgs, ... }:
{
# Define your hostname.
networking.hostName = hostName;
# Enable networking
networking.networkmanager.enable = true;
networking.firewall = firewall;
# NFS Support
services.nfs.server.enable = true;
# Tailscale
services.tailscale.enable = true;
services.tailscale.useRoutingFeatures = "client";
# Disable the flaky nm service
systemd.services.NetworkManager-wait-online.enable = false;
}
-21
View File
@@ -1,21 +0,0 @@
{ enableSSHServer, user }:
{ ... }:
{
services.openssh =
if enableSSHServer then {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "yes";
} else {
enable = false;
};
users.users.${user.name}.openssh.authorizedKeys.keys =
if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [ ];
users.users.root.openssh.authorizedKeys.keys =
if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [ ];
}
-13
View File
@@ -1,13 +0,0 @@
{ user }:
{ pkgs, ... }:
{
users.users.${user.name} = {
shell = pkgs.zsh;
isNormalUser = true;
description = user.name;
extraGroups = [
"networkmanager"
"wheel"
];
};
}
-22
View File
@@ -1,22 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.skyg.core;
in
{
options = {
skyg.core = {
hostName = mkOption {
description = "Machine Hostname";
type = types.str;
};
};
};
config = {
users.users.root.shell = pkgs.zsh;
networking.hostName = cfg.hostName;
};
}
+1
View File
@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
set -e
if [ ! -f .locks/.built_via_skg ]; then if [ ! -f .locks/.built_via_skg ]; then
./build-nixos.sh ./build-nixos.sh