Skip to content

Commit

Permalink
feat: add pandora host
Browse files Browse the repository at this point in the history
  • Loading branch information
sioodmy committed Nov 8, 2024
1 parent 2321e82 commit fe26c6c
Show file tree
Hide file tree
Showing 15 changed files with 197 additions and 92 deletions.
54 changes: 54 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 8 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
description = "Consequence of allowing autistic people on the internet. Stay mad one-proper-config-structure purists :3";

outputs = inputs @ {flake-parts, ...}:
outputs = inputs @ {flake-parts, ...}: let
theme = import ./theme;
user = import ./user theme;
in
flake-parts.lib.mkFlake {inherit inputs;} {
flake = {
nixosModules =
Expand All @@ -10,11 +13,7 @@
# it's just so I can easily avoid ../../../../../ mess
system = import ./system;

user = let
theme = import ./theme;
user = import ./user {inherit theme;};
in
user.module;
user = user.module;

# place for my home brew modules
}
Expand All @@ -25,15 +24,10 @@
"x86_64-linux"
"aarch64-linux"
];
perSystem = {pkgs, ...}: let
theme = import ./theme;
user = import ./user {
inherit pkgs theme;
};
in {
perSystem = {pkgs, ...}: {
formatter = pkgs.alejandra;
packages = user.packages;
devShells.default = user.shell;
packages = user.packages pkgs;
devShells.default = user.shell pkgs;
};
};

Expand Down
64 changes: 52 additions & 12 deletions hosts/calypso/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,46 @@
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules =
[
"xhci_pci"
"ahci"
"usbhid"
"sd_mod"
"dm_mod"
"dm_crypt"
"cryptd"
"input_leds"
]
++ config.boot.initrd.luks.cryptoModules;
boot = {
loader = {
systemd-boot = {
enable = true;
memtest86.enable = true;
configurationLimit = 10;
editor = false;
};
# spam space to get to boot menu
timeout = 0;
};
loader.efi.canTouchEfiVariables = true;

kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelParams = [
# fix for suspend issues
# see: https://www.reddit.com/r/archlinux/comments/e5oe4p/comment/fa8mzft/
"snd_hda_intel.dmic_detect=0"
"acpi_osi=linux"
"nowatchdog"
];
initrd.availableKernelModules =
[
"xhci_pci"
"ahci"
"usbhid"
"sd_mod"
"dm_mod"
"dm_crypt"
"cryptd"
"input_leds"
]
++ config.boot.initrd.luks.cryptoModules;
};

fileSystems."/boot" = {
device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
options = ["noatime" "discard"];
};

# For some reason my mic light indicator refuses to turn off on its own
# it may not be a perfect solution, but it works
Expand All @@ -32,5 +60,17 @@
};

hardware.cpu.intel.updateMicrocode = true;
hardware.graphics.extraPackages = builtins.attrValues {
inherit
(pkgs)
vaapiIntel
libva
libvdpau-va-gl
vaapiVdpau
ocl-icd
intel-compute-runtime
;
};

hardware.laptop.enable = true;
}
1 change: 1 addition & 0 deletions hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
};
in {
calypso = mkHost "calypso" "x86_64-linux";
pandora = mkHost "pandora" "aarch64-linux";
}
50 changes: 50 additions & 0 deletions hosts/pandora/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
modulesPath,
lib,
inputs,
...
}: {
imports = [
inputs.apple-silicon-support.nixosModules.apple-silicon-support

(modulesPath + "/installer/scan/not-detected.nix")
];

boot.kernelPatches = [
{
name = "edge-config";
patch = null;
# derived from
# https://github.com/AsahiLinux/PKGBUILDs/blob/stable/linux-asahi/config.edge
extraConfig = ''
DRM_SIMPLEDRM_BACKLIGHT n
BACKLIGHT_GPIO n
DRM_APPLE m
APPLE_SMC m
APPLE_SMC_RTKIT m
APPLE_RTKIT m
APPLE_MBOX m
GPIO_MACSMC m
DRM_VGEM n
DRM_SCHED y
DRM_GEM_SHMEM_HELPER y
DRM_ASAHI m
SUSPEND y
'';
}
];

hardware.asahi = {
enable = true;
extractPeripheralFirmware = true;
peripheralFirmwareDirectory = ./firmware;
withRust = true;
useExperimentalGPUDriver = true;
experimentalGPUInstallMode = "replace";
};

boot.loader.efi.canTouchEfiVariables = lib.mkForce false;

boot.initrd.availableKernelModules = ["usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = ["usbhid" "dm-snapshot"];
}
Binary file added hosts/pandora/firmware/all_firmware.tar.gz
Binary file not shown.
Binary file added hosts/pandora/firmware/kernelcache.release.mac13g
Binary file not shown.
25 changes: 0 additions & 25 deletions system/boot/default.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,8 @@
{pkgs, ...}: {
boot = {
tmp = {
cleanOnBoot = true;
useTmpfs = true;
};
initrd = {
verbose = false;
systemd.enable = true;
};
kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelParams = [
# fix for suspend issues
# see: https://www.reddit.com/r/archlinux/comments/e5oe4p/comment/fa8mzft/
"snd_hda_intel.dmic_detect=0"
"acpi_osi=linux"
"nowatchdog"
];

bootspec.enable = true;
loader = {
systemd-boot = {
enable = true;
memtest86.enable = true;
configurationLimit = 10;
editor = false;
};
# spam space to get to boot menu
timeout = 0;
};
loader.efi.canTouchEfiVariables = true;
};
}
17 changes: 10 additions & 7 deletions system/disks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = ["size=8G" "mode=755"];
# if you need more than 1GB for root then
# you are doing something wrong
options = ["size=1G" "mode=755"];
};

fileSystems."/nix" = {
Expand All @@ -29,6 +31,12 @@
options = ["noatime" "discard" "subvol=@nix" "compress=zstd"];
};

fileSystems."/tmp" = {
device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = ["noatime" "discard" "subvol=@tmp"];
};

fileSystems."/persist" = {
neededForBoot = true;
device = "/dev/disk/by-label/NIXROOT";
Expand All @@ -43,16 +51,11 @@
options = ["noatime" "discard" "subvol=@home" "compress=zstd"];
};

fileSystems."/boot" = {
device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
options = ["noatime" "discard"];
};

# btrfs filesystem mkswapfile --size 16g --uuid clear /persist/swap
swapDevices = [
{
device = "/persist/swap";
size = 8 * 1024;
}
];
}
8 changes: 6 additions & 2 deletions system/users/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{flake, ...}: {
{
flake,
pkgs,
...
}: {
users = {
mutableUsers = false;
users = {
root.hashedPasswordFile = "/persist/secrets/root";
sioodmy = {
isNormalUser = true;
homix = true;
shell = flake.packages.x86_64-linux.cli.zsh;
# shell = flake.packages.${pkgs.system}.cli.zsh;

hashedPasswordFile = "/persist/secrets/sioodmy";
extraGroups = [
Expand Down
19 changes: 2 additions & 17 deletions system/wayland/default.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{pkgs, ...}: let
inherit (builtins) attrValues;
in {
hardware.graphics = {
enable = true;
extraPackages = attrValues {
inherit
(pkgs)
vaapiIntel
libva
libvdpau-va-gl
vaapiVdpau
ocl-icd
intel-compute-runtime
;
};
};
{pkgs, ...}: {
hardware.graphics.enable = true;

systemd.services = {
seatd = {
Expand Down
22 changes: 9 additions & 13 deletions user/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
pkgs,
theme,
...
}: rec {
packages = let
theme: rec {
packages = pkgs: let
inherit (pkgs) callPackage;
in {
cli =
Expand All @@ -21,14 +17,14 @@
};
};

shell = pkgs.mkShell {
name = "sioodmy-devshell";
buildInputs = builtins.attrValues packages.cli;
};

module = {
shell = pkgs:
pkgs.mkShell {
name = "sioodmy-devshell";
buildInputs = builtins.attrValues (packages pkgs).cli;
};
module = {pkgs, ...}: {
config = {
environment.systemPackages = builtins.concatLists (map (x: builtins.attrValues x) (builtins.attrValues packages));
environment.systemPackages = builtins.concatLists (map (x: builtins.attrValues x) (builtins.attrValues (packages pkgs)));
};
imports = [
./packages.nix
Expand Down
Loading

0 comments on commit fe26c6c

Please sign in to comment.