summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2023-09-16 18:12:59 +0200
committerquentin@aristote.fr <quentin@aristote.fr>2023-09-16 22:48:40 +0200
commit7cbe29e8647e9b14c400af9bbf2b45b79b5f2f1c (patch)
tree3c374b36313d54af99c3662cc8adc4451beee1d0 /modules
parentad875ddb0dc561d37a4ca784827e104371737776 (diff)
modules: devenv: improve method to auto-import module in all shells
Diffstat (limited to 'modules')
-rw-r--r--modules/flake-parts/devenv.nix23
-rw-r--r--modules/flake-parts/personal.nix3
2 files changed, 26 insertions, 0 deletions
diff --git a/modules/flake-parts/devenv.nix b/modules/flake-parts/devenv.nix
new file mode 100644
index 0000000..bdc40b1
--- /dev/null
+++ b/modules/flake-parts/devenv.nix
@@ -0,0 +1,23 @@
+devenvModules: {
+ flake-parts-lib,
+ lib,
+ inputs,
+ ...
+}: {
+ imports = [inputs.devenv.flakeModule];
+
+ options.perSystem = flake-parts-lib.mkPerSystemOption {
+ options.devenv.shells = lib.mkOption {
+ type = with lib.types;
+ lazyAttrsOf (submoduleWith {
+ modules = builtins.attrValues devenvModules;
+ shorthandOnlyDefinesConfig = null;
+ });
+ };
+ };
+
+ # the extra parameter before the module make this module behave like an
+ # anonymous module, so we need to manually identify the file, for better
+ # error messages, docs, and deduplication.
+ _file = __curPos.file;
+}
diff --git a/modules/flake-parts/personal.nix b/modules/flake-parts/personal.nix
new file mode 100644
index 0000000..370e176
--- /dev/null
+++ b/modules/flake-parts/personal.nix
@@ -0,0 +1,3 @@
+{
+ systems = ["x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
+}