From 5b2947cc9f7504ef2c7b52dc562b4c0677794aa7 Mon Sep 17 00:00:00 2001 From: Assil Ksiksi Date: Mon, 6 Nov 2023 23:12:15 -0500 Subject: [PATCH] use path instead of pathInStore --- flake.nix | 18 +++++++++--------- templates/container.nix.tmpl | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 1c94f14..51b512d 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,7 @@ options.compose2nix = { # https://nixos.org/manual/nixos/stable/#sec-option-declarations paths = mkOption { - type = types.listOf types.pathInStore; + type = types.listOf types.path; description = lib.mdDoc "One or more paths to Docker Compose files."; }; runtime = mkOption { @@ -64,7 +64,7 @@ env = mkOption { type = types.attrsOf types.str; default = {}; - description = lib.mdDoc "Environment variables. These will be merged with environment files, if any."; + description = lib.mdDoc "Environment to use. Note that these will be merged with environment files, if any."; }; envFiles = mkOption { type = types.listOf types.path; @@ -74,18 +74,18 @@ envFilesOnly = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Only include env files in the output Nix file."; + description = lib.mdDoc "Only include env files in the output Nix file. Useful in cases where env variables contain secrets."; + }; + serviceInclude = mkOption { + type = types.str; + default = ""; + description = lib.mdDoc "Regex pattern for Docker Compose services to include."; }; autoStart = mkOption { type = types.bool; default = true; description = lib.mdDoc "Auto-start all containers."; }; - serviceInclude = mkOption { - type = types.bool; - default = ""; - description = lib.mdDoc "Regex pattern for Docker Compose services to include."; - }; }; configs = mkIf (cfg.paths != []) { compose2nix = { @@ -100,8 +100,8 @@ -project_separator='${cfg.projectSeparator}' \ -env_files='${concatStringsSep "," cfg.envFiles}' \ -env_files_only=${cfg.envFilesOnly} \ - -auto_start=${cfg.autoStart} \ -service_include='${cfg.serviceInclude}' \ + -auto_start=${cfg.autoStart} \ -output=$out ''; }; diff --git a/templates/container.nix.tmpl b/templates/container.nix.tmpl index ffb82df..4d41e71 100644 --- a/templates/container.nix.tmpl +++ b/templates/container.nix.tmpl @@ -13,7 +13,7 @@ virtualisation.oci-containers.containers."{{.Name}}" = { {{- if .EnvFiles}} environmentFiles = [ {{- range .EnvFiles}} - "${./{{.}}}" + "{{.}}" {{- end}} ]; {{- end}}