diff --git a/modules/common/default.nix b/modules/common/default.nix index 4fe6dc9..fff2cf5 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -4,7 +4,7 @@ let allowedClass = [ "darwin" - "home" + "homeManager" "nixos" ]; @@ -18,16 +18,9 @@ in config = { assertions = [ { - assertion = type != null; + assertion = builtins.elem _class allowedClass; message = '' - You must provide `type` as part of specialArgs to use the common modules. - It must be one of ${allowedClassString}. - ''; - } - { - assertion = type != null -> builtins.elem type allowedClass; - message = '' - `type` specialArgs must be one of ${allowedClassString}. + `_class` specialArgs must be one of ${allowedClassString}. ''; } ]; diff --git a/modules/common/profiles/bluetooth/default.nix b/modules/common/profiles/bluetooth/default.nix index 744864e..e687a4c 100644 --- a/modules/common/profiles/bluetooth/default.nix +++ b/modules/common/profiles/bluetooth/default.nix @@ -8,7 +8,7 @@ in }; config = lib.mkIf cfg.enable (lib.mkMerge [ - (lib.optionalAttrs (_class == "home") { + (lib.optionalAttrs (_class == "homeManager") { my.home.bluetooth.enable = true; }) diff --git a/modules/common/profiles/default.nix b/modules/common/profiles/default.nix index 0421dde..8ce5a3c 100644 --- a/modules/common/profiles/default.nix +++ b/modules/common/profiles/default.nix @@ -1,5 +1,5 @@ # Configuration that spans across system and home, or are almagations of modules -{ config, lib, type, ... }: +{ config, lib, _class, ... }: { imports = [ ./bluetooth @@ -12,7 +12,7 @@ config = lib.mkMerge [ # Transparently enable home-manager profiles as well - (lib.optionalAttrs (type != "home") { + (lib.optionalAttrs (_class != "homeManager") { home-manager.users.${config.my.user.name} = { config = { my = { diff --git a/modules/common/profiles/gtk/default.nix b/modules/common/profiles/gtk/default.nix index e312417..3d2a05f 100644 --- a/modules/common/profiles/gtk/default.nix +++ b/modules/common/profiles/gtk/default.nix @@ -8,7 +8,7 @@ in }; config = lib.mkIf cfg.enable (lib.mkMerge [ - (lib.optionalAttrs (_class == "home") { + (lib.optionalAttrs (_class == "homeManager") { # GTK theme configuration my.home.gtk.enable = true; }) diff --git a/modules/common/profiles/laptop/default.nix b/modules/common/profiles/laptop/default.nix index a469f0e..afced27 100644 --- a/modules/common/profiles/laptop/default.nix +++ b/modules/common/profiles/laptop/default.nix @@ -8,7 +8,7 @@ in }; config = lib.mkIf cfg.enable (lib.mkMerge [ - (lib.optionalAttrs (_class == "home") { + (lib.optionalAttrs (_class == "homeManager") { # Enable battery notifications my.home.power-alert.enable = true; }) diff --git a/modules/common/profiles/wm/default.nix b/modules/common/profiles/wm/default.nix index 4fd81b9..6fb80b3 100644 --- a/modules/common/profiles/wm/default.nix +++ b/modules/common/profiles/wm/default.nix @@ -16,7 +16,7 @@ in config = lib.mkMerge [ (applyWm "i3" [ - (lib.optionalAttrs (_class == "home") { + (lib.optionalAttrs (_class == "homeManager") { # i3 settings my.home.wm.windowManager = "i3"; # Screenshot tool diff --git a/modules/common/profiles/x/default.nix b/modules/common/profiles/x/default.nix index 3f32edc..d70b1e6 100644 --- a/modules/common/profiles/x/default.nix +++ b/modules/common/profiles/x/default.nix @@ -8,7 +8,7 @@ in }; config = lib.mkIf cfg.enable (lib.mkMerge [ - (lib.optionalAttrs (_class == "home") { + (lib.optionalAttrs (_class == "homeManager") { # X configuration my.home.x.enable = true; })