From c82c619f1eaa040dae3405b73c4403d9c4ec1295 Mon Sep 17 00:00:00 2001 From: lucasew Date: Fri, 29 Jan 2021 11:17:41 -0300 Subject: [PATCH] root option: add home-manager.sharedModules This option is a list of modules shared among all users to avoid importing the same modules for every user manually. --- nixos/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/default.nix b/nixos/default.nix index 6645b9068c0a..0a1f8c31bfe0 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -34,6 +34,7 @@ let home.homeDirectory = config.users.users.${name}.home; }; }) + ({ ... }: { imports = cfg.sharedModules; }) ]; }; @@ -65,6 +66,15 @@ in { ''; }; + sharedModules = mkOption { + type = types.listOf types.path; + default = [ ]; + example = [ /path/to/module.nix ]; + description = '' + Shared home-manager modules among all users + ''; + }; + verbose = mkEnableOption "verbose output on activation"; users = mkOption {