From 3cd35f78308fc2276873aad28f1c1f63f7a2ed9a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Wed, 28 Aug 2024 21:19:12 +0200 Subject: [PATCH] nixos/virtualisation.docker.rootless: remove `with lib;` --- .../virtualisation/docker-rootless.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/virtualisation/docker-rootless.nix b/nixos/modules/virtualisation/docker-rootless.nix index bad9136afd29..15b9f16eefef 100644 --- a/nixos/modules/virtualisation/docker-rootless.nix +++ b/nixos/modules/virtualisation/docker-rootless.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.virtualisation.docker.rootless; @@ -15,8 +12,8 @@ in ###### interface options.virtualisation.docker.rootless = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' This option enables docker in a rootless mode, a daemon that manages @@ -25,8 +22,8 @@ in ''; }; - setSocketVariable = mkOption { - type = types.bool; + setSocketVariable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Point {command}`DOCKER_HOST` to rootless Docker instance for @@ -34,7 +31,7 @@ in ''; }; - daemon.settings = mkOption { + daemon.settings = lib.mkOption { type = settingsFormat.type; default = { }; example = { @@ -47,15 +44,15 @@ in ''; }; - package = mkPackageOption pkgs "docker" { }; + package = lib.mkPackageOption pkgs "docker" { }; }; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; - environment.extraInit = optionalString cfg.setSocketVariable '' + environment.extraInit = lib.optionalString cfg.setSocketVariable '' if [ -z "$DOCKER_HOST" -a -n "$XDG_RUNTIME_DIR" ]; then export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/docker.sock" fi