From 5e259eb312e19f1a961fae9e3d971f15567f2c0d Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 30 Oct 2022 07:01:01 -0400 Subject: [PATCH] devShells: Use mkTransposedPerSystemModule --- modules/devShells.nix | 45 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/modules/devShells.nix b/modules/devShells.nix index ecc53b3..7ebbeb6 100644 --- a/modules/devShells.nix +++ b/modules/devShells.nix @@ -1,45 +1,22 @@ { config, lib, flake-parts-lib, ... }: let inherit (lib) - filterAttrs - mapAttrs mkOption - optionalAttrs types ; inherit (flake-parts-lib) - mkSubmoduleOptions - mkPerSystemOption + mkTransposedPerSystemModule ; in -{ - options = { - flake = mkSubmoduleOptions { - devShells = mkOption { - type = types.lazyAttrsOf (types.lazyAttrsOf types.package); - default = { }; - description = '' - Per system an attribute set of packages used as shells. - nix develop .#<name> will run devShells.<system>.<name>. - ''; - }; - }; - - perSystem = mkPerSystemOption - ({ config, system, ... }: { - options = { - devShells = mkOption { - type = types.lazyAttrsOf types.package; - default = { }; - description = '' - An attribute set of packages to be built by nix develop .#<name>. - nix build .#<name> will run devShells.<name>. - ''; - }; - }; - }); - }; - config = { - transposition.devShells = { }; +mkTransposedPerSystemModule { + name = "devShells"; + option = mkOption { + type = types.lazyAttrsOf types.package; + default = { }; + description = '' + An attribute set of packages to be built by nix develop .#<name>. + nix build .#<name> will run devShells.<name>. + ''; }; + file = ./devShells.nix; }