2023-05-05 11:29:38 -05:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
2023-05-05 15:59:59 -05:00
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
2023-05-05 11:29:38 -05:00
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
|
2025-11-19 22:43:28 -06:00
|
|
|
|
{ config, pkgs, top, ... }:
|
2023-05-05 15:59:59 -05:00
|
|
|
|
let
|
2024-10-03 11:26:39 -05:00
|
|
|
|
wanInterface = "enp2s0";
|
|
|
|
|
|
lanInterface = "enp1s0";
|
|
|
|
|
|
lanIpAddress = "10.42.1.7";
|
2023-05-05 15:59:59 -05:00
|
|
|
|
in
|
2023-05-05 11:29:38 -05:00
|
|
|
|
|
|
|
|
|
|
{
|
2024-10-11 12:28:53 -05:00
|
|
|
|
imports = [
|
|
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
|
top.btc.nixosModules.default
|
|
|
|
|
|
./bitcoin.nix
|
|
|
|
|
|
];
|
2023-05-05 11:29:38 -05:00
|
|
|
|
|
2024-10-03 11:26:39 -05:00
|
|
|
|
# Bootloader
|
|
|
|
|
|
boot = {
|
|
|
|
|
|
loader = {
|
|
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
|
|
efi = {
|
|
|
|
|
|
canTouchEfiVariables = true;
|
|
|
|
|
|
efiSysMountPoint = "/boot/";
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
extraModprobeConfig = "vboxdrv";
|
|
|
|
|
|
};
|
2025-11-08 15:37:02 -06:00
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
|
clinfo
|
|
|
|
|
|
jellyfin-ffmpeg
|
|
|
|
|
|
libva-utils
|
2025-11-08 16:11:37 -06:00
|
|
|
|
mesa-demos
|
2025-11-08 15:37:02 -06:00
|
|
|
|
nfs-utils
|
|
|
|
|
|
radeontop
|
|
|
|
|
|
vulkan-tools
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
greg = {
|
|
|
|
|
|
home = true;
|
|
|
|
|
|
proxies = {
|
|
|
|
|
|
"jellyfin.home".target = "http://localhost:8096/";
|
|
|
|
|
|
"jellyfin.thehellings.lan".target = "http://localhost:8096/";
|
|
|
|
|
|
};
|
2025-11-15 14:08:34 -06:00
|
|
|
|
tailscale = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
tags = [ "home" ];
|
|
|
|
|
|
};
|
2025-11-08 15:37:02 -06:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
|
|
enableAllFirmware = true;
|
|
|
|
|
|
enableRedistributableFirmware = true;
|
|
|
|
|
|
graphics = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
|
|
intel-media-driver
|
2025-11-08 16:01:21 -06:00
|
|
|
|
intel-vaapi-driver
|
|
|
|
|
|
libva-vdpau-driver
|
2025-11-08 15:37:02 -06:00
|
|
|
|
#intel-media-sdk
|
|
|
|
|
|
intel-compute-runtime
|
|
|
|
|
|
];
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
2023-09-01 23:42:22 -05:00
|
|
|
|
|
2024-10-03 11:26:39 -05:00
|
|
|
|
networking = {
|
|
|
|
|
|
hostName = "hosea";
|
|
|
|
|
|
nameservers = [ "10.42.1.5" ];
|
|
|
|
|
|
defaultGateway = "10.42.1.1";
|
|
|
|
|
|
interfaces = {
|
|
|
|
|
|
"${wanInterface}".useDHCP = true;
|
|
|
|
|
|
"${lanInterface}" = {
|
|
|
|
|
|
useDHCP = false;
|
2024-10-11 12:28:53 -05:00
|
|
|
|
ipv4.addresses = [
|
|
|
|
|
|
{
|
|
|
|
|
|
address = lanIpAddress;
|
|
|
|
|
|
prefixLength = 16;
|
|
|
|
|
|
}
|
|
|
|
|
|
];
|
2024-10-03 11:26:39 -05:00
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
2023-05-05 11:29:38 -05:00
|
|
|
|
|
2024-10-03 11:26:39 -05:00
|
|
|
|
services = {
|
2025-11-08 15:37:02 -06:00
|
|
|
|
jellyfin = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
openFirewall = true;
|
|
|
|
|
|
};
|
2025-11-19 22:43:28 -06:00
|
|
|
|
grafana = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
provision = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
dashboards.settings.providers = [{
|
|
|
|
|
|
name = "Dashboards";
|
|
|
|
|
|
disableDeletion = true;
|
|
|
|
|
|
options = {
|
|
|
|
|
|
path = "/etc/grafana-dashboards";
|
|
|
|
|
|
foldersFromFilesStructure = true;
|
|
|
|
|
|
};
|
|
|
|
|
|
}];
|
|
|
|
|
|
datasources.settings.datasources = [{
|
|
|
|
|
|
name = "Prometheus";
|
|
|
|
|
|
type = "prometheus";
|
|
|
|
|
|
url = "http://${config.services.prometheus.listenAddress}:${toString config.services.prometheus.port}";
|
|
|
|
|
|
isDefault = true;
|
|
|
|
|
|
editable = false;
|
|
|
|
|
|
}];
|
|
|
|
|
|
};
|
|
|
|
|
|
settings = {
|
|
|
|
|
|
server = {
|
|
|
|
|
|
domain = "${config.networking.hostName}.shire-zebra.ts.net";
|
|
|
|
|
|
enforce_domain = true;
|
|
|
|
|
|
http_addr = "0.0.0.0";
|
|
|
|
|
|
enable_gzip = true;
|
|
|
|
|
|
http_port = 3001;
|
|
|
|
|
|
};
|
|
|
|
|
|
analytics.reporting_enabled = false;
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
prometheus = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
globalConfig.scrape_interval = "10s";
|
|
|
|
|
|
scrapeConfigs = [ {
|
|
|
|
|
|
job_name = "node stats";
|
|
|
|
|
|
static_configs = [{
|
2025-11-19 22:53:01 -06:00
|
|
|
|
targets = [
|
|
|
|
|
|
"localhost:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
"isaiah.shire-zebra.ts.net:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
"jeremiah.shire-zebra.ts.net:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
"zeke.shire-zebra.ts.net:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
"genesis.shire-zebra.ts.net:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
"exodus.shire-zebra.ts.net:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
"linode.shire-zebra.ts.net:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
"vm-gitlab.shire-zebra.ts.net:${toString config.services.prometheus.exporters.node.port}"
|
|
|
|
|
|
];
|
2025-11-19 22:43:28 -06:00
|
|
|
|
}];
|
|
|
|
|
|
} ];
|
|
|
|
|
|
};
|
2024-10-03 11:26:39 -05:00
|
|
|
|
# Configure keymap
|
|
|
|
|
|
xserver.xkb = {
|
|
|
|
|
|
layout = "us";
|
|
|
|
|
|
variant = "";
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
2025-11-08 15:37:02 -06:00
|
|
|
|
|
|
|
|
|
|
systemd.mounts =
|
|
|
|
|
|
let
|
|
|
|
|
|
nfs = name: {
|
|
|
|
|
|
what = "nas1.shire-zebra.ts.net:/mnt/all/${name}";
|
|
|
|
|
|
type = "nfs";
|
|
|
|
|
|
name = "${name}.mount";
|
|
|
|
|
|
where = "/${name}";
|
|
|
|
|
|
requires = [ "tailscaled-autoconnect.service" ];
|
|
|
|
|
|
after = [ "tailscaled-autoconnect.service" ];
|
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
mountConfig.Options = "_netdev,noexec,ro,timeo=50,retrans=5,soft";
|
|
|
|
|
|
};
|
|
|
|
|
|
in
|
|
|
|
|
|
[
|
|
|
|
|
|
(nfs "music")
|
|
|
|
|
|
(nfs "photos")
|
|
|
|
|
|
(nfs "video")
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
users.users = {
|
|
|
|
|
|
greg.extraGroups = [ "vboxusers" ];
|
|
|
|
|
|
|
|
|
|
|
|
jellyfin.extraGroups = [
|
|
|
|
|
|
"video"
|
|
|
|
|
|
"render"
|
|
|
|
|
|
];
|
|
|
|
|
|
};
|
2023-05-05 11:29:38 -05:00
|
|
|
|
}
|