1 Commits

Author SHA1 Message Date
Joe Frikker bbec58acba wip 2026-06-18 11:08:34 -04:00
3 changed files with 186 additions and 367 deletions
Generated
+54 -56
View File
@@ -1,41 +1,20 @@
{ {
"nodes": { "nodes": {
"claude-code": { "flake-parts": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "nixpkgs-lib": "nixpkgs-lib"
"nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1783380155, "lastModified": 1765835352,
"narHash": "sha256-SwUwKaLrZ+c5y4GoZHKBf1nUsDHVsIUtn2CFloZrV2A=", "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
"owner": "sadjow", "owner": "hercules-ci",
"repo": "claude-code-nix", "repo": "flake-parts",
"rev": "25d979d1a39d0acdbcb1b8d0b9d83ffdd10b5f43", "rev": "a34fae9c08a15ad73f295041fec82323541400a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "sadjow", "owner": "hercules-ci",
"repo": "claude-code-nix", "repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github" "type": "github"
} }
}, },
@@ -46,11 +25,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1783436070, "lastModified": 1779969295,
"narHash": "sha256-F80z1JoiJgZyTT5D+3siLOVzqmCEphLR7t0Ym/I2CLI=", "narHash": "sha256-HwIJ3tOcwSMiV75L7KqJXciXR9UfT+d7rwOZMX7cTnA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f09af49406ffad37acb6538d3207189a1a1e0b7e", "rev": "61e2c9659324181e0f0ed911958c536333b1d4f6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -60,6 +39,25 @@
"type": "github" "type": "github"
} }
}, },
"kube": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1767247330,
"narHash": "sha256-CxXwzmvAOO07719jzE0Zw14C9r3fQcXfPllLtt5cIzo=",
"rev": "4a4d79a290c92de630e503f395fc8fd709904c1b",
"type": "tarball",
"url": "https://gitea.home-frikker.dedyn.io/api/v1/repos/jfrikker/kube/archive/4a4d79a290c92de630e503f395fc8fd709904c1b.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://gitea.home-frikker.dedyn.io/jfrikker/kube/archive/1.0.1.tar.gz"
}
},
"nix-index-database": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -67,11 +65,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1783414108, "lastModified": 1779604987,
"narHash": "sha256-RY8e+gR2/DhXsYDxGDL6Hhe9+POD9u4+llwxMBqMQDs=", "narHash": "sha256-ZQ5z+fVhxYKtIFwtqGp5O0PD84BM1riASvqDaN5Xs+s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "96d6de10eb281b98f5cfcd1841394c03da5df77c", "rev": "8fba98c80b48fa013820e0163c5096922fea4ddd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -82,42 +80,42 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1783148766, "lastModified": 1779560665,
"narHash": "sha256-uslt2pqShTIXDdAHRHv2QkYLsVdY8Oqwz0EA48/RSM8=", "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a50de1b7d8a586adc18d2395c19de7d6058e6030", "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-26.05", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1765674936,
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"claude-code": "claude-code",
"home-manager": "home-manager", "home-manager": "home-manager",
"kube": "kube",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",
+11 -18
View File
@@ -3,20 +3,15 @@
inputs = { inputs = {
# Specify the source of Home Manager and Nixpkgs. # Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
claude-code = {
url = "github:sadjow/claude-code-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# kube = { kube = {
# url = "https://gitea.home-frikker.dedyn.io/jfrikker/kube/archive/1.0.1.tar.gz"; url = "https://gitea.home-frikker.dedyn.io/jfrikker/kube/archive/1.0.1.tar.gz";
# inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
# }; };
nix-index-database = { nix-index-database = {
url = "github:nix-community/nix-index-database"; url = "github:nix-community/nix-index-database";
@@ -24,7 +19,7 @@
}; };
}; };
outputs = { nixpkgs, home-manager, claude-code, nix-index-database, ... }: outputs = { nixpkgs, home-manager, kube, nix-index-database, ... }:
let modules-for-system = pkgs: pkgs.stdenv.mkDerivation { let modules-for-system = pkgs: pkgs.stdenv.mkDerivation {
name = "home-manager-modules"; name = "home-manager-modules";
src = pkgs.lib.fileset.toSource { src = pkgs.lib.fileset.toSource {
@@ -46,7 +41,7 @@
''; '';
}; };
in { in {
homeConfigurations.redbook = homeConfigurations.shibumi =
let pkgs = import nixpkgs { system = "aarch64-darwin"; config.allowUnfree = true; }; let pkgs = import nixpkgs { system = "aarch64-darwin"; config.allowUnfree = true; };
modules = modules-for-system pkgs; modules = modules-for-system pkgs;
in home-manager.lib.homeManagerConfiguration { in home-manager.lib.homeManagerConfiguration {
@@ -55,19 +50,17 @@
modules = modules =
[ [
nix-index-database.homeModules.default nix-index-database.homeModules.default
"${modules}/base.nix" "${modules}"
"${modules}/desktop.nix"
"${modules}/redbook.nix"
"${modules}/redbook-desktop.nix"
] ++ ] ++
[{ [{
home.stateVersion = "22.05"; home.stateVersion = "22.05";
home.username = "jfrikker"; home.username = "jfrikker";
home.homeDirectory = "/Users/jfrikker"; home.homeDirectory = "/Users/jfrikker";
home.packages = [ pkgs.pinentry_mac ]; home.packages = [ pkgs.pinentry_mac ];
jfrikker.desktop.enable = true;
}]; }];
extraSpecialArgs = { claude-code = claude-code.packages.aarch64-darwin.default; }; extraSpecialArgs = { kube = kube.packages.aarch64-darwin.default; };
}; };
homeConfigurations.home = homeConfigurations.home =
let pkgs = nixpkgs.legacyPackages.x86_64-linux; let pkgs = nixpkgs.legacyPackages.x86_64-linux;
@@ -87,7 +80,7 @@
home.homeDirectory = "/home/jfrikker"; home.homeDirectory = "/home/jfrikker";
}]; }];
extraSpecialArgs = { claude-code = claude-code.packages.x86_64-linux.default; }; extraSpecialArgs = { kube = kube.packages.x86_64-linux.default; };
}; };
packages.aarch64-darwin.default = modules-for-system nixpkgs.legacyPackages.aarch64-darwin; packages.aarch64-darwin.default = modules-for-system nixpkgs.legacyPackages.aarch64-darwin;
}; };
+120 -292
View File
@@ -1,36 +1,32 @@
#+PROPERTY: header-args :mkdirp yes #+PROPERTY: header-args :mkdirp yes
#+PROPERTY: header-args:elisp :lexical t #+PROPERTY: header-args:elisp :lexical t
* Categories * Base
#+BEGIN_SRC nix :tangle target/base.nix #+BEGIN_SRC nix :tangle target/default.nix
{lib, ...}: { {
imports = lib.filter imports = [
(n: lib.strings.hasSuffix ".nix" n) ./base_options.nix
(lib.filesystem.listFilesRecursive ./base); ./sbcl.nix
./crypto.nix
./rust-reimpls.nix
./ledger.nix
./nil.nix
./magic-wormhole.nix
./desktop-packages.nix
./shibumi.nix
./slack.nix
];
} }
#+END_SRC #+END_SRC
#+BEGIN_SRC nix :tangle target/desktop.nix #+BEGIN_SRC nix :tangle target/base_options.nix
{lib, ...}: { {lib, ...}:
imports = lib.filter with lib;
(n: lib.strings.hasSuffix ".nix" n) {
(lib.filesystem.listFilesRecursive ./desktop); options = {
} jfrikker.desktop.enable = mkEnableOption "desktop tools";
#+END_SRC jfrikker.shibumi.enable = mkEnableOption "shibumi-specific tools";
};
#+BEGIN_SRC nix :tangle target/redbook.nix
{lib, ...}: {
imports = lib.filter
(n: lib.strings.hasSuffix ".nix" n)
(lib.filesystem.listFilesRecursive ./redbook);
}
#+END_SRC
#+BEGIN_SRC nix :tangle target/redbook-desktop.nix
{lib, ...}: {
imports = lib.filter
(n: lib.strings.hasSuffix ".nix" n)
(lib.filesystem.listFilesRecursive ./redbook-desktop);
} }
#+END_SRC #+END_SRC
@@ -45,7 +41,7 @@ in a ~nix~ devshell I think I'd also like to use it for scripting / exploratory
so I'm installing it globally with a useful set of libraries. I should curate this somewhat so I'm installing it globally with a useful set of libraries. I should curate this somewhat
carefully so it doesn't get carried away... carefully so it doesn't get carried away...
#+BEGIN_SRC nix :tangle target/base/sbcl.nix #+BEGIN_SRC nix :tangle target/sbcl.nix
{pkgs, ...}: {pkgs, ...}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -54,8 +50,10 @@ carefully so it doesn't get carried away...
alexandria alexandria
cl-markup cl-markup
cl-mock cl-mock
cl-rdkafka
clack clack
clack-handler-woo clack-handler-woo
dbd-mysql
dbi dbi
defstar defstar
dexador dexador
@@ -94,7 +92,7 @@ the name implies, allows generating and storing ~age~ keys on a Yubikey. ~rage~
~age~ when using ~age.el~, because it supports ~pinentry~. That allows it to prompt for yubikey pins ~age~ when using ~age.el~, because it supports ~pinentry~. That allows it to prompt for yubikey pins
using a dialog, rather than a command line prompt. using a dialog, rather than a command line prompt.
#+BEGIN_SRC nix :tangle target/base/crypto.nix #+BEGIN_SRC nix :tangle target/crypto.nix
{pkgs, ...}: {pkgs, ...}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -114,7 +112,7 @@ tools. They boost better speed, or simply more streamlined features.
| ~ripgrep~ | ~grep~ | | ~ripgrep~ | ~grep~ |
| ~xh~ | ~curl~ | | ~xh~ | ~curl~ |
#+BEGIN_SRC nix :tangle target/base/rust-reimpls.nix #+BEGIN_SRC nix :tangle target/rust-reimpls.nix
{pkgs, ...}: {pkgs, ...}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -129,7 +127,7 @@ tools. They boost better speed, or simply more streamlined features.
[[https://ledger-cli.org/][~ledger~]] is how I manage my budget. It's a plain-text accounting tool that's really awesome. [[https://ledger-cli.org/][~ledger~]] is how I manage my budget. It's a plain-text accounting tool that's really awesome.
#+BEGIN_SRC nix :tangle target/base/ledger.nix #+BEGIN_SRC nix :tangle target/ledger.nix
{pkgs, ...}: {pkgs, ...}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -140,7 +138,7 @@ tools. They boost better speed, or simply more streamlined features.
~nil~ is an LSP server for nix files. ~nil~ is an LSP server for nix files.
#+BEGIN_SRC nix :tangle target/base/nil.nix #+BEGIN_SRC nix :tangle target/nil.nix
{pkgs, ...}: {pkgs, ...}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -153,7 +151,7 @@ tools. They boost better speed, or simply more streamlined features.
computers in the world, assuming that you have an out-of-band way to communicate a passphrase computers in the world, assuming that you have an out-of-band way to communicate a passphrase
between them. Once installed, the actual command is ~wormhole~. between them. Once installed, the actual command is ~wormhole~.
#+begin_src nix :tangle target/base/magic-wormhole.nix #+begin_src nix :tangle target/magic-wormhole.nix
{pkgs, ...}: {pkgs, ...}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -163,47 +161,54 @@ between them. Once installed, the actual command is ~wormhole~.
#+end_src #+end_src
These are the other programs I have installed globally. A few (like ~awscli~, ~mysql-client~, etc.) These are the other programs I have installed globally. A few (like ~awscli~, ~mysql-client~, etc.)
are still Redbook-specific; ideally I'd find another way to install them. are still Shibumi-specific; ideally I'd find another way to install them.
#+BEGIN_SRC nix :tangle target/redbook/other-packages.nix #+BEGIN_SRC nix :tangle target/shibumi.nix
{pkgs, ...}: {lib, pkgs, kube, config, ...}:
{ {
home.packages = with pkgs; [ config = lib.mkIf config.jfrikker.shibumi.enable {
postgresql home.packages = with pkgs; [
openssh aws-iam-authenticator
]; awscli2
kube
fonts.fontconfig.enable = true; kubectl
mariadb.client
openssh
];
};
} }
#+END_SRC #+END_SRC
These programs require a full desktop environment: These programs require a full desktop environment:
#+BEGIN_SRC nix :tangle target/desktop/desktop-packages.nix #+BEGIN_SRC nix :tangle target/desktop-packages.nix
{pkgs, ...}: {lib, pkgs, config, ...}:
{ {
home.packages = with pkgs; [ config = lib.mkIf config.jfrikker.desktop.enable {
google-chrome home.packages = with pkgs; [
nerd-fonts.jetbrains-mono google-chrome
nerd-fonts.symbols-only nerd-fonts.jetbrains-mono
(iosevka-bin.override { variant = "Aile"; }) (iosevka-bin.override { variant = "Aile"; })
(iosevka-bin.override { variant = "Etoile"; }) (iosevka-bin.override { variant = "Etoile"; })
(iosevka-bin.override { variant = "SGr-IosevkaTerm"; }) (iosevka-bin.override { variant = "SGr-IosevkaTerm"; })
keymapp keymapp
proton-pass proton-pass
wireshark wireshark
]; ];
fonts.fontconfig.enable = true;
};
} }
#+END_SRC #+END_SRC
#+BEGIN_SRC nix :tangle target/redbook-desktop/desktop-packages.nix #+BEGIN_SRC nix :tangle target/slack.nix
{pkgs, ...}: {lib, pkgs, config, ...}:
{ {
home.packages = with pkgs; [ config = lib.mkIf (config.jfrikker.shibumi.enable && config.jfrikker.desktop.enable) {
linear home.packages = with pkgs; [
slack slack
teams ];
]; };
} }
#+END_SRC #+END_SRC
@@ -310,8 +315,7 @@ We all know what ~git~ does.
programs.git = { programs.git = {
enable = true; enable = true;
settings.user.name = "Joe Frikker"; settings.user.name = "Joe Frikker";
settings.user.email = "joe@redbookcattle.com"; settings.user.email = "joe.frikker@shibumi.com";
settings.github.user = "joe@redbookcattle.com";
}; };
programs.delta = { programs.delta = {
@@ -656,7 +660,7 @@ Now we'll set up some keybindings:
key = "g", key = "g",
mods = "CMD", mods = "CMD",
action = wezterm.action.SpawnCommandInNewTab { action = wezterm.action.SpawnCommandInNewTab {
args = { wezterm.home_dir .. "/.nix-profile/bin/zsh", "-l", "-i", "-c", "lazygit" } args = { wezterm.home_dir .. "/.nix-profile/bin/zsh", "-l", "-c", "lazygit" }
} }
}, },
{ {
@@ -686,17 +690,6 @@ Now we'll set up some keybindings:
end end
#+END_SRC #+END_SRC
** Ghostty
#+BEGIN_SRC nix :tangle target/desktop/ghostty.nix
{pkgs, ...}: {
programs.ghostty = {
enable = true;
package = pkgs.ghostty-bin;
};
}
#+END_SRC
** Zsh ** Zsh
This is my default shell for now. Unfortunately, nix requires a posix-compliant shell, so bash or This is my default shell for now. Unfortunately, nix requires a posix-compliant shell, so bash or
@@ -739,10 +732,9 @@ Actually, nix *really* requires ~bash~. This is a plugin that allows using zsh f
** Claude Code ** Claude Code
#+BEGIN_SRC nix :tangle target/base/claude-code.nix #+BEGIN_SRC nix :tangle target/base/claude-code.nix
{claude-code, ...}: { {
programs.claude-code = { programs.claude-code = {
enable = true; enable = true;
package = claude-code;
}; };
} }
#+END_SRC #+END_SRC
@@ -794,7 +786,6 @@ These are just some general settings that apply everywhere. First, a few package
ligature ligature
mixed-pitch mixed-pitch
ace-window ace-window
popper
]; ];
extraConfig = builtins.readFile ./emacs-global.el; extraConfig = builtins.readFile ./emacs-global.el;
}; };
@@ -924,7 +915,6 @@ Use variable-width fonts in text buffers. ~mixed-pitch-mode~ keeps most code blo
(add-hook 'yaml-ts-mode-hook 'no-mixed-pitch) (add-hook 'yaml-ts-mode-hook 'no-mixed-pitch)
(add-hook 'mhtml-mode 'no-mixed-pitch) (add-hook 'mhtml-mode 'no-mixed-pitch)
(add-hook 'nxml-mode 'no-mixed-pitch)
#+END_SRC #+END_SRC
A basic ace-window setup. Allows switching between windows quickly (although avy can do the same...). A basic ace-window setup. Allows switching between windows quickly (although avy can do the same...).
@@ -996,60 +986,6 @@ windows. I place windows in the bottom or on the right mostly depending on how w
content to be. content to be.
#+BEGIN_SRC elisp #+BEGIN_SRC elisp
(defun jf/window-children (window)
(let ((result nil)
(child (window-child window)))
(while child
(push child result)
(setq child (window-next-sibling child)))
(reverse result)))
(defun jf/enforce-right-side-heights (win)
(let ((slot-heights '((-1 . 20)))
(parent (window-parent win)))
(when parent
(let ((children (jf/window-children parent)))
(when (> (length children) 1)
(cl-loop for child in children
for slot = (window-parameter child 'window-slot)
for height = (alist-get slot slot-heights)
when height do (progn (window-resize child (- height (window-height child)))
(window-preserve-size child nil t))))))))
(setopt popper-reference-buffers
'("\\*Flymake diagnostics .*"
"\\*Embark Export: .*"
"\\*Embark Collect .*"
"\\*xref\\*"
("\\*compilation\\*" . hide)
"\\*sly-mrepl *"
"\\*Messages\\*"
"\\*lispy-message\\*"
"\\*EGLOT connections\\*"
"\\*trace-output\\*"
"\\*occur\\*"
".*eshell\\*"
"\\*SQL: .*"
"magit: *"
"magit-revision: .*"
"magit-log*"
"\\*Help\\*"
"\\*rustfmt\\*"
"\\*slack: .*"
"\\*forge: .*"
"new-pullreq"
"\\*claude:.*"
"\\*Man .*"
"\\*List .*"
"\\*eldoc\\*"))
(setopt popper-display-control nil)
(popper-mode)
(popper-echo-mode)
(bind-keys ("C-z" . popper-toggle)
("C-;" . popper-cycle))
(setq display-buffer-alist (setq display-buffer-alist
'(((or "\\*Flymake diagnostics .*" '(((or "\\*Flymake diagnostics .*"
"\\*Embark Export: .*" "\\*Embark Export: .*"
@@ -1062,43 +998,37 @@ content to be.
"\\*EGLOT connections\\*" "\\*EGLOT connections\\*"
"\\*trace-output\\*" "\\*trace-output\\*"
"\\*occur\\*" "\\*occur\\*"
".*eshell\\*" ".*eshell\\*")
"\\*SQL: .*") (display-buffer-in-side-window)
(display-buffer-in-side-window) (side . bottom)
(side . bottom) (slot . 0)
(slot . 0) (window-height . 0.33)
(window-height . 0.33) (window-parameters (no-delete-other-windows . t)
(window-parameters (no-delete-other-windows . t) (no-other-window . t)))
(no-other-window . t))) ((or "magit: *"
((or "magit: *" "magit-revision: .*"
"magit-revision: .*" "magit-log*"
"magit-log*" "\\*eldoc\\*"
"\\*Help\\*" "\\*Help\\*"
"\\*rustfmt\\*" "\\*rustfmt\\*"
"\\*slack: .*" "\\*slack: .*"
"\\*forge: .*" "\\*forge: .*"
"new-pullreq" "new-pullreq"
"\\*claude:.*" "\\*claude:.*"
"\\*Man .*" "\\*Man .*")
"\\*List .*") (display-buffer-reuse-window display-buffer-in-side-window)
(display-buffer-in-side-window) (side . right)
(side . right) (slot . 0)
(slot . 0) (window-width . 0.5)
(window-width . 101) (window-parameters (no-delete-other-windows . t)
(window-height . jf/enforce-right-side-heights) (no-other-window . t)))
(preserve-size . (t . nil)) ("\\*Embark Actions\\*"
(window-parameters (no-delete-other-windows . t) (display-buffer-in-side-window)
(no-other-window . t))) (side . right)
((or "\\*Embark Actions\\*" (slot . -1)
"\\*eldoc\\*") (window-width . 0.5)
(display-buffer-in-side-window) (window-parameters (no-delete-other-windows . t)
(side . right) (no-other-window . t)))))
(slot . -1)
(window-width . 101)
(window-height . jf/enforce-right-side-heights)
(preserve-size . (t . t))
(window-parameters (no-delete-other-windows . t)
(no-other-window . t)))))
(setopt window-persistent-parameters (setopt window-persistent-parameters
(cl-list* '(no-delete-other-windows . writable) (cl-list* '(no-delete-other-windows . writable)
@@ -1122,11 +1052,9 @@ This configuration affects general text editing, across all modes. First, some p
avy avy
edit-indirect edit-indirect
embark embark
format-all evil
god-mode evil-collection
# evil evil-org
# evil-collection
# evil-org
string-inflection string-inflection
]; ];
extraConfig = builtins.readFile ./emacs-editing.el; extraConfig = builtins.readFile ./emacs-editing.el;
@@ -1146,32 +1074,17 @@ cancel them more frequently). In the end, I opted for Devil mode. It avoids modi
its own devil-mode-only repeat maps that don't interfere when using normal modifier key sequences. its own devil-mode-only repeat maps that don't interfere when using normal modifier key sequences.
#+BEGIN_SRC elisp #+BEGIN_SRC elisp
;; (setopt evil-want-keybinding nil) (setopt evil-want-keybinding nil)
;; (require 'evil) (require 'evil)
;; (evil-mode 1) (evil-mode 1)
;; (require 'evil-collection) (require 'evil-collection)
;; (evil-collection-init) (evil-collection-init)
;; (require 'evil-org) (require 'evil-org)
;; (add-hook 'org-mode-hook 'evil-org-mode) (add-hook 'org-mode-hook 'evil-org-mode)
;; (evil-org-set-key-theme '(navigation insert textobjects additional calendar)) (evil-org-set-key-theme '(navigation insert textobjects additional calendar))
;; (require 'evil-org-agenda) (require 'evil-org-agenda)
;; (evil-org-agenda-set-keys) (evil-org-agenda-set-keys)
(require 'god-mode)
(require 'which-key)
(bind-keys :map god-local-mode-map
("i" . (lambda () (interactive) (god-mode-all -1)))
("z" . repeat))
(bind-keys ("<escape>" . (lambda () (interactive) (god-mode-all 1))))
(defun my-god-mode-update-cursor-type ()
(setq cursor-type (cond
(org-present-mode nil)
((or (and (featurep 'god-mode) god-local-mode) buffer-read-only) 'box)
(t 'bar))))
(add-hook 'post-command-hook 'my-god-mode-update-cursor-type)
(which-key-enable-god-mode-support)
#+END_SRC #+END_SRC
Avy allows jumping to any place on the screen with just a few keystrokes. I've stolen most of these Avy allows jumping to any place on the screen with just a few keystrokes. I've stolen most of these
@@ -1229,43 +1142,6 @@ Just "silently" wrap when searching at the bottom of a document.
(bind-keys ("C-x 4 n" . edit-indirect-region)) (bind-keys ("C-x 4 n" . edit-indirect-region))
#+END_SRC #+END_SRC
** Workflow
:PROPERTIES:
:header-args:elisp: :tangle target/desktop/emacs-workflow.el
:END:
#+BEGIN_SRC nix :tangle target/desktop/emacs-workflow.nix
{
programs.emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [
bufferlo
];
extraConfig = builtins.readFile ./emacs-workflow.el;
};
}
#+END_SRC
#+BEGIN_SRC elisp
(bufferlo-mode)
(setopt bufferlo-include-buried-buffers nil)
(with-eval-after-load 'bufferlo
(setq mode-line-misc-info
(assq-delete-all 'bufferlo-mode mode-line-misc-info)))
(defun my/bury-or-kill-buffer ()
(interactive)
(bury-buffer)
(bufferlo-kill-orphan-buffers))
(bind-keys
("s-b" . bufferlo-switch-to-buffer)
("C-x t 0" . bufferlo-tab-close-kill-buffers)
("C-x k" . my/bury-or-kill-buffer))
#+END_SRC
** Language Support ** Language Support
:PROPERTIES: :PROPERTIES:
:header-args:elisp: :tangle target/desktop/emacs-languages.el :header-args:elisp: :tangle target/desktop/emacs-languages.el
@@ -1277,17 +1153,16 @@ Just "silently" wrap when searching at the bottom of a document.
enable = true; enable = true;
extraPackages = epkgs: with epkgs; [ extraPackages = epkgs: with epkgs; [
consult-eglot consult-eglot
graphql-ts-mode
haskell-ts-mode haskell-ts-mode
jenkinsfile-mode jenkinsfile-mode
jq-mode jq-mode
(lispy.overrideAttrs { (lispy.overrideAttrs {
packageRequires = [ packageRequires = [
ace-window iedit swiper zoutline hydra ace-window iedit swiper zoutline
]; ];
ignoreCompilationError = true; ignoreCompilationError = true;
}) })
# lispyville lispyville
lua-mode lua-mode
nix-mode nix-mode
rust-mode rust-mode
@@ -1397,10 +1272,6 @@ available? It seems to work for now anyway...
(advice-add 'prog-fill-reindent-defun :override #'my-prog-fill-reindent-defun)) (advice-add 'prog-fill-reindent-defun :override #'my-prog-fill-reindent-defun))
#+end_src #+end_src
#+BEGIN_SRC elisp
(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
#+END_SRC
*** Flymake *** Flymake
#+begin_src elisp #+begin_src elisp
(autoload 'flymake-show-project-diagnostics "flymake") (autoload 'flymake-show-project-diagnostics "flymake")
@@ -1472,10 +1343,9 @@ for completion. That makes it really annoying to use; don't use yasnippet with e
(setopt lispy-compat '(god-mode edebug)) (setopt lispy-compat '(god-mode edebug))
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))) (add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))
(add-hook 'lisp-mode-hook (lambda () (lispy-mode 1))) (add-hook 'lisp-mode-hook (lambda () (lispy-mode 1)))
(add-hook 'lisp-data-mode-hook (lambda () (lispy-mode 1)))
(with-eval-after-load 'lispy (with-eval-after-load 'lispy
;; (require 'lispyville) (require 'lispyville)
;; (add-hook 'lispy-mode-hook #'lispyville-mode) (add-hook 'lispy-mode-hook #'lispyville-mode)
(bind-keys :map lispy-mode-map (bind-keys :map lispy-mode-map
("i" . (lambda () ("i" . (lambda ()
(interactive) (interactive)
@@ -1490,7 +1360,7 @@ for completion. That makes it really annoying to use; don't use yasnippet with e
(push '(typescript-mode . typescript-ts-mode) major-mode-remap-alist) (push '(typescript-mode . typescript-ts-mode) major-mode-remap-alist)
(push '("\\.tsx\\'" . tsx-mode) auto-mode-alist) (push '("\\.tsx\\'" . tsx-mode) auto-mode-alist)
(push '(tsx-mode . tsx-ts-mode) major-mode-remap-alist) (push '(tsx-mode . tsx-ts-mode) major-mode-remap-alist)
(setopt typescript-ts-mode-indent-offset 2) (setopt typescript-ts-mode-indent-offset 4)
(with-eval-after-load 'typescript-ts-mode (with-eval-after-load 'typescript-ts-mode
(defun my-tsx-ts-mode--indent-compatibility-b893426 () (defun my-tsx-ts-mode--indent-compatibility-b893426 ()
"Indent rules helper, to handle different releases of tree-sitter-tsx. "Indent rules helper, to handle different releases of tree-sitter-tsx.
@@ -1504,49 +1374,6 @@ for completion. That makes it really annoying to use; don't use yasnippet with e
`(((match "<" "jsx_text") parent 0) `(((match "<" "jsx_text") parent 0)
((parent-is "jsx_text") grand-parent typescript-ts-mode-indent-offset))))) ((parent-is "jsx_text") grand-parent typescript-ts-mode-indent-offset)))))
(advice-add 'tsx-ts-mode--indent-compatibility-b893426 :override #'my-tsx-ts-mode--indent-compatibility-b893426)) (advice-add 'tsx-ts-mode--indent-compatibility-b893426 :override #'my-tsx-ts-mode--indent-compatibility-b893426))
(defvar my/edit-indirect-tag-modes
'(("graphql" . graphql-ts-mode)
("gql" . graphql-ts-mode)
("sql" . sql-mode)
("css" . css-mode))
"Map of tagged-template tag names to major modes.")
(defun my/edit-indirect--node-bounds (node)
"Return (BEG . END) for NODE's contents, excluding delimiters."
(cons (1+ (treesit-node-start node))
(1- (treesit-node-end node))))
(defun my/edit-indirect-tagged-template-at-point ()
(interactive)
(let* ((node (treesit-node-at (point)))
(tmpl-node (treesit-parent-until
node
(lambda (n) (equal (treesit-node-type n) "template_string"))))
(str-node (unless tmpl-node
(treesit-parent-until
node
(lambda (n) (equal (treesit-node-type n) "string")))))
(target-node (or tmpl-node str-node)))
(unless target-node
(user-error "Point is not inside a string or template literal"))
(let* ((tagged-node (and tmpl-node (treesit-node-parent tmpl-node)))
(tag-node (and tagged-node
(equal (treesit-node-type tagged-node) "call_expression")
(treesit-node-child-by-field-name tagged-node "function")))
(tag-name (and tag-node (treesit-node-text tag-node t)))
(mode (cond
(tag-name (or (cdr (assoc tag-name my/edit-indirect-tag-modes))
major-mode))
(t 'text-mode)))
(bounds (my/edit-indirect--node-bounds target-node))
(buf (edit-indirect-region (car bounds) (cdr bounds) t)))
(with-current-buffer buf
(funcall mode)))))
(with-eval-after-load 'typescript-ts-mode
(define-key typescript-ts-mode-map (kbd "C-c '") #'my/edit-indirect-tagged-template-at-point)
(define-key tsx-ts-mode-map (kbd "C-c '") #'my/edit-indirect-tagged-template-at-point))
#+END_SRC #+END_SRC
*** Java *** Java
@@ -1693,6 +1520,7 @@ for completion. That makes it really annoying to use; don't use yasnippet with e
;; ("C-x M-:" . consult-complex-command) ;; ("C-x M-:" . consult-complex-command)
("C-x b" . consult-buffer) ("C-x b" . consult-buffer)
("s-b" . consult-project-buffer)
("s-B" . consult-buffer) ("s-B" . consult-buffer)
("C-x 4 b" . consult-buffer-other-window) ("C-x 4 b" . consult-buffer-other-window)
("C-x 5 b" . consult-buffer-other-frame) ("C-x 5 b" . consult-buffer-other-frame)