nix/system/hosts/peach/default.nix

103 lines
2.7 KiB
Nix

{
config,
pkgs,
lib,
seamless-asahi-plymouth,
...
}:
let
asahi-artwork = pkgs.fetchFromGitHub {
owner = "AsahiLinux";
repo = "artwork";
rev = "80d14f8b6f485b310e305a84b4b806361518ddd1";
hash = "sha256-1r7gPFsn3GmKO4YsixsK7eyQWfVjsWnuOEtSCQequn8=";
};
in
{
nixpkgs.overlays = [
(final: prev: {
uboot-asahi = prev.uboot-asahi.overrideAttrs (old: {
postConfigure = (old.postConfigure or "") + ''
cat >> .config <<'EOF'
# CONFIG_VIDEO_LOGO is not set
CONFIG_DISPLAY_BOARDINFO_LATE=n
CONFIG_BOOTDELAY=0
CONFIG_SILENT_CONSOLE=y
CONFIG_PREBOOT="setenv silent 1"
EOF
# Regenerate the configuration with new flags
make olddefconfig
'';
});
})
];
boot = {
loader.timeout = lib.mkForce 0;
kernelParams = [ "appledrm.show_notch=1" ];
# thank you to u/douv:
# https://www.reddit.com/r/AsahiLinux/comments/1sb8cby/retro_boot_logo/
m1n1CustomLogo = ./apple-rainbow.png;
plymouth = {
enable = true;
theme = "seamless-asahi";
themePackages = [
(seamless-asahi-plymouth.packages.${pkgs.system}.default.override {
logo = ./apple-rainbow.png;
})
];
extraConfig = ''
DeviceScale=1
'';
};
};
programs.dconf.profiles.gdm.databases = [
{
settings."org/gnome/login-screen".logo =
"${asahi-artwork}/logos/svg/AsahiLinux_logo_horizontal_darkbg.svg";
}
];
# environment.systemPackages = with pkgs; [
# # note for wine support (should be done by 26.05 release):
# # https://github.com/NixOS/nixpkgs/issues/412458
# muvm
# fex
# ];
services.logind.settings.Login = {
HandleSuspendKey = "ignore";
HandlePowerKey = "lock";
HandleLidSwitch = "lock";
};
virtualisation.docker = {
enable = true;
# Use the rootless mode - run Docker daemon as non-root user
rootless = {
enable = true;
setSocketVariable = true;
};
};
users.users.${config.userOptions.username}.extraGroups = [ "docker" ];
hardware.asahi = {
enable = true;
setupAsahiSound = true;
# https://github.com/nix-community/nixos-apple-silicon/issues/299#issuecomment-2901508921
peripheralFirmwareDirectory = pkgs.requireFile {
name = "firmware";
hashMode = "recursive";
hash = "sha256-ooBrgsZ+B6Fmoy6Ze5ppP9oKQzMIk1orvx+ldxY6bQs=";
message = ''
you need to add the firmware to the store:
mkdir system/hosts/peach/firmware
sudo cp -r /mnt/boot/asahi/{all_firmware.tar.gz,kernelcache*} system/hosts/peach/firmware
nix-store --add-fixed sha256 --recursive ./system/hosts/peach/firmware
'';
};
};
}