Move variables to more convenient folder

This commit is contained in:
Jimbo 2024-11-24 16:53:49 -05:00
parent 87a53e364f
commit 9c03712908
30 changed files with 159 additions and 45 deletions

View file

@ -1,7 +1,36 @@
{ config, pkgs, ... }:
{
let
commonKernelParams = [
# VM/GPU passthrough
"amd_iommu=on"
"iommu=pt"
"nested=1"
# Virtualization nonsense
"transparent_hugepage=never"
# Isolate devices into IOMMU groups
"pcie_acs_override=downstream,multifunction"
"pci=routeirq"
];
in {
boot = {
kernelPackages = pkgs.linuxPackages_latest;
# Must be Zen for IOMMU isolation
kernelPackages = pkgs.unstable.linuxPackages_zen;
kernel.sysctl."vm.max_map_count" = 2147483642;
kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:1f82,10de:10fa" ];
blacklistedKernelModules = [ "pcspkr" ];
# Needed for GPU passthrough
initrd.kernelModules = [
"vfio"
"vfio_pci"
"vfio_iommu_type1"
];
};
# Use second GPU on boot
specialisation.gputwo.configuration = {
boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ];
};
}

View file

@ -2,13 +2,13 @@
{
imports = [
./boot
./disko
./filesystems
./hardware
./nixmodules
./wireguard
../../modules/system
];
boot.loader.systemd-boot.enable = lib.mkForce false;
services.btrfs.autoScrub.enable = lib.mkForce false;
system.video.nvidia.enable = true;

96
hosts/extern/disko/default.nix vendored Normal file
View file

@ -0,0 +1,96 @@
{ disko, config, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/sdg";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
};
nodev = {
"/" = {
fsType = "tmpfs";
mountOptions = [ "size=4G" ];
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/persist/.snapshots" = { };
"/jimbo" = {
mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/jimbo/.snapshots" = { };
};
};
};
swap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems = {
"/persist".neededForBoot = true;
"/persist/home/jimbo".neededForBoot = true;
};
}

11
hosts/extern/filesystems/default.nix vendored Normal file
View file

@ -0,0 +1,11 @@
{ config, ... }:
{
fileSystems = {
# Remote
"/home/jimbo/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];
};
};
}

View file

@ -1,32 +1,7 @@
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/all-hardware.nix") ];
boot = {
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"uas"
"usb_storage"
"sd_mod"
];
kernelModules = [
"dm-snapshot"
];
};
};
fileSystems = {
# Remote
"/home/jimbo/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];
};
};
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "dm-snapshot" ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -1,7 +0,0 @@
{ modulesPath, ... }:
{
imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
"${modulesPath}/installer/cd-dvd/channel.nix"
];
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./overlays
./variables
];
}

View file

@ -7,8 +7,7 @@
./settings
./wms
./users
../../overlays
../../variables
../extras
# Imports
nur.nixosModules.nur

View file

@ -0,0 +1,4 @@
{ ... }:
{
programs.carapace.enable = true;
}

View file

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./carapace
./fastfetch
./git
./ncmpcpp

View file

@ -2,6 +2,7 @@
{
programs.zsh = {
enable = true;
enableCompletion = false;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
@ -34,9 +35,9 @@
seneca = "ssh jhampton1@matrix.senecapolytechnic.ca";
};
initExtra = ''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
source ${pkgs.zsh-you-should-use}/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch
setopt HIST_IGNORE_SPACE
setopt RM_STAR_WAIT
'';

View file

@ -7,8 +7,7 @@
./programs
./services
./settings
../../overlays
../../variables
../extras
];
time.timeZone = "America/Toronto";

View file

@ -5,6 +5,4 @@
info.enable = false;
nixos.enable = false;
};
programs.command-not-found.enable = true;
}

View file

@ -6,5 +6,6 @@
};
programs.less.lessopen = null;
services.logrotate.enable = false;
}

Binary file not shown.