diff --git a/.Xresources b/.Xresources index cf0bd61..2fdca89 100644 --- a/.Xresources +++ b/.Xresources @@ -155,10 +155,3 @@ URxvt*scrollColor: S_base02 !! scroll back in things like 'less' !!URxvt.secondaryScreen: 1 !!URxvt.secondaryScroll: 0 - - - - - - - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2cabc98 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,15 @@ +name: CI + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.0 diff --git a/.gitignore b/.gitignore index 1b377e6..478c5fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -home.nix - # haskell settings *xmonad.errors *xmonad.state @@ -23,3 +21,9 @@ cabal.project.local cabal.project.local~ .HTF/ .ghc.environment.* + +# Nix +result +result-* +.direnv +.envrc diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6eb9ccf..cbd8ccf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,43 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + rev: v4.4.0 hooks: - id: check-yaml - id: check-toml - id: check-json + exclude: '.*/coc-settings\.json' - id: trailing-whitespace + - id: end-of-file-fixer - id: check-merge-conflict + - id: check-executables-have-shebangs + - id: detect-private-key + - id: no-commit-to-branch + args: [--branch, master, --branch, main] + +- repo: https://github.com/nix-community/nixpkgs-fmt + rev: v1.3.0 + hooks: + - id: nixpkgs-fmt + +- repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.9.0.5 + hooks: + - id: shellcheck + args: [--severity=warning] + exclude: '.*/zsh-themes/.*' + +- repo: https://github.com/commitizen-tools/commitizen + rev: v3.5.3 + hooks: + - id: commitizen + stages: [commit-msg] + +#- repo: local +# hooks: +# - id: nix-flake-check +# name: Nix flake check +# entry: nix flake check +# language: system +# pass_filenames: false +# files: '\.nix$' +# diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..2be62d7 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,8 @@ +# Disable warning about sourcing non-constant files (like ~/.xprofile) +disable=SC1090 + +# Disable warning about ShellCheck only supporting sh/bash/dash/ksh +disable=SC1071 + +# Disable warning about POSIX sh source undefined (we know our environment) +disable=SC3046 diff --git a/.xprofile b/.xprofile old mode 100755 new mode 100644 diff --git a/README.md b/README.md index 0758d51..3360b68 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Andrew Wright's Dotfiles/Nix Config -I use [nix](https://nixos.org/nix/) and [home manager](https://github.com/rycee/home-manager) to manage my applications and dotfiles. +I use [nix](https://nixos.org/nix/) and [home manager](https://github.com/rycee/home-manager) with flakes to manage my applications and dotfiles. I use `zsh` as my main shell, customized using `oh-my-zsh`. @@ -8,27 +8,62 @@ I use `zsh` as my main shell, customized using `oh-my-zsh`. ## Installation -This repository contains user configuration deployed using the helpful tool [Home Manager](https://github.com/rycee/home-manager). The organisation of my nix files are based on [Hugo Reeves' blog post](https://hugoreeves.com/posts/2019/nix-home). In order to setup a new home space, simply add a home.nix file similar to this one. +This repository contains user configuration deployed using [Home Manager](https://github.com/rycee/home-manager) with Nix flakes. The configuration is organized into modular components that can be mixed and matched for different machines and roles. -```nix -{ config, pkgs, ... }: +### Quick Start -{ - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; +1. Clone and install: +```bash +curl -L https://raw.githubusercontent.com/aywrite/nix-config/master/install.sh | bash +``` + +2. Switch to your configuration: +```bash +cd ~/.config/nixpkgs + +# For WSL: +home-manager switch --flake .#awright-wsl - imports = [ - ./machine/t460.nix - ./user/awright-personal.nix - ./role/xmonad-laptop.nix - ]; -} +# For XPS 13 with Sway: +home-manager switch --flake .#awright-xps13 + +# For Work MacBook: +home-manager switch --flake .#awright-work-mbp ``` -- **Programs** contains default setting for various programs & tools. -- **Machines** contains configuration specific to a given machine. -- **Users** contains configuration specific to a given user, think git config etc. -- **Roles** contains the bulk of the configuration and sets up most user space tools, think neovim and your terminal. +## Configuration Structure + +The configuration is organized into several directories: + +- **programs/**: Contains default settings for various programs & tools +- **machines/**: Machine-specific configurations (hardware, display, etc.) +- **users/**: User-specific configurations (git config, personal preferences) +- **roles/**: Role-based configurations that set up specific environments: + - `ubuntu-wsl.nix`: Configuration for WSL environment + - `sway-laptop.nix`: Configuration for Sway window manager on laptops + - `darwin-laptop.nix`: Configuration for macOS environments + +### Base Configuration +All machine configurations inherit from a base configuration in `home.nix` which sets up core Home Manager settings. Machine-specific configurations then add their own modules and roles on top of this base. + +### Available Profiles + +1. **WSL Profile** (`awright-wsl`): + - Base configuration + - Personal user settings + - WSL-specific adaptations + +2. **XPS 13 Profile** (`awright-xps13`): + - Base configuration + - Personal user settings + - Sway window manager setup + - Laptop-specific configurations + +3. **Work MacBook Profile** (`awright-work-mbp`): + - Base configuration + - Work user settings + - macOS-specific adaptations + - Work-related tools and configurations ## Customize @@ -38,7 +73,7 @@ The dotfiles can be easily extended to suit additional local requirements by usi #### `~/.zsh.local` -If the `~/.zsh.local` file exists, it will be automatically sourced. This allows the use of environment variables to store secrets without checking them in. In the future I might use something like git-crypt to check in encrypted secrets instead. +If the `~/.zsh.local` file exists, it will be automatically sourced. This allows the use of environment variables to store secrets without checking them in. ## Acknowledgements diff --git a/bin/free-some-space.sh b/bin/free-some-space.sh index 98cb77c..a516d16 100755 --- a/bin/free-some-space.sh +++ b/bin/free-some-space.sh @@ -12,47 +12,98 @@ set -o errexit set -o nounset set -o pipefail -INITIAL_ROOT=$(df -h) +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color -# debian packages -if command -v apt; then - sudo apt autoremove - sudo apt-get autoclean -fi +# Function to print colored messages +log() { + echo -e "${BLUE}==>${NC} $1" +} -# pacman packages -if command -v paccache; then - sudo paccache -r -fi -if command -v pacman; then - sudo pacman -Sc -fi +success() { + echo -e "${GREEN}==>${NC} $1" +} -# yay cache (aur only) -if command -v yay; then - yay -Sc --aur -fi +error() { + echo -e "${RED}==>${NC} $1" +} -# docker -if command -v docker; then - docker system prune -fi +# Function to get size in megabytes +get_size() { + df -BM "$1" | awk 'NR==2 {sub(/M$/,"",$4); print $4}' +} + +# Function to run command if it exists +run_if_exists() { + local cmd=$1 + shift + if command -v "$cmd" >/dev/null 2>&1; then + log "Running $cmd cleanup..." + "$@" + fi +} + +# Store initial space +SPACE_BEFORE=$(get_size "/") +log "Initial free space: ${SPACE_BEFORE}M" -# nix/nixos -if command -v nix; then - nix-collect-garbage --delete-older-than 30d - nix optimise-store +# Debian/Ubuntu package cleanup +run_if_exists apt \ + bash -c 'sudo apt autoremove -y && sudo apt-get autoclean -y' + +# Arch Linux package cleanup +run_if_exists paccache \ + sudo paccache -r +run_if_exists pacman \ + sudo pacman -Sc --noconfirm + +# AUR package cleanup +run_if_exists yay \ + yay -Sc --aur --noconfirm + +# Docker cleanup +if command -v docker >/dev/null 2>&1; then + log "Cleaning Docker..." + docker system prune -f + # Remove dangling volumes + docker volume prune -f + # Remove unused images + docker image prune -a -f --filter "until=720h" fi -# yarn -if command -v yarn; then - yarn cache clean +# Nix cleanup +if command -v nix >/dev/null 2>&1; then + log "Cleaning Nix store..." + # Remove old generations + nix-collect-garbage --delete-older-than 30d + # Remove all unused paths + nix-store --gc + # Optimize store + nix store optimise + # Clean old roots + rm -f ~/.local/state/nix/profiles/home-manager*-link fi +# Node.js package managers cleanup +run_if_exists yarn \ + yarn cache clean +run_if_exists npm \ + npm cache clean --force +run_if_exists pnpm \ + pnpm store prune + # logs -if command -v journalctl; then +run_if_exists journalctl \ journalctl --vacuum-time=30d -fi -# Report usage changes -diff <(echo "$INITIAL_ROOT") <(df -h) | colordiff +# Final space check +SPACE_AFTER=$(get_size "/") +SPACE_SAVED=$(echo "$SPACE_AFTER $SPACE_BEFORE" | awk '{printf "%d", $1 - $2}') + +success "Cleanup complete!" +success "Free space before: ${SPACE_BEFORE}M" +success "Free space after: ${SPACE_AFTER}M" +success "Space saved: ${SPACE_SAVED}M" diff --git a/bin/screenctl b/bin/screenctl index 95d8828..72b33ca 100755 --- a/bin/screenctl +++ b/bin/screenctl @@ -1,14 +1,13 @@ #!/bin/bash gen_list() { for cfg_script in ~/.screenlayout/*.sh; do - echo $(basename $cfg_script) + echo "$(basename "$cfg_script")" done } -if [[ -z "$@" ]]; then +if [[ -z "$*" ]]; then gen_list else ~/.reset_screen.sh - bash ~/.screenlayout/$@ + bash ~/.screenlayout/"$*" fi - diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3d39088 --- /dev/null +++ b/flake.lock @@ -0,0 +1,88 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733050161, + "narHash": "sha256-lYnT+EYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "62d536255879be574ebfe9b87c4ac194febf47c5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733120037, + "narHash": "sha256-En+gSoVJ3iQKPDU1FHrR6zIxSLXKjzKY+pnh9tt+Yts=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f9f0d5c5380be0a599b1fb54641fa99af8281539", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay", + "spacemacs": "spacemacs" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733193245, + "narHash": "sha256-nwvKoPi3S6XyliqBRuC+01QFF0k94ZOvnoZtbGi/ObM=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "3458f7f946ba61d1a1069aedcc17d7b7616f23cd", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "spacemacs": { + "flake": false, + "locked": { + "lastModified": 1663443599, + "narHash": "sha256-DEKvlFi2927oGfaxnhCWd7AYU0TD8yyaWg4I+Fx+8V0=", + "owner": "syl20bnr", + "repo": "spacemacs", + "rev": "491e17ba9cdcb253a3292a3049abb8767c91b9bb", + "type": "github" + }, + "original": { + "owner": "syl20bnr", + "ref": "master", + "repo": "spacemacs", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1f0967a --- /dev/null +++ b/flake.nix @@ -0,0 +1,83 @@ +{ + description = "Home Manager configuration"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + home-manager = { + url = "github:nix-community/home-manager/release-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + spacemacs = { + url = "github:syl20bnr/spacemacs/master"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, home-manager, rust-overlay, spacemacs, ... }: + let + supportedSystems = [ "x86_64-linux" "aarch64-darwin" ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + # Function to get pkgs for a specific system + pkgsFor = system: import nixpkgs { + inherit system; + overlays = [ rust-overlay.overlays.default ]; + }; + + # Base configuration that all machines will inherit + baseConfig = { + imports = [ + ./home.nix + ]; + }; + + # Function to create machine-specific configurations + mkHomeConfig = { system ? builtins.currentSystem, extraModules ? [ ] }: + home-manager.lib.homeManagerConfiguration { + pkgs = pkgsFor system; + + modules = [ + baseConfig + ] ++ extraModules; + + extraSpecialArgs = { + inherit spacemacs; + }; + }; + in + { + homeConfigurations = { + # WSL configuration + "awright-wsl" = mkHomeConfig { + system = "x86_64-linux"; + extraModules = [ + ./users/awright-personal.nix + ./roles/ubuntu-wsl.nix + ]; + }; + + "awright-xps13" = mkHomeConfig { + system = "x86_64-linux"; + extraModules = [ + ./users/awright-personal.nix + ./machines/xps13.nix + ./roles/sway-laptop.nix + ]; + }; + + "awright-work-mbp" = mkHomeConfig { + system = "aarch64-darwin"; + extraModules = [ + ./users/awright-cg.nix + ./machines/mbp-16.nix + ./roles/darwin-laptop.nix + ]; + }; + }; + }; +} diff --git a/home-template.nix b/home.nix similarity index 79% rename from home-template.nix rename to home.nix index 89a5bd3..1c17b40 100644 --- a/home-template.nix +++ b/home.nix @@ -12,12 +12,6 @@ # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home.stateVersion = "22.05"; + home.stateVersion = "24.05"; manual.manpages.enable = false; - - imports = [ - ./machines/.nix - ./users/.nix - ./roles/.nix - ]; } diff --git a/install.sh b/install.sh index f135ec6..88df8b9 100755 --- a/install.sh +++ b/install.sh @@ -1,14 +1,47 @@ #!/bin/bash set -e +# Function to check if command exists +command_exists() { + command -v "$1" >/dev/null 2>&1 +} + +# Clone repository mkdir -p ~/.config && cd ~/.config -git clone https://github.com/aywrite/nix-config ./nixpkgs -ln -s ~/.config/nixpkgs ~/nix-home + git clone https://github.com/aywrite/nix-config ./nixpkgs + +# Check if nix is installed +if ! command_exists nix; then + echo "==> Installing Nix..." + sh <(curl -L "https://nixos.org/nix/install") + # Source nix + . "$HOME/.nix-profile/etc/profile.d/nix.sh" +else + echo "==> Nix is already installed" +fi -sh <(curl https://nixos.org/nix/install) +# Enable flakes in nix configuration +echo "==> Configuring Nix flakes..." +mkdir -p ~/.config/nix +if ! grep -q "experimental-features" ~/.config/nix/nix.conf 2>/dev/null; then + echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf + echo "==> Enabled flakes in nix.conf" +else + echo "==> Flakes already enabled in nix.conf" +fi -cd ~/.config/nix-home -cp home-template.nix home.nix +# Create required directories +mkdir -p /nix/var/nix/{profiles,gcroots}/per-user/$USER +chmod 0755 /nix/var/nix/{profiles,gcroots}/per-user/$USER -echo 'You should now install home-manager' -mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER +echo "Installation complete! You can now use home-manager with flakes:" +echo "cd ~/.config/nixpkgs" +echo "" +echo "# For WSL:" +echo "home-manager switch --flake .#awright-wsl" +echo "" +echo "# For XPS 13:" +echo "home-manager switch --flake .#awright-xps13" +echo "" +echo "# For Work MacBook:" +echo "home-manager switch --flake .#awright-work-mbp" diff --git a/programs/emacs.nix b/programs/emacs.nix index 75d013f..774ed02 100644 --- a/programs/emacs.nix +++ b/programs/emacs.nix @@ -1,12 +1,9 @@ -{ pkgs, ... }: +{ pkgs, spacemacs, ... }: { programs.emacs.enable = true; home.file.".emacs.d" = { - source = builtins.fetchGit { - url = "https://github.com/syl20bnr/spacemacs"; - ref = "master"; - }; + source = spacemacs; recursive = true; }; home.file.".spacemacs".source = ./spacemacs.el; diff --git a/programs/gpg-agent.conf b/programs/gpg-agent.conf deleted file mode 100644 index a51ab3c..0000000 --- a/programs/gpg-agent.conf +++ /dev/null @@ -1,16 +0,0 @@ -# https://github.com/drduh/config/blob/master/gpg-agent.conf -# https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html -enable-ssh-support -ttyname $GPG_TTY -default-cache-ttl 60 -max-cache-ttl 120 - -## Pin entry options -#pinentry-program /usr/bin/pinentry-curses -#pinentry-program /usr/bin/pinentry-tty -#pinentry-program /usr/bin/pinentry-gtk-2 -#pinentry-program /usr/bin/pinentry-x11 -#pinentry-program /usr/bin/pinentry-qt -#pinentry-program /usr/local/bin/pinentry-curses -#pinentry-program /usr/local/bin/pinentry-mac -#pinentry-program /opt/homebrew/bin/pinentry-mac diff --git a/programs/gpg.nix b/programs/gpg.nix index b18d465..5bda80d 100644 --- a/programs/gpg.nix +++ b/programs/gpg.nix @@ -1,100 +1,119 @@ { config, lib, pkgs, ... }: + +with lib; + let - gpgAgentExtras = builtins.readFile ../programs/gpg-agent.conf; + cfg = config.programs.gpg; + + # Get pinentry program from role config, default to curses + pinentryProgram = + if config.role.pinentryProgram != null + then config.role.pinentryProgram + else "${pkgs.pinentry-curses}/bin/pinentry-curses"; + + # Generate gpg-agent.conf content + gpgAgentConfig = '' + # https://github.com/drduh/config/blob/master/gpg-agent.conf + # https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html + enable-ssh-support + ttyname $GPG_TTY + default-cache-ttl 60 + max-cache-ttl 120 + pinentry-program ${pinentryProgram} + ''; in { - programs.gpg = { - enable = true; - scdaemonSettings = { - reader-port = "Yubico Yubikey"; + options.role = { + pinentryProgram = mkOption { + type = types.nullOr types.str; + default = null; + description = "Path to the pinentry program to use"; + example = "\${pkgs.pinentry-mac}/bin/pinentry-mac"; }; - settings = { - # https://github.com/drduh/config/blob/master/gpg.conf - # https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html - # https://www.gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html - # Use AES256, 192, or 128 as cipher - personal-cipher-preferences = [ - "AES256" - "AES192" - "AES" - ]; - # Use SHA512, 384, or 256 as digest - personal-digest-preferences = [ - "SHA512" - "SHA384" - "SHA256" - ]; - # Use ZLIB, BZIP2, ZIP, or no compression - personal-compress-preferences = [ - "ZLIB" - "BZIP2" - "ZIP" - "Uncompressed" - ]; - # Default preferences for new keys - default-preference-list = [ - "SHA512" - "SHA384" - "SHA256" - "AES256" - "AES192" - "AES" - "ZLIB" - "BZIP2" - "ZIP" - "Uncompressed" - ]; - # SHA512 as digest to sign keys - cert-digest-algo = "SHA512"; - # SHA512 as digest for symmetric ops - s2k-digest-algo = "SHA512"; - # AES256 as cipher for symmetric ops - s2k-cipher-algo = "AES256"; - # UTF-8 support for compatibility - charset = "utf-8"; - # Show Unix timestamps - fixed-list-mode = true; - # No comments in signature - no-comments = true; - # No version in output - no-emit-version = true; - # Disable banner - no-greeting = true; - # Long hexidecimal key format - keyid-format = "0xlong"; - # Display UID validity - list-options = "show-uid-validity"; - verify-options = "show-uid-validity"; - # Display all keys and their fingerprints - with-fingerprint = true; - # Display key origins and updates - #with-key-origin - # Cross-certify subkeys are present and valid - require-cross-certification = true; - # Disable caching of passphrase for symmetrical ops - no-symkey-cache = true; - # Enable smartcard - use-agent = true; - # Disable recipient key ID in messages - throw-keyids = true; - # Default/trusted key ID to use (helpful with throw-keyids) - #default-key 0xFF3E7D88647EBCDB - #trusted-key 0xFF3E7D88647EBCDB - # Group recipient keys (preferred ID last) - #group keygroup = 0xFF00000000000001 0xFF00000000000002 0xFF3E7D88647EBCDB - # Keyserver URL - #keyserver hkps://keys.openpgp.org - #keyserver hkps://keyserver.ubuntu.com:443 - #keyserver hkps://hkps.pool.sks-keyservers.net - #keyserver hkps://pgp.ocf.berkeley.edu - # Proxy to use for keyservers - #keyserver-options http-proxy=http://127.0.0.1:8118 - #keyserver-options http-proxy=socks5-hostname://127.0.0.1:9050 - # Verbose output - #verbose - # Show expired subkeys - #list-options show-unusable-subkeys + }; + + config = { + programs.gpg = { + enable = true; + scdaemonSettings = { + reader-port = "Yubico Yubikey"; + }; + settings = { + # https://github.com/drduh/config/blob/master/gpg.conf + # https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html + # https://www.gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html + + # Use AES256, 192, or 128 as cipher + personal-cipher-preferences = [ + "AES256" + "AES192" + "AES" + ]; + + # Use SHA512, 384, or 256 as digest + personal-digest-preferences = [ + "SHA512" + "SHA384" + "SHA256" + ]; + + # Use ZLIB, BZIP2, ZIP, or no compression + personal-compress-preferences = [ + "ZLIB" + "BZIP2" + "ZIP" + "Uncompressed" + ]; + + # Default preferences for new keys + default-preference-list = [ + "SHA512" + "SHA384" + "SHA256" + "AES256" + "AES192" + "AES" + "ZLIB" + "BZIP2" + "ZIP" + "Uncompressed" + ]; + + # SHA512 as digest to sign keys + cert-digest-algo = "SHA512"; + # SHA512 as digest for symmetric ops + s2k-digest-algo = "SHA512"; + # AES256 as cipher for symmetric ops + s2k-cipher-algo = "AES256"; + # UTF-8 support for compatibility + charset = "utf-8"; + # Show Unix timestamps + fixed-list-mode = true; + # No comments in signature + no-comments = true; + # No version in output + no-emit-version = true; + # Disable banner + no-greeting = true; + # Long hexidecimal key format + keyid-format = "0xlong"; + # Display UID validity + list-options = "show-uid-validity"; + verify-options = "show-uid-validity"; + # Display all keys and their fingerprints + with-fingerprint = true; + # Cross-certify subkeys are present and valid + require-cross-certification = true; + # Disable caching of passphrase for symmetrical ops + no-symkey-cache = true; + # Enable smartcard + use-agent = true; + # Disable recipient key ID in messages + throw-keyids = true; + }; }; + + # Generate gpg-agent.conf dynamically + home.file.".gnupg/gpg-agent.conf".text = gpgAgentConfig; }; - home.file.".gnupg/gpg-agent.conf".source = ../programs/gpg-agent.conf; } diff --git a/programs/i3/xinitrc b/programs/i3/xinitrc index add7ab2..230b1d3 100755 --- a/programs/i3/xinitrc +++ b/programs/i3/xinitrc @@ -1,7 +1,7 @@ #!/bin/sh -[ -f /etc/xprofile ] && source /etc/xprofile -[ -f ~/.xprofile ] && source ~/.xprofile +[ -f /etc/xprofile ] && . /etc/xprofile +[ -f ~/.xprofile ] && . ~/.xprofile # start window manager exec i3 diff --git a/programs/neovim.nix b/programs/neovim.nix index 6af4a05..79d62c0 100644 --- a/programs/neovim.nix +++ b/programs/neovim.nix @@ -17,6 +17,7 @@ in extraConfig = vimRC; plugins = with pkgs.vimPlugins // customPlugins; [ + codeium-vim fzf-vim coc-nvim fzfWrapper diff --git a/programs/python.nix b/programs/python.nix index e9a9256..9591a7f 100644 --- a/programs/python.nix +++ b/programs/python.nix @@ -1,22 +1,65 @@ { pkgs, ... }: -{ - xdg.configFile."pylintrc".source = ../programs/python/pylintrc; - xdg.configFile."flake8".source = ../programs/python/flake8.cfg; - xdg.configFile."pycodestyle".source = ../programs/python/pycodestyle.cfg; - - home.packages = with pkgs; [ - ( - python39.withPackages (ps: [ - ps.python-lsp-server - ps.setuptools - # type checking, import sorting and code formatting - ps.pylsp-mypy - ps.pyls-isort - ps.python-lsp-black - # other - ps.pipx - ]) - ) +let + python = pkgs.python311; + pythonPackages = python.pkgs; + + # Global development tools + globalTools = with pkgs; [ + ruff + uv + ]; + + # Python packages + pythonEnvironment = with pythonPackages; [ + # Core + pip + virtualenv + setuptools + + # LSP and tools + python-lsp-server + python-lsp-ruff + pyls-isort + python-lsp-black + ruff-lsp + + # Testing and debugging + pytest + pytest-cov + debugpy + ipython + + # Package management + pipx + + # Documentation + sphinx ]; + +in +{ + # Configuration files + xdg.configFile = { + "pylintrc".source = ../programs/python/pylintrc; + "flake8".source = ../programs/python/flake8.cfg; + "pycodestyle".source = ../programs/python/pycodestyle.cfg; + "ruff.toml".source = ../programs/python/ruff.toml; + "pyproject.toml".source = ./python/pyproject.toml; + #"pip/pip.conf".source = ./python/pip.conf; + #"pypoetry/config.toml".source = ./python/poetry-config.toml; + }; + + # Python packages + home.packages = [ + (python.withPackages (ps: pythonEnvironment)) + ] ++ globalTools; + + # Environment variables + home.sessionVariables = { + PYTHONBREAKPOINT = "ipdb.set_trace"; + PYTHONDONTWRITEBYTECODE = "1"; # Prevent creation of .pyc files + PYTHONUNBUFFERED = "1"; # Unbuffered output + VIRTUAL_ENV_DISABLE_PROMPT = "1"; # Let shell handle venv prompts + }; } diff --git a/programs/python/flake8.cfg b/programs/python/flake8.cfg index 4f5da19..2fb8397 100644 --- a/programs/python/flake8.cfg +++ b/programs/python/flake8.cfg @@ -1,3 +1,7 @@ [flake8] -ignore = E501 -exclude = .git,__pycache__ +max-line-length = 100 +extend-ignore = E203, W503 +exclude = .git,__pycache__,build,dist,.venv +per-file-ignores = + __init__.py:F401 + tests/*:S101 diff --git a/programs/python/pyproject.toml b/programs/python/pyproject.toml new file mode 100644 index 0000000..fb229bc --- /dev/null +++ b/programs/python/pyproject.toml @@ -0,0 +1,64 @@ +[tool.black] +line-length = 100 +target-version = ['py311'] +include = '\.pyi?$' + +[tool.isort] +profile = "black" +multi_line_output = 3 +line_length = 100 + +[tool.ruff] +line-length = 100 +target-version = "py311" +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + "I", # isort + "C", # flake8-comprehensions + "B", # flake8-bugbear + "UP", # pyupgrade +] +ignore = [] + +# Allow autofix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", +] + +[tool.mypy] +python_version = "3.11" +warn_return_any = true +warn_unused_configs = true +disallow_untyped_defs = true +check_untyped_defs = true + +[tool.pytest.ini_options] +testpaths = ["tests"] +python_files = ["test_*.py"] +addopts = "-ra -q --cov" diff --git a/programs/python/ruff.toml b/programs/python/ruff.toml new file mode 100644 index 0000000..e285b63 --- /dev/null +++ b/programs/python/ruff.toml @@ -0,0 +1,7 @@ +select = ["E", "F", "B", "I"] +ignore = ["E501"] +line-length = 100 +target-version = "py310" + +[per-file-ignores] +"__init__.py" = ["F401"] diff --git a/programs/rust.nix b/programs/rust.nix index fea9056..fb60e25 100644 --- a/programs/rust.nix +++ b/programs/rust.nix @@ -1,8 +1,6 @@ { pkgs, ... }: let - rust-overlay = import (builtins.fetchTarball https://github.com/oxalica/rust-overlay/archive/master.tar.gz); - nixpkgs = import { overlays = [ rust-overlay ]; }; - rustStable = nixpkgs.rust-bin.stable.latest.default.override { + rustStable = pkgs.rust-bin.stable.latest.default.override { extensions = [ "rust-src" "clippy-preview" @@ -12,7 +10,7 @@ let }; in { - home.packages = with nixpkgs; [ + home.packages = with pkgs; [ rustStable rust-analyzer ]; diff --git a/programs/shell/zsh-themes/andrew.zsh-theme b/programs/shell/zsh-themes/andrew.zsh-theme old mode 100755 new mode 100644 diff --git a/programs/status-bars/launch-polybar.sh b/programs/status-bars/launch-polybar.sh index 57fe71b..a90f24a 100755 --- a/programs/status-bars/launch-polybar.sh +++ b/programs/status-bars/launch-polybar.sh @@ -22,5 +22,3 @@ if type "xrandr"; then else polybar --reload main & fi - - diff --git a/programs/vim/vimrc b/programs/vim/vimrc index a734cc2..157ac81 100644 --- a/programs/vim/vimrc +++ b/programs/vim/vimrc @@ -171,6 +171,12 @@ if executable('rg') set grepformat=%f:%l:%c:%m endif +" Terminal settings +set t_Co=256 +let &t_8f = "\[38;2;%lu;%lu;%lum" +let &t_8b = "\[48;2;%lu;%lu;%lum" +set termguicolors + " vim theme (used with altercation/vim-colors-solarized) set background=dark colorscheme solarized diff --git a/programs/vscode.nix b/programs/vscode.nix new file mode 100644 index 0000000..ef10d5d --- /dev/null +++ b/programs/vscode.nix @@ -0,0 +1,201 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.vscode; + + # Common settings for all environments + baseSettings = { + # Vim settings + "vim.easymotion" = true; + "vim.incsearch" = true; + "vim.useSystemClipboard" = true; + "vim.useCtrlKeys" = true; + "vim.hlsearch" = true; + + # Key bindings matching Neovim config + "vim.insertModeKeyBindings" = [ + { + "before" = [ "j" "k" ]; + "after" = [ "" ]; + } + ]; + + "vim.normalModeKeyBindingsNonRecursive" = [ + # Space as leader + { + "before" = [ "" ]; + "commands" = [ "workbench.action.showCommands" ]; + } + # Testing shortcuts + { + "before" = [ "" "t" "n" ]; + "commands" = [ "testing.runTest" ]; + } + { + "before" = [ "" "t" "f" ]; + "commands" = [ "testing.runCurrentFile" ]; + } + { + "before" = [ "" "t" "a" ]; + "commands" = [ "testing.runAll" ]; + } + # Code navigation + { + "before" = [ "" "g" "d" ]; + "commands" = [ "editor.action.revealDefinition" ]; + } + { + "before" = [ "" "g" "t" ]; + "commands" = [ "editor.action.goToTypeDefinition" ]; + } + { + "before" = [ "" "g" "i" ]; + "commands" = [ "editor.action.goToImplementation" ]; + } + { + "before" = [ "" "g" "r" ]; + "commands" = [ "editor.action.goToReferences" ]; + } + # Formatting + { + "before" = [ "" "f" ]; + "commands" = [ "editor.action.formatDocument" ]; + } + # File/buffer navigation + { + "before" = [ "" "" ]; + "commands" = [ "workbench.action.quickOpen" ]; + } + ]; + + "vim.normalModeKeyBindings" = [ + { + "before" = [ "" ]; + "after" = [ "" ]; + } + { + "before" = [ "" ]; + "after" = [ "" ]; + } + { + "before" = [ "" ]; + "after" = [ "" ]; + } + { + "before" = [ "" ]; + "after" = [ "" ]; + } + ]; + + "vim.leader" = ""; + + # Preserve VS Code keybindings + "vim.handleKeys" = { + "" = false; + "" = false; + "" = false; + "" = false; + }; + + # Editor settings matching Neovim + "editor.fontFamily" = "FiraCode Nerd Font"; + "editor.fontSize" = 14; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.rulers" = [ 80 100 120 ]; + "editor.tabSize" = 2; + "editor.insertSpaces" = true; + "editor.autoIndent" = "advanced"; + "editor.renderWhitespace" = "boundary"; + "editor.lineNumbers" = "on"; + + # Files + "files.trimTrailingWhitespace" = true; + "files.insertFinalNewline" = true; + "files.trimFinalNewlines" = true; + + # Terminal + "terminal.integrated.fontFamily" = "FiraCode Nerd Font"; + "terminal.integrated.fontSize" = 14; + + # Git + "git.enableSmartCommit" = true; + "git.confirmSync" = false; + "git.autofetch" = true; + + # Python + "python.formatting.provider" = "black"; + "python.linting.enabled" = true; + "python.linting.flake8Enabled" = true; + + # Nix + "nix.enableLanguageServer" = true; + "[nix]"."editor.tabSize" = 2; + + # Theme (matching Solarized Dark) + "workbench.colorTheme" = "Solarized Dark"; + "workbench.startupEditor" = "none"; + "workbench.colorCustomizations" = { + "editorBracketMatch.background" = "#00000000"; + "editorBracketMatch.border" = "#2aa19899"; + }; + + # Window + "window.zoomLevel" = 0; + + # Telemetry + "telemetry.telemetryLevel" = "off"; + }; + + # Role-specific settings + roleSettings = + if config.role.vscodeSettings != null + then config.role.vscodeSettings + else { }; + + # Merge base and role settings + finalSettings = baseSettings // roleSettings; + + # Helper function to create VSCode settings files + mkVSCodeSettings = isWSL: + let + baseFiles = { + ".vscode/settings.json".text = builtins.toJSON finalSettings; + }; + wslFiles = { + ".vscode-server/data/Machine/settings.json".text = builtins.toJSON finalSettings; + ".vscode-server/data/User/settings.json".text = builtins.toJSON finalSettings; + }; + in + if isWSL + then baseFiles // wslFiles + else baseFiles; +in +{ + options.role = { + isWSL = mkOption { + type = types.bool; + default = false; + description = "Whether this configuration is for WSL"; + }; + + vscodeSettings = mkOption { + type = types.nullOr (types.attrsOf types.anything); + default = null; + description = "Role-specific VSCode settings"; + example = literalExpression '' + { + "window.zoomLevel" = 1; + "workbench.colorTheme" = "Monokai"; + } + ''; + }; + }; + + config = { + # Create VSCode settings files based on WSL status + home.file = mkVSCodeSettings config.role.isWSL; + }; +} diff --git a/programs/windsurf.nix b/programs/windsurf.nix new file mode 100644 index 0000000..35df646 --- /dev/null +++ b/programs/windsurf.nix @@ -0,0 +1,111 @@ +{ config, pkgs, ... }: + +let + settings = { + theme = { + name = "solarized-dark"; # Match your vim theme + }; + terminal = { + font = { + family = "FiraCode"; + size = 12; + }; + shell = { + program = "zsh"; + }; + defaultProfile = "zsh"; + }; + vim = { + enabled = true; + useSystemClipboard = true; + leader = ""; + normalModeKeysNonRepeat = false; # Enable key repeat for normal mode + insertModeKeyBindings = [ + { + before = [ "j" "k" ]; + after = [ "" ]; + } + ]; + normalModeKeyBindings = [ + # File operations + { + before = [ "" "w" ]; + commands = [ "workbench.action.files.save" ]; + } + { + before = [ "" "q" ]; + commands = [ "workbench.action.closeActiveEditor" ]; + } + # Navigation + { + before = [ "" "gd" ]; + commands = [ "editor.action.revealDefinition" ]; + } + { + before = [ "" "gr" ]; + commands = [ "editor.action.goToReferences" ]; + } + { + before = [ "" "gi" ]; + commands = [ "editor.action.goToImplementation" ]; + } + # Search and replace + { + before = [ "" "f" ]; + commands = [ "editor.action.formatDocument" ]; + } + { + before = [ "" "r" ]; + commands = [ "editor.action.rename" ]; + } + ]; + visualModeKeyBindings = [ ]; + handleKeys = { + "" = true; + "" = false; # Let VSCode handle find + "" = true; + "" = false; # Let VSCode handle window management + }; + }; + editor = { + font = { + family = "FiraCode"; + size = 12; + }; + settings = { + "editor.lineNumbers" = "relative"; + "editor.cursorLine" = true; + "editor.tabSize" = 2; + "editor.insertSpaces" = true; + "editor.rulers" = [ 80 100 ]; + "editor.wordWrap" = "off"; + "editor.renderWhitespace" = "all"; + "editor.minimap.enabled" = false; + "files.trimTrailingWhitespace" = true; + "files.insertFinalNewline" = true; + }; + }; + workbench = { + colorTheme = "Solarized Dark"; + iconTheme = "material-icon-theme"; + }; + }; + + wslSettingsPath = ".local/share/windsurf/settings.json"; + windowsSettingsPath = "AppData/Roaming/Windsurf/User/settings.json"; + linuxSettingsPath = ".config/windsurf/settings.json"; + darwinSettingsPath = "Library/Application Support/Windsurf/User/settings.json"; + + settingsJson = builtins.toJSON settings; +in +{ + home.file = + if pkgs.stdenv.isDarwin then { + ${darwinSettingsPath}.text = settingsJson; + } else if config.role.isWSL then { + ${wslSettingsPath}.text = settingsJson; + ${windowsSettingsPath}.text = settingsJson; + } else { + ${linuxSettingsPath}.text = settingsJson; + }; +} diff --git a/programs/xmonad/xinitrc b/programs/xmonad/xinitrc index 52cea2c..c1017da 100755 --- a/programs/xmonad/xinitrc +++ b/programs/xmonad/xinitrc @@ -1,7 +1,7 @@ #!/bin/sh -[ -f /etc/xprofile ] && source /etc/xprofile -[ -f ~/.xprofile ] && source ~/.xprofile +[ -f /etc/xprofile ] && . /etc/xprofile +[ -f ~/.xprofile ] && . ~/.xprofile # start window manager exec startx diff --git a/programs/xmonad/xmonad.hs b/programs/xmonad/xmonad.hs old mode 100755 new mode 100644 diff --git a/programs/xorg/xprofile b/programs/xorg/xprofile old mode 100755 new mode 100644 diff --git a/programs/zsh.nix b/programs/zsh.nix index b987ceb..a2d7d44 100644 --- a/programs/zsh.nix +++ b/programs/zsh.nix @@ -17,7 +17,7 @@ in # .zshenv programs.zsh = { enable = true; - enableAutosuggestions = true; + autosuggestion.enable = true; enableCompletion = true; history = { ignoreDups = true; diff --git a/roles/README.md b/roles/README.md new file mode 100644 index 0000000..ac7f690 --- /dev/null +++ b/roles/README.md @@ -0,0 +1,84 @@ +# Roles + +This directory contains role-based configurations that combine various programs and settings for specific use cases. + +## Available Roles + +### xmonad-laptop.nix +A configuration for laptops using XMonad as the window manager. + +**Features:** +- XMonad window manager with custom configuration +- Status bar with system information +- Power management settings +- Laptop-specific optimizations +- Development tools + +### sway-laptop.nix +A Wayland-based configuration using Sway. + +**Features:** +- Sway window manager +- Waybar status bar +- Native Wayland applications +- HiDPI support +- Modern system notifications + +### i3-laptop.nix +A configuration using i3 window manager. + +**Features:** +- i3 window manager +- i3status bar +- X11 configuration +- Standard development tools + +### darwin-laptop.nix +Configuration for macOS systems. + +**Features:** +- macOS-specific optimizations +- Terminal configuration +- Development environment +- Cross-platform compatibility + +## Creating a New Role + +1. Create a new .nix file in this directory +2. Import necessary program configurations +3. Configure role-specific settings +4. Add documentation in this README + +Example structure for a new role: +```nix +{ config, pkgs, ... }: + +{ + imports = [ + ../programs/core-programs.nix + ../programs/development.nix + # Add other necessary imports + ]; + + # Role-specific configurations + programs.specific-program = { + enable = true; + # Additional settings + }; + + # System settings + services.some-service = { + enable = true; + # Service configuration + }; +} +``` + +## Best Practices + +1. Keep roles focused and purpose-specific +2. Document role requirements and features +3. Consider hardware compatibility +4. Include necessary program imports +5. Configure reasonable defaults +6. Add comments for complex configurations diff --git a/roles/darwin-laptop.nix b/roles/darwin-laptop.nix index 81faf03..8e59472 100644 --- a/roles/darwin-laptop.nix +++ b/roles/darwin-laptop.nix @@ -7,6 +7,9 @@ ../programs/gpg.nix ]; + # Set pinentry program for macOS + role.pinentryProgram = "${pkgs.pinentry_mac}/bin/pinentry-mac"; + # TODO where to put this nixpkgs.config.allowUnfree = true; @@ -16,19 +19,18 @@ fira-code-symbols gelasio noto-fonts - noto-fonts-cjk + noto-fonts-cjk-sans noto-fonts-emoji source-code-pro # other - pinentry + #pinentry yubikey-personalization ]; # TODO move this to user? fonts.fontconfig.enable = true; - programs.alacritty = { enable = true; settings = lib.attrsets.recursiveUpdate (import ../programs/alacritty.nix) { diff --git a/roles/sway-laptop.nix b/roles/sway-laptop.nix index 17cf165..538ceda 100644 --- a/roles/sway-laptop.nix +++ b/roles/sway-laptop.nix @@ -17,7 +17,7 @@ font-awesome # required for waybar gelasio noto-fonts - noto-fonts-cjk + noto-fonts-cjk-sans noto-fonts-emoji source-code-pro diff --git a/roles/ubuntu-wsl.nix b/roles/ubuntu-wsl.nix new file mode 100644 index 0000000..b526d57 --- /dev/null +++ b/roles/ubuntu-wsl.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, attrsets, ... }: + +{ + imports = [ + ../programs/zsh.nix + ../programs/rust.nix + ../programs/gpg.nix + ]; + + # Set WSL-specific configuration + role.isWSL = true; + + # TODO where to put this + nixpkgs.config.allowUnfree = true; + + home.packages = with pkgs; [ + # fonts + fira-code + fira-code-symbols + gelasio + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + source-code-pro + + # other + pinentry + yubikey-personalization + ]; + # TODO move this to user? + fonts.fontconfig.enable = true; + + + + programs.alacritty = { + enable = true; + settings = lib.attrsets.recursiveUpdate (import ../programs/alacritty.nix) { + shell.program = "zsh"; + }; + }; + + # Environment + home.sessionVariables = { + EDITOR = "nvim"; + TERMINAL = "alacritty"; + }; +} diff --git a/update.sh b/update.sh index fcb612a..eb19f7c 100755 --- a/update.sh +++ b/update.sh @@ -2,13 +2,58 @@ set -o errexit set -o pipefail -# update packages source -source "$HOME"/.nix-profile/etc/profile.d/nix.sh -nix-channel --update +# Function to detect the current host +detect_host() { + if grep -q "microsoft" /proc/version 2>/dev/null; then + echo "wsl" + elif [[ "$OSTYPE" == "darwin"* ]]; then + echo "mbp" + elif [[ -f "/etc/nixos/configuration.nix" ]]; then + if [[ "$(hostname)" == *"xps"* ]]; then + echo "xps13" + else + echo "unknown" + fi + else + echo "unknown" + fi +} -# switch to new config -export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH -home-manager switch -f home.nix +# Source nix if it exists +if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then + source "$HOME/.nix-profile/etc/profile.d/nix.sh" +fi -# Post update fixes/commands -vim -E -c UpdateRemotePlugins -c q || true +# Detect the current host +HOST_TYPE=$(detect_host) +FLAKE_TARGET="awright-${HOST_TYPE}" + +echo "==> Detected host type: ${HOST_TYPE}" +echo "==> Using flake target: ${FLAKE_TARGET}" + +# Update flake inputs +echo "==> Updating flake inputs..." +nix flake update + +# Switch to new configuration +echo "==> Switching to new configuration..." +if [ "${HOST_TYPE}" != "unknown" ]; then + home-manager switch --flake ".#${FLAKE_TARGET}" +else + echo "Error: Unknown host type. Please specify your configuration manually:" + echo "home-manager switch --flake .#awright-wsl # For WSL" + echo "home-manager switch --flake .#awright-xps13 # For XPS 13" + echo "home-manager switch --flake .#awright-work-mbp # For Work MacBook" + exit 1 +fi + +# Post update tasks +echo "==> Running post-update tasks..." + +# Update vim plugins if neovim is installed +if command -v nvim >/dev/null 2>&1; then + echo "==> Updating Neovim plugins..." + nvim -E -c "UpdateRemotePlugins" -c "qa!" || true +fi + +echo "==> Update complete!" diff --git a/users/awright-cg.nix b/users/awright-cg.nix index 79fb04d..f96e3a8 100644 --- a/users/awright-cg.nix +++ b/users/awright-cg.nix @@ -9,10 +9,10 @@ home.packages = with pkgs; [ # dev ops - argocd + # argocd - TODO broken? aws-iam-authenticator awscli2 - google-cloud-sdk + (google-cloud-sdk.withExtraComponents [ google-cloud-sdk.components.gke-gcloud-auth-plugin ]) kubectl kubernetes-helm kustomize @@ -20,6 +20,7 @@ krew terraform sops + glab # ruby solargraph @@ -34,7 +35,7 @@ userEmail = "andrew.w@covergenius.com"; userName = "Andrew Wright"; signing.key = "0x46BAAEE2AFADB938"; - signing.signByDefault = true; + #signing.signByDefault = true; TODO re-enable after yubikey fixed extraConfig = { url = { "git@github.com:" = { diff --git a/users/awright-personal.nix b/users/awright-personal.nix index d88469a..3cb1006 100644 --- a/users/awright-personal.nix +++ b/users/awright-personal.nix @@ -4,7 +4,7 @@ imports = [ ../users/base.nix ../programs/bash.nix - ../programs/tmux/default.nix + #../programs/tmux/default.nix ]; home.packages = with pkgs; [ diff --git a/users/base.nix b/users/base.nix index 1b979a1..3a50450 100644 --- a/users/base.nix +++ b/users/base.nix @@ -6,9 +6,11 @@ ../programs/emacs.nix ../programs/neovim.nix ../programs/python.nix + ../programs/vscode.nix + ../programs/windsurf.nix ]; - home.homeDirectory = "/home/awright"; + home.homeDirectory = if pkgs.stdenv.isLinux then "/home/awright" else "/Users/awright"; home.username = "awright"; home.packages = with pkgs; [ @@ -18,6 +20,7 @@ git fzf colordiff + tree # Network utilities mtr @@ -28,7 +31,7 @@ # system tools htop bottom - ncdu + #ncdu - TODO only install on linux devices restic neofetch @@ -36,7 +39,7 @@ ispell # Rust CLI Tools - exa + #exa -- currently broken? tokei fd