From f8e270322582f50049a5415e1ef3d7d45727bbf3 Mon Sep 17 00:00:00 2001 From: Antonio Gurgel Date: Wed, 24 Jul 2024 21:11:51 -0700 Subject: [PATCH] s/user/userData "user" alone is too ambiguous for a variable name. --- README.rst | 14 +++++++------- default.nix | 2 +- flake.nix | 4 ++-- src/mk.nix | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index d2f595b..e4352ef 100644 --- a/README.rst +++ b/README.rst @@ -108,7 +108,7 @@ This is a module that defines a *service derivation*: .. code-block:: nix - { charts, lib, user, ... }: { # I + { charts, lib, userData, ... }: { # I builder = lib.builders.helmChart; # I2; O1 args = { # < - - - - - - - - - - - O2 chart = charts.jetstack.cert-manager; # I1 @@ -129,8 +129,8 @@ This is a module that defines a *service derivation*: { apiVersion = "cert-manager.io/v1"; kind = "ClusterIssuer"; - metadata.name = user.vars.k8sCert.name; # I3 - spec.ca.secretName = user.vars.k8sCert.name; + metadata.name = userData.vars.k8sCert.name; # I3 + spec.ca.secretName = userData.vars.k8sCert.name; } ]; } @@ -312,7 +312,7 @@ These functions are only available outside of service modules. mkDerivation ------------ -``{charts, user?} +``{charts, userData?} -> {pname, version, src, serviceRoot, nsMetadata?, kubeVersion?, apiVersions?} -> `` @@ -321,7 +321,7 @@ The main interface to Turboprop. The first attrset instantiates the derivation builder: - **charts** (attrs): A tree of Helm chart derivations. -- **user** (attrs, default: ``{}``): Additional data to be used by the service modules. +- **userData** (attrs, default: ``{}``): Additional data to be used by the service modules. The second attrset specifies the derivation to build: @@ -466,7 +466,7 @@ Other signatures Service (unbuilt) ----------------- -``{name, namespace, charts?, lib?, pkgs?, user?} -> {builder, args, extraObjects?}`` +``{name, namespace, charts?, lib?, pkgs?, userData?} -> {builder, args, extraObjects?}`` A service module as defined in your flake. @@ -475,7 +475,7 @@ Input attrset, of which any of its attributes may be omitted if unused: - **charts** (attrs): A tree of Helm chart derivations. - **lib** (attrs): Turboprop library. - **pkgs** (attrs): Nixpkgs. -- **user** (attrs): Additional data for the service module. +- **userData** (attrs): Additional data for the service module. Output attrset: diff --git a/default.nix b/default.nix index d101563..dfa3513 100644 --- a/default.nix +++ b/default.nix @@ -3,7 +3,7 @@ haumea, lib, pkgs, - user, + userData, } @ inputs: let mk = import src/mk.nix inputs; in { diff --git a/flake.nix b/flake.nix index b1c96ea..6545a57 100644 --- a/flake.nix +++ b/flake.nix @@ -45,10 +45,10 @@ lib = lib // { mkDerivation = { charts, - user ? {}, + userData ? {}, }: (import self { - inherit charts haumea lib pkgs user; + inherit charts haumea lib pkgs userData; }) .mkDerivation; diff --git a/src/mk.nix b/src/mk.nix index 7104e6d..0be7303 100644 --- a/src/mk.nix +++ b/src/mk.nix @@ -3,10 +3,10 @@ haumea, lib, pkgs, - user, + userData, }: let # This is a Haumea loader that transforms unbuilt service modules: - # {charts, lib, pkgs, user, ...} -> {builder, args} + # {charts, lib, pkgs, userData, ...} -> {builder, args} # into almost-built modules: # {kubeVersion, apiVersions} -> {out, extra} # @@ -16,7 +16,7 @@ charts, lib, pkgs, - user, + userData, ... } @ inputs: p: let srcPath = @@ -64,7 +64,7 @@ in { }: let modules = haumea.lib.load { src = serviceRoot; - inputs = {inherit charts lib pkgs user;}; + inputs = {inherit charts lib pkgs userData;}; loader = serviceLoader; transformer = lib.liftDefault; };