~abyxcos/nas.nix

4c2f90bd05d07874a76eeb7770190ca00aa2fd18 — abyxcos 1 year, 5 months ago 88d9228
Start using tabs for the config. No major changes, just some organization.
3 files changed, 50 insertions(+), 50 deletions(-)

M configuration.nix
M libvirtd.pool_guava.xml
M libvirtd.pool_guava_isos.xml
M configuration.nix => configuration.nix +50 -28
@@ 5,19 5,25 @@
{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.supportedFilesystems = [ "zfs" ];

  # Enable virtualisation
  boot.kernelModules = [ "kvm-amd" "kvm-intel" "coretemp" "jc42" ];
  virtualisation.libvirtd.enable = true;
  virtualisation.libvirtd.qemu.ovmf.enable = true;
	imports =
		[ # Include the results of the hardware scan.
			./hardware-configuration.nix
		];

	boot = {
		supportedFilesystems = [ "zfs" ];
		loader = {
			systemd-boot.enable = true;
			efi.canTouchEfiVariables = true;
		};
		kernelModules = [ "kvm-amd" "kvm-intel" "coretemp" "jc42" ];
	};

	virtualisation = {
		libvirtd.enable = true;
		libvirtd.qemu.ovmf.enable = true;
	};

  # libvirtd now requires polkit to be enabled
  security.polkit.enable = true;



@@ 25,18 31,40 @@
  system.autoUpgrade.enable = true;
  system.autoUpgrade.allowReboot = false;

  networking.hostName = "nas"; # Define your hostname.
  networking.hostId = "e058e4cd";

  # Set your time zone.
  # time.timeZone = "Europe/Amsterdam";

  networking.interfaces.enp0s20f0.useDHCP = true;
  networking.interfaces.enp0s20f1.useDHCP = true;
  networking.interfaces.enp0s20f2.useDHCP = true;
  networking.interfaces.enp0s20f3.useDHCP = true;
  #networking.bridges.br0.interfaces = ["enp0s20f0" "enp0s20f2" "enp0s20f3"];
  #networking.interfaces.br0.useDHCP = true;
	networking = {
		hostName = "nas"; # Define your hostname.
		hostId = "e058e4cd";
		networkmanager.enable = true;

		interfaces = {
			enp0s20f0.useDHCP = true;
			enp0s20f1.useDHCP = true;
			enp0s20f2.useDHCP = true;
			enp0s20f3.useDHCP = true;
			# virbr1.useDHCP = true;
			# br0.useDHCP = true;
		};

		# bridges.virbr1.interfaces = ["enp0s20f0"];
		# bridges.br0.interfaces = ["enp0s20f0" "enp0s20f2" "enp0s20f3"];

		# Open ports in the firewall.
		firewall = {
			enable = true;
			allowedTCPPorts = [
				22	# ssh
				4533	# Navidrome
				8096	# Jellyfin
			];
			allowedUDPPorts = [ ];

			# Needed for libvirtd.
			checkReversePath = "loose";
		};
	};

  # Select internationalisation properties.
  # i18n.defaultLocale = "en_US.UTF-8";


@@ 105,12 133,6 @@
    };
  };

  # Open ports in the firewall.
  networking.firewall.allowedTCPPorts = [ 4533 8096 6167 ];
  networking.firewall.allowedUDPPorts = [ 6167 ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave

M libvirtd.pool_guava.xml => libvirtd.pool_guava.xml +0 -11
@@ 1,18 1,7 @@
<pool type='dir'>
  <name>guava</name>
  <uuid>7639a36b-f01a-4f07-91f0-b7a5b042e1c3</uuid>
  <capacity unit='bytes'>5325064241152</capacity>
  <allocation unit='bytes'>3354787840</allocation>
  <available unit='bytes'>5321709453312</available>
  <source>
  </source>
  <target>
    <path>/mnt/guava/vm/libvirtd_images</path>
    <permissions>
      <mode>0775</mode>
      <owner>0</owner>
      <group>67</group>
    </permissions>
  </target>
</pool>


M libvirtd.pool_guava_isos.xml => libvirtd.pool_guava_isos.xml +0 -11
@@ 1,18 1,7 @@
<pool type='dir'>
  <name>guava-isos</name>
  <uuid>9db3c962-0872-46ce-907e-44f218da7b24</uuid>
  <capacity unit='bytes'>5436124954624</capacity>
  <allocation unit='bytes'>114399510528</allocation>
  <available unit='bytes'>5321725444096</available>
  <source>
  </source>
  <target>
    <path>/mnt/guava/isos</path>
    <permissions>
      <mode>0755</mode>
      <owner>1000</owner>
      <group>100</group>
    </permissions>
  </target>
</pool>