pkgs/run-with-docker-group: Add script
This commit is contained in:
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" \
|
||||
"$@"
|
Reference in New Issue
Block a user