From afb451d3cc6e7ac9f11a10ae1c7c1e175c2b6472 Mon Sep 17 00:00:00 2001 From: blake Date: Mon, 13 Oct 2025 20:05:19 -0500 Subject: [PATCH] lfrc symlink --- modules/system/backups.nix | 4 +- modules/system/tailscale.nix | 22 ++++--- users/blake/dotfiles/ctpv/config | 9 --- users/blake/dots/lf/ctpv_config | 5 ++ users/blake/dots/lf/default.nix | 90 ++++---------------------- users/blake/{dotfiles => dots}/lf/lfrc | 0 users/blake/home.nix | 7 +- 7 files changed, 35 insertions(+), 102 deletions(-) delete mode 100644 users/blake/dotfiles/ctpv/config create mode 100644 users/blake/dots/lf/ctpv_config rename users/blake/{dotfiles => dots}/lf/lfrc (100%) diff --git a/modules/system/backups.nix b/modules/system/backups.nix index 91dca18..cb544d8 100644 --- a/modules/system/backups.nix +++ b/modules/system/backups.nix @@ -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}..." diff --git a/modules/system/tailscale.nix b/modules/system/tailscale.nix index 6701c1e..8baa2a0 100644 --- a/modules/system/tailscale.nix +++ b/modules/system/tailscale.nix @@ -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"; }; @@ -15,14 +17,18 @@ in useRoutingFeatures = "both"; authKeyFile = authkey_file; extraUpFlags = [ - "--accept-routes=false" # true is equilivant to useRoutingFeatures = "client" (breaks shit) - "--accept-dns=true" # explicitly allow resolved + "--accept-routes=false" # true is equilivant to useRoutingFeatures = "client" (breaks shit) + "--accept-dns=true" # explicitly allow resolved ]; }; + # network config + networking.firewall.trustedInterfaces = ["tailscale0"]; + networking.firewall.allowedUDPPorts = [config.services.tailscale.port]; + # declare authkey secrets sops.secrets = { - "tailscale_authkey" = { + "tailscale_authkey" = { owner = "root"; }; }; diff --git a/users/blake/dotfiles/ctpv/config b/users/blake/dotfiles/ctpv/config deleted file mode 100644 index 9b5c1c4..0000000 --- a/users/blake/dotfiles/ctpv/config +++ /dev/null @@ -1,9 +0,0 @@ -# general -set forcekitty -set chafasixel - - -preview glow .md {{ - glow -s "dark" < "$f" -}} - diff --git a/users/blake/dots/lf/ctpv_config b/users/blake/dots/lf/ctpv_config new file mode 100644 index 0000000..a13432b --- /dev/null +++ b/users/blake/dots/lf/ctpv_config @@ -0,0 +1,5 @@ +# general +set forcekitty +set chafasixel + + diff --git a/users/blake/dots/lf/default.nix b/users/blake/dots/lf/default.nix index dba7469..bc68719 100644 --- a/users/blake/dots/lf/default.nix +++ b/users/blake/dots/lf/default.nix @@ -1,87 +1,21 @@ { pkgs, config, - lib, - inputs, ... -}: -{ +}: { + # just using the normal lfrc programs.lf = { + enable = false; + }; - settings = { - mouse = true; - 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"; - = "trash"; - = "$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 - }} - ''; - }; - + # 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"; + }; + xdg.configFile."ctpv/config" = { + source = config.lib.file.mkOutOfStoreSymlink "/home/blake/.nix/users/blake/dots/lf/ctpv_config"; }; } diff --git a/users/blake/dotfiles/lf/lfrc b/users/blake/dots/lf/lfrc similarity index 100% rename from users/blake/dotfiles/lf/lfrc rename to users/blake/dots/lf/lfrc diff --git a/users/blake/home.nix b/users/blake/home.nix index c09b2c6..0b1b5b3 100644 --- a/users/blake/home.nix +++ b/users/blake/home.nix @@ -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 ]; @@ -41,7 +39,7 @@ enable = true; }; services.gpg-agent = { - enable = true; + enable = true; }; programs.ssh = { @@ -80,5 +78,4 @@ }; - home.stateVersion = "25.05"; }