Better fzgo link handling
This commit is contained in:
parent
275d2875c6
commit
1b24ccb8b9
|
@ -3,7 +3,7 @@ let
|
||||||
mkLink = source_path: file_type: {
|
mkLink = source_path: file_type: {
|
||||||
"${source_path}_${file_type}" = {
|
"${source_path}_${file_type}" = {
|
||||||
source = config.lib.file.mkOutOfStoreSymlink source_path;
|
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");
|
mkLinks = source_path: (mkLink source_path "d") // (mkLink source_path "f");
|
||||||
|
|
|
@ -32,7 +32,12 @@ local function get_entries() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fzgo_update_cache() {
|
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"
|
mkdir -p "$XDG_CACHE_HOME/fzgo/entries"
|
||||||
for entry in "$file_type_dir"/*; do
|
for entry in "$file_type_dir"/*; do
|
||||||
file_type=$(basename "$file_type_dir")
|
file_type=$(basename "$file_type_dir")
|
||||||
|
|
|
@ -48,11 +48,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722536372,
|
"lastModified": 1737991358,
|
||||||
"narHash": "sha256-kcaCZFYKWlGyyL1y5MQ/3LVNw+5GfW2kSYDixdrDJl0=",
|
"narHash": "sha256-Xye+N7I2FMb+GC96xMDjWi/HX5XCoFCz1Ak+KvP9jUQ=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "430ff540f5cedb42cbd9267094d45f275cd480d4",
|
"rev": "a005938761624fd8d3ab7cbb64fe57a40a9b36e9",
|
||||||
"revCount": 13,
|
"revCount": 14,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.thomasave.be/thomasave/fzgo.git"
|
"url": "https://git.thomasave.be/thomasave/fzgo.git"
|
||||||
},
|
},
|
||||||
|
@ -68,11 +68,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732025103,
|
"lastModified": 1737968762,
|
||||||
"narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=",
|
"narHash": "sha256-xiPARGKwocaMtv+U/rgi+h2g56CZZEmrcl7ldRaslq8=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "a46e702093a5c46e192243edbd977d5749e7f294",
|
"rev": "e1ae908bcc30af792b0bb0a52e53b03d2577255e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -99,11 +99,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732014248,
|
"lastModified": 1737885589,
|
||||||
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
|
"narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
|
"rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
Loading…
Reference in New Issue