From fedfd430f96695997b3eaf8d7e82ca79406afa23 Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Thu, 25 Mar 2021 19:01:16 -0700 Subject: [PATCH] nixos/nix-darwin: switch sharedModules type to anything with custom check (#1880) functionTo tries to evaluate functions too quickly and prevents modules from accessing pkgs argument. fixes #1878. Co-authored-by: Pacman99 --- nix-darwin/default.nix | 6 +++++- nixos/default.nix | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nix-darwin/default.nix b/nix-darwin/default.nix index 83e0ba31..9e37f358 100644 --- a/nix-darwin/default.nix +++ b/nix-darwin/default.nix @@ -68,7 +68,11 @@ in }; sharedModules = mkOption { - type = with types; listOf (oneOf [ attrs (functionTo attrs) path ]); + type = with types; + listOf (anything // { + inherit (submodule { }) check; + description = "Home Manager modules"; + }); default = [ ]; example = literalExample "[ { home.packages = [ nixpkgs-fmt ]; } ]"; description = '' diff --git a/nixos/default.nix b/nixos/default.nix index 4b58d154..61f3eb8d 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -75,7 +75,11 @@ in { }; sharedModules = mkOption { - type = with types; listOf (oneOf [ attrs (functionTo attrs) path ]); + type = with types; + listOf (anything // { + inherit (submodule { }) check; + description = "Home Manager modules"; + }); default = [ ]; example = literalExample "[ { home.packages = [ nixpkgs-fmt ]; } ]"; description = ''