feat(nixos): scaffold macbook host for apple silicon (aarch64-linux)
This commit is contained in:
+84
-44
@@ -1,51 +1,91 @@
|
||||
{
|
||||
myConfig = {
|
||||
nixos = {
|
||||
username = "kenji";
|
||||
hostname = "hakase";
|
||||
timezone = "America/Chicago";
|
||||
};
|
||||
git = {
|
||||
username = "kenji";
|
||||
email = "kenji@hakase";
|
||||
defaultBranch = "master";
|
||||
};
|
||||
terminal = {
|
||||
default = "ghostty";
|
||||
aliases = {
|
||||
update = "sudo nixos-rebuild switch --flake ~/.config/nixos/#hakase";
|
||||
hakase = {
|
||||
myConfig = {
|
||||
nixos = {
|
||||
username = "kenji";
|
||||
hostname = "hakase";
|
||||
timezone = "America/Chicago";
|
||||
};
|
||||
git = {
|
||||
username = "kenji";
|
||||
email = "kenji@hakase";
|
||||
defaultBranch = "master";
|
||||
};
|
||||
terminal = {
|
||||
default = "ghostty";
|
||||
aliases = {
|
||||
update = "sudo nixos-rebuild switch --flake ~/.config/nixos/#hakase";
|
||||
};
|
||||
};
|
||||
hyprland = {
|
||||
monitors = [
|
||||
"DP-1,highres@180,0x1080,1,bitdepth,10,cm,hdr,sdrbrightness,1.4,sdrsaturation,0.98,vrr,0"
|
||||
"DP-2, highres@165,760x0,1"
|
||||
"HDMI-A-1, highres@highrr@120, 3440x1440, 1.6"
|
||||
];
|
||||
|
||||
wallpaper = "firewatch.png";
|
||||
};
|
||||
firefox = {
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Home Manager";
|
||||
url = "https://mynixos.com/home-manager/options/programs";
|
||||
}
|
||||
{
|
||||
name = "YouTube";
|
||||
url = "https://youtube.com";
|
||||
}
|
||||
{
|
||||
name = "Nur";
|
||||
url = "https://nur.nix-community.org/repos";
|
||||
}
|
||||
];
|
||||
newtabpage = [
|
||||
{
|
||||
title = "Dashboard";
|
||||
url = "https://dash.sakamoto.dev";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
hyprland = {
|
||||
monitors = [
|
||||
"DP-1,highres@180,0x1080,1,bitdepth,10,cm,hdr,sdrbrightness,1.4,sdrsaturation,0.98,vrr,0"
|
||||
"DP-2, highres@165,760x0,1"
|
||||
"HDMI-A-1, highres@highrr@120, 3440x1440, 1.6"
|
||||
];
|
||||
};
|
||||
|
||||
wallpaper = "firewatch.png";
|
||||
};
|
||||
firefox = {
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Home Manager";
|
||||
url = "https://mynixos.com/home-manager/options/programs";
|
||||
}
|
||||
{
|
||||
name = "YouTube";
|
||||
url = "https://youtube.com";
|
||||
}
|
||||
{
|
||||
name = "Nur";
|
||||
url = "https://nur.nix-community.org/repos";
|
||||
}
|
||||
];
|
||||
newtabpage = [
|
||||
{
|
||||
title = "Dashboard";
|
||||
url = "https://dash.sakamoto.dev";
|
||||
}
|
||||
];
|
||||
macbook = {
|
||||
myConfig = {
|
||||
nixos = {
|
||||
username = "kenji";
|
||||
hostname = "macbook";
|
||||
timezone = "America/Chicago";
|
||||
};
|
||||
git = {
|
||||
username = "kenji";
|
||||
email = "kenji@macbook";
|
||||
defaultBranch = "master";
|
||||
};
|
||||
terminal = {
|
||||
default = "ghostty";
|
||||
aliases = {
|
||||
update = "sudo nixos-rebuild switch --flake ~/.config/nixos/#macbook";
|
||||
};
|
||||
};
|
||||
hyprland = {
|
||||
# M1 Pro/Max/Air screens are usually built-in eDP-1.
|
||||
# HiDPI scale 2.0 is safe for Retina.
|
||||
monitors = [
|
||||
"eDP-1, highres, auto, 2"
|
||||
];
|
||||
wallpaper = "firewatch.png";
|
||||
};
|
||||
firefox = {
|
||||
bookmarks = [
|
||||
{
|
||||
name = "Asahi Linux";
|
||||
url = "https://asahilinux.org/";
|
||||
}
|
||||
];
|
||||
newtabpage = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@
|
||||
url = "github:vicinaehq/vicinae";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
apple-silicon = {
|
||||
url = "github:tpwrules/nixos-apple-silicon";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
@@ -62,19 +66,18 @@
|
||||
chaotic,
|
||||
sops-nix,
|
||||
textfox,
|
||||
apple-silicon,
|
||||
...
|
||||
} @ inputs: let
|
||||
config = import ./config.nix;
|
||||
system = "x86_64-linux";
|
||||
args =
|
||||
{
|
||||
inherit inputs system;
|
||||
}
|
||||
// config;
|
||||
allConfig = import ./config.nix;
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
hakase = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = args;
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
system = "x86_64-linux";
|
||||
} // allConfig.hakase;
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
sops-nix.nixosModules.sops
|
||||
@@ -82,6 +85,20 @@
|
||||
./hosts/hakase/configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
macbook = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
system = "aarch64-linux";
|
||||
} // allConfig.macbook;
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
sops-nix.nixosModules.sops
|
||||
apple-silicon.nixosModules.apple-silicon-support
|
||||
./hosts/macbook/configuration.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
../../modules/nixos/default.nix
|
||||
../../modules/nixos/hyprland.nix
|
||||
../../modules/nixos/gaming.nix
|
||||
../../modules/nixos/amd.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules/nixos/default.nix
|
||||
../../modules/nixos/hyprland.nix
|
||||
# No gaming.nix (Steam is x86 only)
|
||||
# No amd.nix
|
||||
];
|
||||
|
||||
# Apple Silicon specific hardware tweaks
|
||||
hardware.asahi = {
|
||||
# peripheralFirmwareDirectory = ./firmware; # If you have extracted firmware
|
||||
useExperimentalGPUDriver = true;
|
||||
experimentalGPUInstallMode = "replace";
|
||||
};
|
||||
|
||||
# Bootloader for Asahi is usually systemd-boot or grub, but asahi-module handles m1n1
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = false; # Asahi often prefers this false to avoid bricking nvram
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
# 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, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "usb_storage" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/0000-0000";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./amd.nix
|
||||
./backlight.nix
|
||||
./boot.nix
|
||||
./fonts.nix
|
||||
|
||||
Reference in New Issue
Block a user