refactor: massively overhaul home manager module system

This commit is contained in:
Youwen Wu 2024-12-25 19:47:59 -08:00
parent b2270408fc
commit a506d2aed4
Signed by: youwen
GPG key ID: 865658ED1FE61EC3
64 changed files with 5201 additions and 64 deletions

View file

@ -0,0 +1,86 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
inputs,
pkgs,
...
}:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
networking.hostName = "demeter"; # Define your hostname.
liminalOS = {
flakeLocation = "/home/youwen/.config/liminalOS";
config.allowUnfree = true;
defaultEditor = inputs.viminal.packages.${pkgs.system}.default;
formFactor = "desktop";
system = {
audio.prod.enable = true;
networking = {
firewallPresets.vite = true;
cloudflareNameservers.enable = true;
};
graphics.nvidia.enable = true;
};
extras.gaming = {
enable = true;
roblox.enable = true;
utilities.gamemode = {
enable = true;
gamemodeUsers = [ "youwen" ];
};
};
};
time.timeZone = "America/Los_Angeles";
hardware.cpu.intel.updateMicrocode = true;
# Bootloader.
boot = {
loader = {
efi.canTouchEfiVariables = true;
timeout = 15;
# Lanzaboote currently replaces the systemd-boot module.
# This setting is usually set to true in configuration.nix
# generated at installation time. So we force it to false
# for now.
systemd-boot = {
enable = false;
consoleMode = "auto";
};
};
lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
kernelPackages = pkgs.linuxPackages_zen;
initrd.luks.devices."luks-af320a0f-b388-43f5-b5a3-af2b47cfc716".device =
"/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716";
};
users.users.youwen = {
isNormalUser = true;
description = "Youwen Wu";
extraGroups = [
"networkmanager"
"wheel"
];
shell = pkgs.fish;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -0,0 +1,21 @@
{
inputs,
...
}:
{
imports =
[
./configuration.nix
../../../modules/linux
../../../hm
../../../overlays
{
home-manager.users.youwen = {
imports = [ ./home.nix ];
};
}
]
++ (with inputs; [
lanzaboote.nixosModules.lanzaboote
]);
}

View file

@ -0,0 +1,59 @@
# 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"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/5a339a7f-8668-42d7-9ecc-d7a8f1d3f7b2";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-362ec972-7c5e-4c9f-ba5d-b8f2ed083509".device =
"/dev/disk/by-uuid/362ec972-7c5e-4c9f-ba5d-b8f2ed083509";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/27EE-D950";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/670fc084-d593-44b3-aed9-78d95fec71de"; }
];
# 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.enp6s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.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,16 @@
{ lib, ... }:
{
imports = [
../../../hm/modules
../../users/youwen
];
home.stateVersion = "24.05";
wayland.windowManager.hyprland.settings.monitor = [
"DP-1,2560x1440@144,1920x0,auto"
"HDMI-A-1,1920x1080@60,0x0,1"
];
programs.hyprlock.settings.background.monitor = lib.mkForce "DP-1";
}