treewide: apply statix fixes
This commit is contained in:
parent
10a9705ec6
commit
dbbf2330fd
9 changed files with 19 additions and 21 deletions
|
@ -4,7 +4,7 @@ with lib;
|
|||
let
|
||||
getHostConfigurations = svcConfig: hostName:
|
||||
lib.mapAttrsToList (groupName: _: svcConfig.nixos.${groupName})
|
||||
(lib.filterAttrs (_: v: lib.elem hostName v) svcConfig.nodes);
|
||||
(lib.filterAttrs (_: lib.elem hostName) svcConfig.nodes);
|
||||
|
||||
getServiceConfigurations = svcConfig: getHostConfigurations svcConfig config.vars.hostName;
|
||||
in
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
let
|
||||
cfg = config.services.patroni;
|
||||
|
||||
renameToLink = mode: n: v: lib.nameValuePair "patroni-etcd-node-${mode}-${n}" v;
|
||||
renameToLink = mode: n: lib.nameValuePair "patroni-etcd-node-${mode}-${n}";
|
||||
|
||||
genLinks = mode: nodes: f: lib.mapAttrs' (renameToLink mode) (lib.genAttrs nodes f);
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
mkDeployments = hosts: overrides: lib.genAttrs hosts
|
||||
(host: mkDeploy host // (overrides.${host} or {}) );
|
||||
|
||||
effects = inputs.hercules-ci-effects.lib.withPkgs (nixpkgsFor.x86_64-linux);
|
||||
effects = inputs.hercules-ci-effects.lib.withPkgs nixpkgsFor.x86_64-linux;
|
||||
in flake-parts.lib.mkFlake { inherit self; } {
|
||||
inherit systems;
|
||||
flake = {
|
||||
|
|
|
@ -9,8 +9,8 @@ let
|
|||
cfg = { inherit (config.services) loki; };
|
||||
|
||||
toString' = v:
|
||||
if v == true then "true" else
|
||||
if v == false then "false" else
|
||||
if v then "true" else
|
||||
if !v then "false" else
|
||||
toString v;
|
||||
|
||||
mapPaths = lib.mapAttrsRecursive (
|
||||
|
|
|
@ -162,7 +162,7 @@ in
|
|||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = format.type;
|
||||
inherit (format) type;
|
||||
default = { };
|
||||
description = mdDoc ''
|
||||
The primary patroni configuration. See the [documentation](https://patroni.readthedocs.io/en/latest/SETTINGS.html)
|
||||
|
@ -185,13 +185,13 @@ in
|
|||
config = mkIf cfg.enable {
|
||||
|
||||
services.patroni.settings = {
|
||||
scope = cfg.scope;
|
||||
name = cfg.name;
|
||||
namespace = cfg.namespace;
|
||||
inherit (cfg) scope;
|
||||
inherit (cfg) name;
|
||||
inherit (cfg) namespace;
|
||||
|
||||
restapi = {
|
||||
listen = "${cfg.nodeIp}:${toString(cfg.restApiPort)}";
|
||||
connect_address = "${cfg.nodeIp}:${toString(cfg.restApiPort)}";
|
||||
listen = "${cfg.nodeIp}:${toString cfg.restApiPort}";
|
||||
connect_address = "${cfg.nodeIp}:${toString cfg.restApiPort}";
|
||||
};
|
||||
|
||||
raft = mkIf cfg.raft {
|
||||
|
@ -201,8 +201,8 @@ in
|
|||
};
|
||||
|
||||
postgresql = {
|
||||
listen = "${cfg.nodeIp}:${toString(cfg.postgresqlPort)}";
|
||||
connect_address = "${cfg.nodeIp}:${toString(cfg.postgresqlPort)}";
|
||||
listen = "${cfg.nodeIp}:${toString cfg.postgresqlPort}";
|
||||
connect_address = "${cfg.nodeIp}:${toString cfg.postgresqlPort}";
|
||||
data_dir = cfg.postgresqlDataDir;
|
||||
bin_dir = "${postgresql}/bin";
|
||||
pgpass = "${cfg.dataDir}/pgpass";
|
||||
|
@ -219,7 +219,7 @@ in
|
|||
users = {
|
||||
users = mkIf (cfg.user == defaultUser) {
|
||||
patroni = {
|
||||
group = cfg.group;
|
||||
inherit (cfg) group;
|
||||
isSystemUser = true;
|
||||
};
|
||||
};
|
||||
|
@ -282,7 +282,7 @@ in
|
|||
StateDirectory = "patroni patroni/raft postgresql postgresql/${postgresql.psqlSchema}";
|
||||
StateDirectoryMode = "0750";
|
||||
})
|
||||
(mkIf (cfg.softwareWatchdog) {
|
||||
(mkIf cfg.softwareWatchdog {
|
||||
ExecStartPre = "+" + pkgs.writeShellScript "configure-software-watchdog.sh" ''
|
||||
${pkgs.kmod}/bin/modprobe softdog
|
||||
${pkgs.coreutils}/bin/chown ${cfg.user} /dev/watchdog
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
rootDir: let
|
||||
|
||||
prefix = ((toString rootDir) + "/");
|
||||
prefix = (toString rootDir) + "/";
|
||||
|
||||
files = lib.filesystem.listFilesRecursive rootDir;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{ inputs, lib, ... }:
|
||||
let
|
||||
filters = import ./system-filter.nix;
|
||||
doFilter' = system: filterSet: pkgSet: lib.filterAttrs (name: _:
|
||||
doFilter' = system: filterSet: lib.filterAttrs (name: _:
|
||||
filterSet ? "${name}" -> builtins.elem system filterSet."${name}"
|
||||
) pkgSet;
|
||||
);
|
||||
in {
|
||||
imports = [
|
||||
./projects.nix
|
||||
|
|
|
@ -18,7 +18,7 @@ let
|
|||
sources = (builtins.fromJSON (builtins.readFile ./sources.json)).pins;
|
||||
in rustPlatform.buildRustPackage rec {
|
||||
pname = "npins";
|
||||
version = src.version;
|
||||
inherit (src) version;
|
||||
src = passthru.mkSource sources.npins;
|
||||
|
||||
cargoSha256 = "0rwnzkmx91cwcz9yw0rbbqv73ba6ggim9f4qgz5pgy6h696ld2k8";
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
let
|
||||
inherit (pins) cinny;
|
||||
repo = cinny.repository;
|
||||
in
|
||||
|
||||
let
|
||||
app = stdenvNoCC.mkDerivation rec {
|
||||
pname = "cinny-bin";
|
||||
version = builtins.substring 1 (-1) cinny.version;
|
||||
|
|
Loading…
Reference in a new issue