nix: change names of hosts

This commit is contained in:
Nico 2025-05-03 16:16:04 +10:00
parent c1719ac77b
commit 44696ee9e4
8 changed files with 44 additions and 13 deletions

View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
{
imports = [
./disko.nix
./hardware-configuration.nix
./specialisation.nix
];
networking.hostName = "nijika";
hardware.graphics.enable = true;
environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD";
hardware.graphics.extraPackages = with pkgs; [
intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
libva-vdpau-driver # Previously vaapiVdpau
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
# OpenCL support for intel CPUs before 12th gen
# see: https://github.com/NixOS/nixpkgs/issues/356535
# intel-compute-runtime-legacy1
vpl-gpu-rt # QSV on 11th gen or newer
intel-media-sdk # QSV up to 11th gen
intel-ocl # OpenCL support
];
services.logind.lidSwitchExternalPower = "ignore";
}

104
hosts/nijika/disko.nix Normal file
View file

@ -0,0 +1,104 @@
{ ... }:
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "root";
passwordFile = "/tmp/secret.key";
settings = {
allowDiscards = true;
};
# additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "1G";
};
};
};
};
};
};
};
};
media = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
luks = {
size = "100%";
content = {
type = "luks";
name = "media";
settings = {
allowDiscards = true;
fallbackToPassword = false;
keyFile = "/sysroot/var/lib/disk-media.key";
};
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/media/shows" = {
mountpoint = "/media/shows";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/media/movies" = {
mountpoint = "/media/movies";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/media/music" = {
mountpoint = "/media/music";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/media/books" = {
mountpoint = "/media/books";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
};
};
};
};
};
};
};
}

View file

@ -0,0 +1,25 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "uas" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,18 @@
{ ... }:
{
specialisation.desktop = {
inheritParentConfig = true;
configuration = {
imports = [
../../modules/applications/default.nix
../../modules/browser/firefox.nix
../../modules/games/linux.nix
../../modules/desktop/default.nix
../../modules/desktop/de/hyprland.nix
../../modules/desktop/login/autologin.nix
];
};
};
}