Link docker credentials.
This commit is contained in:
parent
c0afe006b8
commit
ed11bf1e65
@ -56,6 +56,32 @@
|
||||
# };
|
||||
};
|
||||
|
||||
systemd.services.link-docker-creds = {
|
||||
# Contains credentials so it cannot be added to the nix store
|
||||
enable = true;
|
||||
description = "link-docker-creds";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "multi-user.target" ];
|
||||
after = [ "multi-user.target" ];
|
||||
# path = with pkgs; [
|
||||
# zfs
|
||||
# ];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = "yes";
|
||||
};
|
||||
script = ''
|
||||
if [ -e /persist/manual/docker/config.json ]; then
|
||||
install --directory --owner talexander --group talexander --mode 0700 /home/talexander/.docker
|
||||
ln -s /persist/manual/docker/config.json /home/talexander/.docker/config.json
|
||||
fi
|
||||
'';
|
||||
preStop = ''
|
||||
rm -f /home/talexander/.docker/config.json
|
||||
'';
|
||||
};
|
||||
|
||||
# Needed for non-rootless docker
|
||||
users.users.talexander.extraGroups = [ "docker" ];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user