mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 01:38:28 +02:00
refactor: Use haumea for filesystem-based module system for flake outputs
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
This commit is contained in:
60
outputs/riscv64-linux/src/rolling-girls-nozomi.nix
Normal file
60
outputs/riscv64-linux/src/rolling-girls-nozomi.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
# NOTE: the args not used in this file CAN NOT be removed!
|
||||
# because haumea pass argument lazily,
|
||||
# and these arguments are used in the functions like `mylib.nixosSystem`, `mylib.colmenaSystem`, etc.
|
||||
inputs,
|
||||
lib,
|
||||
mylib,
|
||||
myvars,
|
||||
system,
|
||||
genSpecialArgs,
|
||||
...
|
||||
} @ args: let
|
||||
# 森友 望未, Moritomo Nozomi
|
||||
name = "nozomi";
|
||||
tags = [name "riscv"];
|
||||
ssh-user = "root";
|
||||
|
||||
modules = {
|
||||
nixos-modules =
|
||||
(map mylib.relativeToRoot [
|
||||
"modules/nixos/server/server-riscv64.nix"
|
||||
# host specific modules
|
||||
"hosts/rolling-girls-${name}"
|
||||
])
|
||||
++ [
|
||||
# cross-compilation this flake.
|
||||
{nixpkgs.crossSystem.system = "riscv64-linux";}
|
||||
];
|
||||
};
|
||||
|
||||
inherit (inputs) nixos-licheepi4a;
|
||||
baseSpecialArgs = genSpecialArgs system;
|
||||
|
||||
# using the same nixpkgs as nixos-licheepi4a to utilize the cross-compilation cache.
|
||||
lpi4aPkgs = import nixos-licheepi4a.inputs.nixpkgs {inherit system;};
|
||||
lpi4aSpecialArgs =
|
||||
baseSpecialArgs
|
||||
// {
|
||||
inherit (nixos-licheepi4a.inputs) nixpkgs;
|
||||
pkgsKernel = nixos-licheepi4a.packages.${system}.pkgsKernelCross;
|
||||
}
|
||||
// args;
|
||||
lpi4aSystemArgs =
|
||||
modules
|
||||
// args
|
||||
// {
|
||||
inherit (nixos-licheepi4a.inputs) nixpkgs;
|
||||
specialArgs = lpi4aSpecialArgs;
|
||||
};
|
||||
in {
|
||||
nixosConfigurations.${name} = mylib.nixosSystem lpi4aSystemArgs;
|
||||
|
||||
colmena-meta = {
|
||||
nodeSpecialArgs.${name} = lpi4aSpecialArgs;
|
||||
nodeNixpkgs.${name} = lpi4aPkgs;
|
||||
};
|
||||
colmena.${name} =
|
||||
mylib.colmenaSystem
|
||||
(lpi4aSystemArgs // {inherit tags ssh-user;});
|
||||
}
|
||||
60
outputs/riscv64-linux/src/rolling-girls-yukina.nix
Normal file
60
outputs/riscv64-linux/src/rolling-girls-yukina.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
# NOTE: the args not used in this file CAN NOT be removed!
|
||||
# because haumea pass argument lazily,
|
||||
# and these arguments are used in the functions like `mylib.nixosSystem`, `mylib.colmenaSystem`, etc.
|
||||
inputs,
|
||||
lib,
|
||||
mylib,
|
||||
myvars,
|
||||
system,
|
||||
genSpecialArgs,
|
||||
...
|
||||
} @ args: let
|
||||
# 小坂 結季奈, Kosaka Yukina
|
||||
name = "yukina";
|
||||
tags = [name "riscv"];
|
||||
ssh-user = "root";
|
||||
|
||||
modules = {
|
||||
nixos-modules =
|
||||
(map mylib.relativeToRoot [
|
||||
"modules/nixos/server/server-riscv64.nix"
|
||||
# host specific modules
|
||||
"hosts/rolling-girls-${name}"
|
||||
])
|
||||
++ [
|
||||
# cross-compilation this flake.
|
||||
{nixpkgs.crossSystem.system = "riscv64-linux";}
|
||||
];
|
||||
};
|
||||
|
||||
inherit (inputs) nixos-licheepi4a;
|
||||
baseSpecialArgs = genSpecialArgs system;
|
||||
|
||||
# using the same nixpkgs as nixos-licheepi4a to utilize the cross-compilation cache.
|
||||
lpi4aPkgs = import nixos-licheepi4a.inputs.nixpkgs {inherit system;};
|
||||
lpi4aSpecialArgs =
|
||||
baseSpecialArgs
|
||||
// {
|
||||
inherit (nixos-licheepi4a.inputs) nixpkgs;
|
||||
pkgsKernel = nixos-licheepi4a.packages.${system}.pkgsKernelCross;
|
||||
}
|
||||
// args;
|
||||
lpi4aSystemArgs =
|
||||
modules
|
||||
// args
|
||||
// {
|
||||
inherit (nixos-licheepi4a.inputs) nixpkgs;
|
||||
specialArgs = lpi4aSpecialArgs;
|
||||
};
|
||||
in {
|
||||
nixosConfigurations.${name} = mylib.nixosSystem lpi4aSystemArgs;
|
||||
|
||||
colmena-meta = {
|
||||
nodeSpecialArgs.${name} = lpi4aSpecialArgs;
|
||||
nodeNixpkgs.${name} = lpi4aPkgs;
|
||||
};
|
||||
colmena.${name} =
|
||||
mylib.colmenaSystem
|
||||
(lpi4aSystemArgs // {inherit tags ssh-user;});
|
||||
}
|
||||
Reference in New Issue
Block a user