feat: scripts
This commit is contained in:
@@ -54,6 +54,7 @@ in
|
|||||||
k9s = enabled;
|
k9s = enabled;
|
||||||
nvim = enabled;
|
nvim = enabled;
|
||||||
pi = enabled;
|
pi = enabled;
|
||||||
|
scripts.plan-disk-burns = enabled;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -70,6 +71,7 @@ in
|
|||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
orca-slicer
|
orca-slicer
|
||||||
|
blender
|
||||||
];
|
];
|
||||||
|
|
||||||
home.pointerCursor = {
|
home.pointerCursor = {
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
echo "plan-disk-burns: placeholder"
|
||||||
|
echo "runtime tools available: smartctl, lsblk"
|
||||||
40
modules/home/programs/terminal/scripts/default.nix
Normal file
40
modules/home/programs/terminal/scripts/default.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{ lib
|
||||||
|
, pkgs
|
||||||
|
, config
|
||||||
|
, namespace
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkEnableOption mapAttrs' mapAttrsToList nameValuePair filterAttrs;
|
||||||
|
cfg = config.${namespace}.programs.terminal.scripts;
|
||||||
|
|
||||||
|
# Script Registry - Each entry declares its runtime dependencies. The script
|
||||||
|
# source lives in ./bin/<name>.sh and is exposed on PATH as <name> when enabled.
|
||||||
|
# Add a script by dropping ./bin/<name>.sh and a one-line entry here, e.g.:
|
||||||
|
# scriptDefs = {
|
||||||
|
# plan-disk-burns = { runtimeInputs = with pkgs; [ smartmontools util-linux ]; };
|
||||||
|
# my-new-thing = { runtimeInputs = with pkgs; [ jq curl ]; };
|
||||||
|
# };
|
||||||
|
scriptDefs = {
|
||||||
|
plan-disk-burns = { runtimeInputs = with pkgs; [ smartmontools util-linux ]; };
|
||||||
|
};
|
||||||
|
|
||||||
|
mkScript = name: def:
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
inherit name;
|
||||||
|
runtimeInputs = def.runtimeInputs or [ ];
|
||||||
|
text = builtins.readFile (./bin + "/${name}.sh");
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.${namespace}.programs.terminal.scripts =
|
||||||
|
mapAttrs'
|
||||||
|
(name: _: nameValuePair name { enable = mkEnableOption name; })
|
||||||
|
scriptDefs;
|
||||||
|
|
||||||
|
config = {
|
||||||
|
home.packages =
|
||||||
|
mapAttrsToList (name: def: mkScript name def)
|
||||||
|
(filterAttrs (name: _: cfg.${name}.enable) scriptDefs);
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user