Better fzgo link handling

This commit is contained in:
Thomas Avé 2025-01-28 01:37:58 +01:00
parent 275d2875c6
commit 1b24ccb8b9
4 changed files with 17 additions and 12 deletions

View File

@ -3,7 +3,7 @@ let
mkLink = source_path: file_type: {
"${source_path}_${file_type}" = {
source = config.lib.file.mkOutOfStoreSymlink source_path;
target = "/home/user/.config/fzgo/entries/${file_type}/${pkgs.lib.strings.replaceStrings [ "/" ] [ "|" ] source_path}";
target = ".config/fzgo/entries/${file_type}/${pkgs.lib.strings.replaceStrings [ "/" ] [ "|" ] source_path}";
};
};
mkLinks = source_path: (mkLink source_path "d") // (mkLink source_path "f");

View File

@ -32,7 +32,12 @@ local function get_entries() {
}
function fzgo_update_cache() {
for file_type_dir in "$XDG_CONFIG_HOME/fzgo/entries"/*; do
# Check if the directory exists and it contains entries
if [ ! -d "$XDG_CONFIG_HOME/fzgo/entries" ]; then
return
fi
for file_type_dir in "$XDG_CONFIG_HOME/fzgo/entries"/*(N); do
mkdir -p "$XDG_CACHE_HOME/fzgo/entries"
for entry in "$file_type_dir"/*; do
file_type=$(basename "$file_type_dir")

View File

View File

@ -48,11 +48,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1722536372,
"narHash": "sha256-kcaCZFYKWlGyyL1y5MQ/3LVNw+5GfW2kSYDixdrDJl0=",
"lastModified": 1737991358,
"narHash": "sha256-Xye+N7I2FMb+GC96xMDjWi/HX5XCoFCz1Ak+KvP9jUQ=",
"ref": "refs/heads/master",
"rev": "430ff540f5cedb42cbd9267094d45f275cd480d4",
"revCount": 13,
"rev": "a005938761624fd8d3ab7cbb64fe57a40a9b36e9",
"revCount": 14,
"type": "git",
"url": "https://git.thomasave.be/thomasave/fzgo.git"
},
@ -68,11 +68,11 @@
]
},
"locked": {
"lastModified": 1732025103,
"narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=",
"lastModified": 1737968762,
"narHash": "sha256-xiPARGKwocaMtv+U/rgi+h2g56CZZEmrcl7ldRaslq8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a46e702093a5c46e192243edbd977d5749e7f294",
"rev": "e1ae908bcc30af792b0bb0a52e53b03d2577255e",
"type": "github"
},
"original": {
@ -99,11 +99,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"lastModified": 1737885589,
"narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
"type": "github"
},
"original": {