feat: make soonix a bit more flexible with and without devshell

This commit is contained in:
technofab 2025-09-02 14:21:53 +02:00
parent 3baef660cf
commit 690332ceea
No known key found for this signature in database
6 changed files with 106 additions and 37 deletions

View file

@ -7,17 +7,30 @@
inherit (lib) mkOption types;
soonixModule = ./module.nix;
in {
options.soonix = mkOption {
type = types.submodule {
# propagate pkgs to the soonix module
_module.args.pkgs = pkgs;
imports = [soonixModule];
options = {
soonix = mkOption {
type = types.submodule {
# propagate pkgs to the soonix module
_module.args.pkgs = pkgs;
imports = [soonixModule];
};
default = {};
};
soonixShellHook = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Set the shell hook manually, useful if you already use `soonix.make` and
want to add the devshell integration.
'';
};
default = {};
};
config.enterShellCommands.soonix = {
text = config.soonix.shellHook;
text =
if config.soonixShellHook != null
then config.soonixShellHook
else config.soonix.shellHook;
deps = ["env"];
};
}