changes :3
This commit is contained in:
parent
c50bfc3eea
commit
0ad695abcf
27 changed files with 1022 additions and 656 deletions
47
modules/home/scripts/default.nix
Normal file
47
modules/home/scripts/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.scripts;
|
||||
in {
|
||||
options.scripts = with types; {
|
||||
enable = mkBoolOpt false "Enable custom scripts";
|
||||
onepassword = {
|
||||
enable = mkBoolOpt false "Enable 1Password search utility";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
(writeShellScriptBin "opsearch" (builtins.readFile ./opsearch.sh))
|
||||
]
|
||||
++ (
|
||||
if cfg.onepassword.enable
|
||||
then
|
||||
with pkgs; [
|
||||
jq
|
||||
wl-clipboard
|
||||
]
|
||||
else []
|
||||
);
|
||||
|
||||
# Ensure the scripts directory exists and copy scripts there
|
||||
home.file = {
|
||||
".local/bin/opsearch.sh" = {
|
||||
source = ./opsearch.sh;
|
||||
executable = true;
|
||||
};
|
||||
|
||||
# Add fish function for 1Password search if fish is enabled
|
||||
".config/fish/functions/ops.fish" = mkIf cfg.onepassword.enable {
|
||||
source = ../shell/fish/functions/ops.fish;
|
||||
executable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue