diff options
Diffstat (limited to 'users')
34 files changed, 0 insertions, 1879 deletions
diff --git a/users/modules/onepassword.nix b/users/modules/onepassword.nix deleted file mode 100644 index d98df25..0000000 --- a/users/modules/onepassword.nix +++ /dev/null @@ -1,148 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -with lib; - -let - cfg = config.programs.onepassword; - - generateAgentConfig = - keys: - let - keyToToml = - key: - let - lines = - [ "[[ssh-keys]]" ] - ++ optional (key.item != null) ''item = "${key.item}"'' - ++ optional (key.vault != null) ''vault = "${key.vault}"'' - ++ [ ''account = "${key.account}"'' ]; - in - concatStringsSep "\n" lines; - in - concatStringsSep "\n\n" (map keyToToml keys); - - home = config.home.homeDirectory; - darwinSockPath = "${home}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"; - defaultSockPath = ".1password/agent.sock"; - -in -{ - options.programs.onepassword = { - enable = mkEnableOption "1Password CLI and SSH agent integration"; - - package = mkOption { - type = types.package; - default = pkgs._1password-cli; - description = "The 1Password CLI package to use."; - }; - - socketPath = mkOption { - type = types.str; - default = defaultSockPath; - description = "Relative path from home directory for the SSH agent socket."; - example = ".1password/agent.sock"; - }; - - darwinSocketPath = mkOption { - type = types.str; - default = darwinSockPath; - description = "Full path to the 1Password agent socket on macOS."; - }; - - setSshAuthSock = mkOption { - type = types.bool; - default = true; - description = "Whether to set the SSH_AUTH_SOCK environment variable."; - }; - - configureSshClient = mkOption { - type = types.bool; - default = true; - description = "Whether to configure the SSH client to use 1Password agent."; - }; - - fishIntegration = mkOption { - type = types.bool; - default = false; - description = "Enable fish shell completion for 1Password CLI."; - }; - - sshKeys = mkOption { - type = - with types; - listOf (submodule { - options = { - item = mkOption { - type = nullOr str; - default = null; - description = "The name of the SSH key item in 1Password."; - example = "Git Signing Key"; - }; - - vault = mkOption { - type = nullOr str; - default = null; - description = "The vault name where the SSH key is stored (optional)."; - example = "Private"; - }; - - account = mkOption { - type = str; - default = "my.1password.com"; - description = "The 1Password account identifier."; - example = "my.1password.com"; - }; - }; - }); - default = [ ]; - description = "SSH keys configuration for 1Password agent. Lists from multiple configurations will be merged."; - example = [ - { account = "my.1password.com"; } - { - item = "Git Signing Key"; - vault = "Work"; - account = "ACME, Inc."; - } - { - item = "Personal SSH Key"; - account = "my.1password.com"; - } - ]; - }; - }; - - config = mkIf cfg.enable { - home.packages = [ cfg.package ]; - - home.sessionVariables = mkIf cfg.setSshAuthSock { - SSH_AUTH_SOCK = "${home}/${cfg.socketPath}"; - }; - - # Create symlink to Darwin socket (macOS specific) - home.file."${cfg.socketPath}" = mkIf pkgs.stdenv.isDarwin { - source = config.lib.file.mkOutOfStoreSymlink cfg.darwinSocketPath; - }; - - # Configure SSH client - programs.ssh = mkIf cfg.configureSshClient { - extraConfig = "IdentityAgent ~/${cfg.socketPath}"; - }; - - # Fish shell integration - programs.fish = mkIf cfg.fishIntegration { - interactiveShellInit = '' - op completion fish | source - ''; - }; - - # Generate SSH agent configuration - home.file.".config/1Password/ssh/agent.toml" = mkIf (cfg.sshKeys != [ ]) { - text = generateAgentConfig cfg.sshKeys; - }; - }; -} diff --git a/users/modules/userinfo.nix b/users/modules/userinfo.nix deleted file mode 100644 index 46afc73..0000000 --- a/users/modules/userinfo.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib, ... }: -{ - options = with lib; { - userinfo = { - fullName = mkOption { - type = types.str; - example = "Someone Someonesson"; - }; - email = mkOption { - type = types.str; - example = "some@email.com"; - }; - }; - }; -} diff --git a/users/profiles/k8s.nix b/users/profiles/k8s.nix deleted file mode 100644 index 3ef4152..0000000 --- a/users/profiles/k8s.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ self, pkgs, ... }: -{ - - imports = [ - "${self}/users/programs/k9s.nix" - "${self}/users/programs/kubie.nix" - ]; - - home.packages = with pkgs; [ - kind # k8s in docker - kubebuilder # generate controller - kubectl - kubernetes-helm # deploy applications - kubelogin-oidc # OIDC plugin - ]; - - programs.fish = { - shellAbbrs = { - k = "kubectl"; - klogs = "kubectl logs"; - }; - shellAliases = { - ukctx = "${pkgs.gh}/bin/gh api --hostname github.rbx.com repos/Roblox/cell-lifecycle/contents/rks/kubeconfig --jq '.content' | base64 -d > ~/.kube/rksconfig"; - }; - }; -} diff --git a/users/profiles/llm.nix b/users/profiles/llm.nix deleted file mode 100644 index 2793373..0000000 --- a/users/profiles/llm.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - configPath, - lib, - ... -}: -let - basePath = "llm/templates"; - llmTemplates = [ - "pr-prompt.yaml" - "commit-prompt.yaml" - "readme-gen.yaml" - ]; - mkLlmTemplate = file: { - ".config/${basePath}/${file}" = { - source = "${configPath}/${basePath}/${file}"; - }; - }; -in -{ - home.file = lib.mkMerge (map mkLlmTemplate llmTemplates); - - programs.fish = { - shellAliases = { - commit-msg = "git diff --cached | llm -t commit-prompt"; - pr-msg = "git diff HEAD | llm -t pr-prompt"; - readme-gen = "llm -t readme-gen"; - }; - }; - - home.sessionVariables = { - LLM_USER_PATH = "$HOME/.config/llm"; - }; -} diff --git a/users/profiles/mac.nix b/users/profiles/mac.nix deleted file mode 100644 index 16e3b59..0000000 --- a/users/profiles/mac.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ self, pkgs, ... }: -{ - imports = [ - "${self}/users/programs/alacritty" - "${self}/users/programs/bat.nix" - "${self}/users/programs/direnv.nix" - "${self}/users/programs/emacs" - "${self}/users/programs/eza.nix" - "${self}/users/programs/fd.nix" - "${self}/users/programs/fish.nix" - "${self}/users/programs/gh.nix" - "${self}/users/programs/git.nix" - "${self}/users/programs/go.nix" - "${self}/users/programs/onepassword.nix" - "${self}/users/programs/ssh.nix" - "${self}/users/programs/starship.nix" - "${self}/users/programs/tmux.nix" - ./llm.nix - ./secrets.nix - ]; - - home.packages = with pkgs; [ - age - aider-chat - bandwhich - basedpyright - bottom - coreutils - dive # explore layers in docker images - docker - docker-credential-helpers - dust - jless - jq - llmPython.llm # llm and claude support - nil # nix lsp - nix-direnv # integration with direnv - nixfmt-rfc-style # new formatter - procs - python3 - restic - ripgrep - ruff - shellcheck - tree - uv - wget - wireshark - yq - ]; - - home.sessionVariables = { - LESS = "-FRSXM"; - LESSCHARSET = "utf-8"; - PAGER = "less"; - SHELL = "${pkgs.fish}/bin/fish"; - }; - - xdg.enable = true; -} diff --git a/users/profiles/media.nix b/users/profiles/media.nix deleted file mode 100644 index 265eb89..0000000 --- a/users/profiles/media.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - ffmpeg - mpv - transmission_4 - vlc-bin - yt-dlp - ]; -} diff --git a/users/profiles/minimal.nix b/users/profiles/minimal.nix deleted file mode 100644 index b751e91..0000000 --- a/users/profiles/minimal.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ self, pkgs, ... }: -{ - - imports = [ - "${self}/users/programs/bat.nix" - ]; - - home.packages = with pkgs; [ - htop - ]; - - home.stateVersion = "25.05"; -} diff --git a/users/profiles/secrets.nix b/users/profiles/secrets.nix deleted file mode 100644 index 65131df..0000000 --- a/users/profiles/secrets.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ self, config, ... }: -{ - age = { - identityPaths = [ "${config.home.homeDirectory}/.ssh/agenix" ]; - secretsDir = "${config.home.homeDirectory}/.local/share/agenix"; - - secrets = { - llm = { - file = "${self}/secrets/users/fcuny/llm.age"; - path = "${config.home.homeDirectory}/.config/llm/keys.json"; - }; - anthropic-api-key = { - file = "${self}/secrets/users/fcuny/anthropic-api-key.age"; - }; - }; - }; -} diff --git a/users/profiles/work.nix b/users/profiles/work.nix deleted file mode 100644 index 538b547..0000000 --- a/users/profiles/work.nix +++ /dev/null @@ -1,161 +0,0 @@ -{ - lib, - self, - pkgs, - config, - ... -}: -let - nomad-prod = pkgs.writeShellScriptBin "nomad-prod" '' - set -e - - if [ $# -ne 1 ]; then - echo "Usage: nomad-ui CELL_ID" - exit 1 - fi - - CELL_ID=$1 - - echo ">> Login to chi1 vault using Okta" - export VAULT_ADDR="https://chi1-vault.simulprod.com:8200" - export VAULT_TOKEN=$(${pkgs.vault}/bin/vault login -field=token -method=oidc username=$USER) - - echo ">> Accessing cell $CELL_ID" - export NOMAD_ADDR="https://$CELL_ID-nomad.simulprod.com" - export NOMAD_TOKEN=$(${pkgs.vault}/bin/vault read -field secret_id ''${CELL_ID}_nomad/creds/management) - - ${pkgs.nomad}/bin/nomad ui --authenticate - ''; -in -{ - imports = [ - "${self}/users/programs/gh.nix" - ./k8s.nix - ]; - - home.packages = with pkgs; [ - awscli2 - boundary # for secure remote access - hashi - sapi - nomad-prod - tfswitch - vault - ]; - - programs.onepassword = lib.mkMerge [ - config.programs.onepassword.sshKeys - [ - { - account = "roblox.1password.com"; - vault = "Private"; - } - ] - ]; - - programs.fish = { - shellAbbrs = - let - environments = [ - { - name = "chi1"; - alias = "chi1"; - jumpHost = "chi1-jumpcontainer-es"; - } - { - name = "ash1"; - alias = "ash1"; - jumpHost = "chi1-jumpcontainer-es"; - } - { - name = "sitetest3"; - alias = "st3"; - jumpHost = "st3-jumpcontainer-es"; - } - { - name = "sitetest2-snc2"; - alias = "st2-snc2"; - jumpHost = "st2-snc2-jumpcontainer-es"; - } - ]; - - # Generate all environment-specific aliases - envAliases = builtins.listToAttrs ( - builtins.concatMap (env: [ - { - name = "ssh-sign-${env.alias}"; - value = "${pkgs.hashi}/bin/hashi -e ${env.name} sign --output-path=/Users/fcuny/.ssh/cert-${env.alias} --key=(${pkgs._1password-cli}/bin/op read 'op://employee/default rbx ssh key/public key'|psub) key"; - } - { - name = "hashi-${env.alias}"; - value = "${pkgs.hashi}/bin/hashi -e ${env.name} show v"; - } - { - name = "ssh-${env.alias}"; - value = "ssh -o StrictHostKeyChecking=no -J ${env.jumpHost} -o 'CertificateFile=~/.ssh/cert-${env.alias}'"; - } - ]) environments - ); - - # Add any additional non-environment specific aliases - additionalAliases = { - "sjump-st1-snc2" = "${pkgs.sapi}/bin/sapi jump sitetest1-snc2"; - "sjump-st1-snc3" = "${pkgs.sapi}/bin/sapi jump sitetest3-snc2"; - "sjump-st2-snc2" = "${pkgs.sapi}/bin/sapi jump sitetest2-snc2"; - "sjump-st3" = "${pkgs.sapi}/bin/sapi jump sitetest3"; - "sjump" = "${pkgs.sapi}/bin/sapi jump"; - "ssh-edge" = - "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -J chi1-jumpcontainer-es -i (${pkgs._1password-cli}/bin/op read 'op://Infra-Compute-Edge-rks/ice_ssh-private-key/ice_rsa'|psub)"; - }; - in - envAliases // additionalAliases; - }; - - programs.ssh.matchBlocks = { - "github.rbx.com" = { - hostname = "github.rbx.com"; - user = "git"; - forwardAgent = false; - extraOptions = { - preferredAuthentications = "publickey"; - controlMaster = "no"; - controlPath = "none"; - }; - }; - }; - - # the configuration for sapi is generated when we run `sapi jump`, there's no need to manage it with nix. - programs.ssh.includes = [ "config_sapi" ]; - - programs.git = { - extraConfig = { - url = { - "ssh://git@github.rbx.com/" = { - insteadOf = "https://github.rbx.com/"; - }; - }; - }; - # https://stackoverflow.com/questions/74012449/git-includeif-hasconfigremote-url-not-working - # to test it's working as expected: - # run `git config --get-all user.email' in a repository to check that we get all the possible emails - # run `git config --get user.email' in a repository to check which email is selected - includes = [ - { - condition = "hasconfig:remote.*.url:git@github.rbx.com:*/**"; - path = pkgs.writeText "username.cfg" (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; }); - } - { - condition = "hasconfig:remote.*.url:git@github.com:Roblox/**"; - path = pkgs.writeText "username.cfg" (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; }); - } - { - condition = "hasconfig:remote.*.url:https://github.com/Roblox/**"; - path = pkgs.writeText "username.cfg" (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; }); - } - { - condition = "hasconfig:remote.*.url:https://github.rbx.com/*/**"; - path = pkgs.writeText "username.cfg" (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; }); - } - ]; - }; -} diff --git a/users/programs/alacritty/catppuccin-latte.toml b/users/programs/alacritty/catppuccin-latte.toml deleted file mode 100644 index e9414ad..0000000 --- a/users/programs/alacritty/catppuccin-latte.toml +++ /dev/null @@ -1,65 +0,0 @@ -[colors.primary] -background = "#eff1f5" -foreground = "#4c4f69" -dim_foreground = "#8c8fa1" -bright_foreground = "#4c4f69" - -[colors.cursor] -text = "#eff1f5" -cursor = "#dc8a78" - -[colors.vi_mode_cursor] -text = "#eff1f5" -cursor = "#7287fd" - -[colors.search.matches] -foreground = "#eff1f5" -background = "#6c6f85" - -[colors.search.focused_match] -foreground = "#eff1f5" -background = "#40a02b" - -[colors.footer_bar] -foreground = "#eff1f5" -background = "#6c6f85" - -[colors.hints.start] -foreground = "#eff1f5" -background = "#df8e1d" - -[colors.hints.end] -foreground = "#eff1f5" -background = "#6c6f85" - -[colors.selection] -text = "#eff1f5" -background = "#dc8a78" - -[colors.normal] -black = "#bcc0cc" -red = "#d20f39" -green = "#40a02b" -yellow = "#df8e1d" -blue = "#1e66f5" -magenta = "#ea76cb" -cyan = "#179299" -white = "#5c5f77" - -[colors.bright] -black = "#acb0be" -red = "#d20f39" -green = "#40a02b" -yellow = "#df8e1d" -blue = "#1e66f5" -magenta = "#ea76cb" -cyan = "#179299" -white = "#6c6f85" - -[[colors.indexed_colors]] -index = 16 -color = "#fe640b" - -[[colors.indexed_colors]] -index = 17 -color = "#dc8a78" diff --git a/users/programs/alacritty/default.nix b/users/programs/alacritty/default.nix deleted file mode 100644 index 18c5182..0000000 --- a/users/programs/alacritty/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ config, ... }: -let - defaultFont = "Source Code Pro"; -in -{ - programs.alacritty = { - enable = true; - settings = { - env.TERM = "xterm-256color"; - general.import = [ - "${config.xdg.configHome}/alacritty/catppuccin-latte.toml" - ]; - selection.save_to_clipboard = true; - window = { - dimensions = { - columns = 120; - lines = 40; - }; - padding = { - x = 2; - y = 2; - }; - }; - scrolling = { - history = 10000; - multiplier = 3; - }; - font = { - normal.family = defaultFont; - bold = { - family = defaultFont; - style = "Bold"; - }; - italic = { - family = defaultFont; - style = "Italic"; - }; - size = 14; - offset = { - x = 0; - y = 0; - }; - glyph_offset = { - x = 0; - y = 0; - }; - }; - }; - }; - - home.file.".config/alacritty/catppuccin-latte.toml" = { - source = ./catppuccin-latte.toml; - }; -} diff --git a/users/programs/bat.nix b/users/programs/bat.nix deleted file mode 100644 index fb27397..0000000 --- a/users/programs/bat.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - programs.bat = { - enable = true; - config = { - theme = "ansi"; - pager = "less -FR"; - }; - }; -} diff --git a/users/programs/direnv.nix b/users/programs/direnv.nix deleted file mode 100644 index 54585ca..0000000 --- a/users/programs/direnv.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - programs.direnv = { - enable = true; - nix-direnv.enable = true; - config = { - global.disable_stdin = true; - global.strict_env = true; - }; - }; -} diff --git a/users/programs/emacs/default.nix b/users/programs/emacs/default.nix deleted file mode 100644 index d805971..0000000 --- a/users/programs/emacs/default.nix +++ /dev/null @@ -1,88 +0,0 @@ -{ - self, - pkgs, - lib, - ... -}: -let - packages = - epkgs: with epkgs; [ - aidermacs # pair programming in Emacs with Aider - cape - consult - consult-denote - corfu - denote - denote-journal - denote-markdown - denote-org - denote-silo - denote-sequence - diminish - direnv - docker - docker-compose-mode - dockerfile-mode - exec-path-from-shell - git-link - go-mode - gotest - gptel # LLM client for Emacs - hcl-mode - jq-mode - json-mode - json-reformat - magit - marginalia - markdown-mode - nix-mode - orderless - protobuf-mode - rg - terraform-mode - toml-mode - tree-sitter - tree-sitter-langs - treesit-grammars.with-all-grammars - yaml-mode - yasnippet - yasnippet-capf - ]; - emacsFiles = [ - "early-init.el" - "init.el" - "site-lisp/init-base.el" - "site-lisp/init-completion.el" - "site-lisp/init-llm.el" - "site-lisp/init-programming.el" - "site-lisp/init-text.el" - "site-lisp/init-ui.el" - ]; - mkEmacsFile = file: { - ".config/emacs/${file}" = { - source = "${self}/users/programs/emacs/${file}"; - }; - }; -in -{ - home.file = lib.mkMerge (map mkEmacsFile emacsFiles); - - programs.emacs = { - enable = true; - extraPackages = packages; - # FIXME: https://github.com/NixOS/nixpkgs/issues/395169 - package = pkgs.emacs.override { withNativeCompilation = false; }; - }; - - home.packages = with pkgs; [ - aspell - aspellDicts.en - aspellDicts.en-science - aspellDicts.en-computers - ]; - - home.sessionVariables = { - EDITOR = "${pkgs.emacs}/bin/emacsclient -a="; - ASPELL_CONF = "dict-dir ${pkgs.aspellDicts.en}/lib/aspell"; - }; -} diff --git a/users/programs/emacs/early-init.el b/users/programs/emacs/early-init.el deleted file mode 100644 index 3953c90..0000000 --- a/users/programs/emacs/early-init.el +++ /dev/null @@ -1,45 +0,0 @@ -;;; early-init.el --- Early initialization -*- lexical-binding: t -*- - -;;; Commentary: - -;;; Code: - -;; Startup speed, annoyance suppression -(setq gc-cons-threshold 10000000) -(setq byte-compile-warnings '(not obsolete)) -(setq warning-suppress-log-types '((comp) (bytecomp))) -(setq native-comp-async-report-warnings-errors 'silent) - -;; Silence startup message -(setq inhibit-startup-echo-area-message (user-login-name)) - -;; Default frame configuration: full screen, good-looking title bar on macOS -(setq frame-resize-pixelwise t) -(setq default-frame-alist '((fullscreen . maximized) - ;; Setting the face in here prevents flashes of - ;; color as the theme gets activated - (ns-appearance . light) - (ns-transparent-titlebar . t))) - -;; disable GUI elements -(scroll-bar-mode -1) ; hide the scroll bar -(tool-bar-mode -1) ; hide the tool bar -(menu-bar-mode +1) ; show the menu -(blink-cursor-mode -1) ; don't blink the cursor - -(setq make-pointer-invisible t) ;; hide cursor while typing -(setq use-dialog-box nil) ;; do not show GUI dialogs -(setq inhibit-startup-screen t) ;; hide the startup screen - -;; use utf-8 everywhere -(set-default-coding-systems 'utf-8) - -;; `use-package' is builtin since 29. -;; These variables must be set before loading `use-package'. -(setq use-package-always-ensure nil - use-package-always-defer t - use-package-enable-imenu-support t) - -(set-face-attribute 'default nil :family "Source Code Pro" :height 150) - -;;; early-init.el ends here diff --git a/users/programs/emacs/init.el b/users/programs/emacs/init.el deleted file mode 100644 index 973e4ad..0000000 --- a/users/programs/emacs/init.el +++ /dev/null @@ -1,42 +0,0 @@ -;;; init.el --- This is where all emacs start. -*- lexical-binding: t -*- - -;;; Commentary: - -;;; Code: - -(add-to-list 'load-path (concat user-emacs-directory (convert-standard-filename "site-lisp/"))) - -(use-package exec-path-from-shell - :custom - (exec-path-from-shell-variables '("PATH" "MANPATH" "GOPATH" "GOBIN" "ASPELL_CONF")) - :init (exec-path-from-shell-initialize)) - -(require 'init-base) -(require 'init-ui) -(require 'init-completion) -(require 'init-text) -(require 'init-programming) -(require 'init-llm) - -(use-package server - :config - (setq server-client-instructions nil) - (unless (server-running-p) - (server-start))) - -(use-package eshell - :commands (eshell eshell-command) - :bind (("C-r" . consult-history)) - :custom - (eshell-hist-ignoredups t) - (eshell-history-size 50000) - (eshell-ls-dired-initial-args '("-h")) - (eshell-ls-initial-args "-h") - (eshell-ls-exclude-regexp "~\\'") - (eshell-save-history-on-exit t) - (eshell-stringify-t nil) - (eshell-term-name "ansi")) - -;;; init.el ends here -;; byte-compile-warnings: (not docstrings lexical noruntime) -;; End: diff --git a/users/programs/emacs/site-lisp/init-base.el b/users/programs/emacs/site-lisp/init-base.el deleted file mode 100644 index 0593833..0000000 --- a/users/programs/emacs/site-lisp/init-base.el +++ /dev/null @@ -1,175 +0,0 @@ -;;; init-base.el --- base configuration -*- lexical-binding: t -*- -;; Author: Franck Cuny <franck@fcuny.net> - -;;; Commentary: - -;; commentary - -;;; Code: - -(setq backup-inhibited t) ;; no backups -(setq create-lockfiles nil) ;; don't use a lock file - -(setq auto-save-default nil) ;; no auto save -(setq confirm-kill-emacs #'yes-or-no-p) ;; ask before killing emacs -(setq cursor-in-non-selected-windows nil) ;; keep cursors and highlights in current window only -(setq delete-by-moving-to-trash t) ;; delete files by moving them to the trash -(setq highlight-nonselected-windows nil) ;; don't highlight inactive windows -(setq history-delete-duplicates t) ;; delete duplicate from history -(setq initial-major-mode 'fundamental-mode) ;; default mode for the scratch buffer -(setq initial-scratch-message "") ;; makes the scratch buffer empty -(setq midnight-period (* 3600 6)) ;; clear buffer every 6 hours -(setq mode-line-default-help-echo nil) ;; don't say anything on mode-line mouseover -(setq require-final-newline t) ;; ensure a new line is present at the bottom of files -(setq ring-bell-function 'ignore) ;; really no bell -(setq sentence-end-double-space nil) ;; it matters for filling -(setq use-short-answers t) ;; use y-or-n -(setq visible-bell nil) ;; no bell -(setq bidi-display-reordering nil) ;; disable bidirectional text support for slight performance bonus -(setq column-number-mode t) ;; show column number in the mode line - -(global-set-key (kbd "M-j") 'join-line) - -(use-package recentf - :hook (after-init . recentf-mode) - :custom - (recentf-max-saved-items 1000) - (recentf-max-menu-items 25) - (recentf-save-file-modes nil) - (recentf-keep nil) - (recentf-auto-cleanup nil) - (recentf-initialize-file-name-history nil) - (recentf-filename-handlers nil) - (recentf-show-file-shortcuts-flag nil)) - -(use-package midnight - :custom - ;; every 6 hours - (midnight-period (* 3600 6))) - -(use-package imenu - :config - (setq imenu-auto-rescan t)) - -(use-package autorevert - :hook (after-init . global-auto-revert-mode) - :custom - (auto-revert-use-notify nil)) - -(use-package time - :commands (world-clock) - :hook (after-init . display-time-mode) - :config - (setq display-time-format " %a %e %b, %H:%M ") - (setq display-time-24hr-format t) - (setq display-time-interval 60) - (setq display-time-default-load-average nil) - (setq display-time-world-list t) - - ;; M-x shell RET timedatectl list-timezones - (setq zoneinfo-style-world-list '(("America/Los_Angeles" "Berkeley") - ("America/Chicago" "Chicago") - ("UTC" "UTC") - ("Europe/Paris" "Paris"))) - - ;; M-x world-clock - (setq world-clock-list t) - (setq world-clock-time-format "%z %R %a %d %b (%Z)") - (setq world-clock-buffer-name "*world-clock*") ; Placement handled by `display-buffer-alist' - (setq world-clock-timer-enable t) - (setq world-clock-timer-second 60)) - -(use-package ibuffer - :bind ("C-x C-b" . ibuffer) - :custom - (ibuffer-expert t) - (ibuffer-show-empty-filter-groups nil) - (ibuffer-jump-offer-only-visible-buffers t) - (ibuffer-never-show-predicates '("^ ")) - (ibuffer-use-other-window t) - (ibuffer-filter-group-name-face '(:inherit (font-lock-string-face bold)))) - -(use-package which-key - :diminish - :hook (after-init . which-key-mode)) - -(use-package saveplace - :config - (save-place-mode t)) - -(use-package savehist - :hook (after-init . savehist-mode) - :custom - (savehist-file (locate-user-emacs-file "savehist")) - (history-length 100) - (history-delete-duplicates t) - (savehist-save-minibuffer-history t)) - -(use-package project - :bind - (("C-x p ." . project-dired) - ("C-x p <return>" . project-dired)) - :custom - (project-switch-commands - '( - (consult-project-buffer "buffer" ?b) - (project-dired "dired" ?d) - (magit-project-status "magit status" ?g) - (project-find-file "find file" ?p) - (consult-ripgrep "rigprep" ?r))) - (setq project-mode-line t) - (setq project-key-prompt-style t)) - - ; Emacs 30 - -(use-package rg - :custom - (rg-group-result t) - (rg-show-columns t) - (rg-align-line-number-field-length 3) - (rg-align-column-number-field-length 3) - (rg-align-line-column-separator "#") - (rg-align-position-content-separator "|") - (rg-hide-command nil) - (rg-align-position-numbers t) - (rg-command-line-flags '("--follow"))) - -(use-package dired - :hook (dired-mode . dired-omit-mode) - :bind (:map dired-mode-map - ( "." . dired-omit-mode)) - :custom - (dired-listing-switches "-alh --group-directories-first") - (ls-lisp-dirs-first t) - (dired-omit-files (rx (seq bol "."))) - (dired-use-ls-dired t) - (dired-clean-up-buffers-too nil) - (dired-dwim-target t) - (dired-hide-details-hide-information-lines nil) - (dired-hide-details-hide-symlink-targets nil) - (dired-recursive-copies 'always) - (dired-recursive-deletes 'always) - (dired-no-confirm - '(byte-compile chgrp chmod chown copy hardlink symlink touch))) - -(defun my/rename-this-buffer-and-file () - "Renames current buffer and file it is visiting." - (interactive) - (let ((name (buffer-name)) - (filename (buffer-file-name)) - (read-file-name-function 'read-file-name-default)) - (if (not (and filename (file-exists-p filename))) - (error "Buffer '%s' is not visiting a file!" name) - (let ((new-name (read-file-name "New name: " filename))) - (cond ((get-buffer new-name) - (error "A buffer named '%s' already exists!" new-name)) - (t - (rename-file filename new-name 1) - (rename-buffer new-name) - (set-visited-file-name new-name) - (set-buffer-modified-p nil) - (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name)))))))) - -(provide 'init-base) - -;;; init-base.el ends here diff --git a/users/programs/emacs/site-lisp/init-completion.el b/users/programs/emacs/site-lisp/init-completion.el deleted file mode 100644 index 2601756..0000000 --- a/users/programs/emacs/site-lisp/init-completion.el +++ /dev/null @@ -1,54 +0,0 @@ -;;; init-completion.el --- Configure completion -*- lexical-binding: t -*- -;; Author: Franck Cuny <franck@fcuny.net> - -;;; Commentary: - -;; Configure completions - -;;; Code: - -;; default completion behavior -(fido-mode 1) - -(use-package consult - :commands (consult-ripgrep consult-buffer consult-imenu) - :bind (("C-c m" . consult-mode-command) - ("C-x b" . consult-buffer) - ("C-x r b" . consult-bookmark) - ("C-x p b" . consult-project-buffer) - ("C-c i" . consult-imenu) - ("M-g e" . consult-compile-error) - ("M-g M-g" . consult-goto-line) - ("M-g m" . consult-mark) - ("M-g k" . consult-global-mark))) - -(use-package corfu - :custom - (corfu-auto t) - :bind ("M-/" . completion-at-point) - :hook ((after-init . global-corfu-mode) - (global-corfu-mode . corfu-popupinfo-mode))) - -(use-package cape) - -(use-package marginalia - :hook (after-init . marginalia-mode)) - -(use-package orderless - :custom - (completion-styles '(orderless basic)) - (completion-category-defaults nil)) - -(use-package consult-imenu - :after (consult)) - -(use-package corfu-popupinfo - :after corfu - :hook (corfu-mode . corfu-popupinfo-mode) - :custom - (corfu-popupinfo-delay '(0.25 . 0.1)) - (corfu-popupinfo-hide nil)) - -(provide 'init-completion) - -;;; init-completion.el ends here diff --git a/users/programs/emacs/site-lisp/init-llm.el b/users/programs/emacs/site-lisp/init-llm.el deleted file mode 100644 index 48346e6..0000000 --- a/users/programs/emacs/site-lisp/init-llm.el +++ /dev/null @@ -1,33 +0,0 @@ -;;; init-llm.el --- Configure LLMs -*- lexical-binding: t -*- -;; Author: Franck Cuny <franck@fcuny.net> - -;;; Commentary: - -;; Configure completions - -;;; Code: -(require 's) - -(defun fcuny/read-anthropic-key () - "Read and return the API key for anthropic." - (with-temp-buffer - (insert-file-contents "~/.local/share/agenix/anthropic-api-key") - (s-trim (buffer-string)))) - -(use-package gptel - :custom - (gptel-default-mode 'org-mode) - :config - (gptel-make-anthropic "Claude" :stream t :key (lambda () (fcuny/read-anthropic-key)))) - -(use-package aidermacs - :bind ("C-c a" . aidermacs-transient-menu) - :custom - (aider-args '("--no-check-update" "--no-show-model-warnings")) - (aidermacs-default-model "claude-3-7-sonnet-latest") - :config - (setenv "ANTHROPIC_API_KEY" (fcuny/read-anthropic-key))) - -(provide 'init-llm) - -;;; init-llm.el ends here diff --git a/users/programs/emacs/site-lisp/init-programming.el b/users/programs/emacs/site-lisp/init-programming.el deleted file mode 100644 index a2299cf..0000000 --- a/users/programs/emacs/site-lisp/init-programming.el +++ /dev/null @@ -1,199 +0,0 @@ -;;; init-programming.el --- Configure things related to programming -*- lexical-binding: t -*- -;; Author: Franck Cuny <franck@fcuny.net> - -;;; Commentary: - -;; Configure things related to programming - -;;; Code: - -(use-package magit - :bind ("C-x g" . magit-status) - :hook (git-commit-mode . (lambda () (setq fill-column 72))) - :custom - (magit-diff-refine-hunk t) - (magit-repository-directories '(("~/workspace" . 1))) - (magit-repolist-column-flag-alist '((magit-untracked-files . "N") - (magit-unstaged-files . "U") - (magit-staged-files . "S"))) - (magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil) - ("" 3 magit-repolist-column-flag) - ("Version" 25 magit-repolist-column-version - ((:sort magit-repolist-version<))) - ("B<U" 3 magit-repolist-column-unpulled-from-upstream - ((:right-align t) - (:sort <))) - ("B>U" 3 magit-repolist-column-unpushed-to-upstream - ((:right-align t) - (:sort <))) - ("Path" 99 magit-repolist-column-path nil))) - (magit-clone-default-directory "~/workspace/") - :config - ;; show ANSI colors in the process buffer, so it's easier to read what's going on - ;; for some reasons if it's in the `:custom' section it does not get set - (setq magit-process-finish-apply-ansi-colors t)) - -(use-package git-link - :defines git-link-remote-alist - :bind ("C-c Y" . git-link) - :commands (git-link git-link-commit git-link-homepage) - :custom - (git-link-open-in-browser t) - :config - ;; sets up roblox git enterprise as a git-link handler - (add-to-list 'git-link-remote-alist '("github\\.rblx\\.com" git-link-github)) - (add-to-list 'git-link-commit-remote-alist '("github\\.rblx\\.com" git-link-commit-github))) - -(use-package elec-pair - :hook (prog-mode . electric-pair-mode)) - -(use-package eldoc - :diminish - :hook ((emacs-lisp-mode) . eldoc-mode) - :custom - (eldoc-idle-delay 1) - (eldoc-documentation-strategy #'eldoc-documentation-default) - ;; Don't resize the echo area if the documentation is longer. This is very - ;; distracting when combined with Eglot's highlight functionality. - (eldoc-echo-area-use-multiline-p nil)) - -(use-package compile - :hook (compilation-filter . ansi-color-compilation-filter) - :custom - (compilation-always-kill t) - (compilation-context-lines 10) - (compilation-disable-input t) - (compilation-scroll-output 'first-error) - (compilation-scroll-output t) - (compilation-skip-threshold 2) - ;; Save all buffers on M-x `compile' - (compilation-ask-about-save nil)) - -(use-package direnv - :custom - (direnv-always-show-summary nil) - :config - (direnv-mode)) - -(use-package flymake - :bind (:prefix "C-c !" - :prefix-map flymake-prefix-map - ("l" . consult-flymake) - ("d" . flymake-show-buffer-diagnostics) - ("D" . flymake-show-project-diagnostics) - ("n" . flymake-goto-next-error) - ("p" . flymake-goto-prev-error)) - :hook - (prog-mode . flymake-mode) - :custom - (flymake-start-on-save-buffer t) - (flymake-fringe-indicator-position 'left-fringe) - (flymake-suppress-zero-counters t) - (flymake-proc-compilation-prevents-syntax-check t) - (flymake-no-changes-timeout 9999) - (elisp-flymake-byte-compile-load-path load-path)) - -(use-package eglot - :bind (:map eglot-mode-map - ("C-c l a" . eglot-code-actions) - ("C-c l r" . eglot-rename) - ("C-c l f" . eglot-format-buffer)) - :hook ((go-mode . eglot-ensure) - (python-mode . eglot-ensure) - (nix-mode . eglot-ensure)) - :custom - (eglot-send-changes-idle-time 0.1) - :config - (setq eglot-autoshutdown t - ;; Disable logging of events. - eglot-events-buffer-size 0) - (setq-default eglot-workspace-configuration - '(:pylsp (:plugins (:ruff (:enabled t))) - :nil (:formatting (:command ["nixfmt"])) - :gopls (:usePlaceholders t - :staticcheck t - :completeUnimported t - :matcher "CaseSensitive"))) - ;; uses https://github.com/nix-community/nixd for the LSP server instead of rnix - (add-to-list 'eglot-server-programs '(nix-mode . ("nil")))) - -(use-package emacs-lisp-mode - :bind (:map emacs-lisp-mode-map - ("C-c C-r" . eval-region) - ("C-c C-d" . eval-defun) - ("C-c C-b" . eval-buffer)) - :hook ((emacs-lisp-mode . flymake-mode))) - -(use-package go-mode - :hook ((go-mode . (lambda () (setq tab-width 4))) - (go-mode . (lambda () (add-hook 'before-save-hook 'eglot-format-buffer nil t)))) - :bind (:map go-mode-map - ("C-c C-c" . compile)) - :config - (with-eval-after-load 'exec-path-from-shell - (exec-path-from-shell-copy-envs '("GOPATH" "GOBIN")))) - -(use-package gotest - :after go-mode - :custom - (go-test-verbose t)) - -(use-package nix-mode - :hook ((nix-mode . (lambda () (add-hook 'before-save-hook 'eglot-format-buffer nil t)))) - :custom - (nix-indent-function 'nix-indent-line)) - -(use-package python-mode) - -(use-package ruby-mode) - -(use-package json-mode) - -(use-package json-reformat - :after json-mode) - -(use-package jq-mode - :mode "\\.jq\\'") - -(use-package terraform-mode - :mode "\.tf\\'") - -(use-package hcl-mode - :mode "\.nomad\\'") - -(use-package toml-mode) - -(use-package yaml-mode) - -(use-package docker - :bind ("C-c d" . docker) - :diminish - :init - (use-package docker-image :commands docker-images) - (use-package docker-volume :commands docker-volumes) - (use-package docker-network :commands docker-containers) - (use-package docker-compose :commands docker-compose) - - (use-package docker-container - :commands docker-containers - :custom - (docker-containers-shell-file-name "/bin/bash") - (docker-containers-show-all nil))) - -(use-package docker-compose-mode - :mode "docker-compose.*\.yml\\'") - -(use-package dockerfile-mode - :mode "Dockerfile[a-zA-Z.-]*\\'") - -(use-package protobuf-mode - :mode "\\.proto\\'") - -(use-package css-mode - :custom - (css-indent-offset 2) - (cssm-indent-level 1)) - -(provide 'init-programming) - -;;; init-programming.el ends here diff --git a/users/programs/emacs/site-lisp/init-text.el b/users/programs/emacs/site-lisp/init-text.el deleted file mode 100644 index 4a5739b..0000000 --- a/users/programs/emacs/site-lisp/init-text.el +++ /dev/null @@ -1,200 +0,0 @@ -;;; init-text.el --- Configure text modes -*- lexical-binding: t -*- -;; Author: Franck Cuny <franck@fcuny.net> - -;;; Commentary: - -;; Configure completions - -;;; Code: - -(use-package flyspell - :hook ((text-mode . flyspell-mode) - (org-mode . flyspell-mode) - (git-commit-mode . flyspell-mode) - (prog-mode . flyspell-prog-mode)) - :diminish flyspell-mode - :custom - (ispell-program-name "aspell") - (ispell-silently-savep t) - (ispell-dictionary "en_US") - (ispell-local-dictionary "en_US") - (ispell-extra-args '("--camel-case"))) - -(use-package markdown-mode - :mode (("\\`README\\.md\\'" . gfm-mode) - ("\\.md\\'" . markdown-mode) - ("\\.markdown\\'" . markdown-mode)) - :custom - (markdown-command "pandoc -f markdown_github+smart") - (markdown-command-needs-filename t) - (markdown-enable-math t) - (markdown-open-command "marked") - :init - (setq markdown-command "multimarkdown")) - -(use-package org - :hook - (org-mode . turn-on-flyspell) - (org-mode . visual-line-mode) - (org-mode . org-indent-mode) - - :custom - (org-directory "~/Documents/org") - (org-default-notes-file (expand-file-name "notes.org" org-directory)) - - (org-startup-folded t) - (org-startup-indented t) - (org-startup-with-inline-images t) - (org-adapt-indentation 'headline-data) - - ;; enable todo and checkbox dependencies - (org-enforce-todo-dependencies t) - (org-enforce-todo-checkbox-dependencies t) - - ;; quick access for todo states - (org-todo-keywords - '((sequence "TODO(t)" "NEXT(n)" "WAITING(w!)" "SOMEDAY(S!)" "|" "DONE(d)") - (sequence "|" "CANCELLED(c)"))) - - (org-tag-alist - '((:startgroup) - ("!Handson" . ?o) - (:grouptags) - ("write" . ?w) ("code" . ?c) - (:endgroup) - - (:startgroup) - ("_Handsoff" . ?f) - (:grouptags) - ("read" . ?r) ("watch" . ?W) - (:endgroup))) - - (org-log-done 'time) - (org-log-into-drawer t) - - ;; refile - (org-refile-use-outline-path t) - (org-refile-allow-creating-parent-nodes t) - (org-refile-use-cache t) - - ;; no empty lines between items - (org-blank-before-new-entry '((heading . nil) (plain-list-item . nil))) - - (org-hide-emphasis-markers t) - (org-hide-leading-stars t) - (org-pretty-entities t) - - (org-return-follows-link t) - - (org-export-backends '(html md)) - - (org-imenu-depth 4) - - (org-insert-heading-respect-content t) - - (org-outline-path-complete-in-steps nil) - - (org-src-fontify-natively t) - (org-src-preserve-indentation t) - (org-src-tab-acts-natively t) - (org-src-window-setup 'current-window) - - (org-yank-adjusted-subtrees t) - - (org-structure-template-alist - '(("s" . "src") - ("E" . "src emacs-lisp") - ("p" . "src python") - ("e" . "example") - ("q" . "quote")))) - -(use-package org-capture - :ensure nil - :after org - :bind - ("C-c c" . org-capture) - :custom - (org-capture-templates - '(("t" "Tasks" entry (file+headline "~/Documents/org/tasks.org" "Tasks") - "* TODO %?\n :PROPERTIES:\n :CAPTURED: %U\n :END:" :prepend t)))) - -(use-package org-agenda - :ensure nil - :after org - :bind - ("C-c a" . org-agenda) - :custom - (org-agenda-start-on-weekday 1) - (org-deadline-warning-days 3) - (org-agenda-inhibit-startup t) - (org-agenda-diary-file "~/Documents/org/tasks.org") - (org-agenda-files '("~/Documents/org/tasks.org")) - (org-agenda-restore-windows-after-quit t) - (org-agenda-skip-deadline-if-done t) - (org-agenda-skip-scheduled-if-done t) - (org-agenda-custom-commands - '(;; Todo and tags views for ongoing tasks by types of activity - ("#" "To archive" todo "DONE|SKIP") - ("A" "Hands on" tags-todo "+TAGS={write\\|code}+TODO={ONGO}") - ("Z" "Hands off" tags-todo "+TAGS={read\\|watch}+TODO={ONGO}") - - ;; Agenda view to see ONGO/NEXT tasks for this week - ("*" . "What's next?") - ("**" "ONGO/NEXT all" tags-todo "TODO={NEXT}") - - ;; Agenda view to see TODO tasks with no SCHEDULED/DEADLINE - (";" . "What's to do?") - (";;" "TODO all" tags-todo "TODO={TODO}+DEADLINE=\"\"+SCHEDULED=\"\"") - - ;; Agenda view to see WAIT tasks with no SCHEDULED/DEADLINE - (":" . "What's waiting?") - ("::" "WAIT all" tags-todo "TODO={WAITING}+DEADLINE=\"\"+SCHEDULED=\"\"") - - ;; Agenda view to see upcoming deadlines with 60 days of warning period - ("!" . "Upcoming deadlines") - ("!!" "Deadlines all" agenda "Past/upcoming deadlines" - ((org-agenda-span 1) - (org-deadline-warning-days 60) - (org-agenda-entry-types '(:deadline)))))) - (org-agenda-sorting-strategy - '((agenda time-up deadline-up scheduled-up todo-state-up priority-down) - (todo todo-state-down priority-down deadline-up) - (tags todo-state-down priority-down deadline-up) - (search todo-state-down priority-down deadline-up)))) - -(use-package denote - :hook - (dired-mode . denote-dired-mode) - - :custom-face - (denote-faces-link ((t (:slant italic)))) - - :init - (require 'denote-org) - - :bind - (("C-c w d b" . denote-find-backlink) - ("C-c w d d" . denote-date) - ("C-c w d l" . denote-find-link) - ("C-c w d h" . denote-org-link-to-heading) - ("C-c w d i" . denote-link-or-create) - ("C-c w d j" . denote-journal-extras-new-or-existing-entry) - ("C-c w d k" . denote-rename-file-keywords) - ("C-c w d n" . denote) - ("C-c w d N" . denote-open-or-create) - ("C-c w d r" . denote-rename-file) - ("C-c w d R" . denote-rename-file-using-front-matter)) - - :custom - (denote-sort-keywords t) - (denote-known-keywords '("journal" "projects" "ideas" "people" "interviews")) - (denote-directory "~/Documents/org")) - -(use-package consult-denote - :after (consult denote) - :config - (consult-denote-mode)) - -(provide 'init-text) - -;;; init-text.el ends here diff --git a/users/programs/emacs/site-lisp/init-ui.el b/users/programs/emacs/site-lisp/init-ui.el deleted file mode 100644 index ea1cb5a..0000000 --- a/users/programs/emacs/site-lisp/init-ui.el +++ /dev/null @@ -1,47 +0,0 @@ -;;; init-ui.el --- User interface config. -*- lexical-binding: t -*- - -;;; Commentary: - -;; User interface settings. - -;;; Code: - -(use-package whitespace - :init - (global-whitespace-mode t) - :custom - (whitespace-style '(face - trailing missing-newline-at-eof))) - -(use-package fringe - :custom (fringe-mode '(8 . 0))) - -;; | 数字 | アルファベット | 日本語 | 絵文字 | -;; | 0123 | abcdefghijklmn | あいう | 🍎🍎🍎 | -(set-face-attribute 'default nil :family "Source Code Pro" :height 140) - -(use-package modus-themes - :custom - (modus-themes-italic-constructs t) - (modus-themes-syntax '(alt-syntax green-strings)) - (modus-themes-mode-line '(moody accented borderless)) - (modus-themes-tabs-accented t) - - (modus-themes-completions - '((matches . (extrabold background)) - (selection . (semibold accented)) - (popup . (accented)))) - - (modus-themes-fringe 'subtle) - (modus-themes-lang-checkers '(text-also straight-underline)) - (modus-themes-hl-line '(accented)) - (modus-themes-subtle-line-numbers t) - (modus-themes-markup '(bold italic)) - (modus-themes-paren-match '(bold)) - (modus-themes-region '()) - - :init - (load-theme 'modus-operandi-deuteranopia t)) - -(provide 'init-ui) -;;; init-ui.el ends here diff --git a/users/programs/eza.nix b/users/programs/eza.nix deleted file mode 100644 index d0326f6..0000000 --- a/users/programs/eza.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ ... }: -{ - programs.eza = { - enable = true; - icons = "never"; - enableFishIntegration = false; - extraOptions = [ - "--group-directories-first" - "--no-quotes" - "--git-ignore" - "--icons=never" - ]; - }; - - programs.fish.shellAliases = { - la = "eza -la --git --color=always --group-directories-first"; - ll = "eza -la -L=1 --git --color=always --group-directories-first"; - lt = "eza -aT -L=2 --git --color=always --group-directories-first"; - }; -} diff --git a/users/programs/fd.nix b/users/programs/fd.nix deleted file mode 100644 index cdbae66..0000000 --- a/users/programs/fd.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - # an alternative to find - programs.fd = { - enable = true; - hidden = true; - ignores = [ - ".git/" - ".direnv/" - ]; - }; -} diff --git a/users/programs/fish.nix b/users/programs/fish.nix deleted file mode 100644 index e5a1013..0000000 --- a/users/programs/fish.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ ... }: -{ - programs.fish = { - enable = true; - interactiveShellInit = '' - set fish_greeting "" - - fish_add_path -p ~/.cargo/bin/ - - # Add utmctl to PATH - fish_add_path /Applications/UTM.app/Contents/MacOS/ - ''; - shellAbbrs = { - ncg = "nix-collect-garbage --delete-older-than 7d"; - ndc = "nix develop --command"; - nfc = "nix flake check"; - ngcroot = "ls -al /nix/var/nix/gcroots/auto/"; - nph = "nix profile history --profile /nix/var/nix/profiles/system"; - nsn = "nix search nixpkgs"; - nsv = "nix store verify --all"; - - g = "git"; - gap = "git add --patch"; - }; - }; -} diff --git a/users/programs/gh.nix b/users/programs/gh.nix deleted file mode 100644 index b194b35..0000000 --- a/users/programs/gh.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: -{ - programs.gh = { - enable = true; - settings = { - version = 1; - git_protocol = "ssh"; - prompt = "enabled"; - aliases = { - co = "pr checkout"; - vw = "pr view --web"; - }; - }; - }; -} diff --git a/users/programs/git.nix b/users/programs/git.nix deleted file mode 100644 index 354dc71..0000000 --- a/users/programs/git.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - inherit (config) userinfo; -in -{ - home.packages = with pkgs; [ - gitAndTools.pre-commit - git-credential-manager - ]; - - programs.git = { - enable = true; - - delta = { - enable = true; - options.features = "decorations side-by-side line-numbers"; - }; - - userName = lib.mkDefault userinfo.fullName; - userEmail = lib.mkDefault userinfo.email; - - aliases = { - amend = "commit --amend"; - a = "commit --amend --no-edit"; - st = "status"; - co = "checkout"; - br = "branch"; - rb = "pull --rebase"; - hist = "log --pretty=format:\"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)\" --graph --date=relative --decorate --all"; - llog = "log --graph --name-status --pretty=format:\"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset\" --date=relative"; - logo = "log --pretty=format:\"%C(yellow)%h%Cred%d %Creset%s%Cblue (%cn)\" --decorate"; - logf = "log --pretty=format:\"%C(yellow)%h%Cred%d %Creset%s%Cblue (%cn)\" --decorate --numstat"; - }; - - ignores = [ - ".DS_Store" - ".aider.*" - ".direnv" - ]; - - extraConfig = { - core.whitespace = "trailing-space,space-before-tab"; - color.ui = true; - - # nicer output - column.ui = "auto"; - - # https://adamj.eu/tech/2024/01/18/git-improve-diff-histogram/ - diff.algorithm = "histogram"; - - init.defaultBranch = "main"; - - # https://blog.gitbutler.com/how-git-core-devs-configure-git/ - push = { - # abort if the remote branch does not match the local one - default = "simple"; - autoSetupRemote = true; - followTags = true; - }; - - fetch = { - prune = true; - pruneTags = true; - all = true; - }; - - pull.rebase = true; - - rebase = { - autosquash = true; - updateRefs = true; - # Automatically create a temporary stash entry before the - # operation begins, and apply it after the operation ends. - autoStash = true; - # Print a warning if some commits are removed - missingCommitsCheck = "warn"; - }; - - branch = { - autosetuprebase = "remote"; - sort = "authordate"; - }; - }; - }; -} diff --git a/users/programs/go.nix b/users/programs/go.nix deleted file mode 100644 index 0ae1ec1..0000000 --- a/users/programs/go.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, config, ... }: -{ - programs.go = { - enable = true; - goPath = ".local/share/pkg.go"; - goBin = ".local/bin.go"; - goPrivate = [ - "github.rbx.com/*" - "github.com/fcuny/*" - ]; - }; - - home.packages = with pkgs; [ - delve - go-tools # collection of tools, https://github.com/dominikh/go-tools - golangci-lint - gopls - ]; - - home.sessionPath = [ - config.home.sessionVariables.GOBIN - "${config.home.homeDirectory}/.local/bin" - ]; -} diff --git a/users/programs/k9s.nix b/users/programs/k9s.nix deleted file mode 100644 index 2d60ab1..0000000 --- a/users/programs/k9s.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ ... }: -{ - programs.k9s = { - enable = true; - settings = { - k9s = { - refreshRate = 1; - }; - }; - plugin = { - plugins = { - log-bat = { - shortCut = "Shift-L"; - description = "Logs (bat)"; - scopes = [ "po" ]; - command = "bash"; - background = false; - args = [ - "-c" - "\"$@\" | bat" - "dummy-arg" - "kubectl" - "logs" - "$NAME" - "-n" - "$NAMESPACE" - "--context" - "$CONTEXT" - "--kubeconfig" - "$KUBECONFIG" - ]; - }; - log-bat-container = { - shortCut = "Shift-L"; - description = "Logs (bat)"; - scopes = [ "containers" ]; - command = "bash"; - background = false; - args = [ - "-c" - "\"$@\" | bat" - "dummy-arg" - "kubectl" - "logs" - "-c" - "$NAME" - "$POD" - "-n" - "$NAMESPACE" - "--context" - "$CONTEXT" - "--kubeconfig" - "$KUBECONFIG" - ]; - }; - }; - }; - }; -} diff --git a/users/programs/kubie.nix b/users/programs/kubie.nix deleted file mode 100644 index 5ac8678..0000000 --- a/users/programs/kubie.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - kubie # kubeconfig browser https://github.com/sbstp/kubie - ]; - - home.file.kubie = { - target = ".kube/kubie.yaml"; - text = '' - shell: fish - configs: - include: - - ~/.kube/rksconfig - prompt: - fish_use_rprompt: false - ''; - }; - - programs.fish = { - shellAbbrs = { - kctx = "kubie ctx"; - }; - }; -} diff --git a/users/programs/onepassword.nix b/users/programs/onepassword.nix deleted file mode 100644 index f364a9e..0000000 --- a/users/programs/onepassword.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - programs.onepassword = { - enable = true; - sshKeys = [ - { account = "my.1password.com"; } # All keys from personal account - ]; - }; -} diff --git a/users/programs/ssh.nix b/users/programs/ssh.nix deleted file mode 100644 index c236904..0000000 --- a/users/programs/ssh.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, config, ... }: -{ - # https://github.com/nix-community/home-manager/blob/master/modules/programs/ssh.nix - programs.ssh = { - enable = true; - forwardAgent = true; - serverAliveInterval = 60; - controlMaster = "auto"; - controlPersist = "30m"; - controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p"; - - matchBlocks = { - "git.fcuny.net" = { - proxyCommand = "${pkgs.cloudflared}/bin/cloudflared access ssh --hostname %h"; - }; - "github.com" = { - hostname = "github.com"; - user = "git"; - forwardAgent = false; - extraOptions = { - preferredAuthentications = "publickey"; - controlMaster = "no"; - controlPath = "none"; - }; - }; - }; - }; - - home.file = { - # we need this path to be created so that the control path can be used. - ".ssh/sockets/.keep".text = "# Managed by Home Manager"; - }; -} diff --git a/users/programs/starship.nix b/users/programs/starship.nix deleted file mode 100644 index 8a541ce..0000000 --- a/users/programs/starship.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ ... }: -{ - programs.starship = { - enable = true; - settings = { - add_newline = false; - character = { - success_symbol = "[›](bold green)"; - error_symbol = "[›](bold red)"; - }; - directory = { - fish_style_pwd_dir_length = 3; - }; - git_branch = { - symbol = "🌱 "; - }; - git_commit = { - commit_hash_length = 4; - }; - git_status = { - deleted = "✗"; - modified = "✶"; - staged = "✓"; - stashed = "≡"; - }; - "$schema" = "https://starship.rs/config-schema.json"; - hostname = { - ssh_only = true; - }; - username = { - disabled = true; - }; - kubernetes = { - disabled = false; - style = "bold blue"; - }; - nix_shell.disabled = false; - }; - }; -} diff --git a/users/programs/tmux.nix b/users/programs/tmux.nix deleted file mode 100644 index 9b84f5c..0000000 --- a/users/programs/tmux.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: -{ - programs.tmux = { - enable = true; - terminal = "xterm-256color"; - escapeTime = 0; - aggressiveResize = true; - baseIndex = 1; - shortcut = "z"; - clock24 = true; - shell = "${pkgs.fish}/bin/fish"; - historyLimit = 50000; # Bigger buffer - extraConfig = '' - setw -g mouse on - # Avoid date/time taking up space - set -g status-right "" - set -g status-right-length 0 - set-option -g renumber-windows on - ''; - }; -} |
