refractor

This commit is contained in:
js0ny 2025-11-26 12:31:55 +00:00
parent 8f5d47590f
commit ab6da08e74
10 changed files with 138 additions and 77 deletions

View file

@ -51,6 +51,12 @@
url = "github:nix-community/nix-index-database"; url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
elephant.url = "github:abenz1267/elephant";
walker = {
url = "github:abenz1267/walker";
inputs.elephant.follows = "elephant";
};
}; };
outputs = { outputs = {
@ -72,6 +78,7 @@
nixcord, nixcord,
catppuccin, catppuccin,
nix-index-database, nix-index-database,
walker,
... ...
} @ inputs: let } @ inputs: let
overlays = [ overlays = [
@ -96,6 +103,9 @@
"nixvirt" "nixvirt"
"polder" "polder"
]; ];
darwinHosts = [
"zen"
];
mkNixosSystem = hostname: mkNixosSystem = hostname:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
@ -109,27 +119,22 @@
{nixpkgs.overlays = overlays;} {nixpkgs.overlays = overlays;}
]; ];
}; };
mkDarwinSystem = hostname:
nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
inherit specialArgs;
modules = [
./hosts/${hostname}
{nixpkgs.overlays = overlays;}
];
};
in { in {
# This will automatically generate nixOS config for `nixosHosts' # This will automatically generate nixOS config for `nixosHosts'
# Include the module ./hosts/${hostname} by default. # Include the module ./hosts/${hostname} by default.
nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem; nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem;
darwinConfigurations = nixpkgs.lib.genAttrs darwinHosts mkDarwinSystem;
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
inherit specialArgs;
modules = [
./hosts/zen
];
};
homeConfigurations = { homeConfigurations = {
js0ny = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny
];
};
"js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration { "js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux"; pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs; extraSpecialArgs = specialArgs;
@ -143,20 +148,7 @@
nixcord.homeModules.nixcord nixcord.homeModules.nixcord
catppuccin.homeModules.catppuccin catppuccin.homeModules.catppuccin
nix-index-database.homeModules.nix-index nix-index-database.homeModules.nix-index
]; walker.homeManagerModules.default
};
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/nixvirt.nix
];
};
"js0ny@polder" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/polder.nix
]; ];
}; };
"js0ny@zen" = home-manager.lib.homeManagerConfiguration { "js0ny@zen" = home-manager.lib.homeManagerConfiguration {

View file

@ -47,6 +47,7 @@
"telegram-desktop" "telegram-desktop"
"io.github.kukuruzka165.materialgram" "io.github.kukuruzka165.materialgram"
"materialgram" "materialgram"
"com.ayugram.desktop"
"wechat" "wechat"
]; ];
}; };

View file

@ -42,6 +42,20 @@
'' ''
) )
); );
# run wmname LG3D
mkLegacyJavaGUIApp = builtins.map (
p:
lib.hiPrio (
pkgs.runCommand "${p.name}-wrapped" {nativeBuildInputs = with pkgs; [makeWrapper wmname];} ''
mkdir -p $out/bin
ln -s ${p}/share $out/share
makeWrapper \
${p}/bin/${p.meta.mainProgram or p.pname} \
$out/bin/${p.meta.mainProgram or p.pname} \
--run 'wmname LG3D'
''
)
);
in { in {
home.packages = with pkgs; home.packages = with pkgs;
[ [
@ -103,7 +117,6 @@ in {
bruno-cli bruno-cli
kicad kicad
blender blender
logisim-evolution
onlyoffice-desktopeditors onlyoffice-desktopeditors
wayland-bongocat wayland-bongocat
kdePackages.qttools kdePackages.qttools
@ -111,6 +124,7 @@ in {
nur.repos.forkprince.helium-nightly nur.repos.forkprince.helium-nightly
prismlauncher prismlauncher
obsidian obsidian
file-roller
] ]
++ (mkFcitxIM [ ++ (mkFcitxIM [
pkgs.neovim-qt pkgs.neovim-qt
@ -118,6 +132,9 @@ in {
++ (mkElectronWayland [ ++ (mkElectronWayland [
# pkgs.ticktick # pkgs.ticktick
pkgs.cider-2 pkgs.cider-2
])
++ (mkLegacyJavaGUIApp [
pkgs.logisim-evolution
]); ]);
home.sessionVariables = { home.sessionVariables = {

View file

@ -1,13 +0,0 @@
# ~/.config/nixcfgs/users/js0ny/polder.nix
{...}: {
imports = [
./default.nix
./programs/shell.nix
../../modules/home/dev/nix.nix
../../modules/home/programs/fzf.nix
../../modules/home/programs/lsd.nix
../../modules/home/programs/nvim.nix
];
home.stateVersion = "25.05";
}

View file

@ -9,7 +9,7 @@
iconTheme = config.currentUser.iconTheme; iconTheme = config.currentUser.iconTheme;
explorer = config.currentUser.defaultExplorer; explorer = config.currentUser.defaultExplorer;
explorerTerm = config.currentUser.defaultTerminalExplorer; explorerTerm = config.currentUser.defaultTerminalExplorer;
launcher = "rofi"; launcher = "walker";
kbdBacklightDev = config.currentHost.keyboardBacklightDevice; kbdBacklightDev = config.currentHost.keyboardBacklightDevice;
kbdBacklightStep = config.currentHost.keyboardBacklightStep; kbdBacklightStep = config.currentHost.keyboardBacklightStep;
nirictl = import ./scripts.nix {inherit pkgs;}; nirictl = import ./scripts.nix {inherit pkgs;};
@ -23,6 +23,7 @@ in {
"Mod+B".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "firefox" "firefox"; "Mod+B".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "firefox" "firefox";
"Mod+Shift+B".hotkey-overlay.title = "Launch web browser in private mode"; "Mod+Shift+B".hotkey-overlay.title = "Launch web browser in private mode";
"Mod+Shift+B".action = spawn "firefox" "--private-window"; "Mod+Shift+B".action = spawn "firefox" "--private-window";
"Mod+A".action = spawn-sh "${termRunner} --class=terminal-popup -e aichat --session";
"Mod+Shift+A".hotkey-overlay.title = "Focus or launch CherryStudio (AI assistant)"; "Mod+Shift+A".hotkey-overlay.title = "Focus or launch CherryStudio (AI assistant)";
"Mod+Shift+A".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "CherryStudio" "cherry-studio"; "Mod+Shift+A".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "CherryStudio" "cherry-studio";
"Mod+O".hotkey-overlay.title = "Focus or launch Obsidian"; "Mod+O".hotkey-overlay.title = "Focus or launch Obsidian";
@ -30,10 +31,12 @@ in {
# TODO: Change "org.kde.dolphin" to a more generic explorer app id via config.currentUser # TODO: Change "org.kde.dolphin" to a more generic explorer app id via config.currentUser
"Mod+E".hotkey-overlay.title = "Focus or launch file explorer"; "Mod+E".hotkey-overlay.title = "Focus or launch file explorer";
"Mod+E".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "org.kde.dolphin" "dolphin"; "Mod+E".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "org.kde.dolphin" "dolphin";
"Mod+T".action = spawn-sh "${termRunner} --class=terminal-popup";
"Mod+Shift+T".action = spawn-sh "${termRunner} --class=${termRunner}-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop";
"Mod+Semicolon".action = spawn "neovide" "${config.home.homeDirectory}/Atelier"; "Mod+Semicolon".action = spawn "neovide" "${config.home.homeDirectory}/Atelier";
"Mod+Apostrophe".action = "Mod+Apostrophe".action =
spawn-sh "EDITOR_MINIMAL=1 ${termRunner} -o close_on_child_death=yes --class=edit-clipboard-popup -e edit-clipboard --minimal"; spawn-sh "EDITOR_MINIMAL=1 ${termRunner} -o close_on_child_death=yes --class=terminal-popup -e edit-clipboard --minimal";
"Mod+Shift+Slash".action = show-hotkey-overlay; "Mod+Shift+Slash".action = show-hotkey-overlay;
@ -42,17 +45,19 @@ in {
"Mod+D".hotkey-overlay.title = "Run an Application: rofi"; "Mod+D".hotkey-overlay.title = "Run an Application: rofi";
"Mod+D".action = "Mod+D".action =
spawn "${launcher}" "-show" "drun" "-icon-theme" "${iconTheme}" "-show-icons"; spawn "${launcher}" "-m" "desktopapplications";
"Alt+Space".hotkey-overlay.title = "Run an Application: rofi"; "Alt+Space".hotkey-overlay.title = "Run an Application: rofi";
"Alt+Space".action = "Alt+Space".action =
spawn "${launcher}" "-show" "drun" "-icon-theme" "${iconTheme}" "-show-icons"; spawn "${launcher}" "-m" "desktopapplications";
"Mod+W".hotkey-overlay.title = "Search open Window: rofi"; "Mod+W".hotkey-overlay.title = "Search open Window: rofi";
"Mod+W".action = "Mod+W".action =
spawn "${launcher}" "-show" "window" "-icon-theme" "${iconTheme}" "-show-icons"; spawn "${launcher}" "-m" "windows";
"Mod+V".action = spawn-sh "cliphist list | ${launcher} -dmenu | cliphist decode | wl-copy"; "Mod+V".action =
# spawn-sh "cliphist list | ${launcher} -dmenu | cliphist decode | wl-copy";
spawn "${launcher}" "-m" "clipboard";
"XF86AudioRaiseVolume".allow-when-locked = true; "XF86AudioRaiseVolume".allow-when-locked = true;
"XF86AudioRaiseVolume".action = "XF86AudioRaiseVolume".action =

View file

@ -5,7 +5,7 @@
{ {
matches = [ matches = [
{ {
app-id = "^edit-clipboard-popup$"; app-id = "^.*terminal-popup$";
} }
]; ];
@ -100,7 +100,7 @@
} }
{ {
app-id = "^com.ayugram.desktop$"; app-id = "^com.ayugram.desktop$";
title = "^Media viewer$"; title = "^m|Media viewer$";
} }
{ {
app-id = "^io.github.kukuruzka165.materialgram$"; app-id = "^io.github.kukuruzka165.materialgram$";

View file

@ -33,7 +33,7 @@
''; '';
in { in {
imports = [ imports = [
../../rofi.nix ../../walker.nix
./waybar ./waybar
./swww.nix ./swww.nix
./kanshi.nix ./kanshi.nix

View file

@ -44,6 +44,7 @@ in {
shell = config.currentUser.defaultShell; shell = config.currentUser.defaultShell;
allow_remote_control = "socket-only"; allow_remote_control = "socket-only";
listen_on = "unix:/tmp/kitty.sock"; listen_on = "unix:/tmp/kitty.sock";
confirm_os_window_close = 0;
}; };
keybindings = { keybindings = {
"cmd+c" = "copy_and_clear_or_interrupt"; "cmd+c" = "copy_and_clear_or_interrupt";

View file

@ -3,6 +3,47 @@
# * when `rga-fzf`: nvim wrapper failed to launch # * when `rga-fzf`: nvim wrapper failed to launch
# * nvim wrapper reports error on parsing filename with spaces # * nvim wrapper reports error on parsing filename with spaces
gvim = "neovide.desktop"; gvim = "neovide.desktop";
simpleText = [
"text/plain"
"text/x-csrc" # .c
"text/x-chdr" # .h
"text/javascript"
"text/x-python"
"application/yaml" # .yaml, .yml
];
image = [
"image/jpeg"
"image/jpg"
"image/png"
"image/gif"
"image/bmp"
"image/avif"
"image/webp"
];
audio = [
"audio/flac"
"audio/vnd.wave" # .wav
];
browser = [
"text/html"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
archive = [
"application/zip"
"application/x-rar"
"application/x-7z-compressed"
"application/x-tar"
"application/x-zstd-compressed-tar" # .tar.zst
];
# Image Viewer:
# gwenview: keyboard driven, high compatibility
# loupe: Performance is incredible
imageViewers = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop";
audioPlayers = "mpv.desktop;org.kde.elisa";
browsers = "firefox.desktop;chromium-browser.desktop";
archiveManager = "org.gnome.FileRoller.desktop;org.kde.ark.desktop;peazip.desktop";
in { in {
xdg.configFile."mimeapps.list".force = true; xdg.configFile."mimeapps.list".force = true;
xdg.mime.enable = true; xdg.mime.enable = true;
@ -25,30 +66,34 @@ in {
"text/markdown" = gvim; "text/markdown" = gvim;
# File Explorer # File Explorer
"inode/directory" = "org.kde.dolphin.desktop"; "inode/directory" = "org.kde.dolphin.desktop";
# Image Viewer: "image/jpeg" = imageViewers;
# gwenview: keyboard driven, high compatibility "image/jpg" = imageViewers;
# loupe: Performance is incredible "image/png" = imageViewers;
"image/jpeg" = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop"; "image/gif" = imageViewers;
"image/jpg" = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop"; "image/bmp" = imageViewers;
"image/png" = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop"; "image/avif" = imageViewers;
"image/gif" = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop"; "image/webp" = imageViewers;
"image/bmp" = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop";
"image/avif" = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop";
"image/webp" = "org.kde.gwenview.desktop;org.gnome.Loupe.desktop";
# Audio: # Audio:
# music: elisa: fully featured, good cjk support # music: elisa: fully featured, good cjk support
# audio: mpv: simple and fast # audio: mpv: simple and fast
"audio/flac" = "mpv.desktop;org.kde.elisa"; "audio/flac" = audioPlayers;
"audio/vnd.wave" = "mpv.desktop;org.kde.elisa"; # .wav "audio/vnd.wave" = audioPlayers; # .wav
# Browser # Browser
"text/html" = "firefox.desktop;chromium-browser.desktop"; "text/html" = browsers;
"x-scheme-handler/http" = "firefox.desktop;chromium-browser.desktop"; "x-scheme-handler/http" = browsers;
"x-scheme-handler/https" = "firefox.desktop;chromium-browser.desktop"; "x-scheme-handler/https" = browsers;
# URL Scheme # URL Scheme
"x-scheme-handler/tg" = "org.telegram.desktop.desktop"; "x-scheme-handler/tg" = "org.telegram.desktop.desktop";
"x-scheme-handler/tonsite" = "org.telegram.desktop.desktop"; "x-scheme-handler/tonsite" = "org.telegram.desktop.desktop";
# Archives
"application/zip" = archiveManager;
"application/x-rar" = archiveManager;
"application/x-7z-compressed" = archiveManager;
"application/x-tar" = archiveManager;
"application/x-zstd-compressed-tar" = archiveManager; # .tar.zst
}; };
}; };
home.sessionVariables.BROWSER = "firefox"; home.sessionVariables.BROWSER = "firefox";

View file

@ -2,15 +2,28 @@
programs.walker = { programs.walker = {
enable = true; enable = true;
runAsService = true; runAsService = true;
providers.prefixes = [ config = {
{ keybinds = {
provider = "websearch"; next = ["Down" "ctrl j"];
prefix = "+"; previous = ["Up" "ctrl k"];
} };
{ providers = {
provider = "providerlist"; default = [
prefix = "_"; "websearch"
} "desktopapplications"
]; "calc"
];
prefixes = [
{
provider = "websearch";
prefix = "+";
}
{
provider = "providerlist";
prefix = "_";
}
];
};
};
}; };
} }