lfrc symlink
This commit is contained in:
@@ -80,11 +80,11 @@ in
|
||||
echo "backing up: ${lib.concatStringsSep " " bak_paths.paths} → $archive"
|
||||
borg create \
|
||||
--verbose \
|
||||
--filter AME \
|
||||
# --filter AME \
|
||||
--list \
|
||||
--stats \
|
||||
--show-rc \
|
||||
--compression lzma,9 \
|
||||
--compression lz4 \
|
||||
"$BORG_REPO::$archive" \
|
||||
${lib.concatStringsSep " " bak_paths.paths}
|
||||
echo "pruning old backups for ${bak_name}..."
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.modules.system.tailscale;
|
||||
authkey_file = config.sops.secrets."tailscale_authkey".path;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options.modules.system.tailscale = {
|
||||
enable = lib.mkEnableOption "enables tailscale";
|
||||
};
|
||||
@@ -20,6 +22,10 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
# network config
|
||||
networking.firewall.trustedInterfaces = ["tailscale0"];
|
||||
networking.firewall.allowedUDPPorts = [config.services.tailscale.port];
|
||||
|
||||
# declare authkey secrets
|
||||
sops.secrets = {
|
||||
"tailscale_authkey" = {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# general
|
||||
set forcekitty
|
||||
set chafasixel
|
||||
|
||||
|
||||
preview glow .md {{
|
||||
glow -s "dark" < "$f"
|
||||
}}
|
||||
|
||||
5
users/blake/dots/lf/ctpv_config
Normal file
5
users/blake/dots/lf/ctpv_config
Normal file
@@ -0,0 +1,5 @@
|
||||
# general
|
||||
set forcekitty
|
||||
set chafasixel
|
||||
|
||||
|
||||
@@ -1,87 +1,21 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
# just using the normal lfrc
|
||||
programs.lf = {
|
||||
|
||||
settings = {
|
||||
mouse = true;
|
||||
ignorecase = true;
|
||||
enable = false;
|
||||
};
|
||||
|
||||
keybindings = {
|
||||
ad = "mkdir";
|
||||
af = "mkfile";
|
||||
ab = "mkbak";
|
||||
ae = "extract";
|
||||
aa = "archive";
|
||||
gt = "cd ~/.local/share/Trash/files";
|
||||
# install it to userspace
|
||||
home.packages = with pkgs; [lf ctpv];
|
||||
|
||||
# link configs
|
||||
xdg.configFile."lf/lfrc" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dots/lf/lfrc";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
set previewer ctpv
|
||||
set cleaner ctpvclear
|
||||
&ctpv -s $id
|
||||
&ctpvquit $id
|
||||
[ = "half-up";
|
||||
] = "half-down";
|
||||
<delete> = "trash";
|
||||
<s-delete> = "$trash restore";
|
||||
'';
|
||||
|
||||
commands = {
|
||||
extract = ''
|
||||
extract %{{
|
||||
set -f
|
||||
case $f in
|
||||
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
|
||||
*.tar.gz|*.tgz) tar xzvf $f;;
|
||||
*.tar.xz|*.txz) tar xJvf $f;;
|
||||
*.zip) unzip $f;;
|
||||
*.rar) unrar x $f;;
|
||||
*.7z) 7z x $f;;
|
||||
esac
|
||||
}}
|
||||
'';
|
||||
|
||||
# move files to trash
|
||||
trash = ''%IFS="$(printf '\n\t')"; trash put $fx'';
|
||||
# make a directory
|
||||
mkdir = ''
|
||||
mkdir %{{
|
||||
echo "enter directory name: " ; read dir
|
||||
if [ -n "$dir" ]; then
|
||||
mkdir -p "$dir" && echo "'$dir' created."
|
||||
else
|
||||
echo "no dir name provided"
|
||||
fi
|
||||
}}
|
||||
'';
|
||||
# make a file
|
||||
mkfile = ''
|
||||
cmd mkfile %{{
|
||||
echo "enter file name: " ; read file
|
||||
if [ -n "$file" ]; then
|
||||
touch "$file" && echo "'$file' created."
|
||||
else
|
||||
echo "no file name provided"
|
||||
fi
|
||||
}}
|
||||
'';
|
||||
# make backup
|
||||
mkbak = ''
|
||||
mkbak %{{
|
||||
for x in $fx; do
|
||||
cp -r $x $x.bak
|
||||
done
|
||||
}}
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
xdg.configFile."ctpv/config" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dots/lf/ctpv_config";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,18 +10,16 @@
|
||||
# general config
|
||||
home.username = "blake";
|
||||
home.homeDirectory = "/home/blake";
|
||||
home.stateVersion = "25.05";
|
||||
|
||||
# stand alone packages
|
||||
home.packages = with pkgs; [
|
||||
lf
|
||||
ripgrep
|
||||
btop
|
||||
p7zip
|
||||
ctpv
|
||||
imagemagick
|
||||
sops
|
||||
usbutils
|
||||
trashy
|
||||
];
|
||||
|
||||
|
||||
@@ -80,5 +78,4 @@
|
||||
};
|
||||
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user