mirror of
https://gitlab.com/TECHNOFAB/soonix.git
synced 2025-12-11 22:00:05 +01:00
feat: add nice to have devshellModule to soonix module for easy import
This commit is contained in:
parent
6d8cbdcdec
commit
add807ef89
2 changed files with 13 additions and 4 deletions
|
|
@ -124,6 +124,13 @@ in {
|
||||||
Generated shell hook script for managing all files. (readonly)
|
Generated shell hook script for managing all files. (readonly)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
devshellModule = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
readOnly = true;
|
||||||
|
description = ''
|
||||||
|
Devshell module with automatically configured hooks, just import and you're good to go. (readonly)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
finalFiles = mkOption {
|
finalFiles = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
@ -294,6 +301,10 @@ in {
|
||||||
then generatedShellHook
|
then generatedShellHook
|
||||||
else "";
|
else "";
|
||||||
shellHookFile = pkgs.writeShellScript "shellHook" shellHook;
|
shellHookFile = pkgs.writeShellScript "shellHook" shellHook;
|
||||||
|
devshellModule = {
|
||||||
|
imports = [./devshellModule.nix];
|
||||||
|
config.soonixShellHook = shellHook;
|
||||||
|
};
|
||||||
finalFiles = buildAllFiles allFiles;
|
finalFiles = buildAllFiles allFiles;
|
||||||
# make it simpler to update the hooks without any devshell
|
# make it simpler to update the hooks without any devshell
|
||||||
packages."soonix:update" = pkgs.writeShellScriptBin "soonix:update" ''
|
packages."soonix:update" = pkgs.writeShellScriptBin "soonix:update" ''
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (inputs) pkgs devshell soonix treefmt;
|
inherit (inputs) pkgs devshell treefmt;
|
||||||
soonixShellHook = cell.soonix.shellHook;
|
|
||||||
in {
|
in {
|
||||||
default = devshell.mkShell {
|
default = devshell.mkShell {
|
||||||
imports = [soonix.devshellModule];
|
imports = [cell.soonix.devshellModule];
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.nil
|
pkgs.nil
|
||||||
(treefmt.mkWrapper pkgs {
|
(treefmt.mkWrapper pkgs {
|
||||||
|
|
@ -17,6 +16,5 @@ in {
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
inherit soonixShellHook;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue