nix/overlay: add posh and use podman/conman from master

This commit is contained in:
steveej 2019-11-28 01:02:39 +01:00
parent 1c84c702d0
commit 352a0ed5e1

View file

@ -23,15 +23,9 @@ in {
'';
};
podman = nixpkgs-master.podman;
conmon = nixpkgs-master.conmon;
duplicacy = super.callPackage ./pkgs/duplicacy {};
just = super.callPackage ./pkgs/just.nix {};
mfcl3770cdw = super.callPackage ./pkgs/mfcl3770cdw.nix {};
slirp4netns = super.callPackage ./pkgs/slirp4netns.nix {};
staruml = super.callPackage ./pkgs/staruml.nix { inherit (super.gnome2) GConf; libgcrypt = super.libgcrypt_1_5; };
roxterm = super.stdenv.mkDerivation {
@ -76,4 +70,35 @@ in {
facetimehd-firmware = super.hello;
qtile = nixpkgs-master.qtile;
inherit (nixpkgs-master) podman conmon slirp4netns;
# posh makes use of podman to run an encapsulated shell session
posh = { image, pull ? "always", global_args ? "", run_args ? "" }:
(super.writeScriptBin "posh" ''
#! ${super.bash}/bin/bash
source /etc/profile
tty -s && tty="-t" || quiet="-q"
POSH_IMAGE=${image}
POSH_PULL=${pull}
if [ "$1" == "-c" ]; then
# we've most likely been spawned by sshd
# $2 contains the command string
shift
# TODO: make the variables overridable via the command_string
fi
exec ${self.podman}/bin/podman \
${global_args} run --rm -i $tty -v ~/:/root -w /root --pull=always --network host --pull=''${POSH_PULL} \
${run_args} ''${POSH_IMAGE} $@
'')
.overrideAttrs(attrs: attrs // {
passthru = {
shellPath = "/bin/posh";
};
});
}