Use lib.singleton when convenient

This commit is contained in:
SebastianStork 2025-10-21 21:10:53 +02:00
parent dd3c11d88b
commit 464b6a7850
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
6 changed files with 34 additions and 46 deletions

View file

@ -23,8 +23,7 @@
signByDefault = true;
};
includes = [
{
includes = lib.singleton {
condition = "gitdir:~/Projects/h-da/**";
contents = {
user = {
@ -33,8 +32,7 @@
signingkey = config.sops.secrets."ssh-key/code.fbi.h-da.de".path;
};
};
}
];
};
};
ssh = {

View file

@ -8,12 +8,10 @@
options.custom.services.cliphist.enable = lib.mkEnableOption "";
config = lib.mkIf config.custom.services.cliphist.enable {
assertions = [
{
assertions = lib.singleton {
assertion = config.custom.programs.rofi.enable;
message = "Cliphist requires Rofi.";
}
];
};
services.cliphist = {
enable = true;

View file

@ -54,11 +54,9 @@ in
)
|> lib.concatStrings;
in
[
{
lib.singleton {
assertion = duplicateDomains == { };
message = errorMessage;
}
];
};
};
}

View file

@ -23,12 +23,10 @@ in
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertions = lib.singleton {
assertion = lib'.isTailscaleDomain cfg.domain;
message = "FreshRSS isn't configured with access controll.";
}
];
};
meta = {
domains.list = [ cfg.domain ];

View file

@ -159,8 +159,7 @@ in
success-threshold = 4;
send-on-resolved = true;
};
overrides = [
{
overrides = lib.singleton {
group = "Monitoring";
topic = "stork-atlas";
url = "https://ntfy.sh";
@ -168,8 +167,7 @@ in
failure-threshold = 4;
success-threshold = 2;
};
}
];
};
};
ui.default-sort-by = "group";
maintenance = {

View file

@ -47,12 +47,10 @@ in
};
};
nginx.virtualHosts.privatebin.listen = [
{
nginx.virtualHosts.privatebin.listen = lib.singleton {
addr = "localhost";
inherit (cfg) port;
}
];
};
};
custom.persist.directories = [ config.services.privatebin.dataDir ];