mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
fix(ci): build
This commit is contained in:
parent
dc6b335423
commit
7b647b96f1
14 changed files with 208 additions and 80 deletions
32
modules/meta/access.nix
Normal file
32
modules/meta/access.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
access,
|
||||
...
|
||||
}: let
|
||||
nixosModule = {
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
config = {
|
||||
_module.args.access = access // {
|
||||
systemFor = hostName: if hostName == config.networking.hostName
|
||||
then config
|
||||
else access.systemFor hostName;
|
||||
systemForOrNull = hostName: if hostName == config.networking.hostName
|
||||
then config
|
||||
else access.systemForOrNull hostName;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
config = {
|
||||
network.nixos.extraModules = [
|
||||
nixosModule
|
||||
];
|
||||
|
||||
_module.args.access = {
|
||||
systemFor = hostName: config.network.nodes.${hostName};
|
||||
systemForOrNull = hostName: config.network.nodes.${hostName} or null;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
|
|
@ -95,4 +96,16 @@ in {
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
config._module.args.access = let
|
||||
systemFor = hostName: inputs.self.nixosConfigurations.${hostName}.config;
|
||||
systemForOrNull = hostName: inputs.self.nixosConfigurations.${hostName}.config or null;
|
||||
in {
|
||||
systemFor = hostName: if hostName == config.networking.hostName
|
||||
then config
|
||||
else systemFor hostName;
|
||||
systemForOrNull = hostName: if hostName == config.networking.hostName
|
||||
then config
|
||||
else systemForOrNull hostName;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue