formatting

This commit is contained in:
mjallen18
2024-02-28 21:49:51 -06:00
parent bdfd5e92b7
commit 347d30094b
40 changed files with 459 additions and 503 deletions

View File

@@ -5,21 +5,20 @@
{ config, lib, pkgs, ... }:
let
user = "admin";
password = "$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06";
password =
"$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06";
hostname = "jallen-nas";
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../default.nix
];
in {
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
../default.nix
];
nas-apps = {
jellyfin.enable = true;
jellyseerr.enable = true;
sabnzbd.enable = true;
radarr.enable = true;
@@ -82,7 +81,6 @@ in
dataDir = "/mnt/ssd/nix-app-data/grafana";
};
services.prometheus = {
enable = true;
port = 9001;
@@ -95,19 +93,33 @@ in
smartctl = {
enable = true;
group = "disk";
devices = [ "/dev/sda" "/dev/sdb" "/dev/sdc" "/dev/sdd" "/dev/sde" "/dev/sdf" "/dev/sdg" "/dev/sdh" "/dev/sdi" "/dev/nvme0n1" "/dev/nvme1n1" ];
devices = [
"/dev/sda"
"/dev/sdb"
"/dev/sdc"
"/dev/sdd"
"/dev/sde"
"/dev/sdf"
"/dev/sdg"
"/dev/sdh"
"/dev/sdi"
"/dev/nvme0n1"
"/dev/nvme1n1"
];
};
};
scrapeConfigs = [
{
job_name = hostname;
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
"127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"];
}];
}
];
scrapeConfigs = [{
job_name = hostname;
static_configs = [{
targets = [
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
"127.0.0.1:${
toString config.services.prometheus.exporters.smartctl.port
}"
];
}];
}];
};
share.hardware.nvidia = {
@@ -130,13 +142,11 @@ in
efiSysMountPoint = "/boot";
};
};
# Override kernel to latest
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
kernelParams = [
"nohibernate"
];
kernelParams = [ "nohibernate" ];
consoleLogLevel = 3;
bootspec.enable = true;
@@ -152,7 +162,7 @@ in
# # Nvidia
# nvidia = {
# package = config.boot.kernelPackages.nvidiaPackages.beta;
# # Modesetting is required.
# modesetting.enable = true;
@@ -176,7 +186,7 @@ in
# # accessible via `nvidia-settings`.
# nvidiaSettings = true;
# };
# # Enable OpenGL
# opengl = {
# enable = true;
@@ -193,7 +203,7 @@ in
# # Load nvidia driver for Xorg and Wayland
# videoDrivers = ["nvidia"];
# Enable the Plasma 6 Desktop Environment.
displayManager = {
sddm.enable = true;
@@ -279,7 +289,8 @@ in
firewall = {
enable = true;
allowPing = true;
extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns''; # TODO is this needed?
extraCommands =
"iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns"; # TODO is this needed?
allowedTCPPorts = [ 2342 61208 ];
allowedUDPPorts = [ 2342 61208 ];
};
@@ -335,7 +346,15 @@ in
# Admin account
users."${user}" = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "docker" "podman" "libvirtd" "nas-apps" "jallen-nas" ]; # Enable sudo for the user.
extraGroups = [
"wheel"
"networkmanager"
"docker"
"podman"
"libvirtd"
"nas-apps"
"jallen-nas"
]; # Enable sudo for the user.
initialHashedPassword = password;
shell = pkgs.fish;
openssh.authorizedKeys.keys = [
@@ -367,7 +386,7 @@ in
group = "jallen-nas";
extraGroups = [ "jallen-nas" ]; # Enable sudo for the user.
hashedPassword = password;
};
};
};
# Virtualisation