mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
chore(systems): minor cleanup
This commit is contained in:
parent
6e882b5342
commit
35177ce911
4 changed files with 21 additions and 18 deletions
4
lib.nix
4
lib.nix
|
|
@ -34,11 +34,13 @@
|
|||
mkWinPath = replaceStrings ["/"] ["\\"];
|
||||
in {
|
||||
inherit tree nixlib inputs;
|
||||
meta = tree.impure;
|
||||
std = inputs.self.lib.Std.Std.compat;
|
||||
Std = inputs.std-fl.lib;
|
||||
lib = {
|
||||
domain = "gensokyo.zone";
|
||||
inherit mkWinPath userIs eui64 toHexStringLower hexCharToInt;
|
||||
inherit (inputs.arcexprs.lib) unmerged;
|
||||
inherit (inputs.arcexprs.lib) unmerged json;
|
||||
};
|
||||
generate = import ./generate.nix {inherit inputs tree;};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
{ config, name, lib, ... }: with lib;
|
||||
|
||||
{
|
||||
inputs,
|
||||
name,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkDefault mkOverride;
|
||||
inherit (inputs.self.lib.lib) domain;
|
||||
in {
|
||||
networking = {
|
||||
nftables.enable = true;
|
||||
domain = mkDefault "gensokyo.zone";
|
||||
domain = mkDefault domain;
|
||||
hostName = mkOverride 25 name;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
};
|
||||
systems = import ./systems {
|
||||
inherit inputs;
|
||||
tree = tree.impure;
|
||||
};
|
||||
outputs =
|
||||
inputs.flake-utils.lib.eachDefaultSystem
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
{
|
||||
inputs,
|
||||
tree,
|
||||
}: let
|
||||
{inputs}: let
|
||||
# The purpose of this file is to set up the host module which allows assigning of the system, e.g. aarch64-linux and the builder used with less pain.
|
||||
lib = inputs.self.lib.nixlib;
|
||||
inherit (inputs.self.lib) meta std;
|
||||
inherit (lib.modules) evalModules mkOptionDefault;
|
||||
inherit (inputs.self.lib) std;
|
||||
inherit (std) string set;
|
||||
defaultSpecialArgs = {
|
||||
inherit inputs std;
|
||||
meta = tree;
|
||||
inherit inputs std meta;
|
||||
};
|
||||
hostModule = {
|
||||
config,
|
||||
|
|
@ -17,8 +13,8 @@
|
|||
...
|
||||
}: {
|
||||
options = let
|
||||
inherit (inputs.self.lib.lib) json;
|
||||
inherit (lib.types) str listOf attrs unspecified attrsOf nullOr;
|
||||
jsonAttrsType = inputs.arcexprs.lib.json.types.attrs;
|
||||
inherit (lib.options) mkOption;
|
||||
in {
|
||||
arch = mkOption {
|
||||
|
|
@ -51,7 +47,7 @@
|
|||
internal = true;
|
||||
};
|
||||
deploy = mkOption {
|
||||
type = nullOr jsonAttrsType;
|
||||
type = nullOr json.types.attrs;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
|
|
@ -91,11 +87,11 @@
|
|||
linux = "linux";
|
||||
}
|
||||
.${string.toLower config.type};
|
||||
modules = with tree; [
|
||||
modules = [
|
||||
# per-OS modules
|
||||
tree.modules.${config.folder}
|
||||
meta.modules.${config.folder}
|
||||
# per-OS configuration
|
||||
tree.${config.folder}.base
|
||||
meta.${config.folder}.base
|
||||
];
|
||||
builder =
|
||||
{
|
||||
|
|
@ -140,7 +136,7 @@
|
|||
machine = name;
|
||||
};
|
||||
})
|
||||
(set.map (_: c: c) tree.systems);
|
||||
(set.map (_: c: c) meta.systems);
|
||||
processHost = name: cfg: let
|
||||
host = cfg.config;
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue