From 9cd81e58804d2f0babd151a8a6d02a7bdd8a1f1d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 10 May 2024 16:02:32 +0800 Subject: [PATCH] home-manager/state: init module --- modules/home-manager/_private/default.nix | 1 + modules/home-manager/_private/state.nix | 37 +++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 modules/home-manager/_private/state.nix diff --git a/modules/home-manager/_private/default.nix b/modules/home-manager/_private/default.nix index 0f180cfc..ea8ac78f 100644 --- a/modules/home-manager/_private/default.nix +++ b/modules/home-manager/_private/default.nix @@ -1,6 +1,7 @@ { imports = [ ./extra-arguments.nix + ./state.nix ./suites/desktop.nix ./suites/dev.nix ./suites/editors.nix diff --git a/modules/home-manager/_private/state.nix b/modules/home-manager/_private/state.nix new file mode 100644 index 00000000..ba5d0a73 --- /dev/null +++ b/modules/home-manager/_private/state.nix @@ -0,0 +1,37 @@ +{ lib, ... }: + +{ + options.state = lib.mkOption { + type = lib.types.submodule { + freeformType = with lib.types; attrsOf anything; + options = { + ignoreDirectories = lib.mkOption { + type = with lib.types; listOf str; + description = '' + A state variable holding a list of directory names to be excluded + in processes involving walking through directories (e.g., desktop + indexing). + ''; + default = [ ]; + example = [ + "node_modules" + ".direnv" + ]; + }; + }; + }; + description = '' + A set of values to be held in the home-manager configuration. Pretty much + used for anything that requires consistency or deduplicate the source of + truth for module values. + ''; + example = { + sampleValue = 10; + dev.ignoreDirectories = [ + ".git" + "node_modules" + ".direnv" + ]; + }; + }; +}