-
-
Save grahamc/4ee2456d0a0b80a5496e6137bb9ac18b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
let | |
zfs = if config.boot.zfs.enableUnstable | |
then pkgs.zfsUnstable | |
else pkgs.zfs; | |
user = "buildkite-agent-pgloadndump"; | |
in { | |
systemd.paths.pgloadndump-trigger-mount = { | |
wantedBy = [ "multi-user.target" ]; | |
pathConfig = { | |
PathModified = "${config.users.users."${user}".home}/load-n-dump-trigger-mount"; | |
}; | |
}; | |
systemd.services.pgloadndump-trigger-mount = { | |
serviceConfig = { | |
Type = "oneshot"; | |
}; | |
path = [ zfs ]; | |
# Write out the buildkite token | |
# Then, allocate an approle / secret ID login token | |
script = '' | |
set -eux | |
zfs mount rpool/scratch/haumea-load-and-dump/target | |
chown -R "${user}" /rpool/scratch/haumea-load-and-dump/target | |
''; | |
}; | |
systemd.paths.pgloadndump-trigger-unmount = { | |
wantedBy = [ "multi-user.target" ]; | |
pathConfig = { | |
PathModified = "${config.users.users."${user}".home}/load-n-dump-trigger-unmount"; | |
}; | |
}; | |
systemd.services.pgloadndump-trigger-unmount = { | |
serviceConfig = { | |
Type = "oneshot"; | |
}; | |
path = [ zfs ]; | |
# Write out the buildkite token | |
# Then, allocate an approle / secret ID login token | |
script = '' | |
zfs unmount rpool/scratch/haumea-load-and-dump/target | |
''; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment