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

View File

@@ -4,58 +4,56 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "nvme" "mpt3sas" "xhci_pci" "ahci" "uas" "sd_mod" ];
boot.initrd.availableKernelModules =
[ "nvme" "mpt3sas" "xhci_pci" "ahci" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "none";
fsType = "tmpfs";
};
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C6E9-7371";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/C6E9-7371";
fsType = "vfat";
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=nix" "compress-force=zstd" "noatime" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=nix" "compress-force=zstd" "noatime" ];
};
fileSystems."/etc" =
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=etc" "compress-force=zstd" "noatime" ];
};
fileSystems."/etc" = {
device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=etc" "compress-force=zstd" "noatime" ];
};
fileSystems."/root" =
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=root" "compress-force=zstd" "noatime" ];
};
fileSystems."/root" = {
device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=root" "compress-force=zstd" "noatime" ];
};
fileSystems."/var/log" =
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=log" "compress-force=zstd" "noatime" ];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=log" "compress-force=zstd" "noatime" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=home" "compress-force=zstd"];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
fsType = "btrfs";
options = [ "subvol=home" "compress-force=zstd" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/c08ba901-a8a9-4006-9688-002bb24da1b6"; }
];
[{ device = "/dev/disk/by-uuid/c08ba901-a8a9-4006-9688-002bb24da1b6"; }];
# 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
@@ -77,5 +75,6 @@
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}