Add back lacros and some keybind stuff

This commit is contained in:
Jimbo 2024-12-10 17:54:39 -05:00
parent 7c5ff0253e
commit 7540a2156a
26 changed files with 134 additions and 157 deletions

View file

@ -10,6 +10,8 @@
../../modules/system
];
networking.enableB43Firmware = true;
system.wireguard.client.enable = true;
networking.wireguard.interfaces.wgc.ips = [ "10.100.0.21/24" ];

View file

@ -2,38 +2,6 @@
{
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernel.sysctl."vm.max_map_count" = 2147483642;
initrd = {
systemd = {
enable = true;
services.root-reset = {
description = "Reset root and snapshot last boot";
wantedBy = [ "initrd.target" ];
after = [ "dev-${config.networking.hostName}-root.device" ];
before = [ "sysroot.mount" ];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
mkdir -p /mnt
mount /dev/${config.networking.hostName}/root /mnt
if [[ -e /mnt/prev ]]; then
btrfs subvolume delete /mnt/prev
fi
btrfs subvolume snapshot /mnt/root /mnt/prev
btrfs subvolume list -o /mnt/root | cut -f9 -d' ' | while read subvolume; do
btrfs subvolume delete "/mnt/$subvolume"
done
btrfs subvolume delete /mnt/root
btrfs subvolume create /mnt/root
umount /mnt
'';
};
};
};
kernel.sysctl."vm.max_map_count" = 2147483642;
};
}

View file

@ -3,26 +3,10 @@
imports = [
./boot
./disko
./filesystems
./hardware
./wireguard
# Apps and programs
../../../modules/system
../../../modules/system/accounts
../../../modules/system/desktop
../../../modules/system/programs
../../../modules/system/services
# Devices and hardware
../../../modules/system/devices
../../../modules/system/devices/boot/lanzaboote
../../../modules/system/devices/networking/wireless
../../../modules/system/devices/networking/firewall/pc
../../../modules/system/devices/networking/wireguard/pc
# Extras
../../../overlays
../../../variables
./users
../../modules/system
];
services.keyd.keyboards.default.settings.main = {
@ -31,5 +15,8 @@
f13 = lib.mkForce "delete";
};
system.lanzaboote.enable = true;
networking.hostName = "lacros";
system.stateVersion = "24.11";
}

View file

@ -6,25 +6,26 @@
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/nvme0n1";
device = "/dev/mmcblk0";
content = {
type = "gpt";
partitions = {
ESP = {
size = "2G";
priority = 1;
size = "1500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "fmask=0022" "dmask=0022" ];
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypt-nvme";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
@ -50,34 +51,34 @@
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/persist/.snapshots" = { };
"/jimbo" = {
mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/jimbo/.snapshots" = { };
};
};
};
swap = {
size = "8G";
size = "1500M";
content = {
type = "swap";
discardPolicy = "both";

View file

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

View file

@ -1,22 +1,9 @@
{ config, lib, modulesPath, ... }:
{ config, lib, ... }:
{
boot = {
kernelModules = [ "kvm-intel" ];
initrd = {
availableKernelModules = [ "xhci_pci" "sdhci_pci" ];
kernelModules = [ "dm-snapshot" ];
};
};
fileSystems = {
# Remote
"/home/jimbo/JimboNFS" = {
device = "${config.ips.wgSpan}.1:/export/JimboNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];
};
};
boot.kernelModules = [ "kvm-intel" ];
boot.initrd.availableKernelModules = [ "xhci_pci" "sdhci_pci" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -1 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBk6ALxn+zKrRys6/c1oYSoWJaUUEo3nAM224ElhjJQR
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl

View file

@ -0,0 +1,4 @@
{ ... }:
{
imports = [ ./jimbo ];
}

View file

@ -0,0 +1,6 @@
{ lib, ... }:
{
home-manager.users.jimbo = {
home.stateVersion = lib.mkForce "24.11";
};
}

View file

@ -1,23 +0,0 @@
{ lib, config, ... }:
{
networking = {
firewall = {
allowedUDPPorts = [ 51820 ];
trustedInterfaces = [ "wgc" ];
};
wireguard.interfaces.wgc = {
ips = [ "${config.ips.wgSpan}.18/24" ];
listenPort = 51820;
privateKey = config.secrets.wgClientPriv;
peers = [
{ # Cyberspark Server
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "sv.${config.domains.jim1}:51820";
persistentKeepalive = 25;
}
];
};
};
}

View file

@ -35,15 +35,13 @@ in {
# Use second GPU on boot
specialisation.gputwo.configuration = {
boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ];
environment.sessionVariables.WLR_RENDERER = lib.mkForce "gles2";
};
# Use Nouveau
specialisation.nouveau.configuration.config = {
environment.sessionVariables = {
NIXOS_OZONE_WL = lib.mkForce "0";
WLR_RENDERER = lib.mkForce "vulkan";
};
system.video.nvidia.enable = lib.mkForce false;
system.video.nouveau.enable = lib.mkForce true;
environment.sessionVariables.NIXOS_OZONE_WL = lib.mkForce "0";
};
}