lfrc symlink
This commit is contained in:
@@ -80,11 +80,11 @@ in
|
|||||||
echo "backing up: ${lib.concatStringsSep " " bak_paths.paths} → $archive"
|
echo "backing up: ${lib.concatStringsSep " " bak_paths.paths} → $archive"
|
||||||
borg create \
|
borg create \
|
||||||
--verbose \
|
--verbose \
|
||||||
--filter AME \
|
# --filter AME \
|
||||||
--list \
|
--list \
|
||||||
--stats \
|
--stats \
|
||||||
--show-rc \
|
--show-rc \
|
||||||
--compression lzma,9 \
|
--compression lz4 \
|
||||||
"$BORG_REPO::$archive" \
|
"$BORG_REPO::$archive" \
|
||||||
${lib.concatStringsSep " " bak_paths.paths}
|
${lib.concatStringsSep " " bak_paths.paths}
|
||||||
echo "pruning old backups for ${bak_name}..."
|
echo "pruning old backups for ${bak_name}..."
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
let
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
cfg = config.modules.system.tailscale;
|
cfg = config.modules.system.tailscale;
|
||||||
authkey_file = config.sops.secrets."tailscale_authkey".path;
|
authkey_file = config.sops.secrets."tailscale_authkey".path;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.system.tailscale = {
|
options.modules.system.tailscale = {
|
||||||
enable = lib.mkEnableOption "enables tailscale";
|
enable = lib.mkEnableOption "enables tailscale";
|
||||||
};
|
};
|
||||||
@@ -15,11 +17,15 @@ in
|
|||||||
useRoutingFeatures = "both";
|
useRoutingFeatures = "both";
|
||||||
authKeyFile = authkey_file;
|
authKeyFile = authkey_file;
|
||||||
extraUpFlags = [
|
extraUpFlags = [
|
||||||
"--accept-routes=false" # true is equilivant to useRoutingFeatures = "client" (breaks shit)
|
"--accept-routes=false" # true is equilivant to useRoutingFeatures = "client" (breaks shit)
|
||||||
"--accept-dns=true" # explicitly allow resolved
|
"--accept-dns=true" # explicitly allow resolved
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# network config
|
||||||
|
networking.firewall.trustedInterfaces = ["tailscale0"];
|
||||||
|
networking.firewall.allowedUDPPorts = [config.services.tailscale.port];
|
||||||
|
|
||||||
# declare authkey secrets
|
# declare authkey secrets
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
"tailscale_authkey" = {
|
"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,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
{
|
# just using the normal lfrc
|
||||||
programs.lf = {
|
programs.lf = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
settings = {
|
# install it to userspace
|
||||||
mouse = true;
|
home.packages = with pkgs; [lf ctpv];
|
||||||
ignorecase = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
keybindings = {
|
|
||||||
ad = "mkdir";
|
|
||||||
af = "mkfile";
|
|
||||||
ab = "mkbak";
|
|
||||||
ae = "extract";
|
|
||||||
aa = "archive";
|
|
||||||
gt = "cd ~/.local/share/Trash/files";
|
|
||||||
};
|
|
||||||
|
|
||||||
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
|
|
||||||
}}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
# link configs
|
||||||
|
xdg.configFile."lf/lfrc" = {
|
||||||
|
source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dots/lf/lfrc";
|
||||||
|
};
|
||||||
|
xdg.configFile."ctpv/config" = {
|
||||||
|
source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dots/lf/ctpv_config";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,18 +10,16 @@
|
|||||||
# general config
|
# general config
|
||||||
home.username = "blake";
|
home.username = "blake";
|
||||||
home.homeDirectory = "/home/blake";
|
home.homeDirectory = "/home/blake";
|
||||||
|
home.stateVersion = "25.05";
|
||||||
|
|
||||||
# stand alone packages
|
# stand alone packages
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
lf
|
|
||||||
ripgrep
|
ripgrep
|
||||||
btop
|
btop
|
||||||
p7zip
|
p7zip
|
||||||
ctpv
|
|
||||||
imagemagick
|
imagemagick
|
||||||
sops
|
sops
|
||||||
usbutils
|
usbutils
|
||||||
trashy
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -41,7 +39,7 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
@@ -80,5 +78,4 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
home.stateVersion = "25.05";
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user