Add MacBook

This commit is contained in:
Bun 2025-03-08 05:36:01 -05:00
parent b3310802cb
commit 1b9bbe397e
12 changed files with 169 additions and 7 deletions

View file

@ -58,6 +58,7 @@
tower = mkNix [ ./hosts/tower ]; # Main Desktop
envy = mkNix [ ./hosts/envy ]; # HP Convertable
pear = mkNix [ ./hosts/pear ]; # MacBook Pro
redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot
iso = mkNix [ ./hosts/iso ]; # ISO File

View file

@ -11,7 +11,6 @@
networking = {
hostName = "envy";
hostId = "db2e5735";
wg-quick.interfaces.wgc.address = [ "10.100.0.25/24" ];
};

View file

@ -9,10 +9,7 @@
../../modules/system
];
networking = {
hostName = "midas";
hostId = "462433de";
};
networking.hostName = "midas";
system = {
desktop.enable = true;

View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
}

37
hosts/pear/default.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, lib, ... }:
{
imports = [
./boot
./disko
./filesystems
./hardware
./users
../../modules/system
];
networking = {
hostName = "pear";
wg-quick.interfaces.wgc.address = [ "10.100.0.18/24" ];
};
system = {
desktop.enable = true;
#lanzaboote.enable = true;
fancyboot.enable = true;
wireless.enable = true;
wireguard.client.enable = true;
libvirtd.enable = true;
stateVersion = "24.11";
};
# Services to make this work as a school laptop
services.globalprotect.enable = true;
virtualisation.vmware.host.enable = true;
nixpkgs.allowUnfreePackages = [ "vmware-workstation" ];
environment.persistence."/persist".directories = [
"/home/${config.sysusers.main}/vmware"
"/home/${config.sysusers.main}/.vmware"
];
}

View file

@ -0,0 +1,90 @@
{ config, disko, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/persist/.snapshots" = { };
"/persist/home/${config.sysusers.main}" = { };
"/persist/home/${config.sysusers.main}/.snapshots" = { };
};
};
};
swap = {
size = "4G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -0,0 +1,8 @@
{ config, ... }:
{
fileSystems."/home/${config.sysusers.main}/KittyNFS" = {
device = "10.100.0.1:/storage";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];
};
}

View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/hardware/network/broadcom-43xx.nix")
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" "atkbd" "applespi" "intel_lpss_pci" "spi_pxa2xx_platform" ];
boot.kernelModules = [ "kvm-intel" ];
networking.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,4 @@
{ ... }:
{
imports = [ ./main ];
}

View file

@ -0,0 +1,9 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}".home = {
desktop.enable = true;
remote-desktop.enable = true;
school.enable = true;
stateVersion = lib.mkForce config.system.stateVersion;
};
}

View file

@ -11,7 +11,6 @@
networking = {
hostName = "redmond";
hostId = "ae713850";
wg-quick.interfaces.wgc.address = [ "10.100.0.23/24" ];
};

View file

@ -12,7 +12,6 @@
networking = {
hostName = "tower";
hostId = "3d16423a";
interfaces.enp42s0.wakeOnLan.enable = true;
};