From 194cefe34054570182bef61f411bfd7ed9e55aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Wed, 18 Mar 2026 11:18:21 +0100 Subject: [PATCH 1/3] vimium etc --- flake.lock | 41 ++++++++++++++++++++++++-- flake.nix | 15 +++++----- programs/default.nix | 10 ++++--- programs/firefox/default.nix | 56 +++++++++++++++++++++++++++++++----- programs/nvim/config.lua | 7 +++-- programs/nvim/keys.nix | 3 +- programs/xdg.nix | 1 + 7 files changed, 106 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index 44aa71e..e1d0ce5 100644 --- a/flake.lock +++ b/flake.lock @@ -718,11 +718,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1772058280, - "narHash": "sha256-8gZ6wh++43JAe6PH0hmm4Q8gPEScf0S7rkb0MmIxu2U=", + "lastModified": 1773832951, + "narHash": "sha256-qzWEWTC1l7aofSoYoW9Zckh/gNLK8pbjiUuRl9qRc7k=", "owner": "jdonszelmann", "repo": "homepage", - "rev": "ead7bebdfa71b207d2513d7f002e164d0b17a264", + "rev": "92cb1f2f367d52a64bf088f413aacb6446642794", "type": "github" }, "original": { @@ -1326,6 +1326,22 @@ "type": "github" } }, + "nixpkgs_22": { + "locked": { + "lastModified": 1745930157, + "narHash": "sha256-y3h3NLnzRSiUkYpnfvnS669zWZLoqqI6NprtLQ+5dck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46e634be05ce9dc6d4db8e664515ba10b78151ae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_3": { "locked": { "lastModified": 1732521221, @@ -1707,6 +1723,7 @@ "sops-nix": "sops-nix", "t": "t", "totpal": "totpal", + "vimium-options": "vimium-options", "vpn-confinement": "vpn-confinement" } }, @@ -2273,6 +2290,24 @@ "type": "github" } }, + "vimium-options": { + "inputs": { + "nixpkgs": "nixpkgs_22" + }, + "locked": { + "lastModified": 1746118178, + "narHash": "sha256-MtIuTMLMF/Cl3MEJwO56rVhtXUtRhZ/i2hG49jcosEE=", + "owner": "uimataso", + "repo": "vimium-nixos", + "rev": "a9e4b051cf944718fd3fbb638bc1c08057507c31", + "type": "github" + }, + "original": { + "owner": "uimataso", + "repo": "vimium-nixos", + "type": "github" + } + }, "vpn-confinement": { "locked": { "lastModified": 1767604552, diff --git a/flake.nix b/flake.nix index 3f9ad6c..7c23e70 100644 --- a/flake.nix +++ b/flake.nix @@ -68,16 +68,15 @@ url = "github:drannex/FirefoxSidebar"; flake = false; }; - + vimium-options.url = "github:uimataso/vimium-nixos"; }; outputs = - { - nixpkgs, - flake-utils, - sops-nix, - vpn-confinement, - deploy-rs, - ... + { nixpkgs + , flake-utils + , sops-nix + , vpn-confinement + , deploy-rs + , ... }@inputs: let custom = pkgs: import ./pkgs/custom.nix (inputs // { inherit pkgs; }); diff --git a/programs/default.nix b/programs/default.nix index c22ce6d..9b78fe0 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -44,10 +44,11 @@ inherit inputs; requirements = [ "graphical" ]; home-config = - { config - , pkgs - , lib - , ... + { + config, + pkgs, + lib, + ... }: let disableFeatures = [ @@ -212,6 +213,7 @@ just uv llvmPackages.bintools + nodejs (writeShellScriptBin "nas" '' mkdir -p ~/Documents/nas diff --git a/programs/firefox/default.nix b/programs/firefox/default.nix index 186fc2f..09df2cd 100644 --- a/programs/firefox/default.nix +++ b/programs/firefox/default.nix @@ -23,6 +23,48 @@ inputs@{ machine, ... }: # }; in { + imports = [ flakes.vimium-options.homeManagerModules.vimium-options ]; + + home.vimiumOptions = { + enable = true; + outputFilePath = ".cache/vimium-options.json"; + keyMappings = { + unmapAll = true; + map = { + "j" = "scrollDown"; + "k" = "scrollUp"; + "<" = "goBack"; + ">" = "goForward"; + "gi" = "focusInput"; + "gr" = "goToRoot"; + "gu" = "goUp"; + "g[" = "goNext"; + "g]" = "goPrevious"; + "gF" = "mainFrame"; + "gf" = "nextFrame"; + "p" = "openCopiedUrlInCurrentTab"; + "P" = "openCopiedUrlInNewTab"; + "G" = "scrollToBottom"; + "gg" = "scrollToTop"; + "C-o" = "visitPreviousTab"; + + "f" = "LinkHints.activateMode"; + "F" = "LinkHints.activateModeToOpenInNewTab"; + "" = "LinkHints.activateModeWithQueue"; + "yf" = "LinkHints.activateModeToCopyLinkUrl"; + }; + }; + + exclusionRules = [ + { + pattern = "https?://mail.google.com/*"; + } + { + pattern = "https?://squaredle.app/*"; + } + ]; + }; + programs.firefox = { enable = true; package = pkgs.wrapFirefox pkgs.firefox-unwrapped { @@ -88,7 +130,7 @@ inputs@{ machine, ... }: ublock-origin sidebery sponsorblock - # vimium + vimium ]; bookmarks = { @@ -154,16 +196,16 @@ inputs@{ machine, ... }: }; }; - xdg.mimeApps = { - defaultApplications."x-scheme-handler/http" = [ + xdg.mimeApps.defaultApplications = { + "x-scheme-handler/http" = [ "firefox.desktop" ]; - defaultApplications."x-scheme-handler/https" = [ + "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" ]; + "text/html" = [ "firefox.desktop" ]; + "x-scheme-handler/about" = [ "firefox.desktop" ]; + "x-scheme-handler/unknown" = [ "firefox.desktop" ]; }; }; }; diff --git a/programs/nvim/config.lua b/programs/nvim/config.lua index 8db77ea..d2e686d 100644 --- a/programs/nvim/config.lua +++ b/programs/nvim/config.lua @@ -28,9 +28,10 @@ end, { remap = true }) --- vim.keymap.set('n', 'gr', (function() builtin.lsp_references({jump_type="vsplit"}) end), {}) --- vim.keymap.set('n', 'gd', (function() builtin.lsp_definitions({jump_type="vsplit"}) end), {}) --- vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({jump_type="vsplit"}) end), {}) +vim.keymap.set('n', 'gr', (function() builtin.lsp_references({}) end), {}) +vim.keymap.set('n', 'gd', (function() builtin.lsp_definitions({}) end), {}) +vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({}) end), {}) +vim.keymap.set('n', 'gi', (function() builtin.lsp_implementations({}) end), {}) -- vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({jump_type="vsplit"}) end), {}) diff --git a/programs/nvim/keys.nix b/programs/nvim/keys.nix index 679ecbd..4a9d4b3 100644 --- a/programs/nvim/keys.nix +++ b/programs/nvim/keys.nix @@ -19,8 +19,7 @@ in # jumplist (map "" "" "") # note: C-a is actually C-i, remapped through kitty. - (luamap "n" "r" "${telescope}.jumplist()") - (luamap "n" "R" "${telescope}.loclist()") + (luamap "n" "j" "${telescope}.jumplist()") # pickers (luamap "n" "" "${telescope}.find_files()") diff --git a/programs/xdg.nix b/programs/xdg.nix index 0fad6fa..2910559 100644 --- a/programs/xdg.nix +++ b/programs/xdg.nix @@ -27,6 +27,7 @@ let mimeMap = { text = [ + "text/rust" "text/plain" "text/english" "application/x-zerosize" From ac7e310e001f03e3f7c5c9d1e084de3c529d3005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Thu, 19 Mar 2026 10:24:29 +0100 Subject: [PATCH 2/3] less --- config.nix | 2 + flake.lock | 25 ++++++++++-- flake.nix | 28 ++++++++----- programs/default.nix | 1 + programs/jj/default.nix | 27 ++++++++---- programs/less.nix | 22 ++++++++++ programs/nvim/default.nix | 28 +++++++------ programs/nvim/plugins.nix | 86 +++++++++++++++++++++------------------ programs/ssh.nix | 73 ++++++++++++++++----------------- 9 files changed, 181 insertions(+), 111 deletions(-) create mode 100644 programs/less.nix diff --git a/config.nix b/config.nix index 53750c1..9353aca 100644 --- a/config.nix +++ b/config.nix @@ -3,6 +3,7 @@ inputs@{ deploy-rs, self, pkgsForSystem, + unstablePkgsForSystem, ... }: @@ -63,6 +64,7 @@ rec { }: home-only: { pkgs = pkgsForSystem system; + pkgs-unstable = unstablePkgsForSystem system; flakes = inputs; inherit inputs; inherit (inputs.secrets.packages.${system}) secrets; diff --git a/flake.lock b/flake.lock index e1d0ce5..4b41c53 100644 --- a/flake.lock +++ b/flake.lock @@ -718,11 +718,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1773832951, - "narHash": "sha256-qzWEWTC1l7aofSoYoW9Zckh/gNLK8pbjiUuRl9qRc7k=", + "lastModified": 1774289893, + "narHash": "sha256-si2LHcNiLuF01yOuaUs90p1U09hhaketA8tyanWwiP0=", "owner": "jdonszelmann", "repo": "homepage", - "rev": "92cb1f2f367d52a64bf088f413aacb6446642794", + "rev": "635f900ce31b7f901da33c6fa830a2e7c116552f", "type": "github" }, "original": { @@ -1123,6 +1123,22 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1766185129, + "narHash": "sha256-ldujgxS7lslpNf3oV2DHCEgNutfzEtMPv5O6l22XHNY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5d9ea8caac0dda3bc216047d29943b8a59e431b7", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5d9ea8caac0dda3bc216047d29943b8a59e431b7", + "type": "github" + } + }, "nixpkgs_10": { "locked": { "lastModified": 1757967192, @@ -1458,7 +1474,7 @@ "inputs": { "flake-parts": "flake-parts", "nixpkgs": [ - "nixpkgs" + "nixpkgs-unstable" ], "systems": "systems_10" }, @@ -1712,6 +1728,7 @@ "niri": "niri", "niri-unstable": "niri-unstable", "nixpkgs": "nixpkgs_11", + "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", "noctalia": "noctalia", "p1n3appl3": "p1n3appl3", diff --git a/flake.nix b/flake.nix index 7c23e70..9b6d375 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ description = "jana's server infrastructure"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/5d9ea8caac0dda3bc216047d29943b8a59e431b7"; flake-utils.url = "github:numtide/flake-utils"; home-manager = { url = "github:nix-community/home-manager"; @@ -29,7 +30,7 @@ # home nixvim = { url = "github:nix-community/nixvim"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; }; t.url = "github:jdonszelmann/t-rs"; dumpasm.url = "github:jdonszelmann/dumpasm"; @@ -71,18 +72,21 @@ vimium-options.url = "github:uimataso/vimium-nixos"; }; outputs = - { nixpkgs - , flake-utils - , sops-nix - , vpn-confinement - , deploy-rs - , ... + { + nixpkgs, + nixpkgs-unstable, + flake-utils, + sops-nix, + vpn-confinement, + deploy-rs, + ... }@inputs: let custom = pkgs: import ./pkgs/custom.nix (inputs // { inherit pkgs; }); - pkgsForSystem = - system: - import nixpkgs { + + pkgsForSystemShared = + np: system: + import np { inherit system; config.allowUnfree = true; overlays = [ @@ -91,7 +95,9 @@ }) ]; }; - configs = import ./config.nix (inputs // { inherit pkgsForSystem; }); + pkgsForSystem = pkgsForSystemShared nixpkgs; + unstablePkgsForSystem = pkgsForSystemShared nixpkgs-unstable; + configs = import ./config.nix (inputs // { inherit pkgsForSystem unstablePkgsForSystem; }); in (configs.configs [ { diff --git a/programs/default.nix b/programs/default.nix index 9b78fe0..272d8a2 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -5,6 +5,7 @@ [ ./xdg.nix ./ssh.nix + ./less.nix ./nvim ./fish ./kanata diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 1947a1e..654621f 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -13,12 +13,12 @@ inputs@{ machine, ... }: settings = { user = { - email = config.programs.git.settings.user.email; - name = config.programs.git.settings.user.name; + inherit (config.programs.git.settings.user) email; + inherit (config.programs.git.settings.user) name; }; ui = { - paginate = "never"; + # paginate = "never"; # pager = "${pkgs.delta}/bin/delta"; # for delta # diff-formatter = ":git"; @@ -32,7 +32,6 @@ inputs@{ machine, ... }: default-command = [ "log" "--reversed" - "--no-pager" ]; merge-editor = [ "${pkgs.meld}/bin/meld" @@ -154,14 +153,26 @@ inputs@{ machine, ... }: "--from" "trunk()" ]; - n = [ "edit" "@+" ]; - p = [ "edit" "@-" ]; + n = [ + "edit" + "@+" + ]; + p = [ + "edit" + "@-" + ]; - gp = [ "git" "push" ]; + gp = [ + "git" + "push" + ]; t = tug; d = "describe"; - dm = [ "describe" "-m" ]; + dm = [ + "describe" + "-m" + ]; e = "edit"; s = "squash"; si = "squash -i"; diff --git a/programs/less.nix b/programs/less.nix new file mode 100644 index 0000000..c4a2973 --- /dev/null +++ b/programs/less.nix @@ -0,0 +1,22 @@ +inputs@{ machine, ... }: +{ + imports = machine.program { + name = "less"; + inherit inputs; + requirements = [ "cli" ]; + home-config = + { pkgs, ... }: + { + home.packages = with pkgs; [ less ]; + + programs.less = { + enable = true; + config = '' + #command + #env + LESS=--quit-if-one-screen --ignore-case --long-prompt --tabs=4 --redraw-on-quit --use-color --RAW-CONTROL-CHARS --chop-long-lines --exit-follow-on-close +F + ''; + }; + }; + }; +} diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index 9cc33d0..e938cdb 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -5,10 +5,12 @@ inputs@{ machine, ... }: inherit inputs; requirements = [ "cli" ]; home-config = - { pkgs - , flakes - , lib - , ... + { + pkgs, + pkgs-unstable, + flakes, + lib, + ... }: let nvim_mime_types = [ @@ -50,6 +52,10 @@ inputs@{ machine, ... }: sessionVariables = { EDITOR = "nvim"; }; + + packages = with pkgs-unstable; [ + tree-sitter + ]; }; home.file.".local/share/applications/${desktop-entry-name}.desktop" = { @@ -57,11 +63,9 @@ inputs@{ machine, ... }: }; xdg.mimeApps.associations.added = lib.mergeAttrsList ( - map - (mime: { - ${mime} = [ "${desktop-entry-name}.desktop" ]; - }) - nvim_mime_types + map (mime: { + ${mime} = [ "${desktop-entry-name}.desktop" ]; + }) nvim_mime_types ); imports = [ @@ -90,11 +94,10 @@ inputs@{ machine, ... }: performance = { byteCompileLua.enable = true; combinePlugins = { - enable = true; + enable = false; standalonePlugins = [ # clashes with lualine - "onedark.nvim" ]; }; }; @@ -103,7 +106,8 @@ inputs@{ machine, ... }: extraPackages = [ pkgs.imagemagick ]; # package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped; - package = pkgs.neovim-unwrapped; + # package = pkgs.neovim-unwrapped; + package = with pkgs-unstable; neovim-unwrapped; colorschemes.onedark = { enable = true; diff --git a/programs/nvim/plugins.nix b/programs/nvim/plugins.nix index 818421a..a8c5a92 100644 --- a/programs/nvim/plugins.nix +++ b/programs/nvim/plugins.nix @@ -1,4 +1,9 @@ -{ pkgs, config, ... }: +{ + pkgs, + pkgs-unstable, + config, + ... +}: let render-markdown = pkgs.vimUtils.buildVimPlugin { name = "render-markdown"; @@ -127,17 +132,19 @@ in treesitter = { enable = true; - nixGrammars = false; + nixGrammars = true; + grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars; nixvimInjections = false; + # package = with pkgs-unstable; tree-sitter; settings = { indent.enable = true; - ensure_installed = "all"; - ignore_install = [ - "wing" - "brightscript" - ]; + # ensure_installed = "all"; + # ignore_install = [ + # "wing" + # "brightscript" + # ]; highlight.enable = true; @@ -435,8 +442,8 @@ in __unkeyed-1 = "filetype"; } ]; - lualine_y = [{ __unkeyed-1 = "progress"; }]; - lualine_z = [{ __unkeyed-1 = "location"; }]; + lualine_y = [ { __unkeyed-1 = "progress"; } ]; + lualine_z = [ { __unkeyed-1 = "location"; } ]; }; }; }; @@ -623,36 +630,37 @@ in }; options = { - pipeline = config.lib.nixvim.mkRaw '' - wilder.branch( - wilder.cmdline_pipeline({ - language = 'python', - fuzzy = 2, - }), - wilder.python_search_pipeline({ - pattern = wilder.python_fuzzy_pattern(), - sorter = wilder.python_difflib_sorter(), - engine = 're', - }), - wilder.substitute_pipeline({ - pipeline = wilder.python_search_pipeline({ - skip_cmdtype_check = 1, - pattern = wilder.python_fuzzy_pattern({ - start_at_boundary = 0, - }), - }), - }), - { - wilder.check(function(ctx, x) return x == "" end), - wilder.history(), - }, - wilder.python_file_finder_pipeline({ - file_command = {'${pkgs.ripgrep}/bin/rg', '--files'}, - dir_command = {'${pkgs.fd}/bin/fd', '-td'}, - filters = {'cpsm_filter'}, - }) - ) - ''; + # pipeline = config.lib.nixvim.mkRaw ""; + #'' + # wilder.branch( + # wilder.cmdline_pipeline({ + # language = 'python', + # fuzzy = 2, + # }), + # wilder.python_search_pipeline({ + # pattern = wilder.python_fuzzy_pattern(), + # sorter = wilder.python_difflib_sorter(), + # engine = 're', + # }), + # wilder.substitute_pipeline({ + # pipeline = wilder.python_search_pipeline({ + # skip_cmdtype_check = 1, + # pattern = wilder.python_fuzzy_pattern({ + # start_at_boundary = 0, + # }), + # }), + # }), + # { + # wilder.check(function(ctx, x) return x == "" end), + # wilder.history(), + # }, + # wilder.python_file_finder_pipeline({ + # file_command = {'${pkgs.ripgrep}/bin/rg', '--files'}, + # dir_command = {'${pkgs.fd}/bin/fd', '-td'}, + # filters = {'cpsm_filter'}, + # }) + # ) + # ''; renderer = config.lib.nixvim.mkRaw '' (function() diff --git a/programs/ssh.nix b/programs/ssh.nix index 1300ac9..fca7d4c 100644 --- a/programs/ssh.nix +++ b/programs/ssh.nix @@ -1,42 +1,41 @@ -inputs@{ machine, ... }: { - imports = - machine.program { - name = "ssh"; - inherit inputs; - requirements = [ "cli" ]; - home-config = _: { - programs.ssh = { - enable = true; - enableDefaultConfig = false; - matchBlocks = { - fili = { - user = "jana"; - hostname = "donsz.nl"; - }; - icecube = { - hostname = "192.168.178.138"; - proxyJump = "fili"; - }; - ragdoll = { - hostname = "192.168.178.138"; - proxyJump = "fili"; - }; +inputs@{ machine, ... }: +{ + imports = machine.program { + name = "ssh"; + inherit inputs; + requirements = [ "cli" ]; + home-config = _: { + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks = { + fili = { + user = "jana"; + hostname = "donsz.nl"; + }; + icecube = { + hostname = "192.168.178.138"; + proxyJump = "fili"; + }; + ragdoll = { + hostname = "192.168.178.138"; + proxyJump = "fili"; + }; - "*" = { - forwardAgent = false; - serverAliveInterval = 0; - serverAliveCountMax = 3; - compression = false; - addKeysToAgent = null; - hashKnownHosts = false; - userKnownHostsFile = "~/.ssh/known_hosts"; - controlMaster = "no"; - controlPath = "~/.ssh/master-%r@%n:%p"; - controlPersist = null; - }; + "*" = { + forwardAgent = false; + serverAliveInterval = 0; + serverAliveCountMax = 3; + compression = false; + addKeysToAgent = null; + hashKnownHosts = false; + userKnownHostsFile = "~/.ssh/known_hosts"; + controlMaster = "no"; + controlPath = "~/.ssh/master-%r@%n:%p"; + controlPersist = null; }; }; }; - } - ; + }; + }; } From ae9854f178251a149561f4cd9b9240835445a615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Tue, 24 Mar 2026 08:41:29 +0100 Subject: [PATCH 3/3] fish and jj --- programs/fish/default.nix | 468 +++++++++++++++++++------------------- programs/jj/default.nix | 1 - programs/less.nix | 2 +- 3 files changed, 238 insertions(+), 233 deletions(-) diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 5bc8d3d..e478e52 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -5,245 +5,251 @@ inputs@{ machine, ... }: inherit inputs; requirements = [ "cli" ]; home-config = - { config - , pkgs - , lib - , ... + { + 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"; - "ragdoll" = ragdoll; - "dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm"; - "p" = 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"; + 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"; + "ragdoll" = ragdoll; + "dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm"; + "p" = 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 + "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 - ''; - in - { - programs = { - atuin = { - enable = true; - enableFishIntegration = true; + 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 = "workspace"; - exit_mode = "return-original"; - inline_height = 20; - 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 - - bind \e\[3\;5~ kill-word - bind \cH backward-kill-word - bind \cV beginning-of-line - bind \f end-of-line - - bind -M insert \e\[3\;5~ kill-word - bind -M insert \cH backward-kill-word - bind -M insert \cV beginning-of-line - bind -M insert \f end-of-line - - bind \cl 'clear; commandline -f repaint' - bind -M insert \cl 'clear; commandline -f repaint' - - 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 - echo "mrow! This is $(uname -n) and ur $(whoami) :3" - end - ''; + settings = { + filter_mode_shell_up_key_binding = "workspace"; + exit_mode = "return-original"; + inline_height = 20; + workspaces = true; }; }; - home.activation = { - setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - setupTide() { - ${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${ - lib.cli.toCommandLineShell (optionName: { + 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 + + bind \e\[3\;5~ kill-word + bind \cH backward-kill-word + bind \cV beginning-of-line + bind \f end-of-line + + bind -M insert \e\[3\;5~ kill-word + bind -M insert \cH backward-kill-word + bind -M insert \cV beginning-of-line + bind -M insert \f end-of-line + + bind \cl 'clear; commandline -f repaint' + bind -M insert \cl 'clear; commandline -f repaint' + + 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 + if test -e /etc/motd + else + ${pkgs.blahaj}/bin/blahaj -s + end + echo "mrow! This is $(uname -n) and ur $(whoami) :3" + end + ''; + }; + }; + + home.activation = { + setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + setupTide() { + ${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${ + lib.cli.toCommandLineShell + (optionName: { option = if builtins.stringLength optionName > 1 then "--${optionName}" else "-${optionName}"; sep = null; explicitBool = false; - }) { + }) + { auto = true; style = "Lean"; prompt_colors = "True color"; @@ -254,11 +260,11 @@ inputs@{ machine, ... }: icons = "Few icons"; transient = "Yes"; } - }"} >/dev/null 2>&1 - } - setupTide - ''; - }; + }"} >/dev/null 2>&1 + } + setupTide + ''; }; + }; }; } diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 654621f..5989eb8 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -31,7 +31,6 @@ inputs@{ machine, ... }: default-command = [ "log" - "--reversed" ]; merge-editor = [ "${pkgs.meld}/bin/meld" diff --git a/programs/less.nix b/programs/less.nix index c4a2973..2116959 100644 --- a/programs/less.nix +++ b/programs/less.nix @@ -14,7 +14,7 @@ inputs@{ machine, ... }: config = '' #command #env - LESS=--quit-if-one-screen --ignore-case --long-prompt --tabs=4 --redraw-on-quit --use-color --RAW-CONTROL-CHARS --chop-long-lines --exit-follow-on-close +F + LESS=--quit-if-one-screen --ignore-case --long-prompt --tabs=4 --redraw-on-quit --use-color --RAW-CONTROL-CHARS --chop-long-lines --exit-follow-on-close ''; }; };