iterm config in nix

This commit is contained in:
willemml 2023-01-31 16:47:24 -08:00
parent 15390d303d
commit c35a1d8336
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
5 changed files with 1140 additions and 50 deletions

11
darwin.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, pkgs, lib, inputs, ... }:
{
imports = [ ./launchd.nix ./apps.nix ];
targets.darwin = {
defaults = {
"com.googlecode.iterm2" = import ./iterm2.nix;
};
};
}

View file

@ -195,6 +195,8 @@ in {
''; '';
}; };
yafolding.enable = true;
format-all = { format-all = {
enable = true; enable = true;
command = [ "format-all-buffer" ]; command = [ "format-all-buffer" ];
@ -434,7 +436,7 @@ in {
(setq nix-nixfmt-bin "${pkgs.nixfmt}/bin/nixfmt") (setq nix-nixfmt-bin "${pkgs.nixfmt}/bin/nixfmt")
(setq nix-executable "/nix/var/nix/profiles/default/bin/nix") (setq nix-executable "/nix/var/nix/profiles/default/bin/nix")
''; '';
bindLocal.nix-mode-map = { "C-c C-y" = "nix-format-buffer"; }; bindLocal.nix-mode-map = { "C-c C-y" = "nix-mode-format"; };
}; };
ob-calc = { ob-calc = {

View file

@ -19,7 +19,9 @@ in {
''; '';
home.file.".gnupg/gpg-agent.conf".text = mkIf stdenv.isDarwin '' home.file.".gnupg/gpg-agent.conf".text = mkIf stdenv.isDarwin ''
pinentry-program "${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac" pinentry-program "${pkgs.pinentry-touchid}/bin/pinentry-touchid"
default-cache-ttl 30
max-cache-ttl 600
''; '';
home.file.".config/zsh/am.sh" = mkIf stdenv.isDarwin { home.file.".config/zsh/am.sh" = mkIf stdenv.isDarwin {
@ -49,7 +51,7 @@ in {
}; };
imports = imports =
[ ./emacs.nix ./launchd.nix ./packages.nix ./programs.nix ./apps.nix ]; [ ./emacs.nix ./packages.nix ./programs.nix ./darwin.nix ];
nixpkgs.config = { nixpkgs.config = {
allowUnfree = true; allowUnfree = true;

1055
iterm2.nix Normal file

File diff suppressed because it is too large Load diff

View file

@ -52,47 +52,47 @@
settings = { settings = {
format = format =
"$os[](fg:#979797 bg:#444444)$directory$git_branch$git_status[](fg:#444444)$fill[](fg:#444444)$cmd_duration$time$line_break$character"; "$os[](fg:#979797 bg:#444444)$directory$git_branch$git_status[](fg:#444444)$fill[](fg:#444444)$cmd_duration$time$line_break$character";
fill = { fill = {
symbol = "·"; symbol = "·";
style = "fg:#505050"; style = "fg:#505050";
}; };
cmd_duration = { cmd_duration = {
disabled = false; disabled = false;
min_time = 1500; min_time = 1500;
style = "fg:#979797 bg:#444444"; style = "fg:#979797 bg:#444444";
format = "[ $duration ]($style)"; format = "[ $duration ]($style)";
}; };
os = { os = {
disabled = false; disabled = false;
style = "fg:#eaeaea bg:#444444"; style = "fg:#eaeaea bg:#444444";
format = "[ $symbol ]($style)"; format = "[ $symbol ]($style)";
symbols.Macos = ""; symbols.Macos = "";
}; };
directory = { directory = {
disabled = false; disabled = false;
style = "fg:#149dff bg:#444444"; style = "fg:#149dff bg:#444444";
format = "[ $path ]($style)"; format = "[ $path ]($style)";
truncation_length = 3; truncation_length = 3;
truncation_symbol = ""; truncation_symbol = "";
}; };
git_branch = { git_branch = {
disabled = false; disabled = false;
symbol = ""; symbol = "";
style = "fg:#53d306 bg:#444444"; style = "fg:#53d306 bg:#444444";
format = "[[](fg:#979797 bg:#444444) $symbol $branch ]($style)"; format = "[[](fg:#979797 bg:#444444) $symbol $branch ]($style)";
}; };
git_status = { git_status = {
disabled = false; disabled = false;
style = "bg:#444444"; style = "bg:#444444";
format = format =
"[[$staged](fg:#cca107 bg:#444444)[$modified](fg:#cca107 bg:#444444)[$untracked](fg:#149dff bg:#444444)[$conflicted](fg:#ed0505 bg:#444444)]($style)"; "[[$staged](fg:#cca107 bg:#444444)[$modified](fg:#cca107 bg:#444444)[$untracked](fg:#149dff bg:#444444)[$conflicted](fg:#ed0505 bg:#444444)]($style)";
}; };
time = { time = {
disabled = false; disabled = false;
style = "fg:#4d7573 bg:#444444"; style = "fg:#4d7573 bg:#444444";
format = "[ $time ]($style)"; format = "[ $time ]($style)";
time_format = "%T"; time_format = "%T";
}; };
}; };
}; };
@ -109,13 +109,33 @@
autocd = true; autocd = true;
defaultKeymap = "emacs"; defaultKeymap = "emacs";
envExtra = '' envExtra = ''
export PATH=${pkgs.pinentry_mac.out}/Applications/pinentry-mac.app/Contents/MacOS:$PATH #!/usr/bin/env zsh
export GPG_TTY=$(tty) export GPG_TTY=$(tty)
eval $(gpg-agent --daemon -q 2>/dev/null) eval $(gpg-agent --daemon -q 2>/dev/null)
function gsearch() { function gsearch() {
open -a Safari "https://google.com/search?q=$(echo $@ | sed -e 's/ /%20/g')" open -a Safari "https://google.com/search?q=$(echo $@ | sed -e 's/ /%20/g')"
} }
function plistxml2nix() {
tail -n +4 |
sed -e "s/<dict>/{/g" \
-e "s/<\/dict>/\}\;/g" \
-e "s/<key>/\"/g" \
-e "s/<\/key>/\"=/g" \
-e "s/<real>//g" \
-e "s/<\/real>/;/g" \
-e "s/<integer>//g" \
-e "s/<\/integer>/;/g" \
-e "s/<string>/\"/g" \
-e "s/<\/string>/\"\;/g" \
-e "s/<array>/\[/g" \
-e "s/<\/array>/\];/g" \
-e "s/<true\/>/true;/g" \
-e "s/<false\/>/false;/g" \
-e "$ d" |
sed \-e "$ s/;//"
}
''; '';
dotDir = ".config/zsh"; dotDir = ".config/zsh";
history = { history = {