pg update
This commit is contained in:
parent
2d0c946fe3
commit
bdaf07dca9
2 changed files with 70 additions and 38 deletions
|
|
@ -7,51 +7,51 @@
|
|||
}:
|
||||
let
|
||||
channels = [
|
||||
"WilliamOsman2"
|
||||
"TechnologyConnections"
|
||||
"GarbageTime420"
|
||||
"LinusTechTips"
|
||||
"gabe.follower"
|
||||
"TheB1M"
|
||||
"2BoredGuysOfficial"
|
||||
"DankPods"
|
||||
"Ididathing"
|
||||
"AlexPrinz"
|
||||
"BagelBoyOfficial"
|
||||
"BenEater"
|
||||
"Boy_Boy"
|
||||
"TylerMcVicker1"
|
||||
"PosyMusic"
|
||||
"jameshoffmann"
|
||||
"ContraPoints"
|
||||
"DIYPerks"
|
||||
"DankPods"
|
||||
"Defunctland"
|
||||
"DeviantOllam"
|
||||
"GarbageTime420"
|
||||
"Ididathing"
|
||||
"LinusTechTips"
|
||||
"MaxFosh"
|
||||
"MaxMakerChannel"
|
||||
"MichaelReeves"
|
||||
"Nerdforge"
|
||||
"NileBlue"
|
||||
"NileRed"
|
||||
"NoBoilerplate"
|
||||
"Parabelritter"
|
||||
"TomScottGo"
|
||||
"f4micom"
|
||||
"DeviantOllam"
|
||||
"styropyro"
|
||||
"Defunctland"
|
||||
"BenEater"
|
||||
"stacksmashing"
|
||||
"ZackFreedman"
|
||||
"MaxMakerChannel"
|
||||
"agingwheels"
|
||||
"PhilosophyTube"
|
||||
"Nerdforge"
|
||||
"AlexPrinz"
|
||||
"MaxFosh"
|
||||
"BagelBoyOfficial"
|
||||
"hbomberguy"
|
||||
"ContraPoints"
|
||||
"PosyMusic"
|
||||
"RobBubble"
|
||||
"standupmaths"
|
||||
"theCodyReeder"
|
||||
"NileRed"
|
||||
"NileBlue"
|
||||
"TechnologyConnections"
|
||||
"TechnologyConnextras"
|
||||
"simonegiertz"
|
||||
"billwurtz"
|
||||
"MichaelReeves"
|
||||
"williamosman"
|
||||
"iliketomakestuff"
|
||||
"TheB1M"
|
||||
"TomScottGo"
|
||||
"TylerMcVicker1"
|
||||
"WilliamOsman2"
|
||||
"ZackFreedman"
|
||||
"agingwheels"
|
||||
"altf4games"
|
||||
"DIYPerks"
|
||||
"billwurtz"
|
||||
"f4micom"
|
||||
"gabe.follower"
|
||||
"hbomberguy"
|
||||
"iliketomakestuff"
|
||||
"jameshoffmann"
|
||||
"simonegiertz"
|
||||
"stacksmashing"
|
||||
"standupmaths"
|
||||
"styropyro"
|
||||
"theCodyReeder"
|
||||
"williamosman"
|
||||
];
|
||||
in
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,39 @@
|
|||
# Immutable users due to tmpfs
|
||||
users.mutableUsers = false;
|
||||
|
||||
services.postgresql.package = pkgs.postgresql_13;
|
||||
services.postgresql.package = pkgs.postgresql_17_jit;
|
||||
environment.systemPackages = [
|
||||
(
|
||||
let
|
||||
# XXX specify the postgresql package you'd like to upgrade to.
|
||||
# Do not forget to list the extensions you need.
|
||||
newPostgres = pkgs.postgresql_17_jit.withPackages (pp: [
|
||||
# pp.plv8
|
||||
]);
|
||||
cfg = config.services.postgresql;
|
||||
in
|
||||
pkgs.writeScriptBin "upgrade-pg-cluster" ''
|
||||
set -eux
|
||||
# XXX it's perhaps advisable to stop all services that depend on postgresql
|
||||
systemctl stop postgresql
|
||||
|
||||
export NEWDATA="/var/lib/postgresql/${newPostgres.psqlSchema}"
|
||||
export NEWBIN="${newPostgres}/bin"
|
||||
|
||||
export OLDDATA="${cfg.dataDir}"
|
||||
export OLDBIN="${cfg.finalPackage}/bin"
|
||||
|
||||
install -d -m 0700 -o postgres -g postgres "$NEWDATA"
|
||||
cd "$NEWDATA"
|
||||
sudo -u postgres "$NEWBIN/initdb" -D "$NEWDATA" ${lib.escapeShellArgs cfg.initdbArgs}
|
||||
|
||||
sudo -u postgres "$NEWBIN/pg_upgrade" \
|
||||
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
|
||||
--old-bindir "$OLDBIN" --new-bindir "$NEWBIN" \
|
||||
"$@"
|
||||
''
|
||||
)
|
||||
];
|
||||
|
||||
systemd.services.caddy.serviceConfig.EnvironmentFile = config.age.secrets.desec.path;
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue