Secrets, scripts, clean..

This commit is contained in:
Hadi
2024-03-15 21:26:34 +01:00
parent 05fc3fbcd9
commit 5e98256a82
27 changed files with 141 additions and 66 deletions

12
home/scripts/age.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, config, ... }:
let
homedir = config.home.homeDirectory;
add-secrets = pkgs.writeShellScriptBin "add-secrets" ''
file=$1
pubkey=$(cat ~/nixy.key | grep "public key" | cut -d':' -f2 | sed 's/ //g')
${pkgs.age}/bin/age -r $pubkey -o ~/.config/nixos/home/secrets/$file.age -a $file
'';
in { home.packages = with pkgs; [ add-secrets ]; }

View File

@@ -7,5 +7,6 @@
./brightness.nix
./caffeine.nix
./night-shift.nix
./age.nix
];
}

View File

@@ -3,20 +3,20 @@
let
homedir = config.home.homeDirectory;
wallpaper = pkgs.writeShellScriptBin "wallpaper" ''
WALLPAPER_FOLDER="${homedir}/Nextcloud/wallpaper"
cd $WALLPAPER_FOLDER
choosed_wallpaper=$(fd . |
fzf \
--preview='kitty icat --clear --transfer-mode=memory --stdin=no --place=''${FZF_PREVIEW_COLUMNS}x''${FZF_PREVIEW_LINES}@0x0 {}' \
--preview-window=bottom,border-top \
--border-label "Wallpaper" ) || exit 1
swww img $choosed_wallpaper
cp $choosed_wallpaper $HOME/.config/wallpaper/default.png
'';
#wallpaper = pkgs.writeShellScriptBin "wallpaper" ''
# WALLPAPER_FOLDER="${homedir}/Nextcloud/wallpaper"
#
# cd $WALLPAPER_FOLDER
#
# choosed_wallpaper=$(fd . |
# fzf \
# --preview='kitty icat --clear --transfer-mode=memory --stdin=no --place=''${FZF_PREVIEW_COLUMNS}x''${FZF_PREVIEW_LINES}@0x0 {}' \
# --preview-window=bottom,border-top \
# --border-label "Wallpaper" ) || exit 1
#
# swww img $choosed_wallpaper
# cp $choosed_wallpaper $HOME/.config/wallpaper/default.png
#'';
menu = pkgs.writeShellScriptBin "menu" ''
if pgrep wofi; then
@@ -34,4 +34,4 @@ let
nmcli connection import type wireguard file "$0"
'';
in { home.packages = with pkgs; [ wallpaper menu wireguard-import powermenu ]; }
in { home.packages = with pkgs; [ menu wireguard-import powermenu ]; }