From cf2e31df21964b97a3413bf0bea2fbf2cadd6413 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 15 Mar 2023 14:05:57 -0400 Subject: [PATCH] Fix option definition --- lib.nix | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/lib.nix b/lib.nix index 4620a30..0880f69 100644 --- a/lib.nix +++ b/lib.nix @@ -1,6 +1,8 @@ # Support code for this repo. This module could be made its own external repo. { self, inputs, config, flake-parts-lib, lib, ... }: let + inherit (flake-parts-lib) + mkPerSystemOption; inherit (lib) types; specialArgsFor = rec { @@ -18,17 +20,23 @@ let in { options = { - nixos-template = types.submodule { - options = { - primary-inputs = lib.mkOption { - type = types.listOf types.str; - default = [ "nixpkgs" "home-manager" "darwin" ]; - description = '' - List of flake inputs to update when running `nix run .#update`. - ''; + perSystem = mkPerSystemOption + ({ config, self', inputs', pkgs, system, ... }: { + options.nixos-template = lib.mkOption { + default = { }; + type = types.submodule { + options = { + primary-inputs = lib.mkOption { + type = types.listOf types.str; + default = [ "nixpkgs" "home-manager" "darwin" "nixos-hardware" ]; + description = '' + List of flake inputs to update when running `nix run .#update`. + ''; + }; + }; + }; }; - }; - }; + }); }; config = { flake = {