added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 7d4f626b7d
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,9 @@
{
imports = [
./fs
./modules
./system.nix
./encryption.nix
];
}

View file

@ -0,0 +1,19 @@
{
# mildly improves performance for the disk encryption
boot.initrd.availableKernelModules = [
"aesni_intel"
"cryptd"
"usb_storage"
];
boot.initrd.luks.devices."enc" = {
# improve performance on ssds
bypassWorkqueues = true;
keyFileSize = 4096;
# the device with the maching id will be searched for the key file
keyFile = "/dev/disk/by-id/usb-Generic_Flash_Disk_B314B63E-0:0";
preLVM = true;
# if keyfile is not there, fall back to cryptsetup password
# fallbackToPassword = true; # IMPLIED BY config.boot.initrd.systemd.enable
};
}

View file

@ -0,0 +1,46 @@
{
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/82144284-cf1d-4d65-9999-2e7cdc3c75d4";
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/b79d3c8b-d511-4d66-a5e0-641a75440ada";
fsType = "btrfs";
options = ["subvol=root"];
};
"/home" = {
device = "/dev/disk/by-uuid/b79d3c8b-d511-4d66-a5e0-641a75440ada";
fsType = "btrfs";
options = ["subvol=home"];
};
"/nix" = {
device = "/dev/disk/by-uuid/b79d3c8b-d511-4d66-a5e0-641a75440ada";
fsType = "btrfs";
options = ["subvol=nix"];
};
"/persist" = {
device = "/dev/disk/by-uuid/b79d3c8b-d511-4d66-a5e0-641a75440ada";
fsType = "btrfs";
options = ["subvol=persist"];
neededForBoot = true;
};
"/var/log" = {
device = "/dev/disk/by-uuid/b79d3c8b-d511-4d66-a5e0-641a75440ada";
fsType = "btrfs";
options = ["subvol=log"];
neededForBoot = true;
};
"/boot" = {
device = "/dev/disk/by-uuid/FDED-3BCF";
fsType = "vfat";
};
};
swapDevices = [
{device = "/dev/disk/by-uuid/0d1fc824-623b-4bb8-bf7b-63a3e657889d";}
];
}

View file

@ -0,0 +1,7 @@
{
imports = [
./device.nix
./system.nix
./usrEnv.nix
];
}

View file

@ -0,0 +1,11 @@
{
config.modules.device = {
type = "laptop";
cpu.type = "intel";
gpu.type = "hybrid-nv"; # nvidia drivers :b:roke
monitors = ["eDP-1"];
hasBluetooth = true;
hasSound = true;
hasTPM = true;
};
}

View file

@ -0,0 +1,57 @@
{
config.modules.system = {
mainUser = "notashelf";
fs = ["btrfs" "ext4" "vfat"];
autoLogin = true;
boot = {
secureBoot = false;
loader = "systemd-boot";
enableKernelTweaks = true;
initrd.enableTweaks = true;
loadRecommendedModules = true;
tmpOnTmpfs = true;
};
encryption = {
enable = true;
device = "enc";
};
video.enable = true;
sound.enable = true;
bluetooth.enable = false;
printing.enable = false;
emulation.enable = true;
networking = {
optimizeTcp = true;
};
security = {
fixWebcam = false;
};
virtualization = {
enable = true;
docker.enable = false;
qemu.enable = true;
podman.enable = false;
};
programs = {
git.signingKey = "0x05A3BD53FEB32B81";
cli.enable = true;
gui.enable = true;
gaming = {
enable = false;
chess.enable = false;
};
default = {
terminal = "foot";
};
};
};
}

View file

@ -0,0 +1,7 @@
{
config.modules.usrEnv = {
isWayland = true;
desktop = "Hyprland";
useHomeManager = true;
};
}

View file

@ -0,0 +1,59 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkForce optionals;
dev = config.modules.device;
in {
config = {
fileSystems = {
"/".options = ["compress=zstd" "noatime"];
"/home".options = ["compress=zstd"];
"/nix".options = ["compress=zstd" "noatime"];
"/var/log".options = ["compress=zstd" "noatime"];
"/persist".options = ["compress=zstd" "noatime"];
};
hardware = {
nvidia = mkIf (builtins.elem dev.gpu ["nvidia" "hybrid-nv"]) {
nvidiaPersistenced = mkForce false;
open = mkForce false;
prime = {
offload.enable = mkForce true;
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
};
};
};
boot = {
kernelParams =
[
"nohibernate"
# The passive default severely degrades performance.
"intel_pstate=active"
]
++ optionals ((dev.cpu == "intel") && (dev.gpu != "hybrid-nv")) [
"i915.enable_fbc=1"
"i915.enable_psr=2"
];
kernelModules = [
"sdhci" # fix microsd cards
];
};
services.btrfs.autoScrub = {fileSystems = ["/"];};
home-manager.users.notashelf.systemd.user.startServices = "legacy";
console.earlySetup = true;
};
}