snowfallorg / snowfallorg/lib

`_modules.args` is not respected

Open
#188 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Nix
Stars
628
Forks
64
PR merge metrics
No merged PRs in 30d

Description

I am not sure why, but values from _module.args cannot be accessed by modules in modules/nixos

Placing this module in modules/nixos

{ lib, config, ... }@options:
{
  time.timeZone =
    let
      log-options = lib.trace (lib.attrNames options);
      log-module-args = lib.trace (lib.attrNames config._module.args);
    in
    log-options log-module-args "UTC";
}

and then running nix eval .#nixosConfigurations.my-system.config.system.build.toplevel gives this result

# modules get these arguments
trace: [ "_class" "_prefix" "channel" "config" "format" "host" "inputs" "lib" "modulesPath" "namespace" "nixpkgsModulesPath" "options" "pkgs" "specialArgs" "system" "systems" "target" "virtual" ]
# but there are also these arguments in `_module.args`
trace: [ "baseModules" "extendModules" "extraModules" "inputs" "moduleType" "modules" "noUserModules" "pkgs" "utils" ]

As we can see, nothing except inputs and pkgs is passed to the modules

mre.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the module setup under modules/nixos and reproduce the reported behavior using the provided MRE and nix eval command. Compare the arguments exposed to modules with config._module.args, then verify that the intended _module.args values are available to NixOS modules without losing the existing behavior.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.