mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 14:28:02 +03:00
24 lines
709 B
Nix
24 lines
709 B
Nix
{ ... }:
|
|
{
|
|
commonModules.hostname-assert =
|
|
{ config, lib, ... }:
|
|
{
|
|
options.elars.expectedHostName = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
description = "host filename must match networking.hostName.";
|
|
};
|
|
|
|
config.assertions = lib.singleton {
|
|
assertion =
|
|
config.elars.expectedHostName == null
|
|
|| config.networking.hostName == config.elars.expectedHostName;
|
|
message = ''
|
|
syntax: hostname assertion failed:
|
|
expected (filename) : ${toString config.elars.expectedHostName}
|
|
real (networking) : ${toString config.networking.hostName}
|
|
'';
|
|
};
|
|
};
|
|
}
|