treewide: format files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
		@@ -1,22 +1,49 @@
 | 
			
		||||
{ lib, config, pkgs, ... }:
 | 
			
		||||
{
 | 
			
		||||
  lib,
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  boot = {
 | 
			
		||||
    kernelPackages = pkgs.linuxPackages_latest;
 | 
			
		||||
    initrd = {
 | 
			
		||||
      availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "vfio-pci" ];
 | 
			
		||||
      /*     preDeviceCommands = ''
 | 
			
		||||
      availableKernelModules = [
 | 
			
		||||
        "xhci_pci"
 | 
			
		||||
        "ahci"
 | 
			
		||||
        "nvme"
 | 
			
		||||
        "usb_storage"
 | 
			
		||||
        "sd_mod"
 | 
			
		||||
        "vfio-pci"
 | 
			
		||||
      ];
 | 
			
		||||
      /*
 | 
			
		||||
        preDeviceCommands = ''
 | 
			
		||||
        DEVS="0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3"
 | 
			
		||||
        for DEV in $DEVS; do
 | 
			
		||||
        echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
 | 
			
		||||
        done
 | 
			
		||||
        modprobe -i vfio-pci
 | 
			
		||||
        '';*/
 | 
			
		||||
        '';
 | 
			
		||||
      */
 | 
			
		||||
      kernelModules = [ ];
 | 
			
		||||
    };
 | 
			
		||||
    kernelParams = [ "intel_pstate=active" "intel_iommu=on" "nvidia_drm.modeset=1" "clearcpuid=512" ];
 | 
			
		||||
    kernelModules = [ "kvm-intel" "snd-seq" "snd-rawmidi" "joydev" ];
 | 
			
		||||
    extraModulePackages = with config.boot.kernelPackages; [ nvidia_x11 v4l2loopback ];
 | 
			
		||||
    kernelParams = [
 | 
			
		||||
      "intel_pstate=active"
 | 
			
		||||
      "intel_iommu=on"
 | 
			
		||||
      "nvidia_drm.modeset=1"
 | 
			
		||||
      "clearcpuid=512"
 | 
			
		||||
    ];
 | 
			
		||||
    kernelModules = [
 | 
			
		||||
      "kvm-intel"
 | 
			
		||||
      "snd-seq"
 | 
			
		||||
      "snd-rawmidi"
 | 
			
		||||
      "joydev"
 | 
			
		||||
    ];
 | 
			
		||||
    extraModulePackages = with config.boot.kernelPackages; [
 | 
			
		||||
      nvidia_x11
 | 
			
		||||
      v4l2loopback
 | 
			
		||||
    ];
 | 
			
		||||
    loader = {
 | 
			
		||||
      efi = {
 | 
			
		||||
        canTouchEfiVariables = true;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,13 +1,12 @@
 | 
			
		||||
{ lib, config, ... }:
 | 
			
		||||
{
 | 
			
		||||
  imports =
 | 
			
		||||
    [
 | 
			
		||||
      ./hardware.nix
 | 
			
		||||
      ./stuff.nix
 | 
			
		||||
      ./networking.nix
 | 
			
		||||
      ./boot.nix
 | 
			
		||||
      ./services.nix
 | 
			
		||||
      ./graphics.nix
 | 
			
		||||
    ];
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./hardware.nix
 | 
			
		||||
    ./stuff.nix
 | 
			
		||||
    ./networking.nix
 | 
			
		||||
    ./boot.nix
 | 
			
		||||
    ./services.nix
 | 
			
		||||
    ./graphics.nix
 | 
			
		||||
  ];
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,9 @@
 | 
			
		||||
{ config, pkgs, lib, ... }:
 | 
			
		||||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
let
 | 
			
		||||
  nvidia-offload = pkgs.writeShellScriptBin "nvi" ''
 | 
			
		||||
    export __NV_PRIME_RENDER_OFFLOAD=1
 | 
			
		||||
@@ -23,11 +28,15 @@ in
 | 
			
		||||
      package = config.boot.kernelPackages.nvidia_x11;
 | 
			
		||||
      prime = {
 | 
			
		||||
        #      sync.enable = true;
 | 
			
		||||
        offload = { enable = true; };
 | 
			
		||||
        offload = {
 | 
			
		||||
          enable = true;
 | 
			
		||||
        };
 | 
			
		||||
        intelBusId = "PCI:0:2:0";
 | 
			
		||||
        nvidiaBusId = "PCI:1:0:0";
 | 
			
		||||
      };
 | 
			
		||||
      modesetting = { enable = true; };
 | 
			
		||||
      modesetting = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
      };
 | 
			
		||||
      powerManagement = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        finegrained = true;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,29 +1,30 @@
 | 
			
		||||
{ config, lib, modulesPath, ... }:
 | 
			
		||||
{
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  modulesPath,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports =
 | 
			
		||||
    [
 | 
			
		||||
      (modulesPath + "/installer/scan/not-detected.nix")
 | 
			
		||||
    ];
 | 
			
		||||
  imports = [
 | 
			
		||||
    (modulesPath + "/installer/scan/not-detected.nix")
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  fileSystems."/" =
 | 
			
		||||
    {
 | 
			
		||||
      device = "/dev/disk/by-uuid/59af143c-1a87-4654-9b31-7594ac8ba530";
 | 
			
		||||
      fsType = "ext4";
 | 
			
		||||
    };
 | 
			
		||||
  fileSystems."/" = {
 | 
			
		||||
    device = "/dev/disk/by-uuid/59af143c-1a87-4654-9b31-7594ac8ba530";
 | 
			
		||||
    fsType = "ext4";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  fileSystems."/media/real" =
 | 
			
		||||
    {
 | 
			
		||||
      device = "/dev/disk/by-uuid/8086be20-c770-46be-bd8f-5bd2d7735c7d";
 | 
			
		||||
      fsType = "btrfs";
 | 
			
		||||
      options = [ "compress-force=zstd:3" ];
 | 
			
		||||
    };
 | 
			
		||||
  fileSystems."/media/real" = {
 | 
			
		||||
    device = "/dev/disk/by-uuid/8086be20-c770-46be-bd8f-5bd2d7735c7d";
 | 
			
		||||
    fsType = "btrfs";
 | 
			
		||||
    options = [ "compress-force=zstd:3" ];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  fileSystems."/boot/efi" =
 | 
			
		||||
    {
 | 
			
		||||
      device = "/dev/disk/by-uuid/2424-5639";
 | 
			
		||||
      fsType = "vfat";
 | 
			
		||||
    };
 | 
			
		||||
  fileSystems."/boot/efi" = {
 | 
			
		||||
    device = "/dev/disk/by-uuid/2424-5639";
 | 
			
		||||
    fsType = "vfat";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  zramSwap = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
@@ -33,7 +34,10 @@
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  swapDevices = [
 | 
			
		||||
    { device = "/var/swap"; size = 4096; }
 | 
			
		||||
    {
 | 
			
		||||
      device = "/var/swap";
 | 
			
		||||
      size = 4096;
 | 
			
		||||
    }
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  powerManagement = {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,9 @@
 | 
			
		||||
{ config, pkgs, conf, ... }:
 | 
			
		||||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  conf,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  networking = {
 | 
			
		||||
@@ -10,8 +15,20 @@
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    firewall = {
 | 
			
		||||
      allowedTCPPorts = [ 22 18172 6600 8001 7590 25565 9092 ];
 | 
			
		||||
      allowedUDPPorts = [ 22 17840 18172 ];
 | 
			
		||||
      allowedTCPPorts = [
 | 
			
		||||
        22
 | 
			
		||||
        18172
 | 
			
		||||
        6600
 | 
			
		||||
        8001
 | 
			
		||||
        7590
 | 
			
		||||
        25565
 | 
			
		||||
        9092
 | 
			
		||||
      ];
 | 
			
		||||
      allowedUDPPorts = [
 | 
			
		||||
        22
 | 
			
		||||
        17840
 | 
			
		||||
        18172
 | 
			
		||||
      ];
 | 
			
		||||
      trustedInterfaces = [ "docker0" ];
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
@@ -19,16 +36,21 @@
 | 
			
		||||
      ips = [ satori ];
 | 
			
		||||
      listenPort = 17840;
 | 
			
		||||
      privateKeyFile = "/var/secrets/wg.key";
 | 
			
		||||
      peers = [{
 | 
			
		||||
        #Oracle VM1
 | 
			
		||||
        publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM=";
 | 
			
		||||
        allowedIPs = [ remilia ];
 | 
			
		||||
        endpoint = "${conf.network.addresses.domain.natto}:17840";
 | 
			
		||||
        persistentKeepalive = 25;
 | 
			
		||||
      }];
 | 
			
		||||
      peers = [
 | 
			
		||||
        {
 | 
			
		||||
          #Oracle VM1
 | 
			
		||||
          publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM=";
 | 
			
		||||
          allowedIPs = [ remilia ];
 | 
			
		||||
          endpoint = "${conf.network.addresses.domain.natto}:17840";
 | 
			
		||||
          persistentKeepalive = 25;
 | 
			
		||||
        }
 | 
			
		||||
      ];
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    defaultGateway = "192.168.1.1";
 | 
			
		||||
    nameservers = [ "1.1.1.1" "8.8.8.8" ];
 | 
			
		||||
    nameservers = [
 | 
			
		||||
      "1.1.1.1"
 | 
			
		||||
      "8.8.8.8"
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,9 @@
 | 
			
		||||
{ lib, config, pkgs, ... }:
 | 
			
		||||
{
 | 
			
		||||
  lib,
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
{
 | 
			
		||||
  services = {
 | 
			
		||||
    openssh = {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,9 @@
 | 
			
		||||
{ lib, config, pkgs, ... }:
 | 
			
		||||
{
 | 
			
		||||
  lib,
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
{
 | 
			
		||||
  time.timeZone = "Asia/Kolkata";
 | 
			
		||||
 | 
			
		||||
@@ -11,12 +16,19 @@
 | 
			
		||||
  };
 | 
			
		||||
  console.useXkbConfig = true;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  users.users.natto = {
 | 
			
		||||
    isNormalUser = true;
 | 
			
		||||
    shell = pkgs.zsh;
 | 
			
		||||
    home = "/home/natto";
 | 
			
		||||
    extraGroups = [ "wheel" "adbusers" "video" "libvirtd" "docker" "networkmanager" "dialout" ];
 | 
			
		||||
    extraGroups = [
 | 
			
		||||
      "wheel"
 | 
			
		||||
      "adbusers"
 | 
			
		||||
      "video"
 | 
			
		||||
      "libvirtd"
 | 
			
		||||
      "docker"
 | 
			
		||||
      "networkmanager"
 | 
			
		||||
      "dialout"
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  virtualisation = {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user