initial commit
This commit is contained in:
commit
4014d5e658
30 changed files with 911 additions and 0 deletions
34
hosts/blobercraft/ai.nix
Normal file
34
hosts/blobercraft/ai.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.ai.enable = lib.mkEnableOption "enable ai services";
|
||||
config = lib.mkIf config.ai.enable {
|
||||
fileSystems."/mnt/priv" = {
|
||||
device = "192.168.50.240:/mnt/tank/Private";
|
||||
fsType = "nfs";
|
||||
options = [ "defaults" ];
|
||||
};
|
||||
|
||||
services.gatus.settings.endpoints = [
|
||||
{
|
||||
name = "open-webui";
|
||||
group = "local";
|
||||
url = "http://0.0.0.0:${config.services.open-webui.port}/System/Ping";
|
||||
interval = "5m";
|
||||
# conditions = [''[BODY] == "Jellyfin Server"'']; # TODO:
|
||||
}
|
||||
];
|
||||
|
||||
services = {
|
||||
ollama = {
|
||||
enable = true;
|
||||
# Optional: preload models, see https://ollama.com/library
|
||||
loadModels = [ "llama3.2:3b" "deepseek-r1:1.5b"];
|
||||
};
|
||||
open-webui = {
|
||||
enable = true;
|
||||
port = 2333;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
17
hosts/blobercraft/default.nix
Normal file
17
hosts/blobercraft/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix # Include the results of the hardware scan.
|
||||
./jellyfin.nix
|
||||
./minecraft.nix
|
||||
./gatus.nix
|
||||
./ai.nix
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# ai.enable = true;
|
||||
jellyfin.enable = true;
|
||||
minecraft.enable = true;
|
||||
}
|
||||
45
hosts/blobercraft/gatus.nix
Normal file
45
hosts/blobercraft/gatus.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ unstable, ... }: let
|
||||
gatus.up = [
|
||||
"[STATUS] == 200"
|
||||
"[RESPONSE_TIME] < 300"
|
||||
];
|
||||
in {
|
||||
services.gatus = {
|
||||
package = unstable.gatus;
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
web.port = 8081;
|
||||
endpoints = [
|
||||
{
|
||||
name = "nas";
|
||||
group = "external";
|
||||
url = "http://192.168.50.240";
|
||||
interval = "5m";
|
||||
conditions = gatus.up;
|
||||
}
|
||||
{
|
||||
name = "site";
|
||||
group = "remote";
|
||||
url = "https://squi.bid";
|
||||
interval = "10m";
|
||||
conditions = gatus.up;
|
||||
}
|
||||
{
|
||||
name = "git site";
|
||||
group = "remote";
|
||||
url = "https://git.squi.bid";
|
||||
interval = "10m";
|
||||
conditions = gatus.up;
|
||||
}
|
||||
{
|
||||
name = "voidpkgs";
|
||||
group = "remote";
|
||||
url = "https://voidpkgs.squi.bid";
|
||||
interval = "10m";
|
||||
conditions = [''[BODY] == pat(*x86_64-repodata.sig2*)''];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
39
hosts/blobercraft/hardware-configuration.nix
Normal file
39
hosts/blobercraft/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# 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, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/37cd6e5e-5e67-48de-a2cf-9f1f26db5721";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/2EB4-8533";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/7849db93-3c39-4571-ac39-8542251eb194"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
78
hosts/blobercraft/jellyfin.nix
Normal file
78
hosts/blobercraft/jellyfin.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.jellyfin.enable = lib.mkEnableOption "enable jellfin service";
|
||||
config = lib.mkIf config.jellyfin.enable {
|
||||
fileSystems."/mnt/media" = {
|
||||
device = "192.168.50.240:/mnt/tank/Media";
|
||||
fsType = "nfs";
|
||||
options = [ "defaults" ];
|
||||
};
|
||||
|
||||
services.gatus.settings.endpoints = [
|
||||
{
|
||||
name = "jellyfin";
|
||||
group = "local";
|
||||
url = "http://localhost:8096/System/Ping";
|
||||
interval = "5m";
|
||||
conditions = [''[BODY] == "Jellyfin Server"''];
|
||||
}
|
||||
];
|
||||
|
||||
services.declarative-jellyfin = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
serverId = "0ba4e888503b4524a90285b7ad500256"; # could be anything
|
||||
system = {
|
||||
serverName = config.networking.hostName;
|
||||
trickplayOptions = {
|
||||
enableHwAcceleration = true;
|
||||
enableHwEncoding = true;
|
||||
};
|
||||
pluginRepositories = [
|
||||
{
|
||||
content.Name = "Jellyfin Stable";
|
||||
content.Url = "https://repo.jellyfin.org/files/plugin/manifest.json";
|
||||
tag = "RepositoryInfo"; # Needed to generate the correct XML
|
||||
}
|
||||
{
|
||||
content.Name = "Intro Skipper";
|
||||
content.Url = "https://intro-skipper.org/manifest.json";
|
||||
tag = "RepositoryInfo"; # Needed to generate the correct XML
|
||||
}
|
||||
];
|
||||
};
|
||||
users.zachary = {
|
||||
mutable = false;
|
||||
permissions.isAdministrator = true;
|
||||
hashedPasswordFile = config.sops.secrets."jellyfin/zachary".path;
|
||||
};
|
||||
libraries = {
|
||||
Movies = {
|
||||
enabled = true;
|
||||
contentType = "movies";
|
||||
pathInfos = ["/mnt/media/movies"];
|
||||
};
|
||||
Shows = {
|
||||
enabled = true;
|
||||
contentType = "tvshows";
|
||||
pathInfos = ["/mnt/media/shows"];
|
||||
};
|
||||
};
|
||||
encoding = {
|
||||
enableHardwareEncoding = true;
|
||||
hardwareAccelerationType = "vaapi";
|
||||
enableDecodingColorDepth10Hevc = true; # enable if your system supports
|
||||
allowHevcEncoding = true; # enable if your system supports
|
||||
allowAv1Encoding = true; # enable if your system supports
|
||||
hardwareDecodingCodecs = [ # enable the codecs your system supports
|
||||
"h264"
|
||||
"hevc"
|
||||
"mpeg2video"
|
||||
"vc1"
|
||||
"vp9"
|
||||
"av1"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
24
hosts/blobercraft/minecraft.nix
Normal file
24
hosts/blobercraft/minecraft.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
options.minecraft.enable = lib.mkEnableOption "enable minecraft user";
|
||||
config = lib.mkIf config.minecraft.enable {
|
||||
users.users.minecraft = {
|
||||
createHome = true;
|
||||
home = "/home/minecraft";
|
||||
useDefaultShell = true;
|
||||
isNormalUser = true;
|
||||
description = "minecraft server account";
|
||||
group = "minecraft";
|
||||
openssh.authorizedKeys.keys = [] ++ config.ssh.keys;
|
||||
|
||||
# make sure we have every version of java required to run minecraft
|
||||
packages = with pkgs; [
|
||||
jre8
|
||||
jre17_minimal
|
||||
jre21_minimal
|
||||
];
|
||||
};
|
||||
|
||||
users.groups.minecraft = {};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue