From 40b41d3b7b950e3a05c0059bf0fd3a37b4ed1c7b Mon Sep 17 00:00:00 2001 From: Joscha Loos Date: Mon, 10 Oct 2022 23:56:32 +0200 Subject: [PATCH] feat: add support for docker-rootless --- nixos-module.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos-module.nix b/nixos-module.nix index ba0abce..688a540 100644 --- a/nixos-module.nix +++ b/nixos-module.nix @@ -28,7 +28,7 @@ let _systemd = mkOption { internal = true; }; }; config = - let config = { + let service = { wantedBy = [ "multi-user.target" ]; after = [ "sockets.target" ]; @@ -37,7 +37,7 @@ let cfg.docker.client.package ]; environment.ARION_PREBUILT = config.settings.out.dockerComposeYaml; - # environment.DOCKER_HOST = "unix://$XDG_RUNTIME_DIR/docker.sock"; + environment.DOCKER_HOST = mkIf (cfg.backend == "docker-rootless") "unix:///run/user/1000/docker.sock"; script = '' echo 1>&2 "docker compose file: $ARION_PREBUILT" arion --prebuilt-file "$ARION_PREBUILT" up @@ -45,9 +45,9 @@ let }; in if cfg.backend == "docker-rootless" then - { _systemd.user.services."arion-${name}" = config; } + { _systemd.user.services."arion-${name}" = service; } else - { _systemd.services."arion-${name}" = config; }; + { _systemd.services."arion-${name}" = service; }; }; arionSettingsType = name: