treewide: use boolToString function
This commit is contained in:
parent
54fff9ec1a
commit
3ab45f4b36
|
@ -30,6 +30,11 @@ rec {
|
||||||
/* boolean “and” */
|
/* boolean “and” */
|
||||||
and = x: y: x && y;
|
and = x: y: x && y;
|
||||||
|
|
||||||
|
/* Convert a boolean to a string.
|
||||||
|
Note that toString on a bool returns "1" and "".
|
||||||
|
*/
|
||||||
|
boolToString = b: if b then "true" else "false";
|
||||||
|
|
||||||
/* Merge two attribute sets shallowly, right side trumps left
|
/* Merge two attribute sets shallowly, right side trumps left
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
|
@ -5,7 +5,7 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.fonts.fontconfig;
|
cfg = config.fonts.fontconfig;
|
||||||
|
|
||||||
fcBool = x: "<bool>" + (if x then "true" else "false") + "</bool>";
|
fcBool = x: "<bool>" + (boolToString x) + "</bool>";
|
||||||
|
|
||||||
# back-supported fontconfig version and package
|
# back-supported fontconfig version and package
|
||||||
# version is used for font cache generation
|
# version is used for font cache generation
|
||||||
|
|
|
@ -20,7 +20,7 @@ with lib;
|
||||||
|
|
||||||
let cfg = config.fonts.fontconfig;
|
let cfg = config.fonts.fontconfig;
|
||||||
|
|
||||||
fcBool = x: "<bool>" + (if x then "true" else "false") + "</bool>";
|
fcBool = x: "<bool>" + (boolToString x) + "</bool>";
|
||||||
|
|
||||||
# back-supported fontconfig version and package
|
# back-supported fontconfig version and package
|
||||||
# version is used for font cache generation
|
# version is used for font cache generation
|
||||||
|
|
|
@ -612,8 +612,8 @@ in {
|
||||||
--require-kubeconfig \
|
--require-kubeconfig \
|
||||||
--address=${cfg.kubelet.address} \
|
--address=${cfg.kubelet.address} \
|
||||||
--port=${toString cfg.kubelet.port} \
|
--port=${toString cfg.kubelet.port} \
|
||||||
--register-node=${if cfg.kubelet.registerNode then "true" else "false"} \
|
--register-node=${boolToString cfg.kubelet.registerNode} \
|
||||||
--register-schedulable=${if cfg.kubelet.registerSchedulable then "true" else "false"} \
|
--register-schedulable=${boolToString cfg.kubelet.registerSchedulable} \
|
||||||
${optionalString (cfg.kubelet.tlsCertFile != null)
|
${optionalString (cfg.kubelet.tlsCertFile != null)
|
||||||
"--tls-cert-file=${cfg.kubelet.tlsCertFile}"} \
|
"--tls-cert-file=${cfg.kubelet.tlsCertFile}"} \
|
||||||
${optionalString (cfg.kubelet.tlsKeyFile != null)
|
${optionalString (cfg.kubelet.tlsKeyFile != null)
|
||||||
|
@ -621,7 +621,7 @@ in {
|
||||||
--healthz-bind-address=${cfg.kubelet.healthz.bind} \
|
--healthz-bind-address=${cfg.kubelet.healthz.bind} \
|
||||||
--healthz-port=${toString cfg.kubelet.healthz.port} \
|
--healthz-port=${toString cfg.kubelet.healthz.port} \
|
||||||
--hostname-override=${cfg.kubelet.hostname} \
|
--hostname-override=${cfg.kubelet.hostname} \
|
||||||
--allow-privileged=${if cfg.kubelet.allowPrivileged then "true" else "false"} \
|
--allow-privileged=${boolToString cfg.kubelet.allowPrivileged} \
|
||||||
--root-dir=${cfg.dataDir} \
|
--root-dir=${cfg.dataDir} \
|
||||||
--cadvisor_port=${toString cfg.kubelet.cadvisorPort} \
|
--cadvisor_port=${toString cfg.kubelet.cadvisorPort} \
|
||||||
${optionalString (cfg.kubelet.clusterDns != "")
|
${optionalString (cfg.kubelet.clusterDns != "")
|
||||||
|
@ -670,14 +670,14 @@ in {
|
||||||
--bind-address=0.0.0.0 \
|
--bind-address=0.0.0.0 \
|
||||||
${optionalString (cfg.apiserver.advertiseAddress != null)
|
${optionalString (cfg.apiserver.advertiseAddress != null)
|
||||||
"--advertise-address=${cfg.apiserver.advertiseAddress}"} \
|
"--advertise-address=${cfg.apiserver.advertiseAddress}"} \
|
||||||
--allow-privileged=${if cfg.apiserver.allowPrivileged then "true" else "false"} \
|
--allow-privileged=${boolToString cfg.apiserver.allowPrivileged}\
|
||||||
${optionalString (cfg.apiserver.tlsCertFile != null)
|
${optionalString (cfg.apiserver.tlsCertFile != null)
|
||||||
"--tls-cert-file=${cfg.apiserver.tlsCertFile}"} \
|
"--tls-cert-file=${cfg.apiserver.tlsCertFile}"} \
|
||||||
${optionalString (cfg.apiserver.tlsKeyFile != null)
|
${optionalString (cfg.apiserver.tlsKeyFile != null)
|
||||||
"--tls-private-key-file=${cfg.apiserver.tlsKeyFile}"} \
|
"--tls-private-key-file=${cfg.apiserver.tlsKeyFile}"} \
|
||||||
${optionalString (cfg.apiserver.tokenAuth != null)
|
${optionalString (cfg.apiserver.tokenAuth != null)
|
||||||
"--token-auth-file=${cfg.apiserver.tokenAuth}"} \
|
"--token-auth-file=${cfg.apiserver.tokenAuth}"} \
|
||||||
--kubelet-https=${if cfg.apiserver.kubeletHttps then "true" else "false"} \
|
--kubelet-https=${boolToString cfg.apiserver.kubeletHttps} \
|
||||||
${optionalString (cfg.apiserver.kubeletClientCaFile != null)
|
${optionalString (cfg.apiserver.kubeletClientCaFile != null)
|
||||||
"--kubelet-certificate-authority=${cfg.apiserver.kubeletClientCaFile}"} \
|
"--kubelet-certificate-authority=${cfg.apiserver.kubeletClientCaFile}"} \
|
||||||
${optionalString (cfg.apiserver.kubeletClientCertFile != null)
|
${optionalString (cfg.apiserver.kubeletClientCertFile != null)
|
||||||
|
@ -719,7 +719,7 @@ in {
|
||||||
ExecStart = ''${cfg.package}/bin/kube-scheduler \
|
ExecStart = ''${cfg.package}/bin/kube-scheduler \
|
||||||
--address=${cfg.scheduler.address} \
|
--address=${cfg.scheduler.address} \
|
||||||
--port=${toString cfg.scheduler.port} \
|
--port=${toString cfg.scheduler.port} \
|
||||||
--leader-elect=${if cfg.scheduler.leaderElect then "true" else "false"} \
|
--leader-elect=${boolToString cfg.scheduler.leaderElect} \
|
||||||
--kubeconfig=${kubeconfig} \
|
--kubeconfig=${kubeconfig} \
|
||||||
${optionalString cfg.verbose "--v=6"} \
|
${optionalString cfg.verbose "--v=6"} \
|
||||||
${optionalString cfg.verbose "--log-flush-frequency=1s"} \
|
${optionalString cfg.verbose "--log-flush-frequency=1s"} \
|
||||||
|
@ -744,7 +744,7 @@ in {
|
||||||
--address=${cfg.controllerManager.address} \
|
--address=${cfg.controllerManager.address} \
|
||||||
--port=${toString cfg.controllerManager.port} \
|
--port=${toString cfg.controllerManager.port} \
|
||||||
--kubeconfig=${kubeconfig} \
|
--kubeconfig=${kubeconfig} \
|
||||||
--leader-elect=${if cfg.controllerManager.leaderElect then "true" else "false"} \
|
--leader-elect=${boolToString cfg.controllerManager.leaderElect} \
|
||||||
${if (cfg.controllerManager.serviceAccountKeyFile!=null)
|
${if (cfg.controllerManager.serviceAccountKeyFile!=null)
|
||||||
then "--service-account-private-key-file=${cfg.controllerManager.serviceAccountKeyFile}"
|
then "--service-account-private-key-file=${cfg.controllerManager.serviceAccountKeyFile}"
|
||||||
else "--service-account-private-key-file=/var/run/kubernetes/apiserver.key"} \
|
else "--service-account-private-key-file=/var/run/kubernetes/apiserver.key"} \
|
||||||
|
|
|
@ -328,7 +328,7 @@ in
|
||||||
IN_SYSTEMD = "1"; # to get log severity levels
|
IN_SYSTEMD = "1"; # to get log severity levels
|
||||||
};
|
};
|
||||||
serviceConfig =
|
serviceConfig =
|
||||||
{ ExecStart = "@${cfg.package}/bin/hydra-queue-runner hydra-queue-runner -v --option build-use-substitutes ${if cfg.useSubstitutes then "true" else "false"}";
|
{ ExecStart = "@${cfg.package}/bin/hydra-queue-runner hydra-queue-runner -v --option build-use-substitutes ${boolToString cfg.useSubstitutes}";
|
||||||
ExecStopPost = "${cfg.package}/bin/hydra-queue-runner --unlock";
|
ExecStopPost = "${cfg.package}/bin/hydra-queue-runner --unlock";
|
||||||
User = "hydra-queue-runner";
|
User = "hydra-queue-runner";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
|
|
|
@ -21,8 +21,8 @@ let
|
||||||
cassandraConf = ''
|
cassandraConf = ''
|
||||||
cluster_name: ${cfg.clusterName}
|
cluster_name: ${cfg.clusterName}
|
||||||
num_tokens: 256
|
num_tokens: 256
|
||||||
auto_bootstrap: ${if cfg.autoBootstrap then "true" else "false"}
|
auto_bootstrap: ${boolToString cfg.autoBootstrap}
|
||||||
hinted_handoff_enabled: ${if cfg.hintedHandOff then "true" else "false"}
|
hinted_handoff_enabled: ${boolToString cfg.hintedHandOff}
|
||||||
hinted_handoff_throttle_in_kb: ${builtins.toString cfg.hintedHandOffThrottle}
|
hinted_handoff_throttle_in_kb: ${builtins.toString cfg.hintedHandOffThrottle}
|
||||||
max_hints_delivery_threads: 2
|
max_hints_delivery_threads: 2
|
||||||
max_hint_window_in_ms: 10800000 # 3 hours
|
max_hint_window_in_ms: 10800000 # 3 hours
|
||||||
|
@ -62,7 +62,7 @@ let
|
||||||
rpc_keepalive: true
|
rpc_keepalive: true
|
||||||
rpc_server_type: sync
|
rpc_server_type: sync
|
||||||
thrift_framed_transport_size_in_mb: 15
|
thrift_framed_transport_size_in_mb: 15
|
||||||
incremental_backups: ${if cfg.incrementalBackups then "true" else "false"}
|
incremental_backups: ${boolToString cfg.incrementalBackups}
|
||||||
snapshot_before_compaction: false
|
snapshot_before_compaction: false
|
||||||
auto_snapshot: true
|
auto_snapshot: true
|
||||||
column_index_size_in_kb: 64
|
column_index_size_in_kb: 64
|
||||||
|
@ -89,7 +89,7 @@ let
|
||||||
truststore: ${cfg.trustStorePath}
|
truststore: ${cfg.trustStorePath}
|
||||||
truststore_password: ${cfg.trustStorePassword}
|
truststore_password: ${cfg.trustStorePassword}
|
||||||
client_encryption_options:
|
client_encryption_options:
|
||||||
enabled: ${if cfg.clientEncryption then "true" else "false"}
|
enabled: ${boolToString cfg.clientEncryption}
|
||||||
keystore: ${cfg.keyStorePath}
|
keystore: ${cfg.keyStorePath}
|
||||||
keystore_password: ${cfg.keyStorePassword}
|
keystore_password: ${cfg.keyStorePassword}
|
||||||
internode_compression: all
|
internode_compression: all
|
||||||
|
|
|
@ -4,8 +4,6 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
b2s = x: if x then "true" else "false";
|
|
||||||
|
|
||||||
cfg = config.services.mongodb;
|
cfg = config.services.mongodb;
|
||||||
|
|
||||||
mongodb = cfg.package;
|
mongodb = cfg.package;
|
||||||
|
|
|
@ -4,16 +4,15 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.graylog;
|
cfg = config.services.graylog;
|
||||||
configBool = b: if b then "true" else "false";
|
|
||||||
|
|
||||||
confFile = pkgs.writeText "graylog.conf" ''
|
confFile = pkgs.writeText "graylog.conf" ''
|
||||||
is_master = ${configBool cfg.isMaster}
|
is_master = ${boolToString cfg.isMaster}
|
||||||
node_id_file = ${cfg.nodeIdFile}
|
node_id_file = ${cfg.nodeIdFile}
|
||||||
password_secret = ${cfg.passwordSecret}
|
password_secret = ${cfg.passwordSecret}
|
||||||
root_username = ${cfg.rootUsername}
|
root_username = ${cfg.rootUsername}
|
||||||
root_password_sha2 = ${cfg.rootPasswordSha2}
|
root_password_sha2 = ${cfg.rootPasswordSha2}
|
||||||
elasticsearch_cluster_name = ${cfg.elasticsearchClusterName}
|
elasticsearch_cluster_name = ${cfg.elasticsearchClusterName}
|
||||||
elasticsearch_discovery_zen_ping_multicast_enabled = ${configBool cfg.elasticsearchDiscoveryZenPingMulticastEnabled}
|
elasticsearch_discovery_zen_ping_multicast_enabled = ${boolToString cfg.elasticsearchDiscoveryZenPingMulticastEnabled}
|
||||||
elasticsearch_discovery_zen_ping_unicast_hosts = ${cfg.elasticsearchDiscoveryZenPingUnicastHosts}
|
elasticsearch_discovery_zen_ping_unicast_hosts = ${cfg.elasticsearchDiscoveryZenPingUnicastHosts}
|
||||||
message_journal_dir = ${cfg.messageJournalDir}
|
message_journal_dir = ${cfg.messageJournalDir}
|
||||||
mongodb_uri = ${cfg.mongodbUri}
|
mongodb_uri = ${cfg.mongodbUri}
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
cfg = config.services.cgminer;
|
cfg = config.services.cgminer;
|
||||||
|
|
||||||
convType = with builtins;
|
convType = with builtins;
|
||||||
v: if isBool v then (if v then "true" else "false") else toString v;
|
v: if isBool v then boolToString v else toString v;
|
||||||
mergedHwConfig =
|
mergedHwConfig =
|
||||||
mapAttrsToList (n: v: ''"${n}": "${(concatStringsSep "," (map convType v))}"'')
|
mapAttrsToList (n: v: ''"${n}": "${(concatStringsSep "," (map convType v))}"'')
|
||||||
(foldAttrs (n: a: [n] ++ a) [] cfg.hardware);
|
(foldAttrs (n: a: [n] ++ a) [] cfg.hardware);
|
||||||
|
|
|
@ -12,7 +12,7 @@ let
|
||||||
nodes = [ ${concatMapStringsSep "," (s: ''"${s}"'') cfg.nodes}, ]
|
nodes = [ ${concatMapStringsSep "," (s: ''"${s}"'') cfg.nodes}, ]
|
||||||
prefix = "${cfg.prefix}"
|
prefix = "${cfg.prefix}"
|
||||||
log-level = "${cfg.logLevel}"
|
log-level = "${cfg.logLevel}"
|
||||||
watch = ${if cfg.watch then "true" else "false"}
|
watch = ${boolToString cfg.watch}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -5,9 +5,8 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.matrix-synapse;
|
cfg = config.services.matrix-synapse;
|
||||||
logConfigFile = pkgs.writeText "log_config.yaml" cfg.logConfig;
|
logConfigFile = pkgs.writeText "log_config.yaml" cfg.logConfig;
|
||||||
mkResource = r: ''{names: ${builtins.toJSON r.names}, compress: ${fromBool r.compress}}'';
|
mkResource = r: ''{names: ${builtins.toJSON r.names}, compress: ${boolToString r.compress}}'';
|
||||||
mkListener = l: ''{port: ${toString l.port}, bind_address: "${l.bind_address}", type: ${l.type}, tls: ${fromBool l.tls}, x_forwarded: ${fromBool l.x_forwarded}, resources: [${concatStringsSep "," (map mkResource l.resources)}]}'';
|
mkListener = l: ''{port: ${toString l.port}, bind_address: "${l.bind_address}", type: ${l.type}, tls: ${boolToString l.tls}, x_forwarded: ${boolToString l.x_forwarded}, resources: [${concatStringsSep "," (map mkResource l.resources)}]}'';
|
||||||
fromBool = x: if x then "true" else "false";
|
|
||||||
configFile = pkgs.writeText "homeserver.yaml" ''
|
configFile = pkgs.writeText "homeserver.yaml" ''
|
||||||
${optionalString (cfg.tls_certificate_path != null) ''
|
${optionalString (cfg.tls_certificate_path != null) ''
|
||||||
tls_certificate_path: "${cfg.tls_certificate_path}"
|
tls_certificate_path: "${cfg.tls_certificate_path}"
|
||||||
|
@ -18,7 +17,7 @@ tls_private_key_path: "${cfg.tls_private_key_path}"
|
||||||
${optionalString (cfg.tls_dh_params_path != null) ''
|
${optionalString (cfg.tls_dh_params_path != null) ''
|
||||||
tls_dh_params_path: "${cfg.tls_dh_params_path}"
|
tls_dh_params_path: "${cfg.tls_dh_params_path}"
|
||||||
''}
|
''}
|
||||||
no_tls: ${fromBool cfg.no_tls}
|
no_tls: ${boolToString cfg.no_tls}
|
||||||
${optionalString (cfg.bind_port != null) ''
|
${optionalString (cfg.bind_port != null) ''
|
||||||
bind_port: ${toString cfg.bind_port}
|
bind_port: ${toString cfg.bind_port}
|
||||||
''}
|
''}
|
||||||
|
@ -30,7 +29,7 @@ bind_host: "${cfg.bind_host}"
|
||||||
''}
|
''}
|
||||||
server_name: "${cfg.server_name}"
|
server_name: "${cfg.server_name}"
|
||||||
pid_file: "/var/run/matrix-synapse.pid"
|
pid_file: "/var/run/matrix-synapse.pid"
|
||||||
web_client: ${fromBool cfg.web_client}
|
web_client: ${boolToString cfg.web_client}
|
||||||
${optionalString (cfg.public_baseurl != null) ''
|
${optionalString (cfg.public_baseurl != null) ''
|
||||||
public_baseurl: "${cfg.public_baseurl}"
|
public_baseurl: "${cfg.public_baseurl}"
|
||||||
''}
|
''}
|
||||||
|
@ -58,8 +57,8 @@ media_store_path: "/var/lib/matrix-synapse/media"
|
||||||
uploads_path: "/var/lib/matrix-synapse/uploads"
|
uploads_path: "/var/lib/matrix-synapse/uploads"
|
||||||
max_upload_size: "${cfg.max_upload_size}"
|
max_upload_size: "${cfg.max_upload_size}"
|
||||||
max_image_pixels: "${cfg.max_image_pixels}"
|
max_image_pixels: "${cfg.max_image_pixels}"
|
||||||
dynamic_thumbnails: ${fromBool cfg.dynamic_thumbnails}
|
dynamic_thumbnails: ${boolToString cfg.dynamic_thumbnails}
|
||||||
url_preview_enabled: ${fromBool cfg.url_preview_enabled}
|
url_preview_enabled: ${boolToString cfg.url_preview_enabled}
|
||||||
${optionalString (cfg.url_preview_enabled == true) ''
|
${optionalString (cfg.url_preview_enabled == true) ''
|
||||||
url_preview_ip_range_blacklist: ${builtins.toJSON cfg.url_preview_ip_range_blacklist}
|
url_preview_ip_range_blacklist: ${builtins.toJSON cfg.url_preview_ip_range_blacklist}
|
||||||
url_preview_ip_range_whitelist: ${builtins.toJSON cfg.url_preview_ip_range_whitelist}
|
url_preview_ip_range_whitelist: ${builtins.toJSON cfg.url_preview_ip_range_whitelist}
|
||||||
|
@ -67,10 +66,10 @@ url_preview_url_blacklist: ${builtins.toJSON cfg.url_preview_url_blacklist}
|
||||||
''}
|
''}
|
||||||
recaptcha_private_key: "${cfg.recaptcha_private_key}"
|
recaptcha_private_key: "${cfg.recaptcha_private_key}"
|
||||||
recaptcha_public_key: "${cfg.recaptcha_public_key}"
|
recaptcha_public_key: "${cfg.recaptcha_public_key}"
|
||||||
enable_registration_captcha: ${fromBool cfg.enable_registration_captcha}
|
enable_registration_captcha: ${boolToString cfg.enable_registration_captcha}
|
||||||
turn_uris: ${builtins.toJSON cfg.turn_uris}
|
turn_uris: ${builtins.toJSON cfg.turn_uris}
|
||||||
turn_shared_secret: "${cfg.turn_shared_secret}"
|
turn_shared_secret: "${cfg.turn_shared_secret}"
|
||||||
enable_registration: ${fromBool cfg.enable_registration}
|
enable_registration: ${boolToString cfg.enable_registration}
|
||||||
${optionalString (cfg.registration_shared_secret != null) ''
|
${optionalString (cfg.registration_shared_secret != null) ''
|
||||||
registration_shared_secret: "${cfg.registration_shared_secret}"
|
registration_shared_secret: "${cfg.registration_shared_secret}"
|
||||||
''}
|
''}
|
||||||
|
@ -78,15 +77,15 @@ recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
|
||||||
turn_user_lifetime: "${cfg.turn_user_lifetime}"
|
turn_user_lifetime: "${cfg.turn_user_lifetime}"
|
||||||
user_creation_max_duration: ${cfg.user_creation_max_duration}
|
user_creation_max_duration: ${cfg.user_creation_max_duration}
|
||||||
bcrypt_rounds: ${cfg.bcrypt_rounds}
|
bcrypt_rounds: ${cfg.bcrypt_rounds}
|
||||||
allow_guest_access: ${fromBool cfg.allow_guest_access}
|
allow_guest_access: ${boolToString cfg.allow_guest_access}
|
||||||
trusted_third_party_id_servers: ${builtins.toJSON cfg.trusted_third_party_id_servers}
|
trusted_third_party_id_servers: ${builtins.toJSON cfg.trusted_third_party_id_servers}
|
||||||
room_invite_state_types: ${builtins.toJSON cfg.room_invite_state_types}
|
room_invite_state_types: ${builtins.toJSON cfg.room_invite_state_types}
|
||||||
${optionalString (cfg.macaroon_secret_key != null) ''
|
${optionalString (cfg.macaroon_secret_key != null) ''
|
||||||
macaroon_secret_key: "${cfg.macaroon_secret_key}"
|
macaroon_secret_key: "${cfg.macaroon_secret_key}"
|
||||||
''}
|
''}
|
||||||
expire_access_token: ${fromBool cfg.expire_access_token}
|
expire_access_token: ${boolToString cfg.expire_access_token}
|
||||||
enable_metrics: ${fromBool cfg.enable_metrics}
|
enable_metrics: ${boolToString cfg.enable_metrics}
|
||||||
report_stats: ${fromBool cfg.report_stats}
|
report_stats: ${boolToString cfg.report_stats}
|
||||||
signing_key_path: "/var/lib/matrix-synapse/homeserver.signing.key"
|
signing_key_path: "/var/lib/matrix-synapse/homeserver.signing.key"
|
||||||
key_refresh_interval: "${cfg.key_refresh_interval}"
|
key_refresh_interval: "${cfg.key_refresh_interval}"
|
||||||
perspectives:
|
perspectives:
|
||||||
|
|
|
@ -41,12 +41,12 @@ let
|
||||||
build-users-group = nixbld
|
build-users-group = nixbld
|
||||||
build-max-jobs = ${toString (cfg.maxJobs)}
|
build-max-jobs = ${toString (cfg.maxJobs)}
|
||||||
build-cores = ${toString (cfg.buildCores)}
|
build-cores = ${toString (cfg.buildCores)}
|
||||||
build-use-sandbox = ${if (builtins.isBool cfg.useSandbox) then (if cfg.useSandbox then "true" else "false") else cfg.useSandbox}
|
build-use-sandbox = ${if (builtins.isBool cfg.useSandbox) then boolToString cfg.useSandbox else cfg.useSandbox}
|
||||||
build-sandbox-paths = ${toString cfg.sandboxPaths} /bin/sh=${sh} $(echo $extraPaths)
|
build-sandbox-paths = ${toString cfg.sandboxPaths} /bin/sh=${sh} $(echo $extraPaths)
|
||||||
binary-caches = ${toString cfg.binaryCaches}
|
binary-caches = ${toString cfg.binaryCaches}
|
||||||
trusted-binary-caches = ${toString cfg.trustedBinaryCaches}
|
trusted-binary-caches = ${toString cfg.trustedBinaryCaches}
|
||||||
binary-cache-public-keys = ${toString cfg.binaryCachePublicKeys}
|
binary-cache-public-keys = ${toString cfg.binaryCachePublicKeys}
|
||||||
auto-optimise-store = ${if cfg.autoOptimiseStore then "true" else "false"}
|
auto-optimise-store = ${boolToString cfg.autoOptimiseStore}
|
||||||
${optionalString cfg.requireSignedBinaryCaches ''
|
${optionalString cfg.requireSignedBinaryCaches ''
|
||||||
signed-binary-caches = *
|
signed-binary-caches = *
|
||||||
''}
|
''}
|
||||||
|
|
|
@ -128,7 +128,7 @@ let
|
||||||
certBits = cfg.pki.auto.bits;
|
certBits = cfg.pki.auto.bits;
|
||||||
clientExpiration = cfg.pki.auto.expiration.client;
|
clientExpiration = cfg.pki.auto.expiration.client;
|
||||||
crlExpiration = cfg.pki.auto.expiration.crl;
|
crlExpiration = cfg.pki.auto.expiration.crl;
|
||||||
isAutoConfig = if needToCreateCA then "True" else "False";
|
isAutoConfig = boolToString needToCreateCA;
|
||||||
}}" > "$out/main.py"
|
}}" > "$out/main.py"
|
||||||
cat > "$out/setup.py" <<EOF
|
cat > "$out/setup.py" <<EOF
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
|
@ -8,7 +8,7 @@ let
|
||||||
conf = pkgs.writeText "collectd.conf" ''
|
conf = pkgs.writeText "collectd.conf" ''
|
||||||
BaseDir "${cfg.dataDir}"
|
BaseDir "${cfg.dataDir}"
|
||||||
PIDFile "${cfg.pidFile}"
|
PIDFile "${cfg.pidFile}"
|
||||||
AutoLoadPlugin ${if cfg.autoLoadPlugin then "true" else "false"}
|
AutoLoadPlugin ${boolToString cfg.autoLoadPlugin}
|
||||||
Hostname "${config.networking.hostName}"
|
Hostname "${config.networking.hostName}"
|
||||||
|
|
||||||
LoadPlugin syslog
|
LoadPlugin syslog
|
||||||
|
|
|
@ -5,8 +5,6 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.grafana;
|
cfg = config.services.grafana;
|
||||||
|
|
||||||
b2s = val: if val then "true" else "false";
|
|
||||||
|
|
||||||
envOptions = {
|
envOptions = {
|
||||||
PATHS_DATA = cfg.dataDir;
|
PATHS_DATA = cfg.dataDir;
|
||||||
PATHS_PLUGINS = "${cfg.dataDir}/plugins";
|
PATHS_PLUGINS = "${cfg.dataDir}/plugins";
|
||||||
|
@ -32,16 +30,16 @@ let
|
||||||
SECURITY_ADMIN_PASSWORD = cfg.security.adminPassword;
|
SECURITY_ADMIN_PASSWORD = cfg.security.adminPassword;
|
||||||
SECURITY_SECRET_KEY = cfg.security.secretKey;
|
SECURITY_SECRET_KEY = cfg.security.secretKey;
|
||||||
|
|
||||||
USERS_ALLOW_SIGN_UP = b2s cfg.users.allowSignUp;
|
USERS_ALLOW_SIGN_UP = boolToString cfg.users.allowSignUp;
|
||||||
USERS_ALLOW_ORG_CREATE = b2s cfg.users.allowOrgCreate;
|
USERS_ALLOW_ORG_CREATE = boolToString cfg.users.allowOrgCreate;
|
||||||
USERS_AUTO_ASSIGN_ORG = b2s cfg.users.autoAssignOrg;
|
USERS_AUTO_ASSIGN_ORG = boolToString cfg.users.autoAssignOrg;
|
||||||
USERS_AUTO_ASSIGN_ORG_ROLE = cfg.users.autoAssignOrgRole;
|
USERS_AUTO_ASSIGN_ORG_ROLE = cfg.users.autoAssignOrgRole;
|
||||||
|
|
||||||
AUTH_ANONYMOUS_ENABLED = b2s cfg.auth.anonymous.enable;
|
AUTH_ANONYMOUS_ENABLED = boolToString cfg.auth.anonymous.enable;
|
||||||
AUTH_ANONYMOUS_ORG_NAME = cfg.auth.anonymous.org_name;
|
AUTH_ANONYMOUS_ORG_NAME = cfg.auth.anonymous.org_name;
|
||||||
AUTH_ANONYMOUS_ORG_ROLE = cfg.auth.anonymous.org_role;
|
AUTH_ANONYMOUS_ORG_ROLE = cfg.auth.anonymous.org_role;
|
||||||
|
|
||||||
ANALYTICS_REPORTING_ENABLED = b2s cfg.analytics.reporting.enable;
|
ANALYTICS_REPORTING_ENABLED = boolToString cfg.analytics.reporting.enable;
|
||||||
} // cfg.extraOptions;
|
} // cfg.extraOptions;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -9,7 +9,7 @@ let
|
||||||
extmapFile = pkgs.writeText "extmap.conf" cfg.extmap;
|
extmapFile = pkgs.writeText "extmap.conf" cfg.extmap;
|
||||||
|
|
||||||
afpToString = x: if builtins.typeOf x == "bool"
|
afpToString = x: if builtins.typeOf x == "bool"
|
||||||
then (if x then "true" else "false")
|
then boolToString x
|
||||||
else toString x;
|
else toString x;
|
||||||
|
|
||||||
volumeConfig = name:
|
volumeConfig = name:
|
||||||
|
|
|
@ -5,7 +5,7 @@ with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
smbToString = x: if builtins.typeOf x == "bool"
|
smbToString = x: if builtins.typeOf x == "bool"
|
||||||
then (if x then "true" else "false")
|
then boolToString x
|
||||||
else toString x;
|
else toString x;
|
||||||
|
|
||||||
cfg = config.services.samba;
|
cfg = config.services.samba;
|
||||||
|
|
|
@ -290,14 +290,14 @@ in
|
||||||
shares.total = ${toString settings.client.shares.total}
|
shares.total = ${toString settings.client.shares.total}
|
||||||
|
|
||||||
[storage]
|
[storage]
|
||||||
enabled = ${if settings.storage.enable then "true" else "false"}
|
enabled = ${boolToString settings.storage.enable}
|
||||||
reserved_space = ${settings.storage.reservedSpace}
|
reserved_space = ${settings.storage.reservedSpace}
|
||||||
|
|
||||||
[helper]
|
[helper]
|
||||||
enabled = ${if settings.helper.enable then "true" else "false"}
|
enabled = ${boolToString settings.helper.enable}
|
||||||
|
|
||||||
[sftpd]
|
[sftpd]
|
||||||
enabled = ${if settings.sftpd.enable then "true" else "false"}
|
enabled = ${boolToString settings.sftpd.enable}
|
||||||
${optionalString (settings.sftpd.port != null)
|
${optionalString (settings.sftpd.port != null)
|
||||||
"port = ${toString settings.sftpd.port}"}
|
"port = ${toString settings.sftpd.port}"}
|
||||||
${optionalString (settings.sftpd.hostPublicKeyFile != null)
|
${optionalString (settings.sftpd.hostPublicKeyFile != null)
|
||||||
|
|
|
@ -5,7 +5,6 @@ with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.services.aiccu;
|
cfg = config.services.aiccu;
|
||||||
showBool = b: if b then "true" else "false";
|
|
||||||
notNull = a: ! isNull a;
|
notNull = a: ! isNull a;
|
||||||
configFile = pkgs.writeText "aiccu.conf" ''
|
configFile = pkgs.writeText "aiccu.conf" ''
|
||||||
${if notNull cfg.username then "username " + cfg.username else ""}
|
${if notNull cfg.username then "username " + cfg.username else ""}
|
||||||
|
@ -13,16 +12,16 @@ let
|
||||||
protocol ${cfg.protocol}
|
protocol ${cfg.protocol}
|
||||||
server ${cfg.server}
|
server ${cfg.server}
|
||||||
ipv6_interface ${cfg.interfaceName}
|
ipv6_interface ${cfg.interfaceName}
|
||||||
verbose ${showBool cfg.verbose}
|
verbose ${boolToString cfg.verbose}
|
||||||
daemonize true
|
daemonize true
|
||||||
automatic ${showBool cfg.automatic}
|
automatic ${boolToString cfg.automatic}
|
||||||
requiretls ${showBool cfg.requireTLS}
|
requiretls ${boolToString cfg.requireTLS}
|
||||||
pidfile ${cfg.pidFile}
|
pidfile ${cfg.pidFile}
|
||||||
defaultroute ${showBool cfg.defaultRoute}
|
defaultroute ${boolToString cfg.defaultRoute}
|
||||||
${if notNull cfg.setupScript then cfg.setupScript else ""}
|
${if notNull cfg.setupScript then cfg.setupScript else ""}
|
||||||
makebeats ${showBool cfg.makeHeartBeats}
|
makebeats ${boolToString cfg.makeHeartBeats}
|
||||||
noconfigure ${showBool cfg.noConfigure}
|
noconfigure ${boolToString cfg.noConfigure}
|
||||||
behindnat ${showBool cfg.behindNAT}
|
behindnat ${boolToString cfg.behindNAT}
|
||||||
${if cfg.localIPv4Override then "local_ipv4_override" else ""}
|
${if cfg.localIPv4Override then "local_ipv4_override" else ""}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ let
|
||||||
|
|
||||||
listenAddr = cfg.httpListenAddr + ":" + (toString cfg.httpListenPort);
|
listenAddr = cfg.httpListenAddr + ":" + (toString cfg.httpListenPort);
|
||||||
|
|
||||||
boolStr = x: if x then "true" else "false";
|
|
||||||
optionalEmptyStr = b: v: optionalString (b != "") v;
|
optionalEmptyStr = b: v: optionalString (b != "") v;
|
||||||
|
|
||||||
webUIConfig = optionalString cfg.enableWebUI
|
webUIConfig = optionalString cfg.enableWebUI
|
||||||
|
@ -31,7 +30,7 @@ let
|
||||||
sharedFoldersRecord =
|
sharedFoldersRecord =
|
||||||
concatStringsSep "," (map (entry:
|
concatStringsSep "," (map (entry:
|
||||||
let helper = attr: v:
|
let helper = attr: v:
|
||||||
if (entry ? attr) then boolStr entry.attr else boolStr v;
|
if (entry ? attr) then boolToString entry.attr else boolToString v;
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
{
|
{
|
||||||
|
@ -65,11 +64,11 @@ let
|
||||||
"listening_port": ${toString cfg.listeningPort},
|
"listening_port": ${toString cfg.listeningPort},
|
||||||
"use_gui": false,
|
"use_gui": false,
|
||||||
|
|
||||||
"check_for_updates": ${boolStr cfg.checkForUpdates},
|
"check_for_updates": ${boolToString cfg.checkForUpdates},
|
||||||
"use_upnp": ${boolStr cfg.useUpnp},
|
"use_upnp": ${boolToString cfg.useUpnp},
|
||||||
"download_limit": ${toString cfg.downloadLimit},
|
"download_limit": ${toString cfg.downloadLimit},
|
||||||
"upload_limit": ${toString cfg.uploadLimit},
|
"upload_limit": ${toString cfg.uploadLimit},
|
||||||
"lan_encrypt_data": ${boolStr cfg.encryptLAN},
|
"lan_encrypt_data": ${boolToString cfg.encryptLAN},
|
||||||
|
|
||||||
${webUIConfig}
|
${webUIConfig}
|
||||||
${sharedFoldersConfig}
|
${sharedFoldersConfig}
|
||||||
|
|
|
@ -19,7 +19,7 @@ let
|
||||||
[syncserver]
|
[syncserver]
|
||||||
public_url = ${cfg.publicUrl}
|
public_url = ${cfg.publicUrl}
|
||||||
${optionalString (cfg.sqlUri != "") "sqluri = ${cfg.sqlUri}"}
|
${optionalString (cfg.sqlUri != "") "sqluri = ${cfg.sqlUri}"}
|
||||||
allow_new_users = ${if cfg.allowNewUsers then "true" else "false"}
|
allow_new_users = ${boolToString cfg.allowNewUsers}
|
||||||
|
|
||||||
[browserid]
|
[browserid]
|
||||||
backend = tokenserver.verifiers.LocalVerifier
|
backend = tokenserver.verifiers.LocalVerifier
|
||||||
|
|
|
@ -10,8 +10,6 @@ let
|
||||||
|
|
||||||
extip = "EXTIP=\$(${pkgs.curl.bin}/bin/curl -sLf \"http://jsonip.com\" | ${pkgs.gawk}/bin/awk -F'\"' '{print $4}')";
|
extip = "EXTIP=\$(${pkgs.curl.bin}/bin/curl -sLf \"http://jsonip.com\" | ${pkgs.gawk}/bin/awk -F'\"' '{print $4}')";
|
||||||
|
|
||||||
toYesNo = b: if b then "true" else "false";
|
|
||||||
|
|
||||||
mkEndpointOpt = name: addr: port: {
|
mkEndpointOpt = name: addr: port: {
|
||||||
enable = mkEnableOption name;
|
enable = mkEnableOption name;
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
|
@ -76,10 +74,10 @@ let
|
||||||
|
|
||||||
i2pdConf = pkgs.writeText "i2pd.conf"
|
i2pdConf = pkgs.writeText "i2pd.conf"
|
||||||
''
|
''
|
||||||
ipv4 = ${toYesNo cfg.enableIPv4}
|
ipv4 = ${boolToString cfg.enableIPv4}
|
||||||
ipv6 = ${toYesNo cfg.enableIPv6}
|
ipv6 = ${boolToString cfg.enableIPv6}
|
||||||
notransit = ${toYesNo cfg.notransit}
|
notransit = ${boolToString cfg.notransit}
|
||||||
floodfill = ${toYesNo cfg.floodfill}
|
floodfill = ${boolToString cfg.floodfill}
|
||||||
netid = ${toString cfg.netid}
|
netid = ${toString cfg.netid}
|
||||||
${if isNull cfg.bandwidth then "" else "bandwidth = ${toString cfg.bandwidth}" }
|
${if isNull cfg.bandwidth then "" else "bandwidth = ${toString cfg.bandwidth}" }
|
||||||
${if isNull cfg.port then "" else "port = ${toString cfg.port}"}
|
${if isNull cfg.port then "" else "port = ${toString cfg.port}"}
|
||||||
|
@ -88,14 +86,14 @@ let
|
||||||
transittunnels = ${toString cfg.limits.transittunnels}
|
transittunnels = ${toString cfg.limits.transittunnels}
|
||||||
|
|
||||||
[upnp]
|
[upnp]
|
||||||
enabled = ${toYesNo cfg.upnp.enable}
|
enabled = ${boolToString cfg.upnp.enable}
|
||||||
name = ${cfg.upnp.name}
|
name = ${cfg.upnp.name}
|
||||||
|
|
||||||
[precomputation]
|
[precomputation]
|
||||||
elgamal = ${toYesNo cfg.precomputation.elgamal}
|
elgamal = ${boolToString cfg.precomputation.elgamal}
|
||||||
|
|
||||||
[reseed]
|
[reseed]
|
||||||
verify = ${toYesNo cfg.reseed.verify}
|
verify = ${boolToString cfg.reseed.verify}
|
||||||
file = ${cfg.reseed.file}
|
file = ${cfg.reseed.file}
|
||||||
urls = ${builtins.concatStringsSep "," cfg.reseed.urls}
|
urls = ${builtins.concatStringsSep "," cfg.reseed.urls}
|
||||||
|
|
||||||
|
@ -107,11 +105,11 @@ let
|
||||||
(proto: let portStr = toString proto.port; in
|
(proto: let portStr = toString proto.port; in
|
||||||
''
|
''
|
||||||
[${proto.name}]
|
[${proto.name}]
|
||||||
enabled = ${toYesNo proto.enable}
|
enabled = ${boolToString proto.enable}
|
||||||
address = ${proto.address}
|
address = ${proto.address}
|
||||||
port = ${toString proto.port}
|
port = ${toString proto.port}
|
||||||
${if proto ? keys then "keys = ${proto.keys}" else ""}
|
${if proto ? keys then "keys = ${proto.keys}" else ""}
|
||||||
${if proto ? auth then "auth = ${toYesNo proto.auth}" else ""}
|
${if proto ? auth then "auth = ${boolToString proto.auth}" else ""}
|
||||||
${if proto ? user then "user = ${proto.user}" else ""}
|
${if proto ? user then "user = ${proto.user}" else ""}
|
||||||
${if proto ? pass then "pass = ${proto.pass}" else ""}
|
${if proto ? pass then "pass = ${proto.pass}" else ""}
|
||||||
${if proto ? outproxy then "outproxy = ${proto.outproxy}" else ""}
|
${if proto ? outproxy then "outproxy = ${proto.outproxy}" else ""}
|
||||||
|
|
|
@ -12,7 +12,7 @@ let
|
||||||
substFiles = [ "=>/conf" ./ircd.conf ];
|
substFiles = [ "=>/conf" ./ircd.conf ];
|
||||||
inherit (pkgs) ircdHybrid coreutils su iproute gnugrep procps;
|
inherit (pkgs) ircdHybrid coreutils su iproute gnugrep procps;
|
||||||
|
|
||||||
ipv6Enabled = if config.networking.enableIPv6 then "true" else "false";
|
ipv6Enabled = boolToString config.networking.enableIPv6;
|
||||||
|
|
||||||
inherit (cfg) serverName sid description adminEmail
|
inherit (cfg) serverName sid description adminEmail
|
||||||
extraPort;
|
extraPort;
|
||||||
|
|
|
@ -16,7 +16,7 @@ let
|
||||||
pid_file /run/mosquitto/pid
|
pid_file /run/mosquitto/pid
|
||||||
acl_file ${aclFile}
|
acl_file ${aclFile}
|
||||||
persistence true
|
persistence true
|
||||||
allow_anonymous ${if cfg.allowAnonymous then "true" else "false"}
|
allow_anonymous ${boolToString cfg.allowAnonymous}
|
||||||
bind_address ${cfg.host}
|
bind_address ${cfg.host}
|
||||||
port ${toString cfg.port}
|
port ${toString cfg.port}
|
||||||
${listenerConf}
|
${listenerConf}
|
||||||
|
|
|
@ -26,17 +26,17 @@ let
|
||||||
|
|
||||||
textmessagelength=${toString cfg.textMsgLength}
|
textmessagelength=${toString cfg.textMsgLength}
|
||||||
imagemessagelength=${toString cfg.imgMsgLength}
|
imagemessagelength=${toString cfg.imgMsgLength}
|
||||||
allowhtml=${if cfg.allowHtml then "true" else "false"}
|
allowhtml=${boolToString cfg.allowHtml}
|
||||||
logdays=${toString cfg.logDays}
|
logdays=${toString cfg.logDays}
|
||||||
bonjour=${if cfg.bonjour then "true" else "false"}
|
bonjour=${babelToString cfg.bonjour}
|
||||||
sendversion=${if cfg.sendVersion then "true" else "false"}
|
sendversion=${babelToString cfg.sendVersion}
|
||||||
|
|
||||||
${if cfg.registerName == "" then "" else "registerName="+cfg.registerName}
|
${if cfg.registerName == "" then "" else "registerName="+cfg.registerName}
|
||||||
${if cfg.registerPassword == "" then "" else "registerPassword="+cfg.registerPassword}
|
${if cfg.registerPassword == "" then "" else "registerPassword="+cfg.registerPassword}
|
||||||
${if cfg.registerUrl == "" then "" else "registerUrl="+cfg.registerUrl}
|
${if cfg.registerUrl == "" then "" else "registerUrl="+cfg.registerUrl}
|
||||||
${if cfg.registerHostname == "" then "" else "registerHostname="+cfg.registerHostname}
|
${if cfg.registerHostname == "" then "" else "registerHostname="+cfg.registerHostname}
|
||||||
|
|
||||||
certrequired=${if cfg.clientCertRequired then "true" else "false"}
|
certrequired=${babelToString cfg.clientCertRequired}
|
||||||
${if cfg.sslCert == "" then "" else "sslCert="+cfg.sslCert}
|
${if cfg.sslCert == "" then "" else "sslCert="+cfg.sslCert}
|
||||||
${if cfg.sslKey == "" then "" else "sslKey="+cfg.sslKey}
|
${if cfg.sslKey == "" then "" else "sslKey="+cfg.sslKey}
|
||||||
${if cfg.sslCa == "" then "" else "sslCA="+cfg.sslCa}
|
${if cfg.sslCa == "" then "" else "sslCA="+cfg.sslCa}
|
||||||
|
|
|
@ -219,7 +219,7 @@ in
|
||||||
|
|
||||||
data_path = "/var/lib/prosody"
|
data_path = "/var/lib/prosody"
|
||||||
|
|
||||||
allow_registration = ${ if cfg.allowRegistration then "true" else "false" };
|
allow_registration = ${boolToString cfg.allowRegistration};
|
||||||
|
|
||||||
${ optionalString cfg.modules.console "console_enabled = true;" }
|
${ optionalString cfg.modules.console "console_enabled = true;" }
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ in
|
||||||
|
|
||||||
${ lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: ''
|
${ lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: ''
|
||||||
VirtualHost "${v.domain}"
|
VirtualHost "${v.domain}"
|
||||||
enabled = ${if v.enabled then "true" else "false"};
|
enabled = ${boolToString v.enabled};
|
||||||
${ optionalString (v.ssl != null) (createSSLOptsStr v.ssl) }
|
${ optionalString (v.ssl != null) (createSSLOptsStr v.ssl) }
|
||||||
${ v.extraConfig }
|
${ v.extraConfig }
|
||||||
'') cfg.virtualHosts) }
|
'') cfg.virtualHosts) }
|
||||||
|
|
|
@ -5,7 +5,7 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.sslh;
|
cfg = config.services.sslh;
|
||||||
configFile = pkgs.writeText "sslh.conf" ''
|
configFile = pkgs.writeText "sslh.conf" ''
|
||||||
verbose: ${if cfg.verbose then "true" else "false"};
|
verbose: ${boolToString cfg.verbose};
|
||||||
foreground: true;
|
foreground: true;
|
||||||
inetd: false;
|
inetd: false;
|
||||||
numeric: false;
|
numeric: false;
|
||||||
|
|
|
@ -35,7 +35,7 @@ let
|
||||||
Port = ${toString confOpts.port}
|
Port = ${toString confOpts.port}
|
||||||
IPv4 = true
|
IPv4 = true
|
||||||
IPv6 = true
|
IPv6 = true
|
||||||
SSL = ${if confOpts.useSSL then "true" else "false"}
|
SSL = ${boolToString confOpts.useSSL}
|
||||||
</Listener>
|
</Listener>
|
||||||
|
|
||||||
<User ${confOpts.userName}>
|
<User ${confOpts.userName}>
|
||||||
|
|
|
@ -10,9 +10,6 @@ let
|
||||||
# repeatedArgs (arg: "--arg=${arg}") args
|
# repeatedArgs (arg: "--arg=${arg}") args
|
||||||
repeatedArgs = concatMapStringsSep " ";
|
repeatedArgs = concatMapStringsSep " ";
|
||||||
|
|
||||||
# 'toString' doesn't quite do what we want for bools.
|
|
||||||
fromBool = x: if x then "true" else "false";
|
|
||||||
|
|
||||||
# oauth2_proxy provides many options that are only relevant if you are using
|
# oauth2_proxy provides many options that are only relevant if you are using
|
||||||
# a certain provider. This set maps from provider name to a function that
|
# a certain provider. This set maps from provider name to a function that
|
||||||
# takes the configuration and returns a string that can be inserted into the
|
# takes the configuration and returns a string that can be inserted into the
|
||||||
|
@ -49,24 +46,24 @@ let
|
||||||
--client-secret='${cfg.clientSecret}' \
|
--client-secret='${cfg.clientSecret}' \
|
||||||
${optionalString (!isNull cfg.cookie.domain) "--cookie-domain='${cfg.cookie.domain}'"} \
|
${optionalString (!isNull cfg.cookie.domain) "--cookie-domain='${cfg.cookie.domain}'"} \
|
||||||
--cookie-expire='${cfg.cookie.expire}' \
|
--cookie-expire='${cfg.cookie.expire}' \
|
||||||
--cookie-httponly=${fromBool cfg.cookie.httpOnly} \
|
--cookie-httponly=${boolToString cfg.cookie.httpOnly} \
|
||||||
--cookie-name='${cfg.cookie.name}' \
|
--cookie-name='${cfg.cookie.name}' \
|
||||||
--cookie-secret='${cfg.cookie.secret}' \
|
--cookie-secret='${cfg.cookie.secret}' \
|
||||||
--cookie-secure=${fromBool cfg.cookie.secure} \
|
--cookie-secure=${boolToString cfg.cookie.secure} \
|
||||||
${optionalString (!isNull cfg.cookie.refresh) "--cookie-refresh='${cfg.cookie.refresh}'"} \
|
${optionalString (!isNull cfg.cookie.refresh) "--cookie-refresh='${cfg.cookie.refresh}'"} \
|
||||||
${optionalString (!isNull cfg.customTemplatesDir) "--custom-templates-dir='${cfg.customTemplatesDir}'"} \
|
${optionalString (!isNull cfg.customTemplatesDir) "--custom-templates-dir='${cfg.customTemplatesDir}'"} \
|
||||||
${repeatedArgs (x: "--email-domain='${x}'") cfg.email.domains} \
|
${repeatedArgs (x: "--email-domain='${x}'") cfg.email.domains} \
|
||||||
--http-address='${cfg.httpAddress}' \
|
--http-address='${cfg.httpAddress}' \
|
||||||
${optionalString (!isNull cfg.htpasswd.file) "--htpasswd-file='${cfg.htpasswd.file}' --display-htpasswd-form=${fromBool cfg.htpasswd.displayForm}"} \
|
${optionalString (!isNull cfg.htpasswd.file) "--htpasswd-file='${cfg.htpasswd.file}' --display-htpasswd-form=${boolToString cfg.htpasswd.displayForm}"} \
|
||||||
${optionalString (!isNull cfg.loginURL) "--login-url='${cfg.loginURL}'"} \
|
${optionalString (!isNull cfg.loginURL) "--login-url='${cfg.loginURL}'"} \
|
||||||
--pass-access-token=${fromBool cfg.passAccessToken} \
|
--pass-access-token=${boolToString cfg.passAccessToken} \
|
||||||
--pass-basic-auth=${fromBool cfg.passBasicAuth} \
|
--pass-basic-auth=${boolToString cfg.passBasicAuth} \
|
||||||
--pass-host-header=${fromBool cfg.passHostHeader} \
|
--pass-host-header=${boolToString cfg.passHostHeader} \
|
||||||
--proxy-prefix='${cfg.proxyPrefix}' \
|
--proxy-prefix='${cfg.proxyPrefix}' \
|
||||||
${optionalString (!isNull cfg.profileURL) "--profile-url='${cfg.profileURL}'"} \
|
${optionalString (!isNull cfg.profileURL) "--profile-url='${cfg.profileURL}'"} \
|
||||||
${optionalString (!isNull cfg.redeemURL) "--redeem-url='${cfg.redeemURL}'"} \
|
${optionalString (!isNull cfg.redeemURL) "--redeem-url='${cfg.redeemURL}'"} \
|
||||||
${optionalString (!isNull cfg.redirectURL) "--redirect-url='${cfg.redirectURL}'"} \
|
${optionalString (!isNull cfg.redirectURL) "--redirect-url='${cfg.redirectURL}'"} \
|
||||||
--request-logging=${fromBool cfg.requestLogging} \
|
--request-logging=${boolToString cfg.requestLogging} \
|
||||||
${optionalString (!isNull cfg.scope) "--scope='${cfg.scope}'"} \
|
${optionalString (!isNull cfg.scope) "--scope='${cfg.scope}'"} \
|
||||||
${repeatedArgs (x: "--skip-auth-regex='${x}'") cfg.skipAuthRegexes} \
|
${repeatedArgs (x: "--skip-auth-regex='${x}'") cfg.skipAuthRegexes} \
|
||||||
${optionalString (!isNull cfg.signatureKey) "--signature-key='${cfg.signatureKey}'"} \
|
${optionalString (!isNull cfg.signatureKey) "--signature-key='${cfg.signatureKey}'"} \
|
||||||
|
|
|
@ -15,8 +15,7 @@ let
|
||||||
|
|
||||||
# Strings must be quoted, ints and bools must not (for settings.json).
|
# Strings must be quoted, ints and bools must not (for settings.json).
|
||||||
toOption = x:
|
toOption = x:
|
||||||
if x == true then "true"
|
if isBool x then boolToString x
|
||||||
else if x == false then "false"
|
|
||||||
else if isInt x then toString x
|
else if isInt x then toString x
|
||||||
else toString ''"${x}"'';
|
else toString ''"${x}"'';
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ in
|
||||||
|
|
||||||
sed -e 's,port="8095",port="${toString cfg.listenPort}" address="${cfg.listenAddress}",' \
|
sed -e 's,port="8095",port="${toString cfg.listenPort}" address="${cfg.listenAddress}",' \
|
||||||
'' + (lib.optionalString cfg.proxy.enable ''
|
'' + (lib.optionalString cfg.proxy.enable ''
|
||||||
-e 's,compression="on",compression="off" protocol="HTTP/1.1" proxyName="${cfg.proxy.name}" proxyPort="${toString cfg.proxy.port}" scheme="${cfg.proxy.scheme}" secure="${if cfg.proxy.secure then "true" else "false"}",' \
|
-e 's,compression="on",compression="off" protocol="HTTP/1.1" proxyName="${cfg.proxy.name}" proxyPort="${toString cfg.proxy.port}" scheme="${cfg.proxy.scheme}" secure="${boolToString cfg.proxy.secure}",' \
|
||||||
'') + ''
|
'') + ''
|
||||||
${pkg}/apache-tomcat/conf/server.xml.dist > ${cfg.home}/server.xml
|
${pkg}/apache-tomcat/conf/server.xml.dist > ${cfg.home}/server.xml
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -12,11 +12,11 @@ let
|
||||||
port: ${toString cfg.quasselCorePort}, // quasselcore port
|
port: ${toString cfg.quasselCorePort}, // quasselcore port
|
||||||
initialBacklogLimit: ${toString cfg.initialBacklogLimit}, // Amount of backlogs to fetch per buffer on connection
|
initialBacklogLimit: ${toString cfg.initialBacklogLimit}, // Amount of backlogs to fetch per buffer on connection
|
||||||
backlogLimit: ${toString cfg.backlogLimit}, // Amount of backlogs to fetch per buffer after first retrieval
|
backlogLimit: ${toString cfg.backlogLimit}, // Amount of backlogs to fetch per buffer after first retrieval
|
||||||
securecore: ${if cfg.secureCore then "true" else "false"}, // Connect to the core using SSL
|
securecore: ${boolToString cfg.secureCore}, // Connect to the core using SSL
|
||||||
theme: '${cfg.theme}' // Default UI theme
|
theme: '${cfg.theme}' // Default UI theme
|
||||||
},
|
},
|
||||||
themes: ['default', 'darksolarized'], // Available themes
|
themes: ['default', 'darksolarized'], // Available themes
|
||||||
forcedefault: ${if cfg.forceHostAndPort then "true" else "false"}, // Will force default host and port to be used, and will hide the corresponding fields in the UI
|
forcedefault: ${boolToString cfg.forceHostAndPort}, // Will force default host and port to be used, and will hide the corresponding fields in the UI
|
||||||
prefixpath: '${cfg.prefixPath}' // Configure this if you use a reverse proxy
|
prefixpath: '${cfg.prefixPath}' // Configure this if you use a reverse proxy
|
||||||
};
|
};
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -6,8 +6,6 @@ let
|
||||||
|
|
||||||
configVersion = 26;
|
configVersion = 26;
|
||||||
|
|
||||||
boolToString = b: if b then "true" else "false";
|
|
||||||
|
|
||||||
cacheDir = "cache";
|
cacheDir = "cache";
|
||||||
lockDir = "lock";
|
lockDir = "lock";
|
||||||
feedIconsDir = "feed-icons";
|
feedIconsDir = "feed-icons";
|
||||||
|
|
|
@ -59,7 +59,7 @@ let
|
||||||
[Autologin]
|
[Autologin]
|
||||||
User=${cfg.autoLogin.user}
|
User=${cfg.autoLogin.user}
|
||||||
Session=${defaultSessionName}.desktop
|
Session=${defaultSessionName}.desktop
|
||||||
Relogin=${if cfg.autoLogin.relogin then "true" else "false"}
|
Relogin=${boolToString cfg.autoLogin.relogin}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
|
|
|
@ -74,7 +74,7 @@ in {
|
||||||
MatchIsTouchpad "on"
|
MatchIsTouchpad "on"
|
||||||
Identifier "Touchpads"
|
Identifier "Touchpads"
|
||||||
Driver "mtrack"
|
Driver "mtrack"
|
||||||
Option "IgnorePalm" "${if cfg.ignorePalm then "true" else "false"}"
|
Option "IgnorePalm" "${boolToString cfg.ignorePalm}"
|
||||||
Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}"
|
Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}"
|
||||||
Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}"
|
Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}"
|
||||||
Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}"
|
Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}"
|
||||||
|
|
|
@ -27,7 +27,7 @@ in stdenv.mkDerivation rec {
|
||||||
echo "<settings><mirrors>\
|
echo "<settings><mirrors>\
|
||||||
<mirror><id>tmpm2</id><url>file://$out/m2</url><mirrorOf>*</mirrorOf></mirror></mirrors>\
|
<mirror><id>tmpm2</id><url>file://$out/m2</url><mirrorOf>*</mirrorOf></mirror></mirrors>\
|
||||||
<localRepository>$out/m2/</localRepository></settings>" >> $out/m2/settings.xml
|
<localRepository>$out/m2/</localRepository></settings>" >> $out/m2/settings.xml
|
||||||
${maven}/bin/mvn ${optionalString (quiet) "-q"} clean package -Dmaven.test.skip=${if skipTests then "true" else "false"} -Danimal.sniffer.skip=true -gs $out/m2/settings.xml
|
${maven}/bin/mvn ${optionalString (quiet) "-q"} clean package -Dmaven.test.skip=${boolToString skipTests} -Danimal.sniffer.skip=true -gs $out/m2/settings.xml
|
||||||
cp ./target/*.jar $out/m2/${m2Path}
|
cp ./target/*.jar $out/m2/${m2Path}
|
||||||
cp -v ./target/*.jar $out/target/
|
cp -v ./target/*.jar $out/target/
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, js_of_ocaml
|
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, opam, js_of_ocaml
|
||||||
, jsooSupport ? !(stdenv.lib.versionAtLeast ocaml.version "4.04")
|
, jsooSupport ? !(stdenv.lib.versionAtLeast ocaml.version "4.04")
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "ocaml${ocaml.version}-mtime-0.8.3";
|
name = "ocaml${ocaml.version}-mtime-0.8.3";
|
||||||
|
|
||||||
|
@ -15,7 +17,7 @@ stdenv.mkDerivation {
|
||||||
buildInputs = [ ocaml findlib ocamlbuild opam ]
|
buildInputs = [ ocaml findlib ocamlbuild opam ]
|
||||||
++ stdenv.lib.optional jsooSupport js_of_ocaml;
|
++ stdenv.lib.optional jsooSupport js_of_ocaml;
|
||||||
|
|
||||||
buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true jsoo=${if jsooSupport then "true" else "false"}";
|
buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true jsoo=${boolToString jsooSupport}";
|
||||||
|
|
||||||
installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
|
installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";
|
||||||
|
|
||||||
|
@ -23,7 +25,7 @@ stdenv.mkDerivation {
|
||||||
description = "Monotonic wall-clock time for OCaml";
|
description = "Monotonic wall-clock time for OCaml";
|
||||||
homepage = http://erratique.ch/software/mtime;
|
homepage = http://erratique.ch/software/mtime;
|
||||||
inherit (ocaml.meta) platforms;
|
inherit (ocaml.meta) platforms;
|
||||||
maintainers = [ stdenv.lib.maintainers.vbgl ];
|
maintainers = [ maintainers.vbgl ];
|
||||||
license = stdenv.lib.licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
LD_LIBRARY_PATH=${cpuid}/lib/ocaml/${ocaml.version}/site-lib/stubslibs/ \
|
LD_LIBRARY_PATH=${cpuid}/lib/ocaml/${ocaml.version}/site-lib/stubslibs/ \
|
||||||
${topkg.buildPhase} --with-lwt ${if withLwt then "true" else "false"}
|
${topkg.buildPhase} --with-lwt ${boolToString withLwt}
|
||||||
'';
|
'';
|
||||||
inherit (topkg) installPhase;
|
inherit (topkg) installPhase;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ buildOcaml rec {
|
||||||
optional withLwt lwt;
|
optional withLwt lwt;
|
||||||
|
|
||||||
buildPhase = topkg.buildPhase
|
buildPhase = topkg.buildPhase
|
||||||
+ " --with-lwt ${if withLwt then "true" else "false"}";
|
+ " --with-lwt ${boolToString withLwt}";
|
||||||
|
|
||||||
inherit (topkg) installPhase;
|
inherit (topkg) installPhase;
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg
|
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg
|
||||||
, uchar, result, gg, uutf, otfm, js_of_ocaml,
|
, uchar, result, gg, uutf, otfm, js_of_ocaml,
|
||||||
pdfBackend ? true, # depends on uutf and otfm
|
pdfBackend ? true, # depends on uutf and otfm
|
||||||
htmlcBackend ? true # depends on js_of_ocaml
|
htmlcBackend ? true # depends on js_of_ocaml
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (stdenv.lib) optionals versionAtLeast;
|
inherit (stdenv.lib) optionals versionAtLeast;
|
||||||
|
|
||||||
pname = "vg";
|
pname = "vg";
|
||||||
version = "0.9.0";
|
version = "0.9.0";
|
||||||
webpage = "http://erratique.ch/software/${pname}";
|
webpage = "http://erratique.ch/software/${pname}";
|
||||||
sob = b: if b then "true" else "false";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
assert versionAtLeast ocaml.version "4.02.0";
|
assert versionAtLeast ocaml.version "4.02.0";
|
||||||
|
@ -35,13 +36,14 @@ stdenv.mkDerivation rec {
|
||||||
unpackCmd = "tar xjf $src";
|
unpackCmd = "tar xjf $src";
|
||||||
|
|
||||||
buildPhase = topkg.buildPhase
|
buildPhase = topkg.buildPhase
|
||||||
+ " --with-uutf ${sob pdfBackend} --with-otfm ${sob pdfBackend}"
|
+ " --with-uutf ${boolToString pdfBackend}"
|
||||||
+ " --with-js_of_ocaml ${sob htmlcBackend}"
|
+ " --with-otfm ${boolToString pdfBackend}"
|
||||||
|
+ " --with-js_of_ocaml ${boolToString htmlcBackend}"
|
||||||
+ " --with-cairo2 false";
|
+ " --with-cairo2 false";
|
||||||
|
|
||||||
inherit (topkg) installPhase;
|
inherit (topkg) installPhase;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = {
|
||||||
description = "Declarative 2D vector graphics for OCaml";
|
description = "Declarative 2D vector graphics for OCaml";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
Vg is an OCaml module for declarative 2D vector graphics. In Vg, images
|
Vg is an OCaml module for declarative 2D vector graphics. In Vg, images
|
||||||
|
|
Loading…
Reference in New Issue