From d1137429055b7cd67ebf6d3438eb6880d9b0de84 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 3 Jan 2024 16:50:05 +0000 Subject: [PATCH] nixos: home: import common modules --- modules/common/default.nix | 4 ++-- modules/nixos/home/default.nix | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/common/default.nix b/modules/common/default.nix index d0c90de..cb06c9e 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -3,9 +3,9 @@ { lib, type ? null, ... }: let allowedTypes = [ - "nixos" - "home" "darwin" + "home" + "nixos" ]; allowedTypesString = lib.concatStringSep ", " (builtins.map lib.escapeNixString allowedTypes); diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix index fe00704..071509b 100644 --- a/modules/nixos/home/default.nix +++ b/modules/nixos/home/default.nix @@ -13,16 +13,23 @@ in config = lib.mkIf cfg.enable { home-manager = { - # Not a fan of out-of-directory imports, but this is a good exception - users.${config.my.user.name} = import "${inputs.self}/modules/home"; + users.${config.my.user.name} = { + # Not a fan of out-of-directory imports, but this is a good exception + imports = [ + "${inputs.self}/modules/common" + "${inputs.self}/modules/home" + ]; + }; # Nix Flakes compatibility useGlobalPkgs = true; useUserPackages = true; - # Forward inputs to home-manager configuration extraSpecialArgs = { + # Forward inputs to home-manager configuration inherit inputs; + # For consumption by common modules + type = "home"; }; }; };