diff options
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/postgresql.nix | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/modules/nixos/postgresql.nix b/modules/nixos/postgresql.nix index 89b24b8..5081340 100644 --- a/modules/nixos/postgresql.nix +++ b/modules/nixos/postgresql.nix @@ -5,9 +5,11 @@ this, ... }: -with lib; let +with lib; +let cfg = config.nixfiles.modules.postgresql; -in { +in +{ options.nixfiles.modules.postgresql = { enable = mkEnableOption "PostgreSQL"; @@ -19,7 +21,7 @@ in { extraPostStart = mkOption { type = with types; listOf str; - default = []; + default = [ ]; description = '' Additional post-startup commands. @@ -37,7 +39,7 @@ in { } ]; - ark.directories = [config.services.postgresql.dataDir]; + ark.directories = [ config.services.postgresql.dataDir ]; services = { postgresql = { @@ -72,21 +74,25 @@ in { }; }; - systemd.services.postgresql.postStart = optionalString (cfg.extraPostStart != []) concatLines cfg.extraPostStart; + systemd.services.postgresql.postStart = optionalString ( + cfg.extraPostStart != [ ] + ) concatLines cfg.extraPostStart; - environment.sessionVariables.PSQLRC = toString (pkgs.writeText "psqlrc" '' - \set QUIET 1 + environment.sessionVariables.PSQLRC = toString ( + pkgs.writeText "psqlrc" '' + \set QUIET 1 - \timing - \x auto - \pset null '[NULL]' - \set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]% λ ' - \set PROMPT2 ' … > ' - \set VERBOSITY verbose - \set HISTCONTROL ignoredups - \set HISTFILE /dev/null + \timing + \x auto + \pset null '[NULL]' + \set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]% λ ' + \set PROMPT2 ' … > ' + \set VERBOSITY verbose + \set HISTCONTROL ignoredups + \set HISTFILE /dev/null - \unset QUIET - ''); + \unset QUIET + '' + ); }; } |