refactor(flake): kyraStack -> defaultSystems rewrite
Signed-off-by: s0me1newithhand7s <git+me@hand7s.org>
This commit is contained in:
parent
3e47204a3f
commit
1ffce7a93e
1 changed files with 131 additions and 143 deletions
248
flake.nix
248
flake.nix
|
|
@ -436,24 +436,79 @@
|
||||||
nixosSystem
|
nixosSystem
|
||||||
filesystem
|
filesystem
|
||||||
genAttrs
|
genAttrs
|
||||||
map
|
optionals
|
||||||
|
elem
|
||||||
;
|
;
|
||||||
|
|
||||||
defaultModules = [];
|
makeModules = modulesList:
|
||||||
|
|
||||||
defaultPath = filesystem.listFilesRecursive "${self}/kyra/";
|
|
||||||
|
|
||||||
inputedModules =
|
|
||||||
map (
|
map (
|
||||||
{
|
{
|
||||||
input,
|
input,
|
||||||
opt ? "default",
|
opt ? "default",
|
||||||
}:
|
}:
|
||||||
inputs.${input}.nixosModules.${opt}
|
inputs.${input}.nixosModules.${opt}
|
||||||
) [
|
)
|
||||||
|
modulesList;
|
||||||
|
|
||||||
|
defaultHost = {
|
||||||
|
name,
|
||||||
|
arch ? "x86_64-linux",
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
nixosSystem {
|
||||||
|
system = let
|
||||||
|
arches = {
|
||||||
|
"mabel" = "aarch64-linux";
|
||||||
|
"blossom" = "riscv64-linux";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
arches.${name} or arch;
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit
|
||||||
|
inputs
|
||||||
|
self
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules =
|
||||||
|
[
|
||||||
|
"${self}/${name}"
|
||||||
|
]
|
||||||
|
++ defaultModules
|
||||||
|
++ optionals (
|
||||||
|
name == "wanda"
|
||||||
|
)
|
||||||
|
extraModules.wanda
|
||||||
|
++ optionals (
|
||||||
|
name == "mabel"
|
||||||
|
)
|
||||||
|
extraModules.mabel
|
||||||
|
++ optionals (
|
||||||
|
elem name [
|
||||||
|
"hazel"
|
||||||
|
"lynn"
|
||||||
|
"yara"
|
||||||
|
"ivy"
|
||||||
|
"mel"
|
||||||
|
]
|
||||||
|
) (
|
||||||
|
extraModules.kyra ++ filesystem.listFilesRecursive "${self}/kyra/"
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultModules = makeModules [
|
||||||
|
{
|
||||||
|
input = "agenix";
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
input = "agenix-rekey";
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
opt = "disko";
|
|
||||||
input = "disko";
|
input = "disko";
|
||||||
|
opt = "disko";
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -461,161 +516,94 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
opt = "sops";
|
input = "stylix";
|
||||||
|
opt = "stylix";
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
input = "sops-nix";
|
input = "sops-nix";
|
||||||
|
opt = "sops";
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
input = "lanzaboote";
|
||||||
|
opt = "lanzaboote";
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
opt = "nix-index";
|
|
||||||
input = "nix-index-database";
|
input = "nix-index-database";
|
||||||
|
opt = "nix-index";
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
opt = "nix-mineral";
|
input = "nixos-cli";
|
||||||
input = "nix-mineral";
|
opt = "nixos-cli";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
kyraHost = name:
|
extraModules = {
|
||||||
nixosSystem {
|
wanda = makeModules [
|
||||||
system = "x86_64-linux";
|
{
|
||||||
modules = defaultModules ++ defaultPath ++ inputedModules;
|
input = "nixos-wsl";
|
||||||
specialArgs = {
|
}
|
||||||
inherit
|
];
|
||||||
inputs
|
|
||||||
name
|
mabel = makeModules [
|
||||||
self
|
{
|
||||||
;
|
input = "nixos-avf";
|
||||||
};
|
opt = "avf";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
kyra = makeModules [
|
||||||
|
{
|
||||||
|
input = "impermanence";
|
||||||
|
opt = "impermanence";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
kyraStack =
|
defaultSystems =
|
||||||
genAttrs [
|
genAttrs [
|
||||||
|
"ada"
|
||||||
|
"isla"
|
||||||
|
"viola"
|
||||||
|
"mabel"
|
||||||
|
"wanda"
|
||||||
|
"florence"
|
||||||
"hazel"
|
"hazel"
|
||||||
"lynn"
|
"lynn"
|
||||||
"yara"
|
"yara"
|
||||||
"ivy"
|
"ivy"
|
||||||
"mel"
|
"mel"
|
||||||
]
|
] (
|
||||||
kyraHost;
|
name:
|
||||||
|
defaultHost {
|
||||||
|
inherit
|
||||||
|
name
|
||||||
|
;
|
||||||
|
}
|
||||||
|
);
|
||||||
in {
|
in {
|
||||||
# Main PC
|
# Main PC
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
{
|
defaultSystems
|
||||||
"ada" = inputs.nixpkgs.lib.nixosSystem {
|
// {
|
||||||
system = "x86_64-linux";
|
# olive, blossom and maybe gonna be routers and etc
|
||||||
|
|
||||||
|
"fawn" = inputs.finix.lib.finixSystem {
|
||||||
|
inherit (self.inputs.nixpkgs) lib;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit
|
inherit
|
||||||
inputs
|
inputs
|
||||||
self
|
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
"${self}/ada/"
|
|
||||||
inputs.chaotic.nixosModules.default
|
|
||||||
inputs.stylix.nixosModules.stylix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
inputs.disko.nixosModules.disko
|
|
||||||
inputs.lanzaboote.nixosModules.lanzaboote
|
|
||||||
inputs.home-manager.nixosModules.default
|
|
||||||
inputs.nix-index-database.nixosModules.nix-index
|
|
||||||
inputs.nix-bwrapper.nixosModules.default
|
|
||||||
inputs.nix-mineral.nixosModules.nix-mineral
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Main Laptop
|
|
||||||
"isla" = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
self
|
|
||||||
;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = [
|
|
||||||
"${self}/isla/"
|
|
||||||
inputs.chaotic.nixosModules.default
|
|
||||||
inputs.stylix.nixosModules.stylix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
inputs.disko.nixosModules.disko
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
inputs.lanzaboote.nixosModules.lanzaboote
|
|
||||||
inputs.nix-index-database.nixosModules.nix-index
|
|
||||||
inputs.nix-bwrapper.nixosModules.default
|
|
||||||
inputs.nix-mineral.nixosModules.nix-mineral
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# homelab
|
|
||||||
"viola" = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
self
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
"${self}/viola"
|
|
||||||
inputs.chaotic.nixosModules.default
|
|
||||||
inputs.stylix.nixosModules.stylix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
inputs.disko.nixosModules.disko
|
|
||||||
inputs.lanzaboote.nixosModules.lanzaboote
|
|
||||||
inputs.home-manager.nixosModules.default
|
|
||||||
inputs.nix-index-database.nixosModules.nix-index
|
|
||||||
inputs.nix-mineral.nixosModules.nix-mineral
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# WSL2
|
|
||||||
"wanda" = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
self
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
"${self}/wanda/"
|
|
||||||
inputs.nixos-wsl.nixosModules.default
|
|
||||||
inputs.stylix.nixosModules.stylix
|
|
||||||
inputs.home-manager.nixosModules.default
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
inputs.nix-index-database.nixosModules.nix-index
|
|
||||||
inputs.nix-bwrapper.nixosModules.default
|
|
||||||
inputs.nix-mineral.nixosModules.nix-mineral
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# custom ISO
|
|
||||||
"florence" = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
self
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
"${self}/florence/"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// kyraStack;
|
|
||||||
# few words about kyraStack:
|
|
||||||
# it's my little fleet, 5 identical VPSes
|
|
||||||
# really nice that all of them are 2 vCPU 2GB
|
|
||||||
# tho ssd/nvme/hdd memory is nothing important
|
|
||||||
# and being KVM VPS / pure VPS too
|
|
||||||
|
|
||||||
# home-manager
|
# home-manager
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"hand7s" = inputs.home-manager.lib.homeManagerConfiguration {
|
"hand7s" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue