Create scripts to add to and edit daily todo files
All checks were successful
/ check (push) Successful in 1m21s
All checks were successful
/ check (push) Successful in 1m21s
This commit is contained in:
parent
3a8388b09f
commit
24fc8e6845
7 changed files with 66 additions and 0 deletions
|
@ -37,6 +37,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
todos.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
todos.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
./ranger.nix
|
./ranger.nix
|
||||||
./scripts
|
./scripts
|
||||||
./starship.nix
|
./starship.nix
|
||||||
|
./todos.nix
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
./tmux-sessionizer.nix
|
./tmux-sessionizer.nix
|
||||||
./zsh
|
./zsh
|
||||||
|
|
36
modules/home-manager/cli/todos.nix
Normal file
36
modules/home-manager/cli/todos.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
name = "todos";
|
||||||
|
cfg = config.cli.${name};
|
||||||
|
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.cli.${name} = {
|
||||||
|
enable = lib.mkEnableOption "Enable ${name}";
|
||||||
|
|
||||||
|
directory = mkOption {
|
||||||
|
default = "${config.xdg.userDirs.documents}/todos";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
todos-add
|
||||||
|
todos-edit
|
||||||
|
];
|
||||||
|
|
||||||
|
sessionVariables = {
|
||||||
|
TODOS_DIRECTORY = cfg.directory;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -12,6 +12,8 @@ in
|
||||||
displayselect = callPackage ./displayselect { };
|
displayselect = callPackage ./displayselect { };
|
||||||
notes = callPackage ./notes { };
|
notes = callPackage ./notes { };
|
||||||
passmenu-otp = callPackage ./passmenu-otp.nix { };
|
passmenu-otp = callPackage ./passmenu-otp.nix { };
|
||||||
|
todos-add = callPackage ./todos/todos-add.nix { };
|
||||||
|
todos-edit = callPackage ./todos/todos-edit.nix { };
|
||||||
tmux-sessionizer = callPackage ./tmux-sessionizer { };
|
tmux-sessionizer = callPackage ./tmux-sessionizer { };
|
||||||
upload-to-files = callPackage ./upload-to-files.nix { };
|
upload-to-files = callPackage ./upload-to-files.nix { };
|
||||||
|
|
||||||
|
|
13
pkgs/todos/todos-add.nix
Normal file
13
pkgs/todos/todos-add.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "todos-add";
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
TODOS_DIRECTORY="''${TODOS_DIRECTORY:-"$XDG_DOCUMENTS_DIR/todos"}"
|
||||||
|
export TODOS_DIRECTORY
|
||||||
|
|
||||||
|
echo "$*" >> "$TODOS_DIRECTORY/$(date +%Y-%m-%d).txt"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
12
pkgs/todos/todos-edit.nix
Normal file
12
pkgs/todos/todos-edit.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "todos-edit";
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
TODOS_DIRECTORY="''${TODOS_DIRECTORY:-"$XDG_DOCUMENTS_DIR/todos"}"
|
||||||
|
export TODOS_DIRECTORY
|
||||||
|
|
||||||
|
"$EDITOR" "$TODOS_DIRECTORY/$(date +%Y-%m-%d).txt";
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue