{ config, pkgs, lib, ... }: let name = "Jip J. Dekker"; user = "dekker1"; email = "jip@dekker.one"; in { bat.enable = true; direnv = { enable = true; enableNushellIntegration = true; nix-direnv.enable = true; }; gh = { enable = true; settings = { git_protocol = "ssh"; version = 1; }; }; git = { enable = true; aliases = { co = "checkout"; l = "log --graph --decorate --pretty=oneline --abbrev-commit"; prune = "fetch --prune"; stash-all = "stash save --include-untracked"; s = "status"; }; ignores = [ ".DS_Store" ".svn" "*~" "*.swp" "*.rbc" ".idea/" "__pycache__/" ".vscode" ".clangd/" ".direnv/" "compile_commands.json" "*.sublime-project" "*.sublime-workspace" "build.nosync/" ]; userName = name; userEmail = email; lfs.enable = true; extraConfig = { init.defaultBranch = "develop"; pull.ff = true; push.default = "simple"; rebase.autoStash = true; credential.helper = "osxkeychain"; commit.gpgsign = true; gpg.format = "ssh"; user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCC0liW47USr/Ic1rJ52V4eE07y42VG9Ols1zYBrPlc"; gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"; }; }; kitty = { enable = true; font = { name = "JetBrains Mono"; size = 14; }; settings = { cursor_shape = "underline"; confirm_os_window_close = 0; shell = "/Users/dekker1/.nix-profile/bin/nu"; }; theme = "Night Owl"; }; # Shared shell configuration nushell = { enable = true; shellAliases = { edit = "^($env.VISUAL)"; start = "^open"; less = "bat"; set-light-theme = "kitty +kitten themes Catppuccin-Latte"; set-dark-theme = "kitty +kitten themes Night Owl"; brew-backup = "brew bundle dump --global --no-lock --formula --cask --mas --tap --force"; brew-cleanup = "brew bundle cleanup --global --no-lock --force --zap"; brew-restore = "brew bundle install --global --no-lock"; }; environmentVariables = { # Set default editor EDITOR = ''"nvim"''; VISUAL = ''"codium"''; # DISABLE VI INDICATORS PROMPT_INDICATOR_VI_INSERT = ''""''; PROMPT_INDICATOR_VI_NORMAL = ''""''; # Alias for Monash compute cluster OPTCLUSTER = ''"compute.optimisation-2020.cloud.edu.au"''; # CMake settings CMAKE_EXPORT_COMPILE_COMMANDS = ''"1"''; # output compile-commands.json for clangd CMAKE_GENERATOR = ''"Ninja Multi-Config"''; # use Ninja generator by default CMAKE_C_COMPILER_LAUNCHER = ''"ccache"''; CMAKE_CXX_COMPILER_LAUNCHER = ''"ccache"''; # Homebrew shell setup (brew shellenv) HOMEBREW_PREFIX = ''"/opt/homebrew"''; HOMEBREW_CELLAR = ''"/opt/homebrew/Cellar"''; HOMEBREW_REPOSITORY = ''"/opt/homebrew"''; INFOPATH = ''"/opt/homebrew/share/info"''; # Set MANPATH MANPATH = ''"/usr/share/man:/usr/local/share/man:/Library/TeX/Distributions/.DefaultTeX/Contents/Man:/opt/homebrew/share/man"''; NIX_PROFILES = ''$"/nix/var/nix/profiles/default:($env.HOME)/.nix-profile"''; }; envFile.text = '' if not 'config' in $env { $env.config = ([] | into record) } $env.config = ($env.config | upsert show_banner false) $env.config = ($env.config | upsert rm.always_trash true) $env.config = ($env.config | upsert edit_mode vi) $env.config = ($env.config | upsert history.max_size 100000) $env.config = ($env.config | upsert footer_mode auto) $env.config = ($env.config | upsert history.file_format "sqlite") ''; configFile.text = '' # Specifies how environment variables are: # - converted from a string to a value on Nushell startup (from_string) # - converted from a value back to a string when running external commands (to_string) # Note: The conversions happen *after* config.nu is loaded $env.ENV_CONVERSIONS = { "PATH": { from_string: { |s| $s | split row (char esep) | path expand --no-symlink } to_string: { |v| $v | path expand --no-symlink | str join (char esep) } } } # Add entries to PATH: # From MacOS helper (/usr/libexec/path_helper) $env.PATH = ($env.PATH | split row (char esep) | append $"($env.HOME)/.nix-profile/bin") $env.PATH = ($env.PATH | split row (char esep) | append "/nix/var/nix/profiles/default/bin") $env.PATH = ($env.PATH | split row (char esep) | append "/Library/TeX/texbin") $env.PATH = ($env.PATH | split row (char esep) | append "/Library/Apple/usr/bin") $env.PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/bin") $env.PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/sbin") $env.PATH = ($env.PATH | split row (char esep) | append "/usr/local/bin") # Other package managers $env.PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.local/bin") $env.PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.cargo/bin") ''; }; sapling = { enable = true; userName = "Jip J. Dekker"; userEmail = "jip@dekker.one"; extraConfig = { ui."ignore.userroot" = "~/.config/git/ignore"; isl = { hasShownGettingStarted = false; render-compact = false; }; }; }; ssh.enable = true; starship = { enable = true; enableNushellIntegration = true; }; zoxide = { enable = true; enableNushellIntegration = true; }; vscode = { enable = false; package = pkgs.vscodium; }; }