pkgs/run-with-docker-group: Add script
This commit is contained in:
parent
43d2172fa7
commit
a6a87883ee
@ -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;
|
||||||
|
@ -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 {};
|
||||||
|
6
pkgs/run-with-docker-group/default.nix
Normal file
6
pkgs/run-with-docker-group/default.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "run-with-docker-group";
|
||||||
|
text = builtins.readFile ./run-with-docker-group.sh;
|
||||||
|
}
|
14
pkgs/run-with-docker-group/run-with-docker-group.sh
Executable file
14
pkgs/run-with-docker-group/run-with-docker-group.sh
Executable 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" \
|
||||||
|
"$@"
|
Loading…
Reference in New Issue
Block a user