a flake module to ease creating and managing multiple hosts in your nix flake.

feat: use lazy types for specialArgs

+9 -6
+9 -6
flake-module.nix
··· 16 ; 17 18 cfg = config.easyHosts; 19 in 20 { 21 options = { ··· 38 modules = mkOption { 39 # we really expect a list of paths but i want to accept lists of lists of lists and so on 40 # since they will be flattened in the final function that applies the settings 41 - type = types.listOf types.anything; 42 default = [ ]; 43 }; 44 45 specialArgs = mkOption { 46 - type = types.attrs; 47 default = { }; 48 }; 49 }; ··· 57 types.submodule { 58 options = { 59 modules = mkOption { 60 - type = types.listOf types.anything; 61 default = [ ]; 62 }; 63 64 specialArgs = mkOption { 65 - type = types.attrs; 66 default = { }; 67 }; 68 }; ··· 120 }; 121 122 modules = mkOption { 123 - type = types.listOf types.anything; 124 default = [ ]; 125 }; 126 127 specialArgs = mkOption { 128 - type = types.attrs; 129 default = { }; 130 }; 131 };
··· 16 ; 17 18 cfg = config.easyHosts; 19 + 20 + modulesType = types.listOf types.anything; 21 + specialArgsType = types.lazyAttrsOf types.raw; 22 in 23 { 24 options = { ··· 41 modules = mkOption { 42 # we really expect a list of paths but i want to accept lists of lists of lists and so on 43 # since they will be flattened in the final function that applies the settings 44 + type = modulesType; 45 default = [ ]; 46 }; 47 48 specialArgs = mkOption { 49 + type = specialArgsType; 50 default = { }; 51 }; 52 }; ··· 60 types.submodule { 61 options = { 62 modules = mkOption { 63 + type = modulesType; 64 default = [ ]; 65 }; 66 67 specialArgs = mkOption { 68 + type = specialArgsType; 69 default = { }; 70 }; 71 }; ··· 123 }; 124 125 modules = mkOption { 126 + type = modulesType; 127 default = [ ]; 128 }; 129 130 specialArgs = mkOption { 131 + type = specialArgsType; 132 default = { }; 133 }; 134 };