migrate brew to nix
This commit is contained in:
parent
f118954615
commit
9cd1661a14
8 changed files with 249 additions and 61 deletions
|
@ -18,6 +18,20 @@ Install Magit for Git integration.
|
|||
(setq tramp-default-method "ssh")
|
||||
#+end_src
|
||||
|
||||
* Fuzzy Finder
|
||||
#+begin_src emacs-lisp
|
||||
(use-package fzf
|
||||
:bind
|
||||
("C-c C-f" . fzf)
|
||||
:config
|
||||
(setq fzf/args "-x --color 16 --print-query --margin=1,0 --no-hscroll"
|
||||
fzf/executable "fzf"
|
||||
fzf/git-grep-args "-i --line-number %s"
|
||||
fzf/grep-command "grep -nrH"
|
||||
fzf/position-bottom nil
|
||||
fzf/window-height 15))
|
||||
#+end_src
|
||||
|
||||
* Document Viewing
|
||||
Replace =DocView= with a better document viewer from =pdf-tools=.
|
||||
#+begin_src emacs-lisp
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#+title: ZSH Configuration
|
||||
|
||||
Open =zsh= configuration.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
#+begin_src nix
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
@ -10,78 +10,103 @@ Open =zsh= configuration.
|
|||
#+end_src
|
||||
|
||||
Automatically =cd= if only the path is used.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
autocd = true;
|
||||
#+begin_src nix
|
||||
autocd = true;
|
||||
#+end_src
|
||||
|
||||
Enable auto-suggestions.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
};
|
||||
#+begin_src nix
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
};
|
||||
#+end_src
|
||||
|
||||
Use =vi= keybindings.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
defaultKeymap = "emacs";
|
||||
#+begin_src nix
|
||||
defaultKeymap = "emacs";
|
||||
#+end_src
|
||||
|
||||
Append to the history and ignore duplicates.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
history = {
|
||||
append = true;
|
||||
ignoreAllDups = true;
|
||||
};
|
||||
#+begin_src nix
|
||||
history = {
|
||||
append = true;
|
||||
ignoreAllDups = true;
|
||||
};
|
||||
#+end_src
|
||||
|
||||
Specify =ls= aliases.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
shellAliases = {
|
||||
"ll" = "ls -alF";
|
||||
"la" = "ls -a";
|
||||
"l" = "ls -F";
|
||||
"sl" = "ls";
|
||||
};
|
||||
#+begin_src nix
|
||||
shellAliases = {
|
||||
"ll" = "ls -alF";
|
||||
"la" = "ls -a";
|
||||
"l" = "ls -F";
|
||||
"sl" = "ls";
|
||||
};
|
||||
#+end_src
|
||||
|
||||
Enable syntax highlighting.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
syntaxHighlighting.enable = true;
|
||||
#+begin_src nix
|
||||
syntaxHighlighting.enable = true;
|
||||
#+end_src
|
||||
|
||||
Load extra code.
|
||||
#+begin_src nix
|
||||
initExtra = ''
|
||||
#+end_src
|
||||
|
||||
Create potential aliases and create the prompt.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
initExtra = ''
|
||||
which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s"
|
||||
which eza &> /dev/null && alias ls=eza
|
||||
parse_git_dirty() {
|
||||
git_status="$(git status 2> /dev/null)"
|
||||
[[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f"
|
||||
[[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f"
|
||||
[[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f"
|
||||
[[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f"
|
||||
}
|
||||
setopt prompt_subst
|
||||
autoload -Uz vcs_info
|
||||
precmd () { vcs_info }
|
||||
zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main)
|
||||
PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ '
|
||||
'';
|
||||
#+begin_src sh
|
||||
which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s"
|
||||
which eza &> /dev/null && alias ls=eza
|
||||
#+end_src
|
||||
|
||||
Set up fuzzy finder.
|
||||
#+begin_src sh
|
||||
which zsh &> /dev/null && source <(fzf --zsh)
|
||||
#+end_src
|
||||
|
||||
Create the prompt.
|
||||
#+begin_src sh
|
||||
parse_git_dirty() {
|
||||
git_status="$(git status 2> /dev/null)"
|
||||
[[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f"
|
||||
[[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f"
|
||||
[[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f"
|
||||
[[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f"
|
||||
}
|
||||
setopt prompt_subst
|
||||
autoload -Uz vcs_info
|
||||
precmd () { vcs_info }
|
||||
zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main)
|
||||
PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ '
|
||||
#+end_src
|
||||
|
||||
#+begin_src nix
|
||||
'';
|
||||
#+end_src
|
||||
|
||||
Load =.profile= code.
|
||||
#+begin_src nix
|
||||
profileExtra = ''
|
||||
#+end_src
|
||||
|
||||
Launch =ssh-agent= at login.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
profileExtra = ''
|
||||
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
|
||||
eval `ssh-agent` > /dev/null
|
||||
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
|
||||
fi
|
||||
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
|
||||
'';
|
||||
#+begin_src sh
|
||||
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
|
||||
eval `ssh-agent` > /dev/null
|
||||
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
|
||||
fi
|
||||
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
|
||||
#+end_src
|
||||
|
||||
Close =.profile= code.
|
||||
#+begin_src nix
|
||||
'';
|
||||
#+end_src
|
||||
|
||||
|
||||
Close =zsh= configuration.
|
||||
#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes
|
||||
#+begin_src nix
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
./system/core.nix
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.backupFileExtension = "bak";
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.jjanzen = import ./home/core.nix;
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
./fastfetch.nix
|
||||
./git.nix
|
||||
./neovim.nix
|
||||
./ssh.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
||||
|
|
37
macos.local/.flake/home/programs/ssh.nix.org
Normal file
37
macos.local/.flake/home/programs/ssh.nix.org
Normal file
|
@ -0,0 +1,37 @@
|
|||
#+title: SSH Configuration
|
||||
|
||||
#+begin_src nix
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
matchBlocks = {
|
||||
"*" = {
|
||||
identityFile = "~/.ssh/id_ed25519";
|
||||
extraOptions = {
|
||||
"UseKeychain" = "yes";
|
||||
};
|
||||
};
|
||||
"aviary" = {
|
||||
hostname = "aviary.cs.umanitoba.ca";
|
||||
user = "janzenj2";
|
||||
};
|
||||
"jjanzen.ca" = {
|
||||
setEnv = {
|
||||
"TERM" = "xterm";
|
||||
};
|
||||
};
|
||||
"oracle" = {
|
||||
setEnv = {
|
||||
"TERM" = "xterm";
|
||||
};
|
||||
hostname = "jjanzen.ca";
|
||||
identityFile = "~/.ssh/oracle";
|
||||
identitiesOnly = true;
|
||||
user = "opc";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
|
@ -13,6 +13,7 @@ This file imports various system configuration components in addition to enablin
|
|||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
imports = [
|
||||
./homebrew.nix
|
||||
./skhd.nix
|
||||
./yabai.nix
|
||||
];
|
||||
|
|
121
macos.local/.flake/system/homebrew.nix.org
Normal file
121
macos.local/.flake/system/homebrew.nix.org
Normal file
|
@ -0,0 +1,121 @@
|
|||
#+title: Homebrew Configuration
|
||||
|
||||
#+begin_src nix
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
homebrew = {
|
||||
enable = true;
|
||||
brews = [
|
||||
"aescrypt"
|
||||
"aspell"
|
||||
"avrdude"
|
||||
"bash-language-server"
|
||||
"bear"
|
||||
"biber"
|
||||
"binutils"
|
||||
"bison"
|
||||
"btop"
|
||||
"clang-format"
|
||||
"cmake"
|
||||
"cmake-language-server"
|
||||
"coreutils"
|
||||
"curl"
|
||||
"dos2unix"
|
||||
"dotnet"
|
||||
"eza"
|
||||
"fd"
|
||||
"gnutls"
|
||||
"ffmpeg"
|
||||
"fzf"
|
||||
"gpgme"
|
||||
"go"
|
||||
"grep"
|
||||
"htop"
|
||||
"hunspell"
|
||||
"hyfetch"
|
||||
"imagemagick"
|
||||
"ispell"
|
||||
"jq"
|
||||
"lesspipe"
|
||||
"latexdiff"
|
||||
"llvm@18"
|
||||
"marksman"
|
||||
"meson"
|
||||
"mono"
|
||||
"mpv"
|
||||
"ninja"
|
||||
"nmap"
|
||||
"open-mpi"
|
||||
"open-ocd"
|
||||
"openjdk"
|
||||
"pandoc"
|
||||
"pinentry-mac"
|
||||
"ripgrep"
|
||||
"rsync"
|
||||
"rust"
|
||||
"sevenzip"
|
||||
"shellcheck"
|
||||
"shfmt"
|
||||
"telnet"
|
||||
"texlab"
|
||||
"tree-sitter"
|
||||
"typescript-language-server"
|
||||
"wget"
|
||||
"yt-dlp"
|
||||
{
|
||||
name = "d12frosted/emacs-plus/emacs-plus@29";
|
||||
args = [ "with-imagemagick" ];
|
||||
}
|
||||
"felixkratz/formulae/sketchybar"
|
||||
"osx-cross/avr/avr-binutils"
|
||||
"osx-cross/avr/avarice"
|
||||
"osx-cross/avr/avr-gcc@14"
|
||||
];
|
||||
caskArgs.no_quarantine = true;
|
||||
casks = [
|
||||
"alacritty"
|
||||
"audacity"
|
||||
"blender"
|
||||
"cabal"
|
||||
"calibre"
|
||||
"desmume"
|
||||
"gcc-arm-embedded"
|
||||
"gimp"
|
||||
"godot"
|
||||
"inkscape"
|
||||
"krita"
|
||||
"mactex"
|
||||
"multimc"
|
||||
"obs"
|
||||
"openemu"
|
||||
"pokemon-showdown"
|
||||
"protonmail-bridge"
|
||||
"protonvpn"
|
||||
"qbittorrent"
|
||||
"rar"
|
||||
"syncthing"
|
||||
"thunderbird"
|
||||
"vlc"
|
||||
"whisky"
|
||||
"zen-browser"
|
||||
"zotero"
|
||||
];
|
||||
global.autoUpdate = false;
|
||||
onActivation = {
|
||||
autoUpdate = false;
|
||||
cleanup = "zap";
|
||||
upgrade = true;
|
||||
};
|
||||
taps = [
|
||||
"d12frosted/emacs-plus"
|
||||
"felixkratz/formulae"
|
||||
"homebrew/bundle"
|
||||
"homebrew/cask-fonts"
|
||||
"homebrew/cask-versions"
|
||||
"homebrew/services"
|
||||
"osx-cross/avr"
|
||||
];
|
||||
};
|
||||
}
|
||||
#+end_src
|
|
@ -1,12 +0,0 @@
|
|||
#+title: SSH Configuration
|
||||
Keys should be added to the SSH agent.
|
||||
#+begin_src conf :tangle ~/.ssh/config :mkdirp yes
|
||||
Host *
|
||||
UseKeychain yes
|
||||
AddKeysToAgent yes
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
|
||||
Host aviary
|
||||
HostName aviary.cs.umanitoba.ca
|
||||
User janzenj2
|
||||
#+end_src
|
Loading…
Add table
Reference in a new issue