chore(systems): minor cleanup

This commit is contained in:
arcnmx 2024-02-19 11:29:46 -08:00
parent 6e882b5342
commit 35177ce911
4 changed files with 21 additions and 18 deletions

View file

@ -34,11 +34,13 @@
mkWinPath = replaceStrings ["/"] ["\\"]; mkWinPath = replaceStrings ["/"] ["\\"];
in { in {
inherit tree nixlib inputs; inherit tree nixlib inputs;
meta = tree.impure;
std = inputs.self.lib.Std.Std.compat; std = inputs.self.lib.Std.Std.compat;
Std = inputs.std-fl.lib; Std = inputs.std-fl.lib;
lib = { lib = {
domain = "gensokyo.zone";
inherit mkWinPath userIs eui64 toHexStringLower hexCharToInt; inherit mkWinPath userIs eui64 toHexStringLower hexCharToInt;
inherit (inputs.arcexprs.lib) unmerged; inherit (inputs.arcexprs.lib) unmerged json;
}; };
generate = import ./generate.nix {inherit inputs tree;}; generate = import ./generate.nix {inherit inputs tree;};
} }

View file

@ -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 = { networking = {
nftables.enable = true; nftables.enable = true;
domain = mkDefault "gensokyo.zone"; domain = mkDefault domain;
hostName = mkOverride 25 name; hostName = mkOverride 25 name;
}; };
} }

View file

@ -4,7 +4,6 @@
}; };
systems = import ./systems { systems = import ./systems {
inherit inputs; inherit inputs;
tree = tree.impure;
}; };
outputs = outputs =
inputs.flake-utils.lib.eachDefaultSystem inputs.flake-utils.lib.eachDefaultSystem

View file

@ -1,15 +1,11 @@
{ {inputs}: let
inputs,
tree,
}: 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. # 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; lib = inputs.self.lib.nixlib;
inherit (inputs.self.lib) meta std;
inherit (lib.modules) evalModules mkOptionDefault; inherit (lib.modules) evalModules mkOptionDefault;
inherit (inputs.self.lib) std;
inherit (std) string set; inherit (std) string set;
defaultSpecialArgs = { defaultSpecialArgs = {
inherit inputs std; inherit inputs std meta;
meta = tree;
}; };
hostModule = { hostModule = {
config, config,
@ -17,8 +13,8 @@
... ...
}: { }: {
options = let options = let
inherit (inputs.self.lib.lib) json;
inherit (lib.types) str listOf attrs unspecified attrsOf nullOr; inherit (lib.types) str listOf attrs unspecified attrsOf nullOr;
jsonAttrsType = inputs.arcexprs.lib.json.types.attrs;
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
in { in {
arch = mkOption { arch = mkOption {
@ -51,7 +47,7 @@
internal = true; internal = true;
}; };
deploy = mkOption { deploy = mkOption {
type = nullOr jsonAttrsType; type = nullOr json.types.attrs;
}; };
}; };
config = { config = {
@ -91,11 +87,11 @@
linux = "linux"; linux = "linux";
} }
.${string.toLower config.type}; .${string.toLower config.type};
modules = with tree; [ modules = [
# per-OS modules # per-OS modules
tree.modules.${config.folder} meta.modules.${config.folder}
# per-OS configuration # per-OS configuration
tree.${config.folder}.base meta.${config.folder}.base
]; ];
builder = builder =
{ {
@ -140,7 +136,7 @@
machine = name; machine = name;
}; };
}) })
(set.map (_: c: c) tree.systems); (set.map (_: c: c) meta.systems);
processHost = name: cfg: let processHost = name: cfg: let
host = cfg.config; host = cfg.config;
in in