feat: add change wallpaper shortcut to yazi
This commit is contained in:
parent
d1f25b377f
commit
c45ba82b90
18 changed files with 188 additions and 21 deletions
21
flake.lock
generated
21
flake.lock
generated
|
|
@ -29,11 +29,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759471829,
|
"lastModified": 1762440797,
|
||||||
"narHash": "sha256-aMBGX6xlDAH02mFJ7FHGMbntfaBkJ/izinIPPoARar4=",
|
"narHash": "sha256-Gl9i+siUDwjAdJ7zUurThP6XhtxV58xVgS0ztsLh7bI=",
|
||||||
"owner": "dachxy",
|
"owner": "dachxy",
|
||||||
"repo": "actual-budget-flake",
|
"repo": "actual-budget-flake",
|
||||||
"rev": "aba51d40a8fa3f0da8400bb100f0802bfeca728b",
|
"rev": "721d97809077c90d895cadbe2002e20e60d182af",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -1416,14 +1416,17 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761409875,
|
"lastModified": 1761893234,
|
||||||
"narHash": "sha256-tTVQsRHO1c/c3rpeHXuYV+HLulv2J3ZLR3c32nSWyas=",
|
"narHash": "sha256-ePHBF/6fyfTSAMvAaES+LxaBIeW6weooAOXxqN1em0s=",
|
||||||
"path": "/home/danny/projects/nix-mail-server",
|
"owner": "dachxy",
|
||||||
"type": "path"
|
"repo": "nix-mail-server",
|
||||||
|
"rev": "b8c26c666a14fcdf4d514c17a2362fc5d33c7358",
|
||||||
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/home/danny/projects/nix-mail-server",
|
"owner": "dachxy",
|
||||||
"type": "path"
|
"repo": "nix-mail-server",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"marks-nvim": {
|
"marks-nvim": {
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@
|
||||||
let
|
let
|
||||||
mkWall = pkgs.writeShellScriptBin "setWall" ''
|
mkWall = pkgs.writeShellScriptBin "setWall" ''
|
||||||
url="$1"
|
url="$1"
|
||||||
filepath="/tmp/wall_cache/$(echo -n "$url" | base64 | tr -d '\n')"
|
DIR="$HOME/Pictures/Wallpapers"
|
||||||
|
filepath="$DIR/$(echo -n "$url" | sha256sum | awk '{print $1}' | tr -d '\n').jpg"
|
||||||
|
|
||||||
if [[ ! -f "$filepath" ]]; then
|
if [[ ! -f "$filepath" ]]; then
|
||||||
|
${pkgs.libnotify}/bin/notify-send " Wallpaper" "$filepath\nDownloading..."
|
||||||
curl -sL "$url" -o "$filepath"
|
curl -sL "$url" -o "$filepath"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,18 @@
|
||||||
pull.rebase = true;
|
pull.rebase = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.gh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
git_protocol = "ssh";
|
||||||
|
aliases = {
|
||||||
|
co = "pr checkout";
|
||||||
|
pv = "pr view";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
gitCredentialHelper = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,13 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
inputs,
|
||||||
|
config,
|
||||||
system,
|
system,
|
||||||
osConfig,
|
osConfig,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
inherit (osConfig.systemConf) username;
|
||||||
inherit (osConfig.systemConf.hyprland) monitors;
|
inherit (osConfig.systemConf.hyprland) monitors;
|
||||||
terminal = "ghostty";
|
terminal = "ghostty";
|
||||||
|
|
||||||
|
|
@ -37,6 +39,10 @@ in
|
||||||
sunsetr
|
sunsetr
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.user.tmpfiles.rules = [
|
||||||
|
"d ${config.home.homeDirectory}/Pictures/Wallpapers 0744 ${username} users -"
|
||||||
|
];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
(import ./hypr/bind.nix { inherit mainMod; })
|
(import ./hypr/bind.nix { inherit mainMod; })
|
||||||
./hypr/workspace.nix
|
./hypr/workspace.nix
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,8 @@ let
|
||||||
|
|
||||||
# Change Wallpaper
|
# Change Wallpaper
|
||||||
wallRand = pkgs.writeShellScript "wallRand" ''
|
wallRand = pkgs.writeShellScript "wallRand" ''
|
||||||
mapfile -t wallpapers < <(find /tmp/wall_cache -type f)
|
WALLPAPER_DIR="$HOME/Pictures/Wallpapers"
|
||||||
|
mapfile -t wallpapers < <(find "$WALLPAPER_DIR" -type f)
|
||||||
|
|
||||||
count="''${#wallpapers[@]}"
|
count="''${#wallpapers[@]}"
|
||||||
|
|
||||||
|
|
@ -71,7 +72,7 @@ let
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${config.services.swww.package}/bin/swww img $selected --transition-fps 45 --transition-duration 1 --transition-type random
|
${config.services.swww.package}/bin/swww img "$selected" --transition-fps 45 --transition-duration 1 --transition-type random
|
||||||
'';
|
'';
|
||||||
|
|
||||||
rbwSelector = import ../scripts/rbwSelector.nix { inherit pkgs; };
|
rbwSelector = import ../scripts/rbwSelector.nix { inherit pkgs; };
|
||||||
|
|
@ -439,7 +440,7 @@ in
|
||||||
on-click-middle = "close";
|
on-click-middle = "close";
|
||||||
ignore-list = [
|
ignore-list = [
|
||||||
"rofi"
|
"rofi"
|
||||||
"chromium"
|
"chromium-browser"
|
||||||
"firefox"
|
"firefox"
|
||||||
"firefox-nightly"
|
"firefox-nightly"
|
||||||
"zen"
|
"zen"
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,13 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
opener = {
|
opener = {
|
||||||
|
set-wallpaper = [
|
||||||
|
{
|
||||||
|
run = ''${pkgs.swww}/bin/swww img "$1" --transition-fps 45 --transition-duration 1 --transition-type random'';
|
||||||
|
for = "linux";
|
||||||
|
desc = "Set as wallpaper";
|
||||||
|
}
|
||||||
|
];
|
||||||
edit = [
|
edit = [
|
||||||
{
|
{
|
||||||
run = ''''\${EDITOR:=nvim} "$@"'';
|
run = ''''\${EDITOR:=nvim} "$@"'';
|
||||||
|
|
@ -98,6 +105,15 @@ in
|
||||||
keymap = {
|
keymap = {
|
||||||
mgr = {
|
mgr = {
|
||||||
prepend_keymap = [
|
prepend_keymap = [
|
||||||
|
# Set Wallpaper
|
||||||
|
{
|
||||||
|
on = [
|
||||||
|
"g"
|
||||||
|
"w"
|
||||||
|
];
|
||||||
|
run = ''shell -- ${pkgs.swww}/bin/swww img "$1" --transition-fps 45 --transition-duration 1 --transition-type random'';
|
||||||
|
desc = "Set as wallpaper";
|
||||||
|
}
|
||||||
# Git Changes
|
# Git Changes
|
||||||
{
|
{
|
||||||
on = [
|
on = [
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,9 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
nvidia = {
|
nvidia = {
|
||||||
enable = true;
|
enable = (mkEnableOption "Enable nvidia configuration") // {
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ in
|
||||||
inherit hostname username;
|
inherit hostname username;
|
||||||
domain = "net.dn";
|
domain = "net.dn";
|
||||||
enableHomeManager = true;
|
enableHomeManager = true;
|
||||||
|
nvidia.enable = true;
|
||||||
hyprland = {
|
hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
monitors = [
|
monitors = [
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,7 @@ in
|
||||||
"test.local." = "127.0.0.1:5359";
|
"test.local." = "127.0.0.1:5359";
|
||||||
};
|
};
|
||||||
forwardZonesRecurse = {
|
forwardZonesRecurse = {
|
||||||
"." = "8.8.8.8";
|
"." = "168.95.1.1";
|
||||||
};
|
};
|
||||||
dnssecValidation = "off";
|
dnssecValidation = "off";
|
||||||
dns.allowFrom = [
|
dns.allowFrom = [
|
||||||
|
|
@ -443,13 +443,19 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemConf.security = {
|
||||||
|
allowedDomains = [
|
||||||
|
"registry-1.docker.io"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
oci-containers = {
|
oci-containers = {
|
||||||
backend = "docker";
|
backend = "docker";
|
||||||
containers = {
|
containers = {
|
||||||
uptime-kuma = {
|
uptime-kuma = {
|
||||||
extraOptions = [ "--network=host" ];
|
extraOptions = [ "--network=host" ];
|
||||||
image = "louislam/uptime-kuma:1";
|
image = "louislam/uptime-kuma:2";
|
||||||
volumes = [
|
volumes = [
|
||||||
"/var/lib/uptime-kuma:/app/data"
|
"/var/lib/uptime-kuma:/app/data"
|
||||||
"${config.security.pki.caBundle}:/etc/ca.crt:ro"
|
"${config.security.pki.caBundle}:/etc/ca.crt:ro"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./actual-budget.nix
|
./actual-budget.nix
|
||||||
|
|
@ -7,5 +8,10 @@
|
||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./paperless-ngx.nix
|
./paperless-ngx.nix
|
||||||
./metrics.nix
|
./metrics.nix
|
||||||
|
# (import ../../../modules/opencloud.nix {
|
||||||
|
# fqdn = "opencloud.net.dn";
|
||||||
|
# envFile = config.sops.secrets."opencloud".path;
|
||||||
|
# })
|
||||||
|
(import ./ntfy.nix { fqdn = "ntfy.net.dn"; })
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,4 +154,39 @@ in
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.prometheus.alertmanager-ntfy = {
|
||||||
|
settings = {
|
||||||
|
http = {
|
||||||
|
addr = ":31006";
|
||||||
|
};
|
||||||
|
ntfy = {
|
||||||
|
baseurl = config.services.ntfy-sh.settings.base-url;
|
||||||
|
notification = {
|
||||||
|
topic = "alertmgr";
|
||||||
|
priority = ''
|
||||||
|
status == "firing" ? "urgent" : "default"
|
||||||
|
'';
|
||||||
|
tags = [
|
||||||
|
{
|
||||||
|
tag = "+1";
|
||||||
|
condition = ''status == "resolved"'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
templates = {
|
||||||
|
title = ''
|
||||||
|
{{ if eq .Status "resolved" }}Resolved: {{ end }}{{ index .Annotations "summary" }}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
{{ index .Annotations "description" }}
|
||||||
|
'';
|
||||||
|
headers.X-Click = ''
|
||||||
|
{{ .GeneratorURL }}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
35
system/dev/dn-server/services/ntfy.nix
Normal file
35
system/dev/dn-server/services/ntfy.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
fqdn ? null,
|
||||||
|
}:
|
||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
port = 31004;
|
||||||
|
finalFqdn = if fqdn == null then config.networking.fqdn else fqdn;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemConf.security.allowedDomains = [
|
||||||
|
"ntfy.sh"
|
||||||
|
];
|
||||||
|
|
||||||
|
services.ntfy-sh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
listen-http = ":${toString port}";
|
||||||
|
base-url = "https://${finalFqdn}";
|
||||||
|
upstream-base-url = "https://ntfy.sh";
|
||||||
|
behind-proxy = true;
|
||||||
|
proxy-trusted-hosts = "127.0.0.1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
"${finalFqdn}" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyWebsockets = true;
|
||||||
|
proxyPass = "http://127.0.0.1:${toString port}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -87,5 +87,10 @@ in
|
||||||
owner = "crowdsec";
|
owner = "crowdsec";
|
||||||
mode = "0600";
|
mode = "0600";
|
||||||
};
|
};
|
||||||
|
"opencloud" = mkIf config.services.opencloud.enable {
|
||||||
|
owner = config.services.opencloud.user;
|
||||||
|
group = config.services.opencloud.group;
|
||||||
|
mode = "0600";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
inputs,
|
||||||
system,
|
system,
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,11 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services."phpfpm-nextcloud".postStart = ''
|
||||||
|
${config.services.nextcloud.occ}/bin/nextcloud-occ config:app:set recognize node_binary --value '${lib.getExe pkgs.nodejs_22}'
|
||||||
|
${config.services.nextcloud.occ}/bin/nextcloud-occ config:app:set recognize tensorflow.purejs --value 'true'
|
||||||
|
'';
|
||||||
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = nextcloudPkg;
|
package = nextcloudPkg;
|
||||||
|
|
@ -88,9 +93,10 @@ in
|
||||||
whiteboard
|
whiteboard
|
||||||
user_oidc
|
user_oidc
|
||||||
memories
|
memories
|
||||||
|
recognize # May break
|
||||||
;
|
;
|
||||||
|
|
||||||
inherit recognize;
|
# inherit recognize;
|
||||||
|
|
||||||
camerarawpreviews = pkgs.fetchNextcloudApp {
|
camerarawpreviews = pkgs.fetchNextcloudApp {
|
||||||
url = "https://github.com/ariselseng/camerarawpreviews/releases/download/v0.8.8/camerarawpreviews_nextcloud.tar.gz";
|
url = "https://github.com/ariselseng/camerarawpreviews/releases/download/v0.8.8/camerarawpreviews_nextcloud.tar.gz";
|
||||||
|
|
|
||||||
23
system/modules/opencloud.nix
Normal file
23
system/modules/opencloud.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
fqdn ? null,
|
||||||
|
https ? false,
|
||||||
|
envFile ? null,
|
||||||
|
}:
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) optionalString mkIf;
|
||||||
|
finalFqdn = if fqdn == null then config.networking.fqdn else fqdn;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.opencloud = {
|
||||||
|
enable = true;
|
||||||
|
url = "http${optionalString https "s"}://${finalFqdn}";
|
||||||
|
environmentFile = envFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."${finalFqdn}" = mkIf https {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/".proxyPass = "http://127.0.0.1:${toString config.services.opencloud.port}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -84,6 +84,11 @@ in
|
||||||
tls.implicit = true;
|
tls.implicit = true;
|
||||||
proxy_protocol = true;
|
proxy_protocol = true;
|
||||||
};
|
};
|
||||||
|
jmap = {
|
||||||
|
bind = [ "10.0.0.130:31004" ];
|
||||||
|
protocol = "http";
|
||||||
|
proxy_protocol = true;
|
||||||
|
};
|
||||||
management = {
|
management = {
|
||||||
protocol = "http";
|
protocol = "http";
|
||||||
bind = [
|
bind = [
|
||||||
|
|
@ -135,6 +140,7 @@ in
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"mail.${domain}" = {
|
"mail.${domain}" = {
|
||||||
locations."/".proxyPass = "http://127.0.0.1:8080";
|
locations."/".proxyPass = "http://127.0.0.1:8080";
|
||||||
|
locations."/jmap".proxyPass = "http://127.0.0.1:31004";
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue