mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-09 06:05:10 +02:00
feat: refactor flake.nix
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
args:
|
||||
with args; let
|
||||
lib = nixpkgs.lib;
|
||||
colmenaSystem = import ../lib/colmenaSystem.nix;
|
||||
# x86_64 related
|
||||
x64_base_args = {
|
||||
inherit home-manager;
|
||||
inherit nixpkgs; # or nixpkgs-unstable
|
||||
specialArgs = x64_system_specialArgs;
|
||||
};
|
||||
|
||||
# riscv64 related
|
||||
# using the same nixpkgs as nixos-licheepi4a to utilize the cross-compilation cache.
|
||||
lpi4a_pkgs = import nixos-licheepi4a.inputs.nixpkgs {system = x64_system;};
|
||||
lpi4a_specialArgs =
|
||||
{
|
||||
inherit username userfullname useremail;
|
||||
pkgsKernel = nixos-licheepi4a.packages.${x64_system}.pkgsKernelCross;
|
||||
}
|
||||
// args;
|
||||
lpi4a_base_args = {
|
||||
inherit home-manager;
|
||||
inherit (nixos-licheepi4a.inputs) nixpkgs; # or nixpkgs-unstable
|
||||
specialArgs = lpi4a_specialArgs;
|
||||
targetUser = "root";
|
||||
};
|
||||
|
||||
# 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;
|
||||
}
|
||||
// nixos-rk3588.inputs;
|
||||
rk3588_base_args = {
|
||||
inherit home-manager;
|
||||
inherit (nixos-rk3588.inputs) nixpkgs; # or nixpkgs-unstable
|
||||
specialArgs = rk3588_specialArgs;
|
||||
targetUser = "root";
|
||||
};
|
||||
in {
|
||||
# colmena - remote deployment via SSH
|
||||
colmena = {
|
||||
meta = {
|
||||
nixpkgs = import nixpkgs {system = x64_system;};
|
||||
specialArgs = x64_system_specialArgs;
|
||||
|
||||
nodeSpecialArgs = {
|
||||
# riscv64 SBCs
|
||||
nozomi = lpi4a_specialArgs;
|
||||
yukina = lpi4a_specialArgs;
|
||||
|
||||
# aarch64 SBCs
|
||||
suzu = rk3588_specialArgs;
|
||||
};
|
||||
nodeNixpkgs = {
|
||||
nozomi = lpi4a_pkgs;
|
||||
yukina = lpi4a_pkgs;
|
||||
|
||||
# aarch64 SBCs
|
||||
suzu = rk3588_pkgs;
|
||||
};
|
||||
};
|
||||
|
||||
# proxmox virtual machines(x86_64)
|
||||
aquamarine = colmenaSystem (lib.attrsets.mergeAttrsList [
|
||||
x64_base_args
|
||||
idol_aquamarine_modules
|
||||
{host_tags = idol_aquamarine_tags;}
|
||||
]);
|
||||
ruby = colmenaSystem (lib.attrsets.mergeAttrsList [
|
||||
x64_base_args
|
||||
idol_ruby_modules
|
||||
{host_tags = idol_ruby_tags;}
|
||||
]);
|
||||
kana = colmenaSystem (lib.attrsets.mergeAttrsList [
|
||||
x64_base_args
|
||||
idol_kana_modules
|
||||
{host_tags = idol_kana_tags;}
|
||||
]);
|
||||
|
||||
# riscv64 SBCs
|
||||
nozomi = colmenaSystem (lib.attrsets.mergeAttrsList [
|
||||
lpi4a_base_args
|
||||
rolling_nozomi_modules
|
||||
{host_tags = rolling_nozomi_tags;}
|
||||
]);
|
||||
yukina = colmenaSystem (lib.attrsets.mergeAttrsList [
|
||||
lpi4a_base_args
|
||||
rolling_yukina_modules
|
||||
{host_tags = rolling_yukina_tags;}
|
||||
]);
|
||||
|
||||
# aarch64 SBCs
|
||||
suzu = colmenaSystem (lib.attrsets.mergeAttrsList [
|
||||
rk3588_base_args
|
||||
_12kingdoms_suzu_modules
|
||||
{host_tags = _12kingdoms_suzu_tags;}
|
||||
]);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user