1
0

pkgs/run-with-docker-group: Add script

This commit is contained in:
clerie 2024-08-05 09:59:33 +02:00
parent 43d2172fa7
commit a6a87883ee
4 changed files with 22 additions and 0 deletions

View File

@ -131,6 +131,7 @@
nixfiles-generate-backup-secrets nixfiles-generate-backup-secrets
nixfiles-update-ssh-host-keys nixfiles-update-ssh-host-keys
print-afra print-afra
run-with-docker-group
ssh-gpg ssh-gpg
update-from-hydra update-from-hydra
uptimestatus; uptimestatus;

View File

@ -16,6 +16,7 @@ final: prev: {
nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {}; nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {};
nixfiles-update-ssh-host-keys = final.callPackage ./nixfiles/nixfiles-update-ssh-host-keys.nix {}; nixfiles-update-ssh-host-keys = final.callPackage ./nixfiles/nixfiles-update-ssh-host-keys.nix {};
print-afra = final.callPackage ./print-afra {}; print-afra = final.callPackage ./print-afra {};
run-with-docker-group = final.callPackage ./run-with-docker-group {};
ssh-gpg = final.callPackage ./ssh-gpg {}; ssh-gpg = final.callPackage ./ssh-gpg {};
update-from-hydra = final.callPackage ./update-from-hydra {}; update-from-hydra = final.callPackage ./update-from-hydra {};
uptimestatus = final.python3.pkgs.callPackage ./uptimestatus {}; uptimestatus = final.python3.pkgs.callPackage ./uptimestatus {};

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
pkgs.writeShellApplication {
name = "run-with-docker-group";
text = builtins.readFile ./run-with-docker-group.sh;
}

View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -eq 0 ]]; then
set -- "${SHELL}"
fi
exec systemd-run \
"--property=User=$(id -un)" \
"--property=SupplementaryGroups=docker" \
"--pty" "--same-dir" "--wait" "--collect" "--service-type=exec" \
"--quiet" \
"$@"