feat: install nixos on orange pi 5 plus with edk2-rk3588(uefi)

This commit is contained in:
Ryan Yin
2024-03-05 20:38:31 +08:00
parent efcee11839
commit 4d0741c841
20 changed files with 560 additions and 29 deletions
+22 -7
View File
@@ -27,14 +27,22 @@ with allSystemAttrs; let
};
# aarch64 related
# using the same nixpkgs as nixos-rk3588 to utilize the cross-compilation cache.
rk3588_pkgs = import nixos-rk3588.inputs.nixpkgs {system = x64_system;};
rk3588_specialArgs = {
inherit username userfullname useremail;
rk3588_pkgs = import nixos-rk3588.inputs.nixpkgs {system = aarch64_system;};
# aarch64 related
rk3588_specialArgs = let
# using the same nixpkgs as nixos-rk3588
inherit (nixos-rk3588.inputs) nixpkgs;
# Provide rk3588 inputs as special argument
rk3588 = nixos-rk3588.inputs;
};
# use aarch64-linux's native toolchain
pkgsKernel = import nixpkgs {
system = aarch64_system;
};
in
allSystemSpecialArgs.aarch64_system
// {
inherit nixpkgs;
# Provide rk3588 inputs as special argument
rk3588 = {inherit nixpkgs pkgsKernel;};
};
rk3588_base_args = {
inherit home-manager;
inherit (nixos-rk3588.inputs) nixpkgs; # or nixpkgs-unstable
@@ -55,6 +63,7 @@ in {
# aarch64 SBCs
suzu = rk3588_specialArgs;
rakushun = rk3588_specialArgs;
};
nodeNixpkgs = {
nozomi = lpi4a_pkgs;
@@ -62,6 +71,7 @@ in {
# aarch64 SBCs
suzu = rk3588_pkgs;
rakushun = rk3588_pkgs;
};
};
@@ -137,5 +147,10 @@ in {
_12kingdoms_suzu_modules
{host_tags = _12kingdoms_suzu_tags;}
]);
rakushun = colmenaSystem (attrs.mergeAttrsList [
rk3588_base_args
_12kingdoms_rakushun_modules
{host_tags = _12kingdoms_rakushun_tags;}
]);
};
}
+26 -1
View File
@@ -8,6 +8,28 @@ with allSystemAttrs; let
system = x64_system;
specialArgs = allSystemSpecialArgs.x64_system;
};
# aarch64 related
rk3588_specialArgs = let
# using the same nixpkgs as nixos-rk3588
inherit (nixos-rk3588.inputs) nixpkgs;
# use aarch64-linux's native toolchain
pkgsKernel = import nixpkgs {
system = aarch64_system;
};
in
allSystemSpecialArgs.aarch64_system
// {
inherit nixpkgs;
# Provide rk3588 inputs as special argument
rk3588 = {inherit nixpkgs pkgsKernel;};
};
rk3588_base_args = {
inherit home-manager nixos-generators;
inherit (nixos-rk3588.inputs) nixpkgs; # or nixpkgs-unstable
system = aarch64_system;
specialArgs = rk3588_specialArgs;
};
in {
nixosConfigurations = {
# ai with i3 window manager
@@ -32,9 +54,12 @@ in {
k3s_prod_1_worker_3 = nixosSystem (k3s_prod_1_worker_3_modules // base_args);
tailscale_gw = nixosSystem (homelab_tailscale_gw_modules // base_args);
# aarch64 hosts
suzu = nixosSystem (_12kingdoms_suzu_modules // rk3588_base_args);
rakushun = nixosSystem (_12kingdoms_rakushun_modules // rk3588_base_args);
};
# take system images for idols
# https://github.com/nix-community/nixos-generators
packages."${x64_system}" = attrs.mergeAttrsList [
(
+10 -3
View File
@@ -246,14 +246,21 @@ in {
nixos-modules = [
../hosts/12kingdoms_suzu
../modules/nixos/server/server-aarch64.nix
# cross-compilation this flake.
{nixpkgs.crossSystem.config = "aarch64-unknown-linux-gnu";}
];
# home-module.imports = [];
};
_12kingdoms_suzu_tags = ["aarch" "suzu"];
# 楽俊, Rakushun
_12kingdoms_rakushun_modules = {
nixos-modules = [
../hosts/12kingdoms_rakushun
../modules/nixos/server/server-aarch64.nix
];
# home-module.imports = [];
};
_12kingdoms_rakushun_tags = ["aarch" "rakushun"];
# Shoukei (祥瓊, Shōkei)
_12kingdoms_shoukei_modules_i3 = {
nixos-modules =
+1
View File
@@ -28,6 +28,7 @@
"kubevirt-shoryu" = "192.168.5.176";
"kubevirt-shushou" = "192.168.5.177";
"kubevirt-youko" = "192.168.5.178";
"rakushun" = "192.168.5.179";
"tailscale-gw" = "192.168.5.192";
};