move old nixos-config over here
This commit is contained in:
parent
346d80ae7e
commit
54baace7c1
35 changed files with 850 additions and 44 deletions
common
48
common/podman.nix
Normal file
48
common/podman.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.shelman.podman;
|
||||
in
|
||||
{
|
||||
options.shelman.podman.enable = mkEnableOption "Podman";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.extraInit = ''
|
||||
if [ -z "$DOCKER_HOST" -a -n "$XDG_RUNTIME_DIR" ]; then
|
||||
export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"
|
||||
fi
|
||||
'';
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
docker-compose
|
||||
podman-compose
|
||||
];
|
||||
|
||||
virtualisation = {
|
||||
containers = {
|
||||
enable = true;
|
||||
storage.settings = {
|
||||
storage = {
|
||||
driver = "overlay";
|
||||
runroot = "/run/containers/storage";
|
||||
graphroot = "/var/lib/containers/storage";
|
||||
rootless_storage_path = "/tmp/containers-$USER";
|
||||
options.overlay.mountopt = "nodev,metacopy=on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
oci-containers.backend = "podman";
|
||||
podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue