From dc510daa7568fbff53e735e306a1c8f13e81097f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 25 Oct 2025 10:03:55 +0100 Subject: [PATCH] Remove scripts that are now in the z application --- modules/nixvim/keymaps.nix | 2 +- modules/scripts/add-weight.nix | 34 ------------------- modules/scripts/clone.nix | 6 ++-- modules/scripts/hnow.nix | 35 -------------------- modules/scripts/now.nix | 32 ------------------ modules/scripts/tmux-sessionizer/default.nix | 30 ----------------- modules/scripts/todo.nix | 34 ------------------- modules/scripts/weight.nix | 28 ---------------- packages/default.nix | 1 - 9 files changed, 4 insertions(+), 198 deletions(-) delete mode 100644 modules/scripts/add-weight.nix delete mode 100644 modules/scripts/hnow.nix delete mode 100644 modules/scripts/now.nix delete mode 100644 modules/scripts/tmux-sessionizer/default.nix delete mode 100644 modules/scripts/todo.nix delete mode 100644 modules/scripts/weight.nix diff --git a/modules/nixvim/keymaps.nix b/modules/nixvim/keymaps.nix index dc13def0..458e411a 100644 --- a/modules/nixvim/keymaps.nix +++ b/modules/nixvim/keymaps.nix @@ -43,7 +43,7 @@ } { - action = "silent !tmux new-window tmux-sessionizer"; + action = "silent !tmux new-window start-tmux"; key = ""; options.silent = true; } diff --git a/modules/scripts/add-weight.nix b/modules/scripts/add-weight.nix deleted file mode 100644 index 8bf9d5f6..00000000 --- a/modules/scripts/add-weight.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ withSystem, ... }: - -let - name = "add-weight"; -in -{ - perSystem = - psArgs@{ pkgs, ... }: - { - packages.${name} = pkgs.writeShellApplication { - inherit name; - - runtimeInputs = with pkgs; [ - coreutils - psArgs.config.packages.today2 - psArgs.config.packages.weight - ]; - - text = '' - echo "$(today2),$1" >> "$XDG_DOCUMENTS_DIR/notes/2-areas/health-fitness/weight.csv" - - weight - ''; - }; - }; - - flake.modules.homeManager.base = - { pkgs, ... }: - { - home.packages = [ - (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) - ]; - }; -} diff --git a/modules/scripts/clone.nix b/modules/scripts/clone.nix index 36d1574d..bcfefeba 100644 --- a/modules/scripts/clone.nix +++ b/modules/scripts/clone.nix @@ -9,7 +9,7 @@ runtimeInputs = with pkgs; [ git - psArgs.config.packages.tmux-sessionizer + psArgs.config.packages.start-tmux ]; text = '' @@ -29,13 +29,13 @@ user_path="$XDG_REPOS_DIR/$domain/$user" repo_path="$user_path/$name" - [[ -d "$repo_path" ]] && tmux-sessionizer "$repo_path" && exit 0 + [[ -d "$repo_path" ]] && start-tmux "$repo_path" && exit 0 mkdir -pv "$repo_path" git clone "$repo_url" "$repo_path" - tmux-sessionizer "$repo_path" + start-tmux "$repo_path" else exit 1 fi diff --git a/modules/scripts/hnow.nix b/modules/scripts/hnow.nix deleted file mode 100644 index 58650c03..00000000 --- a/modules/scripts/hnow.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ lib, withSystem, ... }: - -let - name = "hnow"; -in -{ - perSystem = - psArgs@{ pkgs, ... }: - let - now = withSystem pkgs.system (psArgs: psArgs.config.packages.now); - in - { - packages.${name} = pkgs.writeShellApplication { - inherit name; - - runtimeInputs = [ - psArgs.config.packages.now - ]; - - text = '' - # Based on https://github.com/rwxrob/dot/blob/main/scripts/hnow. - - echo "== $(${lib.getExe now} "$*")" - ''; - }; - }; - - flake.modules.homeManager.base = - { pkgs, ... }: - { - home.packages = [ - (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) - ]; - }; -} diff --git a/modules/scripts/now.nix b/modules/scripts/now.nix deleted file mode 100644 index 94ad3d31..00000000 --- a/modules/scripts/now.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ withSystem, ... }: - -let - name = "now"; -in -{ - perSystem = - { pkgs, ... }: - { - packages.${name} = pkgs.writeShellApplication { - inherit name; - - runtimeInputs = with pkgs; [ coreutils ]; - - text = '' - # Based on https://github.com/rwxrob/dot/blob/main/scripts/now. - - out=$(date "+%A, %B %e, %Y, %R %Z" "-d ''${*:-now}") - - echo "''${out// / }" - ''; - }; - }; - - flake.modules.homeManager.base = - { pkgs, ... }: - { - home.packages = [ - (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) - ]; - }; -} diff --git a/modules/scripts/tmux-sessionizer/default.nix b/modules/scripts/tmux-sessionizer/default.nix deleted file mode 100644 index 8f4513b5..00000000 --- a/modules/scripts/tmux-sessionizer/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - flake.modules.homeManager.base = - { config, pkgs, ... }: - { - home.file.".tmux-sessionizer".source = "${ - pkgs.writeShellApplication { - name = ".tmux-sessionizer"; - - runtimeInputs = with pkgs; [ - tmux - ]; - - text = '' - set +o errexit - set +o nounset - - if [[ "$PWD" == "${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/os" || "$PWD" == "${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/personal" || "$PWD" == "${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/work" ]]; then - clear - - return - fi - - tmux new-window -d -n scratch - nvim . - clear - ''; - } - }/bin/.tmux-sessionizer"; - }; -} diff --git a/modules/scripts/todo.nix b/modules/scripts/todo.nix deleted file mode 100644 index 9eb0248c..00000000 --- a/modules/scripts/todo.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ withSystem, ... }: - -let - name = "todo"; -in -{ - perSystem = - { pkgs, ... }: - { - packages.${name} = pkgs.writeShellApplication { - inherit name; - - runtimeInputs = with pkgs; [ coreutils ]; - - text = '' - "$EDITOR" +3 "$TODO_FILE" - cd "$NOTES_DIRECTORY" - git add "$TODO_FILE" - git commit -m "Update TODOs" - git push - ''; - }; - }; - - flake.modules.homeManager.base = - { config, pkgs, ... }: - { - home.packages = [ - (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) - ]; - - home.sessionVariables.TODO_FILE = "${config.home.sessionVariables.NOTES_DIRECTORY}/todo.adoc"; - }; -} diff --git a/modules/scripts/weight.nix b/modules/scripts/weight.nix deleted file mode 100644 index d2f58553..00000000 --- a/modules/scripts/weight.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ withSystem, ... }: - -let - name = "weight"; -in -{ - perSystem = - { pkgs, ... }: - { - packages.${name} = pkgs.writeShellApplication { - inherit name; - - runtimeInputs = with pkgs; [ - coreutils - ]; - - text = ''tail "$XDG_DOCUMENTS_DIR/notes/2-areas/health-fitness/weight.csv"''; - }; - }; - - flake.modules.homeManager.base = - { pkgs, ... }: - { - home.packages = [ - (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) - ]; - }; -} diff --git a/packages/default.nix b/packages/default.nix index 418c1638..1669f6ef 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -28,7 +28,6 @@ in tag-release = callPackage ./tag-release.nix { }; time-until = callPackage ./time-until.nix { }; timer = callPackage ./timer.nix { }; - tmux-sessionizer = callPackage ./tmux-sessionizer { }; unmounter = callPackage ./unmounter.nix { }; update-all-git-repos = callPackage ./update-all-git-repos.nix { }; vic = callPackage ./vic.nix { inherit inputs; };