mob next [ci-skip] [ci skip] [skip ci]
lastFile:inventories/personal-computer.nix
This commit is contained in:
19
modules/clan/automatic-timezone/default.nix
Normal file
19
modules/clan/automatic-timezone/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ ... }:
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "automatic-timezone";
|
||||
manifest.description = "Automatic Timezone, using geoclue2 to actually set the timezone";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
perInstance.nixosModule =
|
||||
{ lib, ... }:
|
||||
{
|
||||
services.automatic-timezoned.enable = true;
|
||||
services.geoclue2 = {
|
||||
enableDemoAgent = lib.mkForce true;
|
||||
geoProviderUrl = "https://beacondb.net/v1/geolocate";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
19
modules/clan/automatic-timezone/flake-module.nix
Normal file
19
modules/clan/automatic-timezone/flake-module.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ lib, inputs, ... }:
|
||||
let
|
||||
module = lib.modules.importApply ./default.nix { };
|
||||
in
|
||||
{
|
||||
clan.modules = {
|
||||
automatic-timezone = module;
|
||||
};
|
||||
|
||||
perSystem =
|
||||
{ ... }:
|
||||
{
|
||||
clan.nixosTests.automatic-timezone = {
|
||||
imports = [ ./tests/vm/default.nix ];
|
||||
clan.modules."@clan/automatic-timezone" = module;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
31
modules/clan/automatic-timezone/tests/vm/default.nix
Normal file
31
modules/clan/automatic-timezone/tests/vm/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ ... }:
|
||||
{
|
||||
name = "service-automatic-timezone";
|
||||
|
||||
clan = {
|
||||
directory = ./.;
|
||||
inventory = {
|
||||
machines.server = { };
|
||||
|
||||
instances = {
|
||||
tz-test = {
|
||||
module.name = "@clan/automatic-timezone";
|
||||
module.input = "self";
|
||||
roles.default.machines.server = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes = {
|
||||
server = { };
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
server.wait_for_unit("automatic-timezoned")
|
||||
|
||||
server.succeed("systemctl status automatic-timezoned")
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user