update: viridian+fuchsia configuration

This commit is contained in:
♥ Minnie ♥ 2024-08-11 16:15:30 +08:00
parent 802e1c5289
commit 71639ed7ef
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
5 changed files with 92 additions and 65 deletions

View file

@ -1,52 +1,20 @@
{pkgs, ...}: { {...}: {
imports = [ imports = [
# Global configuartion for all our systems
../common/global ../common/global
# Our user configuration and optional user units
../common/users/sajenim ../common/users/sajenim
../common/users/sajenim/samba ../common/users/sajenim/samba
../common/users/sajenim/steam ../common/users/sajenim/steam
# Optional components
../common/optional/key.nix ../common/optional/key.nix
# Programs and services
./programs ./programs
./services ./services
# Setup our hardware
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
# Boot configuration
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [
# Enable amdgpu driver sysfs API that allows fine grain control of GPU
"amdgpu.ppfeaturemask=0xffffffff"
];
kernelModules = ["i2c-dev" "i2c-piix4"];
initrd.kernelModules = ["amdgpu"];
};
# Hardware configuration
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
};
pulseaudio = {
enable = true;
support32Bit = true;
extraConfig = "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1";
};
opengl = {
enable = true;
# Vulkan
driSupport = true;
driSupport32Bit = true;
# OpenCL
extraPackages = with pkgs; [
rocmPackages.clr.icd
];
};
};
# Networking configuration # Networking configuration
networking = { networking = {
hostName = "fuchsia"; hostName = "fuchsia";

View file

@ -1,26 +1,68 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: { }: {
imports = [ imports = [
# Our ephemeral system. Wipe root on reboot.
../common/optional/ephemeral-btrfs.nix ../common/optional/ephemeral-btrfs.nix
]; ];
# Boot configuration
boot = { boot = {
# Initial ramdisk
initrd = { initrd = {
# The modules listed here are available in the initrd, but are only loaded on demand.
availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
kernelModules = ["kvm-amd"]; # List of modules that are always loaded by the initrd.
kernelModules = ["kvm-amd" "amdgpu"];
}; };
# Linux kernel used by NixOS.
kernelPackages = pkgs.linuxPackages_latest;
# Parameters added to the kernel command line.
kernelParams = [
# Enable amdgpu driver sysfs API that allows fine grain control of GPU
"amdgpu.ppfeaturemask=0xffffffff"
];
# The set of kernel modules to be loaded in the second stage of the boot process.
kernelModules = ["i2c-dev" "i2c-piix4"];
# Our boot loader configuration
loader = { loader = {
systemd-boot.enable = true;
efi = { efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot"; efiSysMountPoint = "/boot";
canTouchEfiVariables = true;
}; };
systemd-boot.enable = true;
}; };
}; };
# Hardware configuration
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
};
pulseaudio = {
enable = true;
support32Bit = true;
extraConfig = "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1";
};
opengl = {
enable = true;
# Vulkan
driSupport = true;
driSupport32Bit = true;
# OpenCL
extraPackages = with pkgs; [
rocmPackages.clr.icd
];
};
};
# Setup our filesystems
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP"; device = "/dev/disk/by-label/ESP";
fsType = "vfat"; fsType = "vfat";

View file

@ -1,29 +1,19 @@
{pkgs, ...}: { {...}: {
imports = [ imports = [
# Global configuration for all our systems
../common/global ../common/global
# Our user configuration and optional user units
../common/users/sajenim ../common/users/sajenim
../common/users/spectre ../common/users/spectre
# Programs and services
./programs
./services ./services
./containers ./containers
# Setup our hardware
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
boot.kernel.sysctl = { # Networking configuration
"net.ipv4.ip_unprivileged_port_start" = 0;
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime
];
};
networking = { networking = {
hostName = "viridian"; hostName = "viridian";
networkmanager.enable = true; networkmanager.enable = true;
@ -42,16 +32,12 @@
80 # traefik (HTTP) 80 # traefik (HTTP)
443 # traefik (HTTPS) 443 # traefik (HTTPS)
32372 # qbittorrent 32372 # qbittorrent
51820 # Wireguard
6600 # mpd 6600 # mpd
]; ];
}; };
}; };
programs = { # Use docker instead of podman for our containers.
zsh.enable = true;
};
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
liveRestore = false; liveRestore = false;

View file

@ -1,28 +1,54 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: let }: let
hostname = config.networking.hostName; hostname = config.networking.hostName;
in { in {
imports = [ imports = [
# Our ephemeral system. Wipe root on reboot.
../common/optional/ephemeral-btrfs.nix ../common/optional/ephemeral-btrfs.nix
]; ];
# Boot configuration
boot = { boot = {
# Initial ramdisk
initrd = { initrd = {
# The modules listed here are available in the initrd, but are only loaded on demand.
availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
# List of modules that are always loaded by the initrd.
kernelModules = ["kvm-intel"]; kernelModules = ["kvm-intel"];
}; };
loader = {
systemd-boot.enable = true; # Runtime parameters of the Linux kernel
efi = { kernel.sysctl = {
canTouchEfiVariables = true; "net.ipv4.ip_unprivileged_port_start" = 0;
efiSysMountPoint = "/boot";
}; };
# Our boot loader configuration
loader = {
efi = {
efiSysMountPoint = "/boot";
canTouchEfiVariables = true;
};
systemd-boot.enable = true;
}; };
}; };
# Hardware configuration
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime
];
};
# Setup our filesystems
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP"; device = "/dev/disk/by-label/ESP";
fsType = "vfat"; fsType = "vfat";

View file

@ -0,0 +1,5 @@
{...}: {
programs = {
zsh.enable = true;
};
}