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

View File

@@ -17,8 +17,9 @@
./neofetch
./spicetify
./variables/theme
./wallpaper
./wallpapers
./lf
./secrets # REMOVE
];
home = {
@@ -40,6 +41,7 @@
python3
# Utils
age # Secrets
fd
bc
gcc

View File

@@ -169,7 +169,6 @@
animation = [
"windowsIn, 1, 3, easeOutCubic, popin 30% # window open"
"windowsOut, 1, 3, fluent_decel, popin 70% # window close."
"windowsMove, 1, 2, easeinoutsine, slide # everything in between, moving, dragging, resizing."
"fadeIn, 1, 3, easeOutCubic # fade in (open) -> layers and windows"
"fadeOut, 1, 2, easeOutCubic # fade out (close) -> layers and windows"
"fadeSwitch, 0, 1, easeOutCirc # fade on changing activewindow and its opacity"

View File

@@ -5,7 +5,7 @@
xdg.configFile."hypr/hyprlock.conf".text = ''
background {
monitor =
path = $HOME/.config/wallpaper/${config.theme.wallpaper}
path = $HOME/.config/wallpapers/${config.theme.wallpaper}
color = rgb(${config.theme.colors.bg})
blur_size = 4

View File

@@ -2,8 +2,8 @@
home.packages = with pkgs; [ hyprpaper ];
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload = ~/.config/wallpaper/${config.theme.wallpaper}
wallpaper = ,~/.config/wallpaper/${config.theme.wallpaper}
preload = ~/.config/wallpapers/${config.theme.wallpaper}
wallpaper = ,~/.config/wallpapers/${config.theme.wallpaper}
ipc=true
splash=false
'';

View File

@@ -1 +1,6 @@
{ imports = [ ./sshconfig.nix ./cava/default.nix ]; }
{
imports = [
./cava/default.nix
./nextcloud.nix # REMOVE
];
}

27
home/misc/nextcloud.nix Normal file
View File

@@ -0,0 +1,27 @@
{ pkgs, ... }: {
systemd.user.services.watch-nextcloud = {
Unit = { Description = "Start Nextcloud if I'm on one of my network"; };
Install = { WantedBy = [ "default.target" ]; };
Service = {
ExecStart = "${pkgs.writeShellScript "watch-nextcloud" ''
while 1;do
ssid=$(nmcli -t -f name connection show --active | head -n1)
if [[ $ssid == "inthecloud" || $ssid == "Wired connection 2" ]]; then
status=$(systemctl --user status nextcloud-client)
service_status=$(echo "$status" | awk '/Active:/ {print $2}')
if [[ $service_status == "inactive" ]]; then
systemctl --user start nextcloud-client
fi
else
status=$(systemctl --user status nextcloud-client)
service_status=$(echo "$status" | awk '/Active:/ {print $2}')
if [[ $service_status == "active" ]]; then
systemctl --user stop nextcloud-client
fi
fi
sleep 120
done
''}";
};
};
}

View File

@@ -1,14 +0,0 @@
{
home.file = {
".ssh/config" = {
text = ''
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github
'';
executable = false;
};
};
}

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 ]; }

12
home/secrets/default.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, config, homeage, ... }: {
imports = [ homeage.homeManagerModules.homeage ];
homeage = {
identityPaths = [ "~/nixy.key" ];
installationType = "activation";
file."hadisecretkey" = {
source = ./sshconfig.age;
symlinks = [ "${config.home.homeDirectory}/.ssh/sshconfig" ];
};
};
}

BIN
home/secrets/sshconfig.age Normal file

Binary file not shown.

View File

@@ -12,7 +12,7 @@ with lib;
wallpaper = mkOption {
type = types.str;
description = "Name of the wallpaper (in the wallpaper directory)";
description = "Name of the wallpaper (from the wallpapers directory)";
};
font = mkOption {

View File

@@ -1,6 +0,0 @@
{ config, ... }: {
xdg.configFile."wallpaper" = {
recursive = true;
source = ./wallpaper;
};
}

View File

@@ -0,0 +1,6 @@
{ config, ... }: {
xdg.configFile."wallpapers" = {
recursive = true;
source = ./wallpapers;
};
}

View File

Before

Width:  |  Height:  |  Size: 826 KiB

After

Width:  |  Height:  |  Size: 826 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

Before

Width:  |  Height:  |  Size: 12 MiB

After

Width:  |  Height:  |  Size: 12 MiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 378 KiB

After

Width:  |  Height:  |  Size: 378 KiB

View File

Before

Width:  |  Height:  |  Size: 288 KiB

After

Width:  |  Height:  |  Size: 288 KiB

View File

Before

Width:  |  Height:  |  Size: 641 KiB

After

Width:  |  Height:  |  Size: 641 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

Before

Width:  |  Height:  |  Size: 8.6 MiB

After

Width:  |  Height:  |  Size: 8.6 MiB