switch to cap based home configs
This commit is contained in:
parent
50ee9aac83
commit
49b6f5bde0
64 changed files with 2064 additions and 1779 deletions
70
programs/default.nix
Normal file
70
programs/default.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./nvim
|
||||
./fish
|
||||
./kanata
|
||||
./kitty
|
||||
./tmux
|
||||
./git
|
||||
./jj
|
||||
./niri
|
||||
./zed
|
||||
./firefox
|
||||
];
|
||||
|
||||
custom.program.graphcial-packages = {
|
||||
requirements = [ "graphical" ];
|
||||
home-config = _: {
|
||||
home.packages = with pkgs; [
|
||||
spotify
|
||||
obsidian
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
custom.program.fun-packages = {
|
||||
requirements = [ "fun" ];
|
||||
home-config = _: {
|
||||
home.packages = with pkgs; [
|
||||
p1n3appl3.tab
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
custom.program.homedirs = {
|
||||
home-config =
|
||||
{ config, ... }:
|
||||
{
|
||||
home.file = {
|
||||
"dl".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.download}";
|
||||
"doc".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.documents}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
custom.program.xdg = {
|
||||
home-config =
|
||||
{ config, ... }:
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
|
||||
configHome = "${config.home.homeDirectory}/.config";
|
||||
userDirs = {
|
||||
enable = true;
|
||||
documents = "${config.home.homeDirectory}/Documents";
|
||||
desktop = "${config.home.homeDirectory}/Documents";
|
||||
download = "${config.home.homeDirectory}/Downloads";
|
||||
music = "${config.home.homeDirectory}/Documents/personal/music";
|
||||
pictures = "${config.home.homeDirectory}/Documents/personal/pictures";
|
||||
};
|
||||
|
||||
mime.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,153 +1,158 @@
|
|||
{
|
||||
config,
|
||||
flakes,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
ff-pkgs = flakes.firefox-addons.packages.${pkgs.system};
|
||||
lock-false = {
|
||||
Value = false;
|
||||
Status = "locked";
|
||||
};
|
||||
# lock-true = {
|
||||
# Value = true;
|
||||
# Status = "locked";
|
||||
# };
|
||||
in
|
||||
{
|
||||
|
||||
home.file."${config.programs.firefox.profilesPath}/main/chrome".source =
|
||||
"${flakes.firefox-sidebar-css}";
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
|
||||
extraPolicies = {
|
||||
DisableFormHistory = true;
|
||||
OfferToSaveLogins = false;
|
||||
PasswordManagerEnabled = false;
|
||||
AppAutoUpdate = false;
|
||||
DisableFirefoxStudies = true;
|
||||
DisablePocket = true;
|
||||
DisableTelemetry = true;
|
||||
UserMessaging = {
|
||||
WhatsNew = true;
|
||||
ExtensionRecommendations = false;
|
||||
FeatureRecommendations = false;
|
||||
UrlbarInterventions = false;
|
||||
SkipOnboarding = true;
|
||||
MoreFromMozilla = false;
|
||||
Locked = true;
|
||||
};
|
||||
FirefoxHome = {
|
||||
Search = true;
|
||||
TopSites = false;
|
||||
SponsoredTopSites = false;
|
||||
Highlights = false;
|
||||
Pocket = false;
|
||||
SponsoredPocket = false;
|
||||
Snippets = false;
|
||||
Locked = false;
|
||||
};
|
||||
FirefoxSuggest = {
|
||||
WebSuggestions = false;
|
||||
SponsoredSuggestions = false;
|
||||
ImproveSuggest = false;
|
||||
Locked = true;
|
||||
};
|
||||
# TODO: https://github.com/TheRealGramdalf/nixos/blob/83f4339b121175f47940314bf5811080ac42c316/users/games/firefox/privacy.nix
|
||||
_: {
|
||||
custom.program.firefox.requirements = [ "graphical" ];
|
||||
custom.program.firefox.home-config =
|
||||
{
|
||||
config,
|
||||
flakes,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
ff-pkgs = flakes.firefox-addons.packages.${pkgs.system};
|
||||
lock-false = {
|
||||
Value = false;
|
||||
Status = "locked";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
profiles.default = {
|
||||
id = 0;
|
||||
name = "profile_0";
|
||||
isDefault = true;
|
||||
settings = {
|
||||
# specify profile-specific preferences here; check about:config for options
|
||||
"browser.newtabpage.activity-stream.feeds.section.highlights" = false;
|
||||
"browser.startup.page" = 3; # Restore previous tabs
|
||||
"extensions.autoDisableScopes" = 0;
|
||||
"extensions.pocket.enabled" = lock-false;
|
||||
"browser.tabs.closeWindowWithLastTab" = lock-false;
|
||||
"sidebar.position_start" = false; # sidebar on the right
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
|
||||
userChrome = builtins.readFile ./userChrome.css;
|
||||
userContent = builtins.readFile ./userChrome.css;
|
||||
|
||||
extensions.packages = with ff-pkgs; [
|
||||
bitwarden
|
||||
ublock-origin
|
||||
sidebery
|
||||
sponsorblock
|
||||
# vimium
|
||||
];
|
||||
|
||||
bookmarks = {
|
||||
force = true;
|
||||
settings = [
|
||||
{
|
||||
keyword = "!w";
|
||||
url = "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!m";
|
||||
url = "https://www.google.com/maps?q=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!git";
|
||||
url = "https://github.com/search?q=%s&type=code";
|
||||
}
|
||||
{
|
||||
keyword = "!std";
|
||||
url = "https://std.rs%s";
|
||||
}
|
||||
{
|
||||
keyword = "!rust";
|
||||
url = "https://docs.rs/releases/search?query=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!np";
|
||||
url = "https://search.nixos.org/packages?query=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!nf";
|
||||
url = "https://search.nixos.org/flakes?query=%s";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# extensions.settings = {
|
||||
# "${ff-pkgs.sidebery.addonId}".settings = {
|
||||
# sidebar = {
|
||||
# # panels = with builtins; with lib; listToAttrs (map ffContainerToSideberryPanel (attrsToList containers));
|
||||
# # nav = [ "Personal" "Programming"];
|
||||
# };
|
||||
# # https://github.com/Dash-L/nixconfig/blob/c30f6d1486a3fe2b3793ab0cb13a88edefe83b7a/home/firefox.nix#L82
|
||||
# settings = {
|
||||
# pinnedTabsPosition = "top";
|
||||
# hideEmptyPanels = false;
|
||||
# activateAfterClosing = "prev";
|
||||
# activateAfterClosingStayInPanel = true;
|
||||
# newTabCtxReopen = true;
|
||||
# };
|
||||
# };
|
||||
# lock-true = {
|
||||
# Value = true;
|
||||
# Status = "locked";
|
||||
# };
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
|
||||
extraPolicies = {
|
||||
DisableFormHistory = true;
|
||||
OfferToSaveLogins = false;
|
||||
PasswordManagerEnabled = false;
|
||||
AppAutoUpdate = false;
|
||||
DisableFirefoxStudies = true;
|
||||
DisablePocket = true;
|
||||
DisableTelemetry = true;
|
||||
UserMessaging = {
|
||||
WhatsNew = true;
|
||||
ExtensionRecommendations = false;
|
||||
FeatureRecommendations = false;
|
||||
UrlbarInterventions = false;
|
||||
SkipOnboarding = true;
|
||||
MoreFromMozilla = false;
|
||||
Locked = true;
|
||||
};
|
||||
FirefoxHome = {
|
||||
Search = true;
|
||||
TopSites = false;
|
||||
SponsoredTopSites = false;
|
||||
Highlights = false;
|
||||
Pocket = false;
|
||||
SponsoredPocket = false;
|
||||
Snippets = false;
|
||||
Locked = false;
|
||||
};
|
||||
FirefoxSuggest = {
|
||||
WebSuggestions = false;
|
||||
SponsoredSuggestions = false;
|
||||
ImproveSuggest = false;
|
||||
Locked = true;
|
||||
};
|
||||
# TODO: https://github.com/TheRealGramdalf/nixos/blob/83f4339b121175f47940314bf5811080ac42c316/users/games/firefox/privacy.nix
|
||||
};
|
||||
|
||||
xdg.mimeApps = {
|
||||
defaultApplications."x-scheme-handler/http" = [
|
||||
"firefox.desktop"
|
||||
];
|
||||
defaultApplications."x-scheme-handler/https" = [
|
||||
"firefox.desktop"
|
||||
];
|
||||
defaultApplications."text/html" = [ "firefox.desktop" ];
|
||||
defaultApplications."x-scheme-handler/about" = [ "firefox.desktop" ];
|
||||
defaultApplications."x-scheme-handler/unknown" = [ "firefox.desktop" ];
|
||||
};
|
||||
};
|
||||
|
||||
profiles.default = {
|
||||
id = 0;
|
||||
name = "profile_0";
|
||||
isDefault = true;
|
||||
settings = {
|
||||
# specify profile-specific preferences here; check about:config for options
|
||||
"browser.newtabpage.activity-stream.feeds.section.highlights" = false;
|
||||
"browser.startup.page" = 3; # Restore previous tabs
|
||||
"extensions.autoDisableScopes" = 0;
|
||||
"extensions.pocket.enabled" = lock-false;
|
||||
"browser.tabs.closeWindowWithLastTab" = lock-false;
|
||||
"sidebar.position_start" = false; # sidebar on the right
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
|
||||
userChrome = builtins.readFile ./userChrome.css;
|
||||
userContent = builtins.readFile ./userChrome.css;
|
||||
|
||||
extensions.packages = with ff-pkgs; [
|
||||
bitwarden
|
||||
ublock-origin
|
||||
sidebery
|
||||
sponsorblock
|
||||
# vimium
|
||||
];
|
||||
|
||||
bookmarks = {
|
||||
force = true;
|
||||
settings = [
|
||||
{
|
||||
keyword = "!w";
|
||||
url = "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!m";
|
||||
url = "https://www.google.com/maps?q=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!git";
|
||||
url = "https://github.com/search?q=%s&type=code";
|
||||
}
|
||||
{
|
||||
keyword = "!std";
|
||||
url = "https://std.rs%s";
|
||||
}
|
||||
{
|
||||
keyword = "!rust";
|
||||
url = "https://docs.rs/releases/search?query=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!np";
|
||||
url = "https://search.nixos.org/packages?query=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!nho";
|
||||
url = "https://home-manager-options.extranix.com/?query=%s";
|
||||
}
|
||||
{
|
||||
keyword = "!no";
|
||||
url = "https://search.nixos.org/options?query=%s";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# extensions.settings = {
|
||||
# "${ff-pkgs.sidebery.addonId}".settings = {
|
||||
# sidebar = {
|
||||
# # panels = with builtins; with lib; listToAttrs (map ffContainerToSideberryPanel (attrsToList containers));
|
||||
# # nav = [ "Personal" "Programming"];
|
||||
# };
|
||||
# # https://github.com/Dash-L/nixconfig/blob/c30f6d1486a3fe2b3793ab0cb13a88edefe83b7a/home/firefox.nix#L82
|
||||
# settings = {
|
||||
# pinnedTabsPosition = "top";
|
||||
# hideEmptyPanels = false;
|
||||
# activateAfterClosing = "prev";
|
||||
# activateAfterClosingStayInPanel = true;
|
||||
# newTabCtxReopen = true;
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
xdg.mimeApps = {
|
||||
defaultApplications."x-scheme-handler/http" = [
|
||||
"firefox.desktop"
|
||||
];
|
||||
defaultApplications."x-scheme-handler/https" = [
|
||||
"firefox.desktop"
|
||||
];
|
||||
defaultApplications."text/html" = [ "firefox.desktop" ];
|
||||
defaultApplications."x-scheme-handler/about" = [ "firefox.desktop" ];
|
||||
defaultApplications."x-scheme-handler/unknown" = [ "firefox.desktop" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,236 +1,241 @@
|
|||
{ config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
with builtins;
|
||||
with lib.attrsets;
|
||||
let
|
||||
scripts = (import ./scripts.nix) pkgs;
|
||||
aliases = with scripts; {
|
||||
"cp-mov" = cp-media "mov" "movies";
|
||||
"cp-ser" = cp-media "ser" "shows";
|
||||
"cp-ani" = cp-media "ani" "anime";
|
||||
"dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm";
|
||||
"p" = builtins.trace calc calc;
|
||||
"s" = "systemctl";
|
||||
"j" = "journalctl";
|
||||
"ju" = "journalctl -u";
|
||||
"jfu" = "journalctl -fu";
|
||||
"ls" = "${pkgs.eza}/bin/eza --git";
|
||||
"ll" = "${pkgs.eza}/bin/eza --git";
|
||||
"lt" = "${pkgs.eza}/bin/eza --long --tree -L 3";
|
||||
"open" = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||
"cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy";
|
||||
"cat" = "${pkgs.bat}/bin/bat";
|
||||
_: {
|
||||
custom.program.fish.requirements = [ "cli" ];
|
||||
custom.program.fish.home-config =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with builtins;
|
||||
with lib.attrsets;
|
||||
let
|
||||
scripts = (import ./scripts.nix) pkgs;
|
||||
aliases = with scripts; {
|
||||
"cp-mov" = cp-media "mov" "movies";
|
||||
"cp-ser" = cp-media "ser" "shows";
|
||||
"cp-ani" = cp-media "ani" "anime";
|
||||
"dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm";
|
||||
"p" = builtins.trace calc calc;
|
||||
"s" = "systemctl";
|
||||
"j" = "journalctl";
|
||||
"ju" = "journalctl -u";
|
||||
"jfu" = "journalctl -fu";
|
||||
"ls" = "${pkgs.eza}/bin/eza --git";
|
||||
"ll" = "${pkgs.eza}/bin/eza --git";
|
||||
"lt" = "${pkgs.eza}/bin/eza --long --tree -L 3";
|
||||
"open" = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||
"cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy";
|
||||
"cat" = "${pkgs.bat}/bin/bat";
|
||||
|
||||
# "pull" = "${pkgs.git}/bin/git pull";
|
||||
# "push" = "${pkgs.git}/bin/git push";
|
||||
# "commit" = "${pkgs.git}/bin/git commit";
|
||||
# "add" = "${pkgs.git}/bin/git add";
|
||||
# "patch" = "${pkgs.git}/bin/git add -p";
|
||||
# "amend" = "${pkgs.git}/bin/git commit --amend";
|
||||
# "log" = "${pkgs.git}/bin/git log --all --graph --decorate";
|
||||
# "st" = "${pkgs.git}/bin/git status";
|
||||
# "checkout" = "${pkgs.git}/bin/git checkout";
|
||||
# "rebase" = "${pkgs.git}/bin/git rebase";
|
||||
# "stash" = "${pkgs.git}/bin/git stash";
|
||||
# "pull" = "${pkgs.git}/bin/git pull";
|
||||
# "push" = "${pkgs.git}/bin/git push";
|
||||
# "commit" = "${pkgs.git}/bin/git commit";
|
||||
# "add" = "${pkgs.git}/bin/git add";
|
||||
# "patch" = "${pkgs.git}/bin/git add -p";
|
||||
# "amend" = "${pkgs.git}/bin/git commit --amend";
|
||||
# "log" = "${pkgs.git}/bin/git log --all --graph --decorate";
|
||||
# "st" = "${pkgs.git}/bin/git status";
|
||||
# "checkout" = "${pkgs.git}/bin/git checkout";
|
||||
# "rebase" = "${pkgs.git}/bin/git rebase";
|
||||
# "stash" = "${pkgs.git}/bin/git stash";
|
||||
|
||||
"edit" = "jj edit";
|
||||
"old" = "jj edit @-";
|
||||
"new" = "jj edit @+";
|
||||
"rebase" = "jj rebase";
|
||||
"pull" = "jj git fetch; jj catchup";
|
||||
"msg" = "jj describe -m";
|
||||
"branch" = "jj bookmark set";
|
||||
"stat" = "jj status";
|
||||
"push" = "jj git push";
|
||||
"edit" = "jj edit";
|
||||
"old" = "jj edit @-";
|
||||
"new" = "jj edit @+";
|
||||
"rebase" = "jj rebase";
|
||||
"pull" = "jj git fetch; jj catchup";
|
||||
"msg" = "jj describe -m";
|
||||
"branch" = "jj bookmark set";
|
||||
"stat" = "jj status";
|
||||
"push" = "jj git push";
|
||||
|
||||
"tidy" = "x test tidy --bless";
|
||||
"ui" = "x test tests/ui/";
|
||||
"tidy" = "x test tidy --bless";
|
||||
"ui" = "x test tests/ui/";
|
||||
|
||||
"f" = "nautilus --no-desktop . &";
|
||||
};
|
||||
# extracting any compressed format
|
||||
extract = ''
|
||||
function extract -a file -d "decompress a file"
|
||||
if not test -f $file
|
||||
echo "'$file' is not a valid file"
|
||||
return 1
|
||||
end
|
||||
switch $file
|
||||
# tar can automatically figure out how to decompress
|
||||
case '*.{tar,tar.{bz2,zst,gz,xz},tbz2,tgz'; ${pkgs.gnutar}/bin/tar xf $file; end
|
||||
case '*.bz2'; bunzip2 $file; end
|
||||
case '*.rar'; unrar e $file; end
|
||||
case '*.gz'; gunzip $file; end
|
||||
case '*.zip'; ${pkgs.unzip}/bin/unzip $file; end
|
||||
case '*.Z'; uncompress $file; end
|
||||
case '*.7z'; 7z x $file; end
|
||||
case '*';
|
||||
echo "'$file' cannot be extracted"
|
||||
return 1
|
||||
end
|
||||
end
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs = {
|
||||
atuin = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
|
||||
settings = {
|
||||
filter_mode_shell_up_key_binding = "directory";
|
||||
exit_mode = "return-original";
|
||||
|
||||
workspaces = true;
|
||||
"f" = "nautilus --no-desktop . &";
|
||||
};
|
||||
};
|
||||
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
# enableFishIntegration = lib.mkDefault true;
|
||||
};
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
fish = {
|
||||
enable = true;
|
||||
shellAliases = aliases;
|
||||
plugins = with pkgs.fishPlugins; [
|
||||
{
|
||||
name = "bang-bang";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-bang-bang";
|
||||
rev = "ec991b80ba7d4dda7a962167b036efc5c2d79419";
|
||||
hash = "sha256-oPPCtFN2DPuM//c48SXb4TrFRjJtccg0YPXcAo0Lxq0=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "tide";
|
||||
inherit (tide) src;
|
||||
}
|
||||
{
|
||||
name = "sponge";
|
||||
inherit (sponge) src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
inherit (autopair) src;
|
||||
}
|
||||
];
|
||||
|
||||
functions = {
|
||||
fish_jj_prompt = {
|
||||
body = ''
|
||||
if not ${config.programs.jujutsu.package}/bin/jj root --quiet &>/dev/null
|
||||
# extracting any compressed format
|
||||
extract = ''
|
||||
function extract -a file -d "decompress a file"
|
||||
if not test -f $file
|
||||
echo "'$file' is not a valid file"
|
||||
return 1
|
||||
end
|
||||
switch $file
|
||||
# tar can automatically figure out how to decompress
|
||||
case '*.{tar,tar.{bz2,zst,gz,xz},tbz2,tgz'; ${pkgs.gnutar}/bin/tar xf $file; end
|
||||
case '*.bz2'; bunzip2 $file; end
|
||||
case '*.rar'; unrar e $file; end
|
||||
case '*.gz'; gunzip $file; end
|
||||
case '*.zip'; ${pkgs.unzip}/bin/unzip $file; end
|
||||
case '*.Z'; uncompress $file; end
|
||||
case '*.7z'; 7z x $file; end
|
||||
case '*';
|
||||
echo "'$file' cannot be extracted"
|
||||
return 1
|
||||
end
|
||||
|
||||
${config.programs.jujutsu.package}/bin/jj log --ignore-working-copy --no-graph --color always -r @ -T '
|
||||
separate(
|
||||
" ",
|
||||
bookmarks.join(", "),
|
||||
change_id.shortest(),
|
||||
commit_id.shortest(),
|
||||
if(conflict, "conflict"),
|
||||
if(empty, "empty"),
|
||||
if(divergent, "divergent"),
|
||||
if(hidden, "hidden"),
|
||||
)
|
||||
'
|
||||
'';
|
||||
};
|
||||
|
||||
_tide_item_jj = {
|
||||
body = ''
|
||||
set -l _tide_item_jj_color $_tide_location_color
|
||||
echo -ns $_tide_item_jj_color" ("(fish_jj_prompt)$_tide_item_jj_color")"
|
||||
'';
|
||||
};
|
||||
|
||||
_tide_item_git = {
|
||||
body = ''
|
||||
if not test -d .jj
|
||||
fish_git_prompt '%s'
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
fish_vi_key_bindings
|
||||
|
||||
set -g sponge_successful_exit_codes 0
|
||||
set -g sponge_allow_previously_successful false
|
||||
set -g sponge_delay 10
|
||||
|
||||
${config.programs.jujutsu.package}/bin/jj util completion fish | source
|
||||
|
||||
# if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items
|
||||
# set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items)
|
||||
# if test $tide_item_jj_idx
|
||||
# set tide_left_prompt_items \
|
||||
# $tide_left_prompt_items[1..$tide_item_jj_idx] \
|
||||
# jj \
|
||||
# $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1]
|
||||
# end
|
||||
# end
|
||||
|
||||
function t
|
||||
cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)"
|
||||
end
|
||||
|
||||
function temp
|
||||
t $argv
|
||||
end
|
||||
|
||||
function rs
|
||||
cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)"
|
||||
cargo init . --bin --name $(basename "$PWD")
|
||||
vim src/main.rs
|
||||
end
|
||||
|
||||
fish_add_path "$HOME/.cargo/bin"
|
||||
fish_add_path "$HOME/.local/bin"
|
||||
fish_add_path "$HOME/Documents/scripts"
|
||||
fish_add_path "$HOME/.nix-profile/bin"
|
||||
|
||||
function fish_greeting
|
||||
${pkgs.blahaj}/bin/blahaj -s
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
programs = {
|
||||
atuin = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
|
||||
home.activation = {
|
||||
setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
setupTide() {
|
||||
${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${
|
||||
lib.cli.toGNUCommandLineShell { } {
|
||||
auto = true;
|
||||
style = "Lean";
|
||||
prompt_colors = "True color";
|
||||
show_time = "No";
|
||||
lean_prompt_height = "Two lines";
|
||||
prompt_connection = "Disconnected";
|
||||
prompt_spacing = "Compact";
|
||||
icons = "Few icons";
|
||||
transient = "Yes";
|
||||
settings = {
|
||||
filter_mode_shell_up_key_binding = "directory";
|
||||
exit_mode = "return-original";
|
||||
|
||||
workspaces = true;
|
||||
};
|
||||
};
|
||||
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
# enableFishIntegration = lib.mkDefault true;
|
||||
};
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
fish = {
|
||||
enable = true;
|
||||
shellAliases = aliases;
|
||||
plugins = with pkgs.fishPlugins; [
|
||||
{
|
||||
name = "bang-bang";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-bang-bang";
|
||||
rev = "ec991b80ba7d4dda7a962167b036efc5c2d79419";
|
||||
hash = "sha256-oPPCtFN2DPuM//c48SXb4TrFRjJtccg0YPXcAo0Lxq0=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "tide";
|
||||
inherit (tide) src;
|
||||
}
|
||||
{
|
||||
name = "sponge";
|
||||
inherit (sponge) src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
inherit (autopair) src;
|
||||
}
|
||||
];
|
||||
|
||||
functions = {
|
||||
fish_jj_prompt = {
|
||||
body = ''
|
||||
if not ${config.programs.jujutsu.package}/bin/jj root --quiet &>/dev/null
|
||||
return 1
|
||||
end
|
||||
|
||||
${config.programs.jujutsu.package}/bin/jj log --ignore-working-copy --no-graph --color always -r @ -T '
|
||||
separate(
|
||||
" ",
|
||||
bookmarks.join(", "),
|
||||
change_id.shortest(),
|
||||
commit_id.shortest(),
|
||||
if(conflict, "conflict"),
|
||||
if(empty, "empty"),
|
||||
if(divergent, "divergent"),
|
||||
if(hidden, "hidden"),
|
||||
)
|
||||
'
|
||||
'';
|
||||
};
|
||||
|
||||
_tide_item_jj = {
|
||||
body = ''
|
||||
set -l _tide_item_jj_color $_tide_location_color
|
||||
echo -ns $_tide_item_jj_color" ("(fish_jj_prompt)$_tide_item_jj_color")"
|
||||
'';
|
||||
};
|
||||
|
||||
_tide_item_git = {
|
||||
body = ''
|
||||
if not test -d .jj
|
||||
fish_git_prompt '%s'
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
fish_vi_key_bindings
|
||||
|
||||
set -g sponge_successful_exit_codes 0
|
||||
set -g sponge_allow_previously_successful false
|
||||
set -g sponge_delay 10
|
||||
|
||||
${config.programs.jujutsu.package}/bin/jj util completion fish | source
|
||||
|
||||
# if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items
|
||||
# set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items)
|
||||
# if test $tide_item_jj_idx
|
||||
# set tide_left_prompt_items \
|
||||
# $tide_left_prompt_items[1..$tide_item_jj_idx] \
|
||||
# jj \
|
||||
# $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1]
|
||||
# end
|
||||
# end
|
||||
|
||||
function t
|
||||
cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)"
|
||||
end
|
||||
|
||||
function temp
|
||||
t $argv
|
||||
end
|
||||
|
||||
function rs
|
||||
cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)"
|
||||
cargo init . --bin --name $(basename "$PWD")
|
||||
vim src/main.rs
|
||||
end
|
||||
|
||||
fish_add_path "$HOME/.cargo/bin"
|
||||
fish_add_path "$HOME/.local/bin"
|
||||
fish_add_path "$HOME/Documents/scripts"
|
||||
fish_add_path "$HOME/.nix-profile/bin"
|
||||
|
||||
function fish_greeting
|
||||
${pkgs.blahaj}/bin/blahaj -s
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
home.activation = {
|
||||
setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
setupTide() {
|
||||
${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${
|
||||
lib.cli.toGNUCommandLineShell { } {
|
||||
auto = true;
|
||||
style = "Lean";
|
||||
prompt_colors = "True color";
|
||||
show_time = "No";
|
||||
lean_prompt_height = "Two lines";
|
||||
prompt_connection = "Disconnected";
|
||||
prompt_spacing = "Compact";
|
||||
icons = "Few icons";
|
||||
transient = "Yes";
|
||||
}
|
||||
}"} >/dev/null 2>&1
|
||||
}
|
||||
}"} >/dev/null 2>&1
|
||||
}
|
||||
setupTide
|
||||
'';
|
||||
};
|
||||
setupTide
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,39 @@
|
|||
_: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing.key = "/home/jana/.ssh/id_ed25519.pub";
|
||||
signing.signByDefault = true;
|
||||
custom.program.git.requirements = [ "cli" ];
|
||||
custom.program.git.home-config = _: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing.key = "/home/jana/.ssh/id_ed25519.pub";
|
||||
signing.signByDefault = true;
|
||||
|
||||
settings = {
|
||||
user.email = "jana@donsz.nl";
|
||||
user.name = "Jana Dönszelmann";
|
||||
settings = {
|
||||
user.email = "jana@donsz.nl";
|
||||
user.name = "Jana Dönszelmann";
|
||||
|
||||
push.autoSetupRemote = true;
|
||||
pull.rebase = true;
|
||||
init.defaultBranch = "main";
|
||||
gpg.format = "ssh";
|
||||
diff.colorMoved = "default";
|
||||
rerere.enabled = true;
|
||||
push.autoSetupRemote = true;
|
||||
pull.rebase = true;
|
||||
init.defaultBranch = "main";
|
||||
gpg.format = "ssh";
|
||||
diff.colorMoved = "default";
|
||||
rerere.enabled = true;
|
||||
|
||||
alias.conflicts = "diff --check";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
programs.delta = {
|
||||
enable = true;
|
||||
options = {
|
||||
navigate = true;
|
||||
light = false;
|
||||
side-by-side = true;
|
||||
features = "decorations interactive";
|
||||
interactive = {
|
||||
keep-plus-minus-markers = false;
|
||||
alias.conflicts = "diff --check";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
programs.delta = {
|
||||
enable = true;
|
||||
options = {
|
||||
navigate = true;
|
||||
light = false;
|
||||
side-by-side = true;
|
||||
features = "decorations interactive";
|
||||
interactive = {
|
||||
keep-plus-minus-markers = false;
|
||||
};
|
||||
};
|
||||
enableGitIntegration = true;
|
||||
};
|
||||
enableGitIntegration = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,180 +1,184 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
# package = pkgs.custom.jujutsu;
|
||||
_: {
|
||||
custom.program.jujutsu.requirements = [ "cli" ];
|
||||
custom.program.jujutsu.home-config =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
# package = pkgs.custom.jujutsu;
|
||||
|
||||
settings = {
|
||||
user = {
|
||||
email = config.programs.git.settings.user.email;
|
||||
name = config.programs.git.settings.user.name;
|
||||
};
|
||||
settings = {
|
||||
user = {
|
||||
email = config.programs.git.settings.user.email;
|
||||
name = config.programs.git.settings.user.name;
|
||||
};
|
||||
|
||||
ui = {
|
||||
paginate = "never";
|
||||
# pager = "${pkgs.delta}/bin/delta";
|
||||
# for delta
|
||||
# diff-formatter = ":git";
|
||||
diff-formatter = [
|
||||
"${pkgs.difftastic}/bin/difft"
|
||||
"--color=always"
|
||||
"$left"
|
||||
"$right"
|
||||
];
|
||||
ui = {
|
||||
paginate = "never";
|
||||
# pager = "${pkgs.delta}/bin/delta";
|
||||
# for delta
|
||||
# diff-formatter = ":git";
|
||||
diff-formatter = [
|
||||
"${pkgs.difftastic}/bin/difft"
|
||||
"--color=always"
|
||||
"$left"
|
||||
"$right"
|
||||
];
|
||||
|
||||
default-command = [
|
||||
"log"
|
||||
"--reversed"
|
||||
"--no-pager"
|
||||
];
|
||||
merge-editor = [
|
||||
"${pkgs.meld}/bin/meld"
|
||||
"$left"
|
||||
"$base"
|
||||
"$right"
|
||||
"-o"
|
||||
"$output"
|
||||
"--auto-merge"
|
||||
];
|
||||
# diff-editor = "${pkgs.meld}/bin/meld";
|
||||
};
|
||||
default-command = [
|
||||
"log"
|
||||
"--reversed"
|
||||
"--no-pager"
|
||||
];
|
||||
merge-editor = [
|
||||
"${pkgs.meld}/bin/meld"
|
||||
"$left"
|
||||
"$base"
|
||||
"$right"
|
||||
"-o"
|
||||
"$output"
|
||||
"--auto-merge"
|
||||
];
|
||||
# diff-editor = "${pkgs.meld}/bin/meld";
|
||||
};
|
||||
|
||||
fsmonitor.backend = "watchman";
|
||||
fsmonitor.watchman.register-snapshot-trigger = true;
|
||||
fsmonitor.backend = "watchman";
|
||||
fsmonitor.watchman.register-snapshot-trigger = true;
|
||||
|
||||
# revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()";
|
||||
# revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)";
|
||||
revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)";
|
||||
# revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()";
|
||||
# revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)";
|
||||
revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)";
|
||||
|
||||
revset-aliases = {
|
||||
"my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")";
|
||||
"user(x)" = "author(x) | committer(x)";
|
||||
current = "bookmarks() & my() & ~immutable()";
|
||||
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
||||
};
|
||||
revset-aliases = {
|
||||
"my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")";
|
||||
"user(x)" = "author(x) | committer(x)";
|
||||
current = "bookmarks() & my() & ~immutable()";
|
||||
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
||||
};
|
||||
|
||||
template-aliases = {
|
||||
"format_timestamp(timestamp)" = "timestamp.ago()";
|
||||
log_oneline = ''
|
||||
if(root,
|
||||
format_root_commit(self),
|
||||
label(if(current_working_copy, "working_copy"),
|
||||
concat(
|
||||
separate(" ",
|
||||
format_short_change_id_with_change_offset(self),
|
||||
if(empty, label("empty", "(empty)")),
|
||||
if(description,
|
||||
description.first_line(),
|
||||
label(if(empty, "empty"), description_placeholder),
|
||||
template-aliases = {
|
||||
"format_timestamp(timestamp)" = "timestamp.ago()";
|
||||
log_oneline = ''
|
||||
if(root,
|
||||
format_root_commit(self),
|
||||
label(if(current_working_copy, "working_copy"),
|
||||
concat(
|
||||
separate(" ",
|
||||
format_short_change_id_with_change_offset(self),
|
||||
if(empty, label("empty", "(empty)")),
|
||||
if(description,
|
||||
description.first_line(),
|
||||
label(if(empty, "empty"), description_placeholder),
|
||||
),
|
||||
bookmarks,
|
||||
tags,
|
||||
working_copies,
|
||||
if(conflict, label("conflict", "conflict")),
|
||||
if(config("ui.show-cryptographic-signatures").as_boolean(),
|
||||
format_short_cryptographic_signature(signature)),
|
||||
) ++ "\n",
|
||||
),
|
||||
bookmarks,
|
||||
tags,
|
||||
working_copies,
|
||||
if(conflict, label("conflict", "conflict")),
|
||||
if(config("ui.show-cryptographic-signatures").as_boolean(),
|
||||
format_short_cryptographic_signature(signature)),
|
||||
) ++ "\n",
|
||||
),
|
||||
)
|
||||
)
|
||||
'';
|
||||
# if(.contained_in('first_parent(@)'), label("git_head", "HEAD")),
|
||||
status_summary = "'\n' ++ self.diff().summary() ++ '\n'";
|
||||
log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)";
|
||||
};
|
||||
)
|
||||
)
|
||||
'';
|
||||
# if(.contained_in('first_parent(@)'), label("git_head", "HEAD")),
|
||||
status_summary = "'\n' ++ self.diff().summary() ++ '\n'";
|
||||
log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)";
|
||||
};
|
||||
|
||||
aliases =
|
||||
let
|
||||
util = script: [
|
||||
"util"
|
||||
"exec"
|
||||
"--"
|
||||
"bash"
|
||||
"-c"
|
||||
script
|
||||
];
|
||||
in
|
||||
{
|
||||
tug = [
|
||||
"bookmark"
|
||||
"move"
|
||||
"--from"
|
||||
"heads(::@- & bookmarks())"
|
||||
"--to"
|
||||
"coalesce(@ & ~empty(), @-)"
|
||||
];
|
||||
catchup = [
|
||||
"rebase"
|
||||
"-b"
|
||||
"bookmarks() & mine() & ~immutable()"
|
||||
"-d"
|
||||
"trunk()"
|
||||
"--skip-emptied"
|
||||
];
|
||||
pull = util ''
|
||||
jj git fetch
|
||||
jj catchup
|
||||
'';
|
||||
ch = [
|
||||
"show"
|
||||
"--stat"
|
||||
];
|
||||
move = [
|
||||
"rebase"
|
||||
"-r"
|
||||
];
|
||||
push = [
|
||||
"git"
|
||||
"push"
|
||||
];
|
||||
ll = [
|
||||
"log"
|
||||
"-T"
|
||||
"builtin_log_compact"
|
||||
];
|
||||
mdiff = [
|
||||
"diff"
|
||||
"--from"
|
||||
"trunk()"
|
||||
];
|
||||
aliases =
|
||||
let
|
||||
util = script: [
|
||||
"util"
|
||||
"exec"
|
||||
"--"
|
||||
"bash"
|
||||
"-c"
|
||||
script
|
||||
];
|
||||
in
|
||||
{
|
||||
tug = [
|
||||
"bookmark"
|
||||
"move"
|
||||
"--from"
|
||||
"heads(::@- & bookmarks())"
|
||||
"--to"
|
||||
"coalesce(@ & ~empty(), @-)"
|
||||
];
|
||||
catchup = [
|
||||
"rebase"
|
||||
"-b"
|
||||
"bookmarks() & mine() & ~immutable()"
|
||||
"-d"
|
||||
"trunk()"
|
||||
"--skip-emptied"
|
||||
];
|
||||
pull = util ''
|
||||
jj git fetch
|
||||
jj catchup
|
||||
'';
|
||||
ch = [
|
||||
"show"
|
||||
"--stat"
|
||||
];
|
||||
move = [
|
||||
"rebase"
|
||||
"-r"
|
||||
];
|
||||
push = [
|
||||
"git"
|
||||
"push"
|
||||
];
|
||||
ll = [
|
||||
"log"
|
||||
"-T"
|
||||
"builtin_log_compact"
|
||||
];
|
||||
mdiff = [
|
||||
"diff"
|
||||
"--from"
|
||||
"trunk()"
|
||||
];
|
||||
};
|
||||
|
||||
templates = {
|
||||
log_node = ''
|
||||
label("node",
|
||||
coalesce(
|
||||
if(!self, label("elided", "~")),
|
||||
if(current_working_copy, label("working_copy", "@")),
|
||||
if(conflict, label("conflict", "×")),
|
||||
if(immutable, label("immutable", "*")),
|
||||
label("normal", "·")
|
||||
)
|
||||
)
|
||||
'';
|
||||
log = "log_oneline_with_status_summary";
|
||||
git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()'';
|
||||
};
|
||||
|
||||
signing = {
|
||||
# sign-all = true;
|
||||
behavior = "own";
|
||||
backend = "ssh";
|
||||
key = "~/.ssh/id_ed25519.pub";
|
||||
};
|
||||
|
||||
# remotes.origin.auto-track-bookmarks = true;
|
||||
# remotes.upstream.auto-track-bookmarks = true;
|
||||
|
||||
git = {
|
||||
private-commits = "description(glob:'wip:*') | description(glob:'trial:*')";
|
||||
write-change-id-header = true;
|
||||
|
||||
fetch = [
|
||||
"upstream"
|
||||
"origin"
|
||||
];
|
||||
push = "origin";
|
||||
};
|
||||
};
|
||||
|
||||
templates = {
|
||||
log_node = ''
|
||||
label("node",
|
||||
coalesce(
|
||||
if(!self, label("elided", "~")),
|
||||
if(current_working_copy, label("working_copy", "@")),
|
||||
if(conflict, label("conflict", "×")),
|
||||
if(immutable, label("immutable", "*")),
|
||||
label("normal", "·")
|
||||
)
|
||||
)
|
||||
'';
|
||||
log = "log_oneline_with_status_summary";
|
||||
git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()'';
|
||||
};
|
||||
|
||||
signing = {
|
||||
# sign-all = true;
|
||||
behavior = "own";
|
||||
backend = "ssh";
|
||||
key = "~/.ssh/id_ed25519.pub";
|
||||
};
|
||||
|
||||
# remotes.origin.auto-track-bookmarks = true;
|
||||
# remotes.upstream.auto-track-bookmarks = true;
|
||||
|
||||
git = {
|
||||
private-commits = "description(glob:'wip:*') | description(glob:'trial:*')";
|
||||
write-change-id-header = true;
|
||||
|
||||
fetch = [
|
||||
"upstream"
|
||||
"origin"
|
||||
];
|
||||
push = "origin";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, ... }:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
kanata-config = ''
|
||||
(defcfg
|
||||
|
|
@ -74,31 +74,52 @@ let
|
|||
'';
|
||||
in
|
||||
{
|
||||
custom.program.kanata.requirements = [ "graphical" ];
|
||||
custom.program.kanata.home-config =
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
systemd.user.services.kanata = {
|
||||
Unit = {
|
||||
Description = "kanata";
|
||||
};
|
||||
|
||||
Service = {
|
||||
Restart = "always";
|
||||
RestartSec = "3";
|
||||
ExecStart = "${pkgs.kanata-with-cmd}/bin/kanata --cfg ${pkgs.writeText "kanata.kbd" kanata-config}";
|
||||
Nice = "-20";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
home.file.kanata = {
|
||||
target = ".config/kanata/kanata.kbd";
|
||||
text = kanata-config;
|
||||
};
|
||||
};
|
||||
|
||||
# custom.program.kanata.system-config =
|
||||
# { pkgs, ... }:
|
||||
# {
|
||||
# sudo groupadd uinput
|
||||
# sudo usermod -aG input $USER
|
||||
# sudo usermod -aG uinput $USER
|
||||
# echo "KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"" >> /etc/udev/rules.d/99-input.rules
|
||||
# reboot or sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||
# sudo modprobe uinput
|
||||
systemd.user.services.kanata = {
|
||||
Unit = {
|
||||
Description = "kanata";
|
||||
};
|
||||
|
||||
Service = {
|
||||
Restart = "always";
|
||||
RestartSec = "3";
|
||||
ExecStart = "${pkgs.kanata-with-cmd}/bin/kanata --cfg ${pkgs.writeText "kanata.kbd" kanata-config}";
|
||||
Nice = "-20";
|
||||
};
|
||||
users.groups.uinput = { };
|
||||
users.extraUsers.jana.extraGroups = [
|
||||
"uinput"
|
||||
"input"
|
||||
];
|
||||
environment.systemPackages = [ pkgs.kanata-with-cmd ];
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
|
||||
'';
|
||||
# };
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
home.file.kanata = {
|
||||
target = ".config/kanata/kanata.kbd";
|
||||
text = builtins.readFile ./cfg.kbd;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
# sudo groupadd uinput
|
||||
# sudo usermod -aG input $USER
|
||||
# sudo usermod -aG uinput $USER
|
||||
# echo "KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"" >> /etc/udev/rules.d/99-input.rules
|
||||
# reboot or sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||
# sudo modprobe uinput
|
||||
|
||||
users.groups.uinput = { };
|
||||
users.extraUsers.jana.extraGroups = [
|
||||
"uinput"
|
||||
"input"
|
||||
];
|
||||
environment.systemPackages = [ pkgs.kanata-with-cmd ];
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,53 +1,57 @@
|
|||
{ pkgs, flakes, ... }:
|
||||
{
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
font = {
|
||||
name = "Jetbrains Mono";
|
||||
size = 13.0;
|
||||
package = pkgs.jetbrains-mono;
|
||||
_: {
|
||||
custom.program.kitty.requirements = [ "graphical" ];
|
||||
custom.program.kitty.home-config =
|
||||
{ pkgs, flakes, ... }:
|
||||
{
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
font = {
|
||||
name = "Jetbrains Mono";
|
||||
size = 13.0;
|
||||
package = pkgs.jetbrains-mono;
|
||||
};
|
||||
|
||||
settings = {
|
||||
scrollback_lines = 20000;
|
||||
allow_hyperlinks = true;
|
||||
|
||||
repaint_delay = 10;
|
||||
input_delay = 3;
|
||||
|
||||
enable_audio_bell = false;
|
||||
update_check_interval = 0;
|
||||
|
||||
initial_window_width = "95c";
|
||||
initial_window_height = "30c";
|
||||
remember_window_size = "no";
|
||||
|
||||
draw_minimal_borders = false;
|
||||
hide_window_decorations = true;
|
||||
|
||||
shell = "${pkgs.tmux}/bin/tmux";
|
||||
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
|
||||
|
||||
foreground = "#fcfcfc";
|
||||
background = "#232627";
|
||||
linux_display_server = "auto";
|
||||
};
|
||||
|
||||
keybindings = {
|
||||
"ctrl+f" =
|
||||
"launch --location=hsplit --allow-remote-control kitty +kitten ${flakes.kitty-search}/search.py @active-kitty-window-id";
|
||||
"ctrl+alt+r" = "load_config_file";
|
||||
"ctrl+shift+r" = "no_op";
|
||||
"super+`" = "no_op";
|
||||
"ctrl+EQUAL" = "change_font_size all +2.0";
|
||||
"ctrl+minus" = "change_font_size all -2.0";
|
||||
"ctrl+0" = "change_font_size all 0";
|
||||
# "ctrl+/" = "send_text all ";
|
||||
"super+~" = "no_op";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
mouse_map left click ungrabbed no-op
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
settings = {
|
||||
scrollback_lines = 20000;
|
||||
allow_hyperlinks = true;
|
||||
|
||||
repaint_delay = 10;
|
||||
input_delay = 3;
|
||||
|
||||
enable_audio_bell = false;
|
||||
update_check_interval = 0;
|
||||
|
||||
initial_window_width = "95c";
|
||||
initial_window_height = "30c";
|
||||
remember_window_size = "no";
|
||||
|
||||
draw_minimal_borders = false;
|
||||
hide_window_decorations = true;
|
||||
|
||||
shell = "${pkgs.tmux}/bin/tmux";
|
||||
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
|
||||
|
||||
foreground = "#fcfcfc";
|
||||
background = "#232627";
|
||||
linux_display_server = "auto";
|
||||
};
|
||||
|
||||
keybindings = {
|
||||
"ctrl+f" =
|
||||
"launch --location=hsplit --allow-remote-control kitty +kitten ${flakes.kitty-search}/search.py @active-kitty-window-id";
|
||||
"ctrl+alt+r" = "load_config_file";
|
||||
"ctrl+shift+r" = "no_op";
|
||||
"super+`" = "no_op";
|
||||
"ctrl+EQUAL" = "change_font_size all +2.0";
|
||||
"ctrl+minus" = "change_font_size all -2.0";
|
||||
"ctrl+0" = "change_font_size all 0";
|
||||
# "ctrl+/" = "send_text all ";
|
||||
"super+~" = "no_op";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
mouse_map left click ungrabbed no-op
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,99 +1,104 @@
|
|||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
home = {
|
||||
sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
};
|
||||
_: {
|
||||
custom.program.nvim.requirements = [ "cli" ];
|
||||
custom.program.nvim.home-config =
|
||||
{ pkgs, flakes, ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./options.nix
|
||||
./plugins.nix
|
||||
./keys.nix
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
globals.mapleader = " ";
|
||||
globals.maplocalleader = " ";
|
||||
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
# Highlight and remove extra white spaces
|
||||
# same color as cursorline as per
|
||||
# https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim
|
||||
highlight.ExtraWhitespace.bg = "#2C323C";
|
||||
match.ExtraWhitespace = "\\s\\+$";
|
||||
|
||||
clipboard.providers.wl-copy.enable = true;
|
||||
|
||||
performance = {
|
||||
byteCompileLua.enable = true;
|
||||
combinePlugins = {
|
||||
enable = true;
|
||||
|
||||
standalonePlugins = [
|
||||
# clashes with lualine
|
||||
"onedark.nvim"
|
||||
];
|
||||
home = {
|
||||
sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraLuaPackages = ps: [ ps.magick ];
|
||||
extraPackages = [ pkgs.imagemagick ];
|
||||
imports = [
|
||||
flakes.nixvim.homeModules.nixvim
|
||||
./options.nix
|
||||
./plugins.nix
|
||||
./keys.nix
|
||||
];
|
||||
|
||||
# package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped;
|
||||
package = pkgs.neovim-unwrapped;
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
globals.mapleader = " ";
|
||||
globals.maplocalleader = " ";
|
||||
|
||||
colorschemes.onedark = {
|
||||
enable = true;
|
||||
settings = {
|
||||
style = "deep";
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
highlights = {
|
||||
# bright green doccomments
|
||||
"@lsp.type.comment".fg = "#77B767";
|
||||
"@comment.documentation.rust".fg = "#77B767";
|
||||
"@comment.documentation".fg = "#77B767";
|
||||
"@comment".fg = "#426639";
|
||||
# "Visual".bg = "#2a2e36";
|
||||
# "Cursorline".bg = "#2a2e36";
|
||||
# Highlight and remove extra white spaces
|
||||
# same color as cursorline as per
|
||||
# https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim
|
||||
highlight.ExtraWhitespace.bg = "#2C323C";
|
||||
match.ExtraWhitespace = "\\s\\+$";
|
||||
|
||||
clipboard.providers.wl-copy.enable = true;
|
||||
|
||||
performance = {
|
||||
byteCompileLua.enable = true;
|
||||
combinePlugins = {
|
||||
enable = true;
|
||||
|
||||
standalonePlugins = [
|
||||
# clashes with lualine
|
||||
"onedark.nvim"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
extraLuaPackages = ps: [ ps.magick ];
|
||||
extraPackages = [ pkgs.imagemagick ];
|
||||
|
||||
# package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped;
|
||||
package = pkgs.neovim-unwrapped;
|
||||
|
||||
colorschemes.onedark = {
|
||||
enable = true;
|
||||
settings = {
|
||||
style = "deep";
|
||||
|
||||
highlights = {
|
||||
# bright green doccomments
|
||||
"@lsp.type.comment".fg = "#77B767";
|
||||
"@comment.documentation.rust".fg = "#77B767";
|
||||
"@comment.documentation".fg = "#77B767";
|
||||
"@comment".fg = "#426639";
|
||||
# "Visual".bg = "#2a2e36";
|
||||
# "Cursorline".bg = "#2a2e36";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
extraConfigLuaPre = ''
|
||||
require("neoconf").setup({})
|
||||
'';
|
||||
extraConfigLua = ''
|
||||
require("render-markdown").setup {
|
||||
latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text',
|
||||
}
|
||||
''
|
||||
|
||||
# local lspconfig = require 'lspconfig'
|
||||
# local configs = require 'lspconfig.configs'
|
||||
# if not configs.foo_lsp then
|
||||
# configs.noteslsp = {
|
||||
# default_config = {
|
||||
# -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'},
|
||||
# cmd = {'./noteslsp/target/debug/noteslsp'},
|
||||
# filetypes = {'markdown'},
|
||||
# root_dir = function(fname)
|
||||
# return lspconfig.util.find_git_ancestor(fname)
|
||||
# end,
|
||||
# settings = {}
|
||||
# ,
|
||||
# },
|
||||
# }
|
||||
# end
|
||||
#
|
||||
# lspconfig.noteslsp.setup{}
|
||||
# ''
|
||||
+ (builtins.readFile ./config.lua);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
extraConfigLuaPre = ''
|
||||
require("neoconf").setup({})
|
||||
'';
|
||||
extraConfigLua =
|
||||
''
|
||||
require("render-markdown").setup {
|
||||
latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text',
|
||||
}
|
||||
''
|
||||
|
||||
# local lspconfig = require 'lspconfig'
|
||||
# local configs = require 'lspconfig.configs'
|
||||
# if not configs.foo_lsp then
|
||||
# configs.noteslsp = {
|
||||
# default_config = {
|
||||
# -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'},
|
||||
# cmd = {'./noteslsp/target/debug/noteslsp'},
|
||||
# filetypes = {'markdown'},
|
||||
# root_dir = function(fname)
|
||||
# return lspconfig.util.find_git_ancestor(fname)
|
||||
# end,
|
||||
# settings = {}
|
||||
# ,
|
||||
# },
|
||||
# }
|
||||
# end
|
||||
#
|
||||
# lspconfig.noteslsp.setup{}
|
||||
# ''
|
||||
+ (builtins.readFile ./config.lua);
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,166 +1,170 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
mouse = true;
|
||||
clock24 = true;
|
||||
_: {
|
||||
custom.program.tmux.requirements = [ "cli" ];
|
||||
custom.program.tmux.home-config =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
mouse = true;
|
||||
clock24 = true;
|
||||
|
||||
shortcut = "k";
|
||||
shortcut = "k";
|
||||
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
plugin = tmuxPlugins.mkTmuxPlugin {
|
||||
pluginName = "suspend";
|
||||
version = "1a2f806";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "MunifTanjim";
|
||||
repo = "tmux-suspend";
|
||||
rev = "1a2f806666e0bfed37535372279fa00d27d50d14";
|
||||
sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv";
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
set -g @suspend_key 'F11'
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = tmuxPlugins.mode-indicator;
|
||||
}
|
||||
];
|
||||
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
plugin = tmuxPlugins.mkTmuxPlugin {
|
||||
pluginName = "suspend";
|
||||
version = "1a2f806";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "MunifTanjim";
|
||||
repo = "tmux-suspend";
|
||||
rev = "1a2f806666e0bfed37535372279fa00d27d50d14";
|
||||
sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv";
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
set -g @suspend_key 'F11'
|
||||
# unbind every single normal keybinding
|
||||
unbind-key -a
|
||||
|
||||
# for special characters to work right
|
||||
# like <C-_>
|
||||
# set-window-option -g xterm-keys on
|
||||
set -g default-terminal "screen-256color"
|
||||
|
||||
set -g set-titles on
|
||||
set -g allow-passthrough on
|
||||
set -s escape-time 0
|
||||
|
||||
set-option -g default-shell ${pkgs.fish}/bin/fish
|
||||
set -ga terminal-features "\*:hyperlinks"
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
# clipboard stuff
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
||||
bind v copy-mode
|
||||
bind p paste-buffer -p
|
||||
set -s set-clipboard on
|
||||
|
||||
# get back normal terminal emulator bindings
|
||||
bind-key -n S-PPage copy-mode -u
|
||||
bind-key -T copy-mode -n S-NPage send-keys -X page-down
|
||||
|
||||
# don't scroll to end when copying with mouse
|
||||
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
|
||||
# window control
|
||||
bind t new-window -c "#{pane_current_path}"
|
||||
bind-key Tab next-window
|
||||
bind-key BTab previous-window
|
||||
set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})"
|
||||
set -g renumber-windows on
|
||||
bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window
|
||||
bind A last-window
|
||||
|
||||
bind-key 1 select-window -t :0
|
||||
bind-key 2 select-window -t :1
|
||||
bind-key 3 select-window -t :2
|
||||
bind-key 4 select-window -t :3
|
||||
bind-key 5 select-window -t :4
|
||||
bind-key 6 select-window -t :5
|
||||
bind-key 7 select-window -t :6
|
||||
bind-key 8 select-window -t :7
|
||||
bind-key 9 select-window -t :8
|
||||
bind-key 0 select-window -t :9
|
||||
|
||||
# pane control
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
bind L split-window -h -c "#{pane_current_path}"
|
||||
bind J split-window -v -c "#{pane_current_path}"
|
||||
bind H split-window -h -b -c "#{pane_current_path}"
|
||||
bind K split-window -v -b -c "#{pane_current_path}"
|
||||
bind x swap-pane -D
|
||||
|
||||
# double-click ^k (or lshift with kanata) for previous pane like ^w in vim
|
||||
bind -r ^k select-pane -l
|
||||
bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
||||
|
||||
bind-key o choose-tree -wZ
|
||||
bind-key O choose-tree -sZ
|
||||
|
||||
# get back command mode and some other basics...
|
||||
bind : command-prompt
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded"
|
||||
bind-key ? list-keys
|
||||
|
||||
# Scroll oin man etc
|
||||
tmux_commands_with_legacy_scroll="nano less more man git"
|
||||
|
||||
bind-key -T root WheelUpPane \
|
||||
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Up" "copy-mode -et="'
|
||||
|
||||
bind-key -T root WheelDownPane \
|
||||
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Down" "send -Mt="'
|
||||
|
||||
bind-key -T copy-mode-vi ] \
|
||||
send-keys -X clear-selection \; \
|
||||
send-keys -X search-forward "--> " \; \
|
||||
send-keys -X next-word \; \
|
||||
send-keys -X begin-selection \; \
|
||||
send-keys -X jump-forward ":" \; \
|
||||
send-keys -X jump-to-forward ":" \;
|
||||
|
||||
bind-key -T copy-mode-vi [ \
|
||||
send-keys -X clear-selection \; \
|
||||
send-keys -X start-of-line \; \
|
||||
send-keys -X search-backward "--> " \; \
|
||||
send-keys -X next-word \; \
|
||||
send-keys -X begin-selection \; \
|
||||
send-keys -X jump-forward ":" \; \
|
||||
send-keys -X jump-to-forward ":" \;
|
||||
|
||||
bind-key [ copy-mode \; send-keys [
|
||||
bind-key ] copy-mode \; send-keys ]
|
||||
|
||||
bind d select-pane -l \; send-keys [
|
||||
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = tmuxPlugins.mode-indicator;
|
||||
}
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
# unbind every single normal keybinding
|
||||
unbind-key -a
|
||||
|
||||
# for special characters to work right
|
||||
# like <C-_>
|
||||
# set-window-option -g xterm-keys on
|
||||
set -g default-terminal "screen-256color"
|
||||
|
||||
set -g set-titles on
|
||||
set -g allow-passthrough on
|
||||
set -s escape-time 0
|
||||
|
||||
set-option -g default-shell ${pkgs.fish}/bin/fish
|
||||
set -ga terminal-features "\*:hyperlinks"
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
# clipboard stuff
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
||||
bind v copy-mode
|
||||
bind p paste-buffer -p
|
||||
set -s set-clipboard on
|
||||
|
||||
# get back normal terminal emulator bindings
|
||||
bind-key -n S-PPage copy-mode -u
|
||||
bind-key -T copy-mode -n S-NPage send-keys -X page-down
|
||||
|
||||
# don't scroll to end when copying with mouse
|
||||
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
|
||||
# window control
|
||||
bind t new-window -c "#{pane_current_path}"
|
||||
bind-key Tab next-window
|
||||
bind-key BTab previous-window
|
||||
set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})"
|
||||
set -g renumber-windows on
|
||||
bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window
|
||||
bind A last-window
|
||||
|
||||
bind-key 1 select-window -t :0
|
||||
bind-key 2 select-window -t :1
|
||||
bind-key 3 select-window -t :2
|
||||
bind-key 4 select-window -t :3
|
||||
bind-key 5 select-window -t :4
|
||||
bind-key 6 select-window -t :5
|
||||
bind-key 7 select-window -t :6
|
||||
bind-key 8 select-window -t :7
|
||||
bind-key 9 select-window -t :8
|
||||
bind-key 0 select-window -t :9
|
||||
|
||||
# pane control
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
bind L split-window -h -c "#{pane_current_path}"
|
||||
bind J split-window -v -c "#{pane_current_path}"
|
||||
bind H split-window -h -b -c "#{pane_current_path}"
|
||||
bind K split-window -v -b -c "#{pane_current_path}"
|
||||
bind x swap-pane -D
|
||||
|
||||
# double-click ^k (or lshift with kanata) for previous pane like ^w in vim
|
||||
bind -r ^k select-pane -l
|
||||
bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
||||
|
||||
bind-key o choose-tree -wZ
|
||||
bind-key O choose-tree -sZ
|
||||
|
||||
# get back command mode and some other basics...
|
||||
bind : command-prompt
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded"
|
||||
bind-key ? list-keys
|
||||
|
||||
# Scroll oin man etc
|
||||
tmux_commands_with_legacy_scroll="nano less more man git"
|
||||
|
||||
bind-key -T root WheelUpPane \
|
||||
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Up" "copy-mode -et="'
|
||||
|
||||
bind-key -T root WheelDownPane \
|
||||
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Down" "send -Mt="'
|
||||
|
||||
bind-key -T copy-mode-vi ] \
|
||||
send-keys -X clear-selection \; \
|
||||
send-keys -X search-forward "--> " \; \
|
||||
send-keys -X next-word \; \
|
||||
send-keys -X begin-selection \; \
|
||||
send-keys -X jump-forward ":" \; \
|
||||
send-keys -X jump-to-forward ":" \;
|
||||
|
||||
bind-key -T copy-mode-vi [ \
|
||||
send-keys -X clear-selection \; \
|
||||
send-keys -X start-of-line \; \
|
||||
send-keys -X search-backward "--> " \; \
|
||||
send-keys -X next-word \; \
|
||||
send-keys -X begin-selection \; \
|
||||
send-keys -X jump-forward ":" \; \
|
||||
send-keys -X jump-to-forward ":" \;
|
||||
|
||||
bind-key [ copy-mode \; send-keys [
|
||||
bind-key ] copy-mode \; send-keys ]
|
||||
|
||||
bind d select-pane -l \; send-keys [
|
||||
|
||||
'';
|
||||
};
|
||||
# bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" ''
|
||||
# open_file () {
|
||||
# input=`cat`
|
||||
# link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g')
|
||||
#
|
||||
# if [ ! -z "$link" ]; then
|
||||
# echo "LINK = $link"
|
||||
# vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0")
|
||||
#
|
||||
# nvim --server "$vim_proc" --remote-send "<C-\><C-N>:e $link<cr>"
|
||||
# fi
|
||||
# }
|
||||
#
|
||||
# open_file 2>&1 >> ~/open-file.log
|
||||
#
|
||||
# ''}/bin/open-file"
|
||||
};
|
||||
# bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" ''
|
||||
# open_file () {
|
||||
# input=`cat`
|
||||
# link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g')
|
||||
#
|
||||
# if [ ! -z "$link" ]; then
|
||||
# echo "LINK = $link"
|
||||
# vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0")
|
||||
#
|
||||
# nvim --server "$vim_proc" --remote-send "<C-\><C-N>:e $link<cr>"
|
||||
# fi
|
||||
# }
|
||||
#
|
||||
# open_file 2>&1 >> ~/open-file.log
|
||||
#
|
||||
# ''}/bin/open-file"
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,166 +1,171 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.zed-editor = {
|
||||
enable = true;
|
||||
extensions = [
|
||||
"nix"
|
||||
"intellij-newui-theme"
|
||||
"charmed-icons"
|
||||
];
|
||||
userSettings = {
|
||||
_: {
|
||||
custom.program.zed.requirements = [ "work" ];
|
||||
custom.program.zed.home-config =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.zed-editor = {
|
||||
enable = true;
|
||||
extensions = [
|
||||
"nix"
|
||||
"intellij-newui-theme"
|
||||
"charmed-icons"
|
||||
"astro"
|
||||
];
|
||||
userSettings = {
|
||||
|
||||
ssh_connections = [
|
||||
{
|
||||
host = "icecube";
|
||||
args = [ ];
|
||||
projects = [
|
||||
ssh_connections = [
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/eii-test"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/example"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/fitgirl-ddl"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/libs-team/tools/unstable-api"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/ml-kem-hang"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/opendal/core"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/rust"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/span-lowering-tests"
|
||||
host = "icecube";
|
||||
args = [ ];
|
||||
projects = [
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/eii-test"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/example"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/fitgirl-ddl"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/libs-team/tools/unstable-api"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/ml-kem-hang"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/opendal/core"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/rust"
|
||||
];
|
||||
}
|
||||
{
|
||||
paths = [
|
||||
"/home/jana/src/span-lowering-tests"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
icon_theme = "Warm Charmed Icons";
|
||||
ui_font_size = 16;
|
||||
buffer_font_size = 16;
|
||||
theme = {
|
||||
mode = "system";
|
||||
light = "One Light";
|
||||
dark = "JetBrains New Dark";
|
||||
};
|
||||
disable_ai = true;
|
||||
|
||||
preview_tabs = {
|
||||
enabled = true;
|
||||
enable_preview_from_file_finder = true;
|
||||
};
|
||||
|
||||
close_on_file_delete = true;
|
||||
confirm_quit = true;
|
||||
|
||||
edit_predictions_disabled_in = [
|
||||
"comment"
|
||||
"string"
|
||||
];
|
||||
|
||||
vim_mode = true;
|
||||
cursor_blink = false;
|
||||
vertical_scroll_margin = 0;
|
||||
|
||||
inlay_hints = {
|
||||
enabled = true;
|
||||
};
|
||||
|
||||
project_panel = {
|
||||
dock = "right";
|
||||
git_status = false;
|
||||
};
|
||||
minimap = {
|
||||
show = "auto";
|
||||
thumb = "always";
|
||||
thumb_border = "left_open";
|
||||
};
|
||||
tab_bar = {
|
||||
show = true;
|
||||
show_nav_history_buttons = false;
|
||||
show_tab_bar_buttons = false;
|
||||
};
|
||||
tabs = {
|
||||
file_icons = true;
|
||||
git_status = false;
|
||||
activate_on_close = "history";
|
||||
show_close_button = "hover";
|
||||
};
|
||||
lsp = {
|
||||
rust-analyzer = {
|
||||
initialization_options = {
|
||||
inlayHints = {
|
||||
lifetimeElisionHints = "always";
|
||||
discriminantHints = "always";
|
||||
};
|
||||
diagnostic = {
|
||||
refreshSupport = true;
|
||||
};
|
||||
icon_theme = "Warm Charmed Icons";
|
||||
ui_font_size = 16;
|
||||
buffer_font_size = 16;
|
||||
theme = {
|
||||
mode = "system";
|
||||
light = "One Light";
|
||||
dark = "JetBrains New Dark";
|
||||
};
|
||||
};
|
||||
nil = {
|
||||
binary = {
|
||||
ignore_system_version = false;
|
||||
path = "${pkgs.lib.getExe' pkgs.nil "nil"}";
|
||||
disable_ai = true;
|
||||
|
||||
preview_tabs = {
|
||||
enabled = true;
|
||||
enable_preview_from_file_finder = true;
|
||||
};
|
||||
|
||||
initialization_options = {
|
||||
formatting = {
|
||||
command = [ "${pkgs.lib.getExe' pkgs.nixfmt "nixfmt"}" ];
|
||||
close_on_file_delete = true;
|
||||
confirm_quit = true;
|
||||
|
||||
edit_predictions_disabled_in = [
|
||||
"comment"
|
||||
"string"
|
||||
];
|
||||
|
||||
vim_mode = true;
|
||||
cursor_blink = false;
|
||||
vertical_scroll_margin = 0;
|
||||
|
||||
inlay_hints = {
|
||||
enabled = true;
|
||||
};
|
||||
|
||||
project_panel = {
|
||||
dock = "right";
|
||||
git_status = false;
|
||||
};
|
||||
minimap = {
|
||||
show = "auto";
|
||||
thumb = "always";
|
||||
thumb_border = "left_open";
|
||||
};
|
||||
tab_bar = {
|
||||
show = true;
|
||||
show_nav_history_buttons = false;
|
||||
show_tab_bar_buttons = false;
|
||||
};
|
||||
tabs = {
|
||||
file_icons = true;
|
||||
git_status = false;
|
||||
activate_on_close = "history";
|
||||
show_close_button = "hover";
|
||||
};
|
||||
lsp = {
|
||||
rust-analyzer = {
|
||||
initialization_options = {
|
||||
inlayHints = {
|
||||
lifetimeElisionHints = "always";
|
||||
discriminantHints = "always";
|
||||
};
|
||||
diagnostic = {
|
||||
refreshSupport = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
nil = {
|
||||
binary = {
|
||||
ignore_system_version = false;
|
||||
path = "${pkgs.lib.getExe' pkgs.nil "nil"}";
|
||||
};
|
||||
|
||||
initialization_options = {
|
||||
formatting = {
|
||||
command = [ "${pkgs.lib.getExe' pkgs.nixfmt "nixfmt"}" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
diagnostics = {
|
||||
button = false;
|
||||
include_warnings = true;
|
||||
inline = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
terminal = {
|
||||
"dock" = "left";
|
||||
"env" = {
|
||||
# "EDITOR": "zeditor --wait"
|
||||
"EDITOR" = "vim";
|
||||
};
|
||||
"font_size" = 12;
|
||||
"font_family" = "Noto Sans Mono";
|
||||
"line_height" = "standard";
|
||||
};
|
||||
buffer_font_family = "JetBrains Mono";
|
||||
diagnostics = {
|
||||
button = false;
|
||||
include_warnings = true;
|
||||
inline = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
terminal = {
|
||||
"dock" = "left";
|
||||
"env" = {
|
||||
# "EDITOR": "zeditor --wait"
|
||||
"EDITOR" = "vim";
|
||||
};
|
||||
"font_size" = 12;
|
||||
"font_family" = "Noto Sans Mono";
|
||||
"line_height" = "standard";
|
||||
};
|
||||
buffer_font_family = "JetBrains Mono";
|
||||
|
||||
# "diagnostics_max_severity": "off",
|
||||
# "diagnostics_max_severity": "off",
|
||||
|
||||
"experimental.theme_overrides" = {
|
||||
"syntax" = {
|
||||
"comment.doc" = {
|
||||
"color" = "#77B767";
|
||||
"experimental.theme_overrides" = {
|
||||
"syntax" = {
|
||||
"comment.doc" = {
|
||||
"color" = "#77B767";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue