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:
Ryan Yin
2024-03-09 01:32:58 +08:00
parent d7738efed2
commit b382999a70
167 changed files with 1570 additions and 955 deletions

View File

@@ -0,0 +1,30 @@
{
lib,
inputs,
...
} @ args: let
inherit (inputs) haumea;
# Contains all the flake outputs of this system architecture.
data = haumea.lib.load {
src = ./src;
inputs = args;
};
# nix file names is redundant, so we remove it.
dataWithoutPaths = builtins.attrValues data;
# Merge all the machine's data into a single attribute set.
outputs = {
darwinConfigurations = lib.attrsets.mergeAttrsList (map (it: it.darwinConfigurations or {}) dataWithoutPaths);
};
in
outputs
// {
inherit data; # for debugging purposes
# NixOS's unit tests.
# unit-tests = haumea.lib.loadEvalTests {
# src = ./tests;
# inputs = args;
# };
}

View File

@@ -0,0 +1,35 @@
{
# 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
name = "fern";
modules = {
darwin-modules =
(map mylib.relativeToRoot [
# common
"secrets/darwin.nix"
"modules/darwin"
# host specific
"hosts/darwin-${name}"
])
++ [];
home-module.imports = map mylib.relativeToRoot [
"hosts/darwin-${name}/home.nix"
"home/darwin"
];
};
systemArgs = modules // args;
in {
# macOS's configuration
darwinConfigurations.${name} = mylib.macosSystem systemArgs;
}

View File

@@ -0,0 +1,38 @@
{
lib,
inputs,
...
} @ args: let
inherit (inputs) haumea;
# Contains all the flake outputs of this system architecture.
data = haumea.lib.load {
src = ./src;
inputs = args;
};
# nix file names is redundant, so we remove it.
dataWithoutPaths = builtins.attrValues data;
# Merge all the machine's data into a single attribute set.
outputs = {
nixosConfigurations = lib.attrsets.mergeAttrsList (map (it: it.nixosConfigurations or {}) dataWithoutPaths);
packages = lib.attrsets.mergeAttrsList (map (it: it.packages or {}) dataWithoutPaths);
# colmena contains some meta info, which need to be merged carefully.
colmena-meta = {
nodeNixpkgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeNixpkgs or {}) dataWithoutPaths);
nodeSpecialArgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeSpecialArgs or {}) dataWithoutPaths);
};
# colmena's per-machine data.
colmena = lib.attrsets.mergeAttrsList (map (it: it.colmena or {}) dataWithoutPaths);
};
in
outputs
// {
inherit data; # for debugging purposes
# NixOS's unit tests.
# unit-tests = haumea.lib.loadEvalTests {
# src = ./tests;
# inputs = args;
# };
}

View 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
# 楽俊, Rakushun
name = "rakushun";
tags = [name "aarch"];
ssh-user = "root";
modules = {
nixos-modules = map mylib.relativeToRoot [
"modules/nixos/server/server-aarch64.nix"
# host specific modules
"hosts/12kingdoms-${name}"
];
};
inherit (inputs) nixos-rk3588;
baseSpecialArgs = genSpecialArgs system;
rk3588Pkgs = import nixos-rk3588.inputs.nixpkgs {inherit system;};
rk3588SpecialArgs = let
# using the same nixpkgs as nixos-rk3588
inherit (nixos-rk3588.inputs) nixpkgs;
# use aarch64-linux's native toolchain
pkgsKernel = import nixpkgs {inherit system;};
in
baseSpecialArgs
// {
inherit nixpkgs;
# Provide rk3588 inputs as special argument
rk3588 = {inherit nixpkgs pkgsKernel;};
};
rk3588SystemArgs =
modules
// args
// {
inherit (nixos-rk3588.inputs) nixpkgs; # or nixpkgs-unstable
specialArgs = rk3588SpecialArgs;
};
in {
nixosConfigurations.${name} = mylib.nixosSystem rk3588SystemArgs;
colmena-meta = {
nodeSpecialArgs.${name} = rk3588SpecialArgs;
nodeNixpkgs.${name} = rk3588Pkgs;
};
colmena.${name} =
mylib.colmenaSystem
(rk3588SystemArgs // {inherit tags ssh-user;});
}

View 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
# 大木 鈴, Ōki Suzu
name = "suzu";
tags = [name "aarch"];
ssh-user = "root";
modules = {
nixos-modules = map mylib.relativeToRoot [
"modules/nixos/server/server-aarch64.nix"
# host specific modules
"hosts/12kingdoms-${name}"
];
};
inherit (inputs) nixos-rk3588;
baseSpecialArgs = genSpecialArgs system;
rk3588Pkgs = import nixos-rk3588.inputs.nixpkgs {inherit system;};
rk3588SpecialArgs = let
# using the same nixpkgs as nixos-rk3588
inherit (nixos-rk3588.inputs) nixpkgs;
# use aarch64-linux's native toolchain
pkgsKernel = import nixpkgs {inherit system;};
in
baseSpecialArgs
// {
inherit nixpkgs;
# Provide rk3588 inputs as special argument
rk3588 = {inherit nixpkgs pkgsKernel;};
};
rk3588SystemArgs =
modules
// args
// {
inherit (nixos-rk3588.inputs) nixpkgs; # or nixpkgs-unstable
specialArgs = rk3588SpecialArgs;
};
in {
nixosConfigurations.${name} = mylib.nixosSystem rk3588SystemArgs;
colmena-meta = {
nodeSpecialArgs.${name} = rk3588SpecialArgs;
nodeNixpkgs.${name} = rk3588Pkgs;
};
colmena.${name} =
mylib.colmenaSystem
(rk3588SystemArgs // {inherit tags ssh-user;});
}

135
outputs/default.nix Normal file
View File

@@ -0,0 +1,135 @@
{
self,
nixpkgs,
pre-commit-hooks,
...
} @ inputs: let
inherit (inputs.nixpkgs) lib;
mylib = import ../lib {inherit lib;};
myvars = import ../vars {inherit lib;};
# Add my custom lib, vars, nixpkgs instance, and all the inputs to sepcialArgs,
# so that I can use them in all my nixos/home-manager/darwin modules.
genSpecialArgs = system:
inputs
// {
inherit mylib myvars;
# use unstable branch for some packages to get the latest updates
pkgs-unstable = import inputs.nixpkgs-unstable {
inherit system; # refer the `system` parameter form outer scope recursively
# To use chrome, we need to allow the installation of non-free software
config.allowUnfree = true;
};
pkgs-stable = import inputs.nixpkgs-stable {
inherit system;
# To use chrome, we need to allow the installation of non-free software
config.allowUnfree = true;
};
};
# This is the args for all the haumea modules in this folder.
args = {inherit inputs lib mylib myvars genSpecialArgs;};
# modules for each supported system
nixosSystems = {
x86_64-linux = import ./x86_64-linux (args // {system = "x86_64-linux";});
aarch64-linux = import ./aarch64-linux (args // {system = "aarch64-linux";});
riscv64-linux = import ./riscv64-linux (args // {system = "riscv64-linux";});
};
darwinSystems = {
aarch64-darwin = import ./aarch64-darwin (args // {system = "aarch64-darwin";});
x86_64-darwin = import ./x86_64-darwin (args // {system = "x86_64-darwin";});
};
allSystems = nixosSystems // darwinSystems;
allSystemNames = builtins.attrNames allSystems;
nixosSystemValues = builtins.attrValues nixosSystems;
darwinSystemValues = builtins.attrValues darwinSystems;
# Helper function to generate a set of attributes for each system
forAllSystems = func: (nixpkgs.lib.genAttrs allSystemNames func);
in {
# add attribute sets into outputs, for debugging
debugAttrs = {inherit nixosSystems darwinSystems allSystems allSystemNames;};
# NixOS Hosts
nixosConfigurations =
lib.attrsets.mergeAttrsList (map (it: it.nixosConfigurations or {}) nixosSystemValues);
# colmena - remote deployment via SSH
colmena =
{
meta =
(
let
system = "x86_64-linux";
in {
# colmena's default nixpkgs & specialArgs
nixpkgs = import nixpkgs {inherit system;};
specialArgs = genSpecialArgs system;
}
)
// {
# per-node nixpkgs & specialArgs
nodeNixpkgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeNixpkgs or {}) nixosSystemValues);
nodeSpecialArgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeSpecialArgs or {}) nixosSystemValues);
};
}
// lib.attrsets.mergeAttrsList (map (it: it.colmena or {}) nixosSystemValues);
# macOS Hosts
darwinConfigurations =
lib.attrsets.mergeAttrsList (map (it: it.darwinConfigurations or {}) darwinSystemValues);
# Packages
packages = forAllSystems (
system: allSystems.${system}.packages or {}
);
# Unit Tests, Intergraded Tests, and Pre-commit checks
checks = forAllSystems (
system: {
# Unit Tests for the system
# unit-tests = allSystems.${system}.unit-tests;
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true; # formatter
# deadnix.enable = true; # detect unused variable bindings in `*.nix`
# statix.enable = true; # lints and suggestions for Nix code(auto suggestions)
# prettier = {
# enable = true;
# excludes = [".js" ".md" ".ts"];
# };
};
};
}
);
# Development Shells
devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
packages = with pkgs; [
# fix https://discourse.nixos.org/t/non-interactive-bash-errors-from-flake-nix-mkshell/33310
bashInteractive
# fix `cc` replaced by clang, which causes nvim-treesitter compilation error
gcc
];
name = "dots";
shellHook = ''
${self.checks.${system}.pre-commit-check.shellHook}
'';
};
}
);
# Format the nix code in this flake
formatter = forAllSystems (
# alejandra is a nix formatter with a beautiful output
system: nixpkgs.legacyPackages.${system}.alejandra
);
}

View File

@@ -0,0 +1,38 @@
{
lib,
inputs,
...
} @ args: let
inherit (inputs) haumea;
# Contains all the flake outputs of this system architecture.
data = haumea.lib.load {
src = ./src;
inputs = args;
};
# nix file names is redundant, so we remove it.
dataWithoutPaths = builtins.attrValues data;
# Merge all the machine's data into a single attribute set.
outputs = {
nixosConfigurations = lib.attrsets.mergeAttrsList (map (it: it.nixosConfigurations or {}) dataWithoutPaths);
packages = lib.attrsets.mergeAttrsList (map (it: it.packages or {}) dataWithoutPaths);
# colmena contains some meta info, which need to be merged carefully.
colmena-meta = {
nodeNixpkgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeNixpkgs or {}) dataWithoutPaths);
nodeSpecialArgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeSpecialArgs or {}) dataWithoutPaths);
};
# colmena's per-machine data.
colmena = lib.attrsets.mergeAttrsList (map (it: it.colmena or {}) dataWithoutPaths);
};
in
outputs
// {
inherit data; # for debugging purposes
# NixOS's unit tests.
# unit-tests = haumea.lib.loadEvalTests {
# src = ./tests;
# inputs = args;
# };
}

View 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;});
}

View 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;});
}

View File

@@ -0,0 +1,30 @@
{
lib,
inputs,
...
} @ args: let
inherit (inputs) haumea;
# Contains all the flake outputs of this system architecture.
data = haumea.lib.load {
src = ./src;
inputs = args;
};
# nix file names is redundant, so we remove it.
dataWithoutPaths = builtins.attrValues data;
# Merge all the machine's data into a single attribute set.
outputs = {
darwinConfigurations = lib.attrsets.mergeAttrsList (map (it: it.darwinConfigurations or {}) dataWithoutPaths);
};
in
outputs
// {
inherit data; # for debugging purposes
# NixOS's unit tests.
# unit-tests = haumea.lib.loadEvalTests {
# src = ./tests;
# inputs = args;
# };
}

View File

@@ -0,0 +1,36 @@
{
# 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
name = "harmonica";
modules = {
darwin-modules =
(map mylib.relativeToRoot [
# common
"secrets/darwin.nix"
"modules/darwin"
# host specific
"hosts/darwin-${name}"
])
++ [];
home-module.imports = map mylib.relativeToRoot [
"hosts/darwin-${name}/home.nix"
"home/darwin"
];
};
systemArgs = modules // args;
in {
# macOS's configuration
darwinConfigurations.${name} = mylib.macosSystem systemArgs;
}

View File

@@ -0,0 +1,37 @@
{
lib,
inputs,
...
} @ args: let
inherit (inputs) haumea;
# Contains all the flake outputs of this system architecture.
data = haumea.lib.load {
src = ./src;
inputs = args;
};
# nix file names is redundant, so we remove it.
dataWithoutPaths = builtins.attrValues data;
# Merge all the machine's data into a single attribute set.
outputs = {
nixosConfigurations = lib.attrsets.mergeAttrsList (map (it: it.nixosConfigurations or {}) dataWithoutPaths);
packages = lib.attrsets.mergeAttrsList (map (it: it.packages or {}) dataWithoutPaths);
# colmena contains some meta info, which need to be merged carefully.
colmena-meta = {
nodeNixpkgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeNixpkgs or {}) dataWithoutPaths);
nodeSpecialArgs = lib.attrsets.mergeAttrsList (map (it: it.colmena-meta.nodeSpecialArgs or {}) dataWithoutPaths);
};
colmena = lib.attrsets.mergeAttrsList (map (it: it.colmena or {}) dataWithoutPaths);
};
in
outputs
// {
inherit data; # for debugging purposes
# NixOS's unit tests.
# unit-tests = haumea.lib.loadEvalTests {
# src = ./tests;
# inputs = args;
# };
}

View File

@@ -0,0 +1,77 @@
{
# 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,
myvars,
mylib,
system,
genSpecialArgs,
...
} @ args: let
# Shoukei (祥瓊, Shōkei)
name = "shoukei";
base-modules = {
nixos-modules = map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/desktop.nix"
# host specific
"hosts/12kingdoms-${name}"
];
home-module.imports = map mylib.relativeToRoot [
# common
"home/linux/desktop.nix"
# host specific
"hosts/12kindoms-${name}/home.nix"
];
};
modules-i3 = {
nixos-modules =
[
{
modules.desktop.xorg.enable = true;
modules.secrets.desktop.enable = true;
modules.secrets.impermanence.enable = true;
}
]
++ base-modules.nixos-modules;
home-module.imports =
[
{modules.desktop.i3.enable = true;}
]
++ base-modules.home-module.imports;
};
modules-hyprland = {
nixos-modules =
[
{
modules.desktop.wayland.enable = true;
modules.secrets.desktop.enable = true;
modules.secrets.impermanence.enable = true;
}
]
++ base-modules.nixos-modules;
home-module.imports =
[
{modules.desktop.hyprland.enable = true;}
]
++ base-modules.home-module.imports;
};
in {
nixosConfigurations = {
# with i3 window manager
"${name}-i3" = mylib.nixosSystem (modules-i3 // args);
# host with hyprland compositor
"${name}-hyprland" = mylib.nixosSystem (modules-hyprland // args);
};
# generate iso image for hosts with desktop environment
packages = {
"${name}-i3" = inputs.self.nixosConfigurations."${name}-i3".config.formats.iso;
"${name}-hyprland" = inputs.self.nixosConfigurations."${name}-hyprland".config.formats.iso;
};
}

View File

@@ -0,0 +1,37 @@
{
# 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
name = "tailscale-gw";
tags = [name "homelab-network"];
ssh-user = "root";
modules = {
nixos-modules = map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/homelab-${name}"
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,77 @@
{
# 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,
myvars,
mylib,
system,
genSpecialArgs,
...
} @ args: let
# 星野 アイ, Hoshino Ai
name = "ai";
base-modules = {
nixos-modules = map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/desktop.nix"
# host specific
"hosts/idols-${name}"
];
home-module.imports = map mylib.relativeToRoot [
# common
"home/linux/desktop.nix"
# host specific
"hosts/idols-${name}/home.nix"
];
};
modules-i3 = {
nixos-modules =
[
{
modules.desktop.xorg.enable = true;
modules.secrets.desktop.enable = true;
modules.secrets.impermanence.enable = true;
}
]
++ base-modules.nixos-modules;
home-module.imports =
[
{modules.desktop.i3.enable = true;}
]
++ base-modules.home-module.imports;
};
modules-hyprland = {
nixos-modules =
[
{
modules.desktop.wayland.enable = true;
modules.secrets.desktop.enable = true;
modules.secrets.impermanence.enable = true;
}
]
++ base-modules.nixos-modules;
home-module.imports =
[
{modules.desktop.hyprland.enable = true;}
]
++ base-modules.home-module.imports;
};
in {
nixosConfigurations = {
# with i3 window manager
"${name}-i3" = mylib.nixosSystem (modules-i3 // args);
# host with hyprland compositor
"${name}-hyprland" = mylib.nixosSystem (modules-hyprland // args);
};
# generate iso image for hosts with desktop environment
packages = {
"${name}-i3" = inputs.self.nixosConfigurations."${name}-i3".config.formats.iso;
"${name}-hyprland" = inputs.self.nixosConfigurations."${name}-hyprland".config.formats.iso;
};
}

View File

@@ -0,0 +1,42 @@
{
# 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
# 星野 愛久愛海, Hoshino Akuamarin
name = "aquamarine";
tags = ["aqua" "homelab-network"];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/idols-${name}"
])
++ [
{modules.secrets.server.network.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,42 @@
{
# 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
# 有馬 かな, Arima Kana
name = "kana";
tags = [name "homelab-app"];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/idols-${name}"
])
++ [
{modules.secrets.server.application.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,45 @@
{
# 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
# 星野 瑠美衣, Hoshino Rubii
name = "ruby";
tags = [name "homelab-operation"];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/idols-${name}"
])
++ [
{modules.secrets.server.operation.enable = true;}
];
home-modules.imports = map mylib.relativeToRoot [
"home/linux/server.nix"
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,44 @@
{
# 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
name = "k3s-prod-1-master-1";
tags = [name];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
{modules.secrets.server.kubernetes.enable = true;}
];
home-modules.imports = map mylib.relativeToRoot [
"home/linux/server.nix"
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,41 @@
{
# 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
name = "k3s-prod-1-master-2";
tags = [name];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
{modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,41 @@
{
# 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
name = "k3s-prod-1-master-3";
tags = [name];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
{modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,41 @@
{
# 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
name = "k3s-prod-1-worker-1";
tags = [name];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
{modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,41 @@
{
# 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
name = "k3s-prod-1-worker-2";
tags = [name];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
{modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,41 @@
{
# 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
name = "k3s-prod-1-worker-3";
tags = [name];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
{modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
# generate proxmox image for virtual machines without desktop environment
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.proxmox;
}

View File

@@ -0,0 +1,40 @@
{
# 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
name = "kubevirt-shoryu";
tags = [name "virt-shoryu"];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
# {modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.iso;
}

View File

@@ -0,0 +1,40 @@
{
# 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
name = "kubevirt-shushou";
tags = [name "virt-shushou"];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
# {modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.iso;
}

View File

@@ -0,0 +1,40 @@
{
# 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
name = "kubevirt-youko";
tags = [name "virt-youko"];
ssh-user = "root";
modules = {
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/proxmox-hardware-configuration.nix"
# host specific
"hosts/k8s/${name}"
])
++ [
# {modules.secrets.server.kubernetes.enable = true;}
];
};
systemArgs = modules // args;
in {
nixosConfigurations.${name} = mylib.nixosSystem systemArgs;
colmena.${name} =
mylib.colmenaSystem (systemArgs // {inherit tags ssh-user;});
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.iso;
}