Add fzgo timer
This commit is contained in:
parent
4cdd4d3cf6
commit
2a3f2210b5
|
@ -1,11 +1,19 @@
|
||||||
{ inputs, config, pkgs, ... }:
|
{ inputs, config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
|
username = "server";
|
||||||
|
home_dir = "/home/${username}";
|
||||||
scripts = {
|
scripts = {
|
||||||
disk_check = import ./utils/disk_check.nix { inherit pkgs; };
|
disk_check = import ./utils/disk_check.nix { inherit pkgs; };
|
||||||
# vdirsyncer = {
|
# vdirsyncer = {
|
||||||
# when = "*:0/15";
|
# when = "*:0/15";
|
||||||
# script = toString (pkgs.writeShellScript "script" '' ${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair '');
|
# script = toString (pkgs.writeShellScript "script" '' ${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair '');
|
||||||
# };
|
# };
|
||||||
|
fzgo = {
|
||||||
|
when = "*:0/5";
|
||||||
|
script = toString (pkgs.writeShellScript "script" ''
|
||||||
|
${pkgs.zsh}/bin/zsh -c "source ${./zsh/files/fzgo.zsh} && fzgo_update_cache"
|
||||||
|
'');
|
||||||
|
};
|
||||||
mbsync = {
|
mbsync = {
|
||||||
when = "*-*-* 00:00:00";
|
when = "*-*-* 00:00:00";
|
||||||
script = toString (pkgs.writeShellScript "script" ''
|
script = toString (pkgs.writeShellScript "script" ''
|
||||||
|
@ -48,19 +56,19 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
fzgo_paths = [
|
fzgo_paths = [
|
||||||
"/home/server/.dotfiles"
|
"${home_dir}/.dotfiles"
|
||||||
"/home/server/Containers"
|
"${home_dir}/Workspace"
|
||||||
"/home/server/Workspace"
|
"${home_dir}/Containers"
|
||||||
"/home/server/Storage/Thomas"
|
"${home_dir}/Storage/Thomas"
|
||||||
"/home/server/Storage/Shared"
|
"${home_dir}/Storage/Shared"
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
home.username = "server";
|
home.username = username;
|
||||||
home.homeDirectory = "/home/server";
|
home.homeDirectory = home_dir;
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nix;
|
package = pkgs.nix;
|
||||||
settings = {
|
settings = {
|
||||||
trusted-users = [ "server" ];
|
trusted-users = [ username ];
|
||||||
use-xdg-base-directories = true;
|
use-xdg-base-directories = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -73,7 +81,7 @@ in {
|
||||||
(import ./utils/fzgo_links.nix { inherit config pkgs fzgo_paths; })
|
(import ./utils/fzgo_links.nix { inherit config pkgs fzgo_paths; })
|
||||||
./ssh
|
./ssh
|
||||||
];
|
];
|
||||||
programs.ssh.matchBlocks."*".identityFile = "/home/server/.secrets/SSH/Mallorea/id_ed25519";
|
programs.ssh.matchBlocks."*".identityFile = "${home_dir}/.secrets/SSH/Mallorea/id_ed25519";
|
||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/";
|
NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/";
|
||||||
|
|
|
@ -47,7 +47,7 @@ function fzgo_update_cache() {
|
||||||
if [ -d "$entry" ]; then
|
if [ -d "$entry" ]; then
|
||||||
out_file="$(echo "$entry" | sed 's\/\|\g')"
|
out_file="$(echo "$entry" | sed 's\/\|\g')"
|
||||||
out_file="$XDG_CACHE_HOME/fzgo/entries/$file_type/$out_file"
|
out_file="$XDG_CACHE_HOME/fzgo/entries/$file_type/$out_file"
|
||||||
mkdir -p "$(dirname \"$out_file\")"
|
mkdir -p "$(dirname $out_file)"
|
||||||
fd . "$entry" -t "$file_type" > "$out_file"
|
fd . "$entry" -t "$file_type" > "$out_file"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue