-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from sioodmy/apple-silicon
Apple silicon
- Loading branch information
Showing
29 changed files
with
612 additions
and
436 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
{ | ||
description = "Consequence of allowing autistic people on the internet. Stay mad one-proper-config-structure purists :3"; | ||
|
||
outputs = {nixpkgs, ...} @ inputs: let | ||
pkgs = nixpkgs.legacyPackages.x86_64-linux; | ||
outputs = inputs @ {flake-parts, ...}: let | ||
theme = import ./theme; | ||
user = import ./user { | ||
inherit pkgs theme; | ||
}; | ||
in { | ||
nixosConfigurations = import ./hosts inputs; | ||
nixosModules = | ||
{ | ||
# This module is not meant to be imported by anyone but me | ||
# it's just so I can easily avoid ../../../../../ mess | ||
system = import ./system; | ||
user = import ./user theme; | ||
in | ||
flake-parts.lib.mkFlake {inherit inputs;} { | ||
flake = { | ||
nixosModules = | ||
{ | ||
# This module is not meant to be imported by anyone but me | ||
# it's just so I can easily avoid ../../../../../ mess | ||
system = import ./system; | ||
|
||
user = user.module; | ||
user = user.module; | ||
|
||
# place for my home brew modules | ||
} | ||
// import ./modules; | ||
# place for my home brew modules | ||
} | ||
// import ./modules; | ||
nixosConfigurations = import ./hosts inputs; | ||
}; | ||
systems = [ | ||
"x86_64-linux" | ||
"aarch64-linux" | ||
]; | ||
perSystem = {pkgs, ...}: { | ||
formatter = pkgs.alejandra; | ||
packages = user.packages pkgs; | ||
devShells.default = user.shell pkgs; | ||
}; | ||
}; | ||
|
||
inherit theme; | ||
packages.x86_64-linux = user.packages; | ||
formatter.x86_64-linux = pkgs.alejandra; | ||
devShells.x86_64-linux.default = user.shell; | ||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
apple-silicon-support = { | ||
url = "github:tpwrules/nixos-apple-silicon"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,5 @@ | |
}; | ||
in { | ||
calypso = mkHost "calypso" "x86_64-linux"; | ||
pandora = mkHost "pandora" "aarch64-linux"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
modulesPath, | ||
lib, | ||
inputs, | ||
... | ||
}: { | ||
fileSystems."/boot" = { | ||
device = "/dev/disk/by-uuid/6A3B-1D00"; | ||
fsType = "vfat"; | ||
options = ["noatime" "discard"]; | ||
}; | ||
imports = [ | ||
inputs.apple-silicon-support.nixosModules.apple-silicon-support | ||
|
||
(modulesPath + "/installer/scan/not-detected.nix") | ||
]; | ||
|
||
homix.".config/kanshi/config".text = '' | ||
profile { | ||
output eDP-1 enable scale 1.5 | ||
} | ||
''; | ||
|
||
hardware.asahi = { | ||
enable = true; | ||
extractPeripheralFirmware = true; | ||
peripheralFirmwareDirectory = ./firmware; | ||
withRust = true; | ||
useExperimentalGPUDriver = true; | ||
experimentalGPUInstallMode = "replace"; | ||
}; | ||
|
||
boot = { | ||
binfmt.emulatedSystems = ["x86_64-linux"]; | ||
loader = { | ||
systemd-boot.enable = true; | ||
efi.canTouchEfiVariables = lib.mkForce false; | ||
}; | ||
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 | ||
''; | ||
} | ||
]; | ||
|
||
initrd.availableKernelModules = ["usbhid" "usb_storage" "sd_mod"]; | ||
initrd.kernelModules = ["usbhid" "dm-snapshot"]; | ||
}; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,17 @@ | ||
{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; | ||
}; | ||
} |
Oops, something went wrong.