From 9d1363f2fa33bf590148ece64457272502a310dc Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 2 Dec 2024 20:25:06 +0100 Subject: add developer tools --- install-imperative | 23 +++++++++++++++++++++++ nixos/hamac-configuration.nix | 1 + nixos/parts/dev.nix | 29 +++++++++++++++++++++++++++++ user/VSCodium/User/settings.json | 26 ++++++++++++++++++++++++++ user/readline/inputrc | 1 + user/zsh/.zshrc | 8 ++++++++ 6 files changed, 88 insertions(+) create mode 100755 install-imperative create mode 100644 nixos/parts/dev.nix create mode 100644 user/VSCodium/User/settings.json create mode 100644 user/readline/inputrc diff --git a/install-imperative b/install-imperative new file mode 100755 index 0000000..b5699f5 --- /dev/null +++ b/install-imperative @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# This script installs software which I rather not manage via Nix. +# E.g. typos and pyright are updated so frequently that nixpkgs is bound to be outdated. +# While I could declaratively install them via their version and hash I don't care enough +# (I just want the latest). + +rustup toolchain install stable + +cargo install typos-cli + +npm install -g pyright + +# Mostly installing VSCodium extensions here since the pyright extension cannot +# use the globally installed pyright (https://github.com/microsoft/pyright/issues/2035). +code-ext() { + codium --install-extension "$1" +} + +code-ext vscodevim.vim +code-ext rust-lang.rust-analyzer +code-ext ms-pyright.pyright +code-ext aaron-bond.better-comments +code-ext bbenoist.nix diff --git a/nixos/hamac-configuration.nix b/nixos/hamac-configuration.nix index af97111..4c50cc1 100644 --- a/nixos/hamac-configuration.nix +++ b/nixos/hamac-configuration.nix @@ -10,6 +10,7 @@ ./parts/basics.nix ./parts/graphical.nix ./parts/tailscale.nix + ./parts/dev.nix ]; # Bootloader. diff --git a/nixos/parts/dev.nix b/nixos/parts/dev.nix new file mode 100644 index 0000000..e2ac1f6 --- /dev/null +++ b/nixos/parts/dev.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + rustup + python313 + nodejs_22 + + # CLI tools + docker-compose + gnumake + jq + just + sqlite-interactive + tokei + + gcc # rustc fails if cc linker isn't found + chromium + + vscodium + # I'm installing extensions via my install-imperative script. + ]; + + virtualisation.podman = { + enable = true; + dockerSocket.enable = true; + }; +} + diff --git a/user/VSCodium/User/settings.json b/user/VSCodium/User/settings.json new file mode 100644 index 0000000..470101c --- /dev/null +++ b/user/VSCodium/User/settings.json @@ -0,0 +1,26 @@ +{ + "files.insertFinalNewline": true, + + /** UI **/ + "window.zoomLevel": 1, + "workbench.tree.indent": 14, + + // hide inlay hints unless Ctrl+Alt is pressed + "editor.inlayHints.enabled": "offUnlessPressed", + + "editor.mouseWheelZoom": true, + + /** Extension config **/ + "vim.useSystemClipboard": true, + + "better-comments.tags": [ + { + "tag": "todo", + "color": "#FF8C00" + }, + { + "tag": "future", + "color": "#bd93f9" + } + ], +} diff --git a/user/readline/inputrc b/user/readline/inputrc new file mode 100644 index 0000000..b2cc9d6 --- /dev/null +++ b/user/readline/inputrc @@ -0,0 +1 @@ +set editing-mode vi diff --git a/user/zsh/.zshrc b/user/zsh/.zshrc index 72e6425..2e9d521 100644 --- a/user/zsh/.zshrc +++ b/user/zsh/.zshrc @@ -22,7 +22,9 @@ function ls() { } ## Aliases +alias code='codium' alias ls='ls --color=auto --group-directories-first' # see also ls function +alias tokei='tokei -s code -n commas' alias tree='tree -aI .git --dirsfirst' ## Shell variables @@ -49,6 +51,12 @@ export XDG_CACHE_HOME=$HOME/.cache export XDG_CONFIG_HOME=$HOME/.config export EDITOR=vim +export INPUTRC=$XDG_CONFIG_HOME/readline/inputrc +export NPM_CONFIG_PREFIX="$HOME/.local/npm" +export PYTHON_BASIC_REPL=1 # use readline (Python >=3.13 defaults to its own REPL which has no vi keybindings) + +export PATH="$PATH:$HOME/.cargo/bin" +export PATH="$PATH:$NPM_CONFIG_PREFIX/bin" ## Completion autoload -Uz compinit -- cgit v1.2.3