nix-config/systems/jeroboam/default.nix

151 lines
5.2 KiB
Nix

#############################################################
# ===========================================================
# Rehoboam - LT1
# Simple, Dev
# ===========================================================
#############################################################
{ inputs, pkgs, lib, configLib, ... }:
{
imports = [
# ================= Every Host Needs This ==================== #
./hardware-configuration.nix
# ==================== Hardware Modules ====================== #
inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-gpu-amd
inputs.hardware.nixosModules.common-pc-laptop
# ====================== Disk Layout ========================= #
inputs.disko.nixosModules.disko
( configLib.relativeToRoot "systems/common/disks/jeroboam.nix")
{
_module.args = {
disk = "/dev/nvme0n1";
withSwap = true;
swapSize = "16";
};
}
# ======================= Themeing ========================== #
inputs.stylix.nixosModules.stylix
]
++ (map configLib.relativeToRoot [
# = Required Configs ####################
"systems/common/core"
# --------------- Host-specific Configs -------------------- #
#"systems/common/optional/services/clamav.nix" # depends on optional/msmtp.nix
#"systems/common/optional/msmtp.nix" # required for emailing clamav alerts
#"systems/common/optional/services/openssh.nix" # allow remote ssh
"systems/common/optional/pipewire.nix" # audio
"systems/common/optional/boot/loud_boot.nix" # for testing, otherwise quiet_boot.nix
#"systems/common/optional/boot/quiet_boot.nix" # with plymouth pretty custom load sequence
# ------------------------ Desktop --------------------------- #
#"systems/common/optional/services/greetd.nix" # display manager
#"systems/common/optional/hyprland.nix" # window manager
# ---------------------- Users to Create ---------------------- #
#"systems/common/users/zhuangzi"
"systems/common/users/laozi"
# ---------------------- Themeing ----------------------------- #
"systems/common/optional/stylix.nix"
]);
# set custom autologin options. see greetd.nix for details
# TODO is there a better spot for this?
#autoLogin.enable = true;
#autoLogin.username = "laozi";
# services.gnome.gnome-keyring.enable = true;
# TODO enable and move to greetd area? may need authentication dir or something?
# services.pam.services.greetd.enableGnomeKeyring = true;
networking = {
hostName = "jeroboam";
# wireless.enable = true;
networkmanager.enable = true;
enableIPv6 = false;
};
# ================ HYPRLAND =================== #
environment.sessionVariables = {
# hack to get the cursor to become visible
WLR_NO_HARDWARE_CURSORS = "1";
# WLR_RENDERER_ALLOW_SOFTWARE = "1";
# WLR_DRM_DEVICES = "1";
# Hint electron apps to use wayland
NIXOS_OZONE_WL = "1";
};
# TODO Hyprland
#programs.hyprland = {
#enable = true;
#nvidiaPatches = false;
#xwayland.enable = true;
#};
# ============== Systemd Boot ============== #
boot.loader = {
systemd-boot = {
enable = true;
consoleMode = "max";
};
efi.canTouchEfiVariables = true;
};
# ============ Initrd Luks ================ #
boot = {
kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = [ "btrfs" ];
initrd = {
kernelModules = [ "uas" "usbcore" "usb_storage" "vfat" "nls_cp437" "nls_iso8859_1" ];
luks.devices."crypted" = {
bypassWorkqueues = true;
# ~~~> Define this in system configuration <~~~ search by uuid, partuuid, id, or other stable identification ~> lsblk, blkid or ls -l
device = lib.mkDefault "/dev/disk/by-partuuid/5e65cc4c-eb35-4d62-8fcd-387d6a87c067";
# crypttabExtraOpts = [ "tpm2-device=auto" ]; # tpm2 unlock
preLVM = true;
allowDiscards = true;
# If using a USB or SD Card :
# keyFileSize = 4096;
# keyFile = "/key/hdd.key";
# Use this if you want to fallback to the encryption password when the drive can't be found. HIGHLY RECCOMENDED!!!!
# fallbackToPassword = true;
};
};
resumeDevice = "/dev/nvme0n1"; # should be pointing to disk/dev where swap resides, for some reason my disk does not have uuid
kernelParams = [
# hibernation
"resume_offset=533760"
];
};
swapDevices = [ { device = "/.swapvol/swapfile"; size=16*1024; } ]; #TODO: check module.args locally?
hardware = {
# Opengl
#opengl.enable = true;
# Most wayland compositors need this
nvidia.modesetting.enable = false;
};
passthru = {
requiredLv2Packages = {};
};
# Fix to enable VSCode to successfully remote SSH on a client to a NixOS host
# https://nixos.wiki/wiki/Visual_Studio_Code # Remote_SSH
# programs.nix-ld.enable = true;
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}