Major update to handle multiple systems

This commit is contained in:
Emmet 2025-02-12 14:12:11 -06:00
parent 0453901d17
commit cd1d2d866b
34 changed files with 2040 additions and 456 deletions

3
hosts/zenith/README.org Normal file
View file

@ -0,0 +1,3 @@
#+title: Just chillin'
This is my profile for a personal computer. It is functionally identical to my [[../work]] profile, but includes extra things like games and social apps!

View file

@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
{
config = {
systemSettings = {
# users
users = [ "emmet" ];
adminUsers = [ "emmet" ];
# hardware
cachy.enable = true;
bluetooth.enable = true;
tlp.enable = true;
printing.enable = true;
# software
flatpak.enable = false;
virtualization = {
docker.enable = true;
virtualMachines.enable = true;
};
# wm
hyprland.enable = true;
# dotfiles
dotfilesDir = "/etc/nixos";
# security
security = {
automount.enable = true;
blocklist.enable = true;
doas.enable = true;
firejail.enable = false; # TODO setup firejail profiles
firewall.enable = true;
gpg.enable = true;
openvpn.enable = true;
sshd.enable = false;
};
# style
stylix = {
enable = true;
theme = "alph";
};
};
};
}

14
hosts/zenith/default.nix Normal file
View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
imports = [
./configuration.nix
./hardware-configuration.nix
];
config = {
home-manager.users = builtins.listToAttrs
(map (user: { name = user; value =
({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users);
};
}

View file

@ -0,0 +1,86 @@
# 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, inputs, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
services.fstrim.enable = true;
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];
hardware.graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "ahci" "nvme" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
# my stupid usb hub crashes systemct suspend half of the time now
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Sleep_hooks
systemd.services.root-suspend = {
enable = true;
description = "Root systemd suspend prehook";
unitConfig = {
Description = "Root systemd suspend prehook";
Before = "sleep.target";
};
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.uhubctl}/bin/uhubctl -a off";
};
wantedBy = [ "sleep.target" ];
};
systemd.services.root-resume = {
enable = true;
description = "Root systemd suspend posthook";
unitConfig = {
Description = "Root systemd suspend posthook";
After = "suspend.target";
};
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.uhubctl}/bin/uhubctl -a on";
};
wantedBy = [ "suspend.target" ];
};
services.btrfs.autoScrub = {
enable = true;
interval = "weekly";
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/ca98a0cc-4a50-4e28-84e5-0dddcbfea155";
fsType = "btrfs";
options = [ "noatime,compress-force=zstd:2,discard=async,commit=120,clear_cache,space_cache=v2,subvol=@" ];
};
boot.loader.efi.efiSysMountPoint = "/boot";
boot.initrd.luks.devices."luks-9c74f9e5-41c3-4ba6-8a87-059dbcd4e2b3".device = "/dev/disk/by-uuid/9c74f9e5-41c3-4ba6-8a87-059dbcd4e2b3";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4898-D64F";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# 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;
}

65
hosts/zenith/home.nix Normal file
View file

@ -0,0 +1,65 @@
{ config, lib, pkgs, ... }:
{
config = {
userSettings = {
# setup
shell = {
enable = true;
apps.enable = true;
};
xdg.enable = true;
# programs
browser = "qutebrowser";
brave.enable = true;
editor = "emacs";
ranger.enable = true;
git.enable = true;
engineering.enable = true;
art.enable = true;
flatpak.enable = false;
godot.enable = true;
keepass.enable = true;
media.enable = true;
music.enable = true;
office.enable = true;
recording.enable = true;
virtualization = {
virtualMachines.enable = true;
};
# wm
hyprland.enable = true;
# style
stylix.enable = true;
# hardware
bluetooth.enable = true;
};
wayland.windowManager.hyprland = lib.mkIf config.userSettings.hyprland.enable {
settings = {
bind = [
''SUPER,E,exec,if hyprctl clients | grep qutegmail; then echo "scratch_mail respawn not needed"; else qutebrowser --qt-flag enable-gpu-rasterization --qt-flag enable-native-gpu-memory-buffers --qt-flag num-raster-threads=4 -B ~/.browser/Teaching :'set input.mode_override passthrough -u mail.google.com' :'set window.title_format qutegmail' :'set tabs.show never' :'set statusbar.show never' https://mail.google.com; fi''
"SUPER,E,togglespecialworkspace,scratch_email"
];
windowrulev2 = [
"float,title:^(qutegmail)$"
"size 80% 85%,title:^(qutegmail)$"
"workspace special:scratch_email ,title:^(qutegmail)$"
"center,title:^(qutegmail)$"
];
monitor = [
"eDP-1,1920x1080,1920x0,1"
"HDMI-A-1,1920x1080,0x0,1"
];
};
};
};
}