Skip to content

Overriding nixpkgs.config with IHP flake-parts Module System #2116

@Montmorency

Description

@Montmorency

Trying to build ihp is failing on MacOs Monterey However this causes an error:

error: Package ‘postgresql-test-hook’ in /nix/store/8han14lkbind4nx63hqq3i2sv6fbqiy5-source/pkgs/build-support/trivial-builders/default.nix:80 is marked as broken, refusing to evaluate.

Per flake-parts I'm trying to update the top level nixpkgs config to 'allowBroken':

  outputs = inputs@{ self, nixpkgs, ihp, flake-parts, systems, ... }:
    let
      sshAlias = "app-prod";
      appName = "app";
    in
      flake-parts.lib.mkFlake { inherit inputs; } {
        debug = true;
        systems = import systems;
        # Here is the module system.
        imports = [
            ihp.flakeModules.default
                  ];

        # Custom configuration to add CFLAGS
        perSystem = { pkgs, config, system, ... }: {
          #ALLOW BROKEN across all per system definitions of pkgs.
          _module.args.pkgs = import inputs.nixpkgs {
               inherit system;
               config = {
                 allowBroken = true;
               };
          };

However this is causing issue

error: The option `perSystem.x86_64-darwin._module.args.pkgs' is defined multiple times while it's expected to be unique.

I can see it is defined here upstream flake-module.nix:

_module.args.pkgs = import inputs.nixpkgs { inherit system; overlays = config.devenv.shells.default.overlays; config = { }; };

Is there a way of passing in app level flake config to this top level function or do we need to add a perSystemOption to the ihp.flakeModules.default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions