feat: add formatter

This commit is contained in:
danny 2026-01-10 12:46:40 +08:00
parent d036cf224a
commit cf005ff872
269 changed files with 369 additions and 226 deletions

0
home/config/.face Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before After
Before After

0
home/config/firefox/autohide_toolbox.css Normal file → Executable file
View file

0
home/config/firefox/nightTab.json Normal file → Executable file
View file

0
home/config/fish/functions/fish_prompt.fish Normal file → Executable file
View file

0
home/config/gh/config.yaml Normal file → Executable file
View file

0
home/config/ghostty/shader/mnoise.glsl Normal file → Executable file
View file

0
home/config/rofi/apps.rasi Normal file → Executable file
View file

0
home/config/rofi/config.rasi Normal file → Executable file
View file

0
home/config/rofi/gruvbox-material.rasi Normal file → Executable file
View file

0
home/config/tmux.yaml Normal file → Executable file
View file

0
home/config/wlogout/icons/hibernate.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 307 B

Before After
Before After

0
home/config/wlogout/icons/lock.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 319 B

Before After
Before After

0
home/config/wlogout/icons/logout.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 365 B

Before After
Before After

0
home/config/wlogout/icons/reboot.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 398 B

Before After
Before After

0
home/config/wlogout/icons/shutdown.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

Before After
Before After

0
home/config/wlogout/icons/suspend.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 350 B

After

Width:  |  Height:  |  Size: 350 B

Before After
Before After

0
home/config/zen/zen-keyboard-shortcuts.json Normal file → Executable file
View file

0
home/options/default.nix Normal file → Executable file
View file

0
home/options/hyprlock.nix Normal file → Executable file
View file

0
home/options/noctalia.nix Normal file → Executable file
View file

0
home/options/ntfy-client.nix Normal file → Executable file
View file

0
home/options/sunsetr.nix Normal file → Executable file
View file

0
home/presets/basic.nix Normal file → Executable file
View file

0
home/scripts/md2html.nix Normal file → Executable file
View file

106
home/scripts/memeSelector.nix Normal file → Executable file
View file

@ -3,68 +3,68 @@
url,
...
}:
pkgs.writers.writePython3Bin "memeSelector" {libraries = with pkgs.python3Packages; [requests];}
''
import requests
import xml.etree.ElementTree as ET
import urllib.parse
import sys
import os
import tempfile
import subprocess
pkgs.writers.writePython3Bin "memeSelector" { libraries = with pkgs.python3Packages; [ requests ]; }
''
import requests
import xml.etree.ElementTree as ET
import urllib.parse
import sys
import os
import tempfile
import subprocess
BASE_URL = "${url}"
headers = {"Depth": "1"}
resp = requests.request(
"PROPFIND",
BASE_URL,
headers=headers,
verify="${"" + ../../system/extra/ca.crt}"
)
BASE_URL = "${url}"
headers = {"Depth": "1"}
resp = requests.request(
"PROPFIND",
BASE_URL,
headers=headers,
verify="${"" + ../../system/extra/ca.crt}"
)
if resp.status_code not in (200, 207):
print(f"Error: Http {resp.status_code}")
sys.exit(1)
if resp.status_code not in (200, 207):
print(f"Error: Http {resp.status_code}")
sys.exit(1)
root = ET.fromstring(resp.text)
ns = {"d": "DAV:"}
root = ET.fromstring(resp.text)
ns = {"d": "DAV:"}
files = []
for href in root.findall(".//d:href", ns):
path = href.text
if not path:
continue
filename = urllib.parse.unquote(path.split("/")[-1])
files = []
for href in root.findall(".//d:href", ns):
path = href.text
if not path:
continue
filename = urllib.parse.unquote(path.split("/")[-1])
if filename and not filename.endswith("/"):
files.append(filename)
if filename and not filename.endswith("/"):
files.append(filename)
if not files:
print("No files found")
sys.exit(0)
if not files:
print("No files found")
sys.exit(0)
rofi = subprocess.run(
["rofi", "-i", "-dmenu", "-p", "Meme"],
input="\n".join(files).encode(),
stdout=subprocess.PIPE
)
rofi = subprocess.run(
["rofi", "-i", "-dmenu", "-p", "Meme"],
input="\n".join(files).encode(),
stdout=subprocess.PIPE
)
selected = rofi.stdout.decode().strip()
if not selected:
sys.exit(0)
selected = rofi.stdout.decode().strip()
if not selected:
sys.exit(0)
url = BASE_URL + urllib.parse.quote(selected)
tmpfile = os.path.join(tempfile.gettempdir(), selected)
url = BASE_URL + urllib.parse.quote(selected)
tmpfile = os.path.join(tempfile.gettempdir(), selected)
subprocess.run(["wget", "-q", "-O", tmpfile, url], check=True)
subprocess.run(["wget", "-q", "-O", tmpfile, url], check=True)
with open(tmpfile, "rb") as f:
subprocess.run("wl-copy", stdin=f)
with open(tmpfile, "rb") as f:
subprocess.run("wl-copy", stdin=f)
subprocess.run([
"notify-send",
"-i", tmpfile,
"Meme Copied: ",
f"{selected}"
])
''
subprocess.run([
"notify-send",
"-i", tmpfile,
"Meme Copied: ",
f"{selected}"
])
''

0
home/scripts/mkWall.nix Normal file → Executable file
View file

0
home/scripts/ntfy.nix Normal file → Executable file
View file

0
home/scripts/rbwSelector.nix Normal file → Executable file
View file

0
home/scripts/record.nix Normal file → Executable file
View file

0
home/scripts/remoteRebuild.nix Normal file → Executable file
View file

0
home/scripts/rofiwall.nix Normal file → Executable file
View file

0
home/user/bitwarden.nix Normal file → Executable file
View file

0
home/user/config.nix Normal file → Executable file
View file

0
home/user/direnv.nix Normal file → Executable file
View file

0
home/user/environment.nix Normal file → Executable file
View file

0
home/user/firefox.nix Normal file → Executable file
View file

0
home/user/ghostty.nix Normal file → Executable file
View file

0
home/user/git.nix Normal file → Executable file
View file

0
home/user/gtk.nix Normal file → Executable file
View file

0
home/user/hypr/bind.nix Normal file → Executable file
View file

0
home/user/hypr/input.nix Normal file → Executable file
View file

0
home/user/hypr/window.nix Normal file → Executable file
View file

0
home/user/hypr/windowrule.nix Normal file → Executable file
View file

0
home/user/hypr/workspace.nix Normal file → Executable file
View file

0
home/user/hyprland.nix Normal file → Executable file
View file

0
home/user/internationalisation.nix Normal file → Executable file
View file

0
home/user/music-production.nix Normal file → Executable file
View file

18
home/user/nvf/default.nix Normal file → Executable file
View file

@ -7,8 +7,9 @@
...
}:
let
inherit (builtins) concatStringsSep;
inherit (lib.generators) mkLuaInline;
inherit (lib) concatStringsSep optionalString;
inherit (lib) optionalString;
suda-nvim = pkgs.vimUtils.buildVimPlugin {
name = "vim-suda";
@ -369,11 +370,11 @@ in
formatter = {
conform-nvim = {
enable = true;
setupOpts = {
formatters_by_ft = {
nix = [ "nixfmt" ];
};
};
# setupOpts = {
# formatters_by_ft = {
# nix = [ "nixfmt" ];
# };
# };
};
};
@ -420,7 +421,10 @@ in
nix = {
enable = true;
extraDiagnostics.enable = false;
format.enable = false; # Manually configured in conform-nvim
format = {
type = [ "nixfmt" ];
enable = true;
};
lsp.servers = [ "nixd" ];
};
sql.enable = true;

0
home/user/nvf/extra-lsp.nix Normal file → Executable file
View file

0
home/user/nvf/plugins/leetcode/default.nix Normal file → Executable file
View file

0
home/user/nvf/plugins/lualine/default.nix Normal file → Executable file
View file

0
home/user/nvf/plugins/snacks-nvim/default.nix Normal file → Executable file
View file

0
home/user/nvf/plugins/snacks-nvim/keymaps.nix Normal file → Executable file
View file

0
home/user/packages.nix Normal file → Executable file
View file

0
home/user/podman.nix Normal file → Executable file
View file

0
home/user/shell.nix Normal file → Executable file
View file

0
home/user/shellAlias.nix Normal file → Executable file
View file

0
home/user/shells/caelestia.nix Normal file → Executable file
View file

0
home/user/tmux.nix Normal file → Executable file
View file

0
home/user/virtualization.nix Normal file → Executable file
View file

0
home/user/vscode.nix Normal file → Executable file
View file

0
home/user/wallpaper-engine.nix Normal file → Executable file
View file

0
home/user/waybar.nix Normal file → Executable file
View file

0
home/user/wlogout.nix Normal file → Executable file
View file

0
home/user/wm-service.nix Normal file → Executable file
View file

0
home/user/yazi.nix Normal file → Executable file
View file

0
home/user/zellij.nix Normal file → Executable file
View file

0
home/user/zen-browser.nix Normal file → Executable file
View file