diff --git a/modules/apps.nix b/modules/apps.nix index 0fd5d7c..e395238 100644 --- a/modules/apps.nix +++ b/modules/apps.nix @@ -15,7 +15,9 @@ let }; getExe = x: - "${lib.getBin x}/bin/${x.meta.mainProgram or (throw ''Package ${x.name or ""} does not have meta.mainProgram set, so I don't know how to find the main executable. You can set meta.mainProgram, or pass the full path to executable, e.g. program = "''${pkg}/bin/foo"'')}"; + "${lib.getBin x}/bin/${x.meta.mainProgram or (throw + ''Package ${x.name or ""} does not have meta.mainProgram set, so I don't know how to find the main executable. You can set `meta.mainProgram`, or pass the full path to executable, e.g. program = "''${pkg}/bin/foo"'' + )}"; appType = lib.types.submodule { options = { diff --git a/modules/moduleWithSystem.nix b/modules/moduleWithSystem.nix index e5c7008..bd739cc 100644 --- a/modules/moduleWithSystem.nix +++ b/modules/moduleWithSystem.nix @@ -9,13 +9,14 @@ let system = config._module.args.system or - config._module.args.pkgs.stdenv.hostPlatform.system or - (throw "moduleWithSystem: Could not determine the configuration's system parameter for this module system application."); + config._module.args.pkgs.stdenv.hostPlatform.system or (throw + "moduleWithSystem: Could not determine the `system` parameter for this module set evaluation." + ); allArgs = withSystem system (args: args); lazyArgsPerParameter = f: builtins.mapAttrs - (k: v: allArgs.${k} or (throw "moduleWithSystem: module argument `${k}` does not exist.")) + (k: v: allArgs.${k} or (throw "moduleWithSystem: per-system argument `${k}` does not exist.")) (builtins.functionArgs f); # Use reflection to make the call lazy in the argument. diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 44df915..730af49 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -13,11 +13,13 @@ # { config = { - perSystem = { inputs', lib, ... }: { + perSystem = { inputs', lib, options, ... }: { config = { _module.args.pkgs = lib.mkOptionDefault ( builtins.seq - (inputs'.nixpkgs or (throw "flake-parts: The flake does not have a `nixpkgs` input. Please add it, or set `perSystem._module.args.pkgs` yourself.")) + inputs'.nixpkgs or (throw + "flake-parts: The flake does not have a `nixpkgs` input. Please add it, or set `${options._module.args}.pkgs` yourself." + ) inputs'.nixpkgs.legacyPackages ); };