diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..a8d08c3 --- /dev/null +++ b/.envrc @@ -0,0 +1,8 @@ +use flake .nix + +if on_git_branch; then + echo + git status --short --branch + echo + git fetch +fi diff --git a/.gitignore b/.gitignore index a806510..3357b94 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ # Ignore build outputs from performing a nix-build or `nix build` command result result-* - diff --git a/.nix/flake.lock b/.nix/flake.lock new file mode 100644 index 0000000..f09af8e --- /dev/null +++ b/.nix/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1720418205, + "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", + "rev": "655a58a72a6601292512670343087c2d75d859c1", + "revCount": 650378, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.650378%2Brev-655a58a72a6601292512670343087c2d75d859c1/019095fe-96b2-7a7c-ad7c-2131b3fb6fa7/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/.nix/flake.nix b/.nix/flake.nix new file mode 100644 index 0000000..0cbe327 --- /dev/null +++ b/.nix/flake.nix @@ -0,0 +1,32 @@ +{ + description = "A flake editing flake"; + + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + outputs = { nixpkgs, ... }: + let + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); + in + { + devShells = forEachSupportedSystem ({ pkgs }: { + default = pkgs.mkShell.override + { + # Override stdenv in order to change compiler: + # stdenv = pkgs.clangStdenv; + } + { + packages = with pkgs; [ + pre-commit + commitizen + ]; + + shellHook = '' + pre-commit install --allow-missing-config --hook-type pre-commit --hook-type commit-msg + ''; + }; + }); + }; +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..87f991d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: detect-private-key + - id: mixed-line-ending + + - repo: https://github.com/commitizen-tools/commitizen + rev: v3.27.0 + hooks: + - id: commitizen + stages: [commit-msg] + + - repo: local + hooks: + - id: home-manager-check + name: Home Manager Config Check + entry: home-manager switch --dry-run + language: system + pass_filenames: false + exclude: ^docs/ diff --git a/README.md b/README.md index 6a6da41..c8292c9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ # home-manager - diff --git a/docs/Setup Log WSL+Alpine.md b/docs/Setup Log WSL+Alpine.md new file mode 100644 index 0000000..87ed6cb --- /dev/null +++ b/docs/Setup Log WSL+Alpine.md @@ -0,0 +1,91 @@ +# Setup Log WSL/Alpine + +## User setup + +```bash +su - +apk add sudo +echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel +adduser mmandl sudo +passwd mmandl +logout +``` + +## Home-manager setup + +```bash +# Install nix package manager +sudo apk add curl xz openssh-client +curl -L https://nixos.org/nix/install | sh +echo ". /home/mmandl/.nix-profile/etc/profile.d/nix.sh" >> ~/.profile + +# Add home-manager channel and install +nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager +nix-channel --update +nix-shell '' -A install +``` + +## Home-manager config + +```bash +# Extract initial home-manager config +unzip /mnt/c/Users/mmandl/Downloads/home-manager-main.zip +mv home-manager-main home-manager +rm -rf .config/home-manager +ln -s ../home-manager .config/home-manager + +# Enable nix flakes support +mkdir -p .config/nix +echo "experimental-features = nix-command flakes" > .config/nix/nix.conf + +# Install and configure user environment +home-manager switch + +# Install zsh +sudo apk add zsh +chsh -s /bin/zsh + +# Install gpg and ssh private keys +gpg --import /mnt/c/Users/mmandl/OneDrive\ -\ Horsch\ Maschinen\ GmbH/Dokumente/GPG/Michael\ Mandl\ michael.mandl@horsch.com\ \(0x088ED38F036C7AF2\)\ pub-sec.asc + +# Switch to final home-manager config +rm -rf home-manager +git clone git@github.com:mmandl-horsch/home-manager.git +``` + +## Docker + +```bash +# Enable openrc on boot +echo "[boot]\ncommand = /sbin/openrc default" > /etc/wsl.conf + +# Install docker +sudo apk add docker +sudo rc-update add docker default +sudo adduser mmandl docker + +# Install buildserver CA +firefox https://confluence.horsch.com/display/DFEDOCU1/SE+Tools+-+Buildserver+-+SSL?preview=/114590403/114590426/20201123_horsch_buildserver_ca_install.sh +sudo sh 20201123_horsch_buildserver_ca_install.sh +``` + +## VSCode + +```bash +# Install vscode server runtime dependency +sudo apk add libstdc++ +``` + +## Yocto + +```bash +# Install non-busybox `readlink` +sudo apk add coreutils +``` + +## Kernel Module Autoloading + +```bash +sudo apk add alpine-config +sudo setup-devd udev +``` diff --git a/email.nix b/email.nix deleted file mode 100644 index ea5ad54..0000000 --- a/email.nix +++ /dev/null @@ -1,125 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = [ pkgs.libsecret ]; - - programs.msmtp.enable = true; - programs.mbsync.enable = true; - programs.neomutt = { - enable = true; - sidebar.enable = true; - vimKeys = true; - macros = [ - { - action = "mbsync -all"; - key = "S"; - map = [ "index" ]; - } - ]; - }; - - accounts.email = { - maildirBasePath = "${config.xdg.dataHome}/mail"; - - accounts = { - molez = rec { - primary = true; - - realName = "Michael Mandl"; - address = "mandlm@molez.net"; - - userName = address; - passwordCommand = "secret-tool lookup email mandlm@molez.net"; - - imap = { - host = "mail.molez.net"; - port = 993; - tls.enable = true; - }; - - smtp = { - host = "mail.molez.net"; - port = 465; - tls.enable = true; - }; - - gpg = { - key = "0x4AA25D647AA54CC7"; - signByDefault = true; - }; - - msmtp.enable = true; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - }; - - neomutt.enable = true; - }; - swp = { - realName = "Michael Mandl"; - address = "mandl@vi-bim.de"; - - userName = "mandl"; - passwordCommand = "secret-tool lookup email mandl@vi-bim.de"; - - imap = { - host = "swpmail.softwareparadies.de"; - port = 993; - tls.enable = true; - }; - - smtp = { - host = "swpmail.softwareparadies.de"; - port = 465; - tls.enable = true; - }; - - gpg = { - key = "0x4E60F44227F611B4 "; - signByDefault = true; - }; - - signature = { - showSignature = "append"; - text = '' - -- - Mit freundlichen Grüßen - - Michael Mandl - Entwicklung - ------------------------------------------ - swp software systems GmbH & Co. KG - - Königsbrücker Straße 124 - 01099 Dresden - Tel: 0351-492850 - Fax: 0351-4928550 - www: https://www.vi-bim.de - - Kennen Sie schon unsere FAQ-Wissensdatenbank? Einfach hier klicken: - https://faq.vi-bim.de - - Unsere Datenschutzerklärung finden Sie unter https://datenschutz.vi-bim.de - - Registergericht: Amtsgericht Dresden HRA 3008 - persönlich haftender Gesellschafter: - swp Beteiligungs GmbH - Registergericht: Amtsgericht Dresden HRB 15 20 9 - Geschäftsführer: Holger Schönemann, Stefan Urlberger - ''; - }; - - msmtp.enable = true; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - }; - - neomutt.enable = true; - }; - }; - }; -} diff --git a/flake.nix b/flake.nix index 3bfe5d2..76c916e 100644 --- a/flake.nix +++ b/flake.nix @@ -20,12 +20,40 @@ inherit pkgs; modules = [ - ./home.nix + ./shell + ./git + ./gpg + ./neovim + ./private.nix ./xps.nix ]; extraSpecialArgs = { - username = "mandlm"; + user = "mandlm"; + userName = "Michael Mandl"; + userEmail = "mandlm@molez.net"; + gpgSigningKey = "4AA25D647AA54CC7"; + gpgSSHKeys = [ "1F937AC8F77ED74CE24EAAE79B5601F73C6D115F" ]; + theme = "dark"; + }; + }; + "mmandl@NB11313" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + modules = [ + ./shell + ./git + ./gpg + ./neovim + ./horsch.nix + ]; + + extraSpecialArgs = { + user = "mmandl"; + userName = "Michael Mandl"; + userEmail = "michael.mandl@horsch.com"; + gpgSigningKey = "088ED38F036C7AF2"; + gpgSSHKeys = [ "AEB2BF3FF9CF9529E9A3C6F1A202D21686FF9278" ]; theme = "dark"; }; }; diff --git a/git.nix b/git.nix deleted file mode 100644 index da11041..0000000 --- a/git.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ ... }: - -{ - programs = { - git = { - enable = true; - extraConfig = { - core.editor = "nvim"; - - diff.external = "difft --background light"; - diff.tool = "difftastic"; - diff.ignoreSubmodules = "none"; - - difftool.difftastic.cmd = "difft --background light \"$LOCAL\" \"$REMOTE\""; - difftool.prompt = false; - - fetch.writeCommitGraph = true; - fetch.recurseSubmodules = true; - - format.pretty = "format:%C(yellow)%h %Cblue%>(12)%ad %C(red)%G? %Cgreen%<(7,trunc)%aN%Cred%d %Creset%s"; - - init.defaultBranch = "main"; - - log.date = "relative"; - - merge.ff = false; - merge.tool = "nvim"; - - mergetool.nvim.cmd = "nvim -f -c \"Gdiffsplit!\" \"$MERGED\""; - mergetool.prompt = false; - - pager.difftool = true; - - pull.rebase = true; - - push.recurseSubmodules = "on-demand"; - - rebase.autostash = true; - - rerere.enabled = true; - - status.submoduleSummary = true; - - submodule.recurse = true; - - user.private.email = "mandlm@molez.net"; - user.private.name = "Michael Mandl"; - user.private.signingkey = "4AA25D647AA54CC7"; - - user.swp.email = "mandl@vi-bim.de"; - user.swp.name = "Michael Mandl"; - user.swp.signingkey = "4E60F44227F611B4"; - - worktree.guessRemote = true; - }; - - aliases = { - identity = ''! git config user.name "$(git config user.$1.name)"; git config user.email "$(git config user.$1.email)"; git config user.signingkey "$(git config user.$1.signingkey)"; git config commit.gpgsign "true"; : ''; - clone-worktree = ''! mkdir $2; git clone $1 $2/.base; BRANCH=`git -C $2/.base symbolic-ref --short HEAD`; echo "branch is $BRANCH"; git -C $2/.base checkout --detach HEAD; git -C $2/.base worktree add ../$BRANCH; :''; - graph = "log --graph --all --max-count 32"; - }; - - ignores = [ - ".env" - ".direnv" - "*.swp" - ]; - }; - }; -} - diff --git a/git/default.nix b/git/default.nix new file mode 100644 index 0000000..8f2e90f --- /dev/null +++ b/git/default.nix @@ -0,0 +1,125 @@ +{ pkgs, userName, userEmail, gpgSigningKey, ... }: + +{ + programs = { + less.enable = true; + + git = { + enable = true; + + inherit userName; + inherit userEmail; + + signing = { + key = gpgSigningKey; + signByDefault = true; + }; + + difftastic = { + enable = true; + background = "light"; + }; + + lfs = { + enable = true; + }; + + extraConfig = { + core.editor = "nvim"; + core.pager = "less -FX"; + + credential.helper = "cache --timeout=3600"; + + diff.ignoreSubmodules = "none"; + + fetch.writeCommitGraph = true; + fetch.recurseSubmodules = true; + + format.pretty = "format:%C(yellow)%h %Cblue%>(12)%ad %C(red)%G? %Cgreen%<(7,trunc)%aN%Cred%d %Creset%s"; + + init.defaultBranch = "main"; + + log.date = "relative"; + + merge.ff = false; + merge.tool = "nvim"; + + mergetool.nvim.cmd = "nvim -f -c \"Gdiffsplit!\" \"$MERGED\""; + mergetool.prompt = false; + + pager.difftool = true; + + pull.rebase = true; + + push.recurseSubmodules = "on-demand"; + + rebase.autostash = true; + + rerere.enabled = true; + + status.submoduleSummary = true; + + submodule.recurse = true; + + worktree.guessRemote = true; + }; + + aliases = { + graph = "log --graph --all --max-count 32"; + }; + + ignores = [ + ".env" + ".direnv" + "*.swp" + ]; + }; + }; + + home.packages = with pkgs; [ + (writeShellScriptBin "git-clone-worktree" '' + + uri=''${1} + dir=''${2} + + if [[ -z ''${dir} ]]; then + dir=''$(basename ''${1} .git) + fi + + if [[ -e ''${dir} ]]; then + echo "error: directory ''${dir} already exists" + exit 1 + fi + + mkdir ''${dir} + git clone ''${uri} ''${dir}/.base + + branch=`git -C ''${dir}/.base symbolic-ref --short HEAD` + echo "default branch is ''${branch}" + + git -C ''${dir}/.base checkout --detach HEAD + git -C ''${dir}/.base worktree add ../''${branch} + '') + + (writeShellScriptBin "git-make-relative" '' + + gitfile=''${1} + + if [[ -z ''${gitfile} ]]; then + gitfile=".git" + fi + + if [[ ! -f ''${gitfile} ]]; then + echo "file ''${gitfile} does not exist" + exit 1 + fi + + gitdir=$(grep "gitdir:" ''${gitfile} | cut -d: -f2 | xargs) + rel_gitdir=$(realpath -s --relative-to=. ''${gitdir}) + + echo "relative path: ''${rel_gitdir}" + + sed -i -e "s,gitdir:.*,gitdir: ''${rel_gitdir}," ''${gitfile} + '') + ]; +} diff --git a/gpg/default.nix b/gpg/default.nix index fcd5f77..4a3069c 100644 --- a/gpg/default.nix +++ b/gpg/default.nix @@ -1,21 +1,41 @@ -{ pkgs, ... }: +{ pkgs, gpgSSHKeys, ... }: { services.gpg-agent = { enable = true; enableZshIntegration = true; - pinentryPackage = pkgs.pinentry-gnome3; + pinentryPackage = pkgs.pinentry-curses; enableSshSupport = true; - sshKeys = [ "1F937AC8F77ED74CE24EAAE79B5601F73C6D115F" ]; + sshKeys = gpgSSHKeys; + defaultCacheTtl = 3600 * 12; + defaultCacheTtlSsh = 3600 * 12; + maxCacheTtl = 3600 * 12; + maxCacheTtlSsh = 3600 * 12; + extraConfig = '' + allow-loopback-pinentry + ''; }; programs.gpg = { enable = true; - mutableKeys = true; - mutableTrust = true; - publicKeys = [{ - source = ./pubring.asc; - trust = "ultimate"; - }]; + mutableKeys = false; + mutableTrust = false; + settings = { + pinentry-mode = "loopback"; + }; + publicKeys = [ + { + source = ./molez.pub.asc; + trust = "ultimate"; + } + { + source = ./vi-bim.pub.asc; + trust = "ultimate"; + } + { + source = ./horsch.pub.asc; + trust = "ultimate"; + } + ]; }; } diff --git a/gpg/horsch.pub.asc b/gpg/horsch.pub.asc new file mode 100644 index 0000000..c48050b --- /dev/null +++ b/gpg/horsch.pub.asc @@ -0,0 +1,51 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQGNBGY9z3YBDACr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sQ2enDqTaxtuww1c7latFu9gw7JA5g +WKnRCsV29r5Ut4nwwFuupT74EpAnZhJ74b+WL3ZChAkXPY9BoC3x9MHYo+m5QRCC +QAVIHrtIXO3999YmCjdGB8brJUA59cFW3S8MugninEASkVcoh4YF3+gIUNwGbgKw +xkJvnhphKqM4Y2qi0dKSSh0UuDMEZkGx9hYJKwYBBAHaRw8BAQdACcX55v3TrwzY +ql0GJf46wrk0fLxtdzu1lzAUpFhuc4SJAbYEGAEKACAWIQRI3btAp75ZB1HCI2II +jtOPA2x68gUCZkGx9gIbIAAKCRAIjtOPA2x68uVVC/9KUN1CE3CzPWNSP00oy0kH +W9/8Aznmf85EqMagD1nF4+yaIiOGqYvyCy/+HWwRXsTd/QyYwrXQ5DMRmXOqAcYe +pe/diOTmFXH9OMyf6PkN589WD3DAYjWC5neYNsOoJjMzeWEOcXhuJhR6+ewmUhDe +5Ji9bwpK+Hlm32ptE6xk4XJOsls8jqcRCExcxmW2fqF9GjSUuCoNWN87Jloplcjm +WsoyoqWpxCTjcvm/OpKzzSVM20Cdov+H08eAzLsWATLqfSNrEfIaT7CuWTRvdLuS +q56wtFxsa8X2Id129EJuWyD/7yIfzuHrUdbVkCHpxU+h92RFmYfB6fcE4AydJWOc +50y5pZqcf58Ari+8NryHj0o252Gg2EXi6Wp2QdJxCdUr6baVAKd+olH1i0SP7Hvf +L0+VBbG59VWFuS3G/U0wzobNCP2284mLqkguj2t3sK3V/x4XEaEUPmuKR9PrbEok +K672Cz44DjvnnrXxlxvX7eFsjHgDvgRXoacBaZWyEss= +=oAoO +-----END PGP PUBLIC KEY BLOCK----- diff --git a/gpg/pubring.asc b/gpg/molez.pub.asc similarity index 50% rename from gpg/pubring.asc rename to gpg/molez.pub.asc index 02bccb3..4531725 100644 --- a/gpg/pubring.asc +++ b/gpg/molez.pub.asc @@ -47,53 +47,6 @@ FuydeynUenih4/FBYwLGYIFM6rHVXCv0OYtOasyriNxCRDqbfT2NtSn8yj0Q8erp GAcygR/F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knfC4Fm3oJQFELMbnorkbnxp2HZnSjP2+yY9riV9vrCmN7+YihZC -iL8jv/hUCyjfKBN5Qa14 -=dpaN +0bwMRPpj0JE= +=B2N+ -----END PGP PUBLIC KEY BLOCK----- diff --git a/gpg/vi-bim.pub.asc b/gpg/vi-bim.pub.asc new file mode 100644 index 0000000..9b1449f --- /dev/null +++ b/gpg/vi-bim.pub.asc @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBF75hKEBEADCK0qTyghmaW7P8xw01T7ENVZQknNlvKPpcTzOG50Tt5fzCZ4I +R+ymh1u6OysqNCaF+gAQ9t2hCkCogsTyFG+QovE5kxsbQ8hjRyb18k8a1PGZfijk +X8cm0JZZ8AgvIqrUInMn7gvCU8zXOW5QN53NoDLSHhone6knKjN0GoGcgQlsKlub +c0tUJjoX37A/+SHQk3Ju4kjBsRLL4IERs5CWmmMBconH/9/DNneiOlbEbzwokiTA +Jfr8Cm55zSOksCe6//KzcTuFSoYp6O/L1WnSZp3yT/B+DnzfPUP1ZmjITfa5YA/0 +0j9SAJVujJ90JBieyY+gYPy3uh+uqRmrqtDspuNHfAM7vAgu9AdaPel3IHC0MNIe +JM4b0/w6uuumJVnuHnZ8+Tq6jvDNNWTBBttsudnlmAqUN9c4rKNnY8s6HVPNNwoD +Wxcpw6zzVY8W9WOOqAxsXNUWdbmyivDsNi4OWRlGDhFzye8sGFmkj3PUADYUUbzi +f//C5uE0TYrRjOowP3fNF9fbLb8JZ47kJ/6sjUWMePB4HaOKabFTHlkPNiL4krqt +ZBWko80bjmJwpzECdBM0JaZcbNdpKfW9G5rMdA8h58llT6GkjxnRAgpdTaP3epVa +FtvUirGA8VUgoFvMxJYJhpjQ0iTGoOVUsgc0liTkFeCSK4/j0jH63c2R0QARAQAB +tB9NaWNoYWVsIE1hbmRsIDxtYW5kbEB2aS1iaW0uZGU+iQJUBBMBCAA+FiEEp/wP +92+aeapZ3S8pTmD0Qif2EbQFAl75hKECGyMFC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+ZJJ3wuBZt6CUBRCzG56K5G58adh2Z0oz9vsmPa4lfb6wpje/mIoWQoi/I7/4VAso +3ygTeUGteA== +=Ok46 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/home.nix b/home.nix deleted file mode 100644 index b7b354c..0000000 --- a/home.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ pkgs, username, ... }: - -{ - home.username = "${username}"; - home.homeDirectory = "/home/${username}"; - - home.stateVersion = "24.05"; # Please read the comment before changing. - - home.packages = with pkgs; [ - eza - jq - htop - ripgrep - pavucontrol - gnumake - unzip - gcc - thunderbird - keepassxc - tree - light - element-desktop - difftastic - darktable - kubectl - kubectx - simple-scan - calibre - libreoffice - gthumb - gimp - evince - screen - inkscape - chromium - xclip - ]; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # shell provided by Home Manager. If you don't want to manage your shell - # through Home Manager then you have to manually source 'hm-session-vars.sh' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/mandlm/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { }; - - programs.home-manager.enable = true; - - imports = [ - ./bat.nix - ./carapace.nix - ./direnv.nix - ./firefox.nix - ./fzf.nix - ./git.nix - ./gpg - ./kitty.nix - ./neovim - ./nextcloud.nix - ./starship.nix - ./sway - ./zoxide.nix - ./zsh.nix - ]; -} diff --git a/horsch.nix b/horsch.nix new file mode 100644 index 0000000..68a3050 --- /dev/null +++ b/horsch.nix @@ -0,0 +1,23 @@ +{ pkgs, user, ... }: + +{ + home.username = user; + home.homeDirectory = "/home/${user}"; + + home.stateVersion = "24.05"; # Please read the comment before changing. + + programs.home-manager.enable = true; + + home.packages = with pkgs; [ + wsl-open + xdg-utils + ]; + + imports = [ + ./picocom.nix + ./podman.nix + + ./horsch/ssh.nix + ./horsch/zsh.nix + ]; +} diff --git a/horsch/ssh.nix b/horsch/ssh.nix new file mode 100644 index 0000000..7890487 --- /dev/null +++ b/horsch/ssh.nix @@ -0,0 +1,64 @@ +{ ... }: + +{ + programs = { + ssh = { + enable = true; + matchBlocks = { + SmartCAN = { + host = "smartcan 192.168.5.1"; + user = "root"; + hostname = "192.168.5.1"; + checkHostIP = false; + extraOptions = { + StrictHostKeyChecking = "no"; + UserKnownHostsFile = "/dev/null"; + LogLevel = "ERROR"; + }; + }; + Fusion-USB = { + host = "fusion-usb fusion 172.16.0.1"; + user = "root"; + hostname = "172.16.0.1"; + checkHostIP = false; + extraOptions = { + StrictHostKeyChecking = "no"; + UserKnownHostsFile = "/dev/null"; + LogLevel = "ERROR"; + }; + }; + Fusion-Wifi = { + host = "fusion-wifi 172.16.1.1"; + user = "root"; + hostname = "172.16.1.1"; + checkHostIP = false; + extraOptions = { + StrictHostKeyChecking = "no"; + UserKnownHostsFile = "/dev/null"; + LogLevel = "ERROR"; + }; + }; + Fusion-TX = { + host = "fusion-tx 10.100.30.160"; + user = "root"; + hostname = "10.100.30.160"; + checkHostIP = false; + extraOptions = { + StrictHostKeyChecking = "no"; + UserKnownHostsFile = "/dev/null"; + LogLevel = "ERROR"; + }; + }; + hcvpnde = { + host = "hcvpnde hcvpnde.horsch.com"; + hostname = "hcvpnde.horsch.com"; + }; + smartcan-vpn = { + host = "smartcan3-*"; + user = "root"; + proxyJump = "hcvpnde"; + }; + }; + }; + }; +} diff --git a/horsch/zsh.nix b/horsch/zsh.nix new file mode 100644 index 0000000..768828f --- /dev/null +++ b/horsch/zsh.nix @@ -0,0 +1,53 @@ +{ ... }: +{ + programs.zsh.initExtra = '' + if [ -f $HOME/.nix-profile/etc/profile.d/nix.sh ]; + then + source $HOME/.nix-profile/etc/profile.d/nix.sh + fi + + function sc-log { + ssh smartcan "SYSTEMD_COLORS=true journalctl --follow --no-tail --unit smartcan-''${1:-*}" + } + + function sc-restart { + ssh smartcan "systemctl restart smartcan-''${1}" + } + + function fu-reboot { + ssh fusion "reboot" + } + + function fu-flash { + local ssh_login="fusion" + local update_file=''${1} + + if [ -z ''${update_file} ]; then + update_file=$(find build/tmp/deploy/images -name "*.swu" -type f | fzf --select-1) + fi + + if [ -z ''${update_file} ]; then + echo "no file selected" + return 1 + fi + + if [ ! -f ''${update_file} ]; then + echo "file \"''${update_file}\" does not exist" + return 2 + fi + + echo "flashing ''${update_file} to device..." + cat "''${update_file}" | ssh ''${ssh_login} "swupdate-client -" + + if [ $? -ne 0 ]; then + echo "update failed" + return 3 + fi + + echo "rebooting device" + ssh ''${ssh_login} reboot + + echo "done." + } + ''; +} diff --git a/neovim/auto-session.lua b/neovim/auto-session.lua index a3dc5d9..25036fa 100644 --- a/neovim/auto-session.lua +++ b/neovim/auto-session.lua @@ -1,3 +1,3 @@ require("auto-session").setup { - log_level = "error", + log_level = "error", } diff --git a/neovim/dap.lua b/neovim/dap.lua index d491267..a36d4ee 100644 --- a/neovim/dap.lua +++ b/neovim/dap.lua @@ -25,11 +25,11 @@ vim.cmd([[ ]]) dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() + dapui.open() end dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() + dapui.close() end dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() + dapui.close() end diff --git a/neovim/default.nix b/neovim/default.nix index 0026390..a52092c 100644 --- a/neovim/default.nix +++ b/neovim/default.nix @@ -1,8 +1,6 @@ { pkgs, theme, ... }: - { - - # symlink for a stable path + # symlink for a stable path home.file.".vscode-extensions/vscode-lldb".source = pkgs.vscode-extensions.vadimcn.vscode-lldb; programs = { @@ -18,17 +16,18 @@ vim-bbye ansible-vim - # ui + # ui dressing-nvim # session handling project-nvim auto-session - # escape handling + # escape handling better-escape-nvim nvim-treesitter.withAllGrammars + nvim-treesitter-textobjects markdown-preview-nvim # use({ "iamcco/markdown-preview.nvim", run = ":call mkdp#util#install()" }) toggleterm-nvim nvim-notify @@ -83,7 +82,7 @@ nvim-dap nvim-dap-ui - # neorg + # neorg neorg neorg-telescope ]; @@ -96,13 +95,14 @@ terraform-ls tflint bash-language-server - nodePackages.dockerfile-language-server-nodejs - nodePackages.eslint_d - nodePackages.prettier - nodePackages.typescript - nodePackages.typescript-language-server - nodePackages.vscode-langservers-extracted nodePackages.yaml-language-server + nodePackages.prettier + nodePackages.eslint_d + nodePackages.typescript-language-server + nodePackages.typescript + nodePackages.dockerfile-language-server-nodejs + nodePackages.vscode-langservers-extracted + vscode-extensions.vue.volar lldb vscode-extensions.vadimcn.vscode-lldb marksman @@ -111,6 +111,16 @@ texlab nixd nixpkgs-fmt + bitbake-language-server + (python3.withPackages (ps: with ps; [ + pep8 + autopep8 + python-lsp-server + ])) + pyright + + #clipboard + xclip ]; extraLuaPackages = luaPackages: [ @@ -151,17 +161,11 @@ ${builtins.readFile ./project-nvim.lua } ${builtins.readFile ./dap.lua } ${builtins.readFile ./neorg.lua } + ${builtins.readFile ./illuminate.lua } vim.g.gitblame_date_format = "%r" - - -- setup illuminate highlight groups - vim.api.nvim_set_hl(0, "IlluminatedWordText", { bold = true }) - vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "IlluminatedWordText" }) - vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "IlluminatedWordText" }) EOF ''; }; }; } - - diff --git a/neovim/illuminate.lua b/neovim/illuminate.lua new file mode 100644 index 0000000..b8dc894 --- /dev/null +++ b/neovim/illuminate.lua @@ -0,0 +1,8 @@ +local illuminate = require("illuminate") + +illuminate.configure({ + providers = { + "lsp", "treesitter", "regex", + }, + under_cursor = true, +}) diff --git a/neovim/indent-blankline.lua b/neovim/indent-blankline.lua index d7e7b6c..6a6404f 100644 --- a/neovim/indent-blankline.lua +++ b/neovim/indent-blankline.lua @@ -1,5 +1,5 @@ require("ibl").setup { - indent = { - char = "┊", - }, + indent = { + char = "┊", + }, } diff --git a/neovim/keymaps.lua b/neovim/keymaps.lua index 721631d..18b7360 100644 --- a/neovim/keymaps.lua +++ b/neovim/keymaps.lua @@ -1,5 +1,5 @@ local function nnoremap(key, command) - vim.api.nvim_set_keymap("n", key, command, { noremap = true }) + vim.api.nvim_set_keymap("n", key, command, { noremap = true }) end vim.g.mapleader = " " @@ -27,13 +27,13 @@ local telescope_themes = require("telescope.themes") local telescope_projects = require("telescope").extensions.projects local function map_telescope(key, telescope_function) - vim.api.nvim_set_keymap("n", key, "", { - noremap = true, - callback = function() - local theme = telescope_themes.get_dropdown({ layout_config = { width = 0.9 } }) - telescope_function(theme) - end, - }) + vim.api.nvim_set_keymap("n", key, "", { + noremap = true, + callback = function() + local theme = telescope_themes.get_dropdown({ layout_config = { width = 0.9 } }) + telescope_function(theme) + end, + }) end map_telescope("ff", telescope.find_files) @@ -47,16 +47,16 @@ map_telescope("", telescope.live_grep) -- terminal vim.api.nvim_create_autocmd("TermOpen", { - pattern = "term://*", - callback = function() - local opts = { noremap = true } - vim.api.nvim_buf_set_keymap(0, 't', '', [[]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[h]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[j]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[k]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[l]], opts) - end, - desc = "Map terminal esc and window switch keys", + pattern = "term://*", + callback = function() + local opts = { noremap = true } + vim.api.nvim_buf_set_keymap(0, 't', '', [[]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[h]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[j]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[k]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[l]], opts) + end, + desc = "Map terminal esc and window switch keys", }) -- buffer closing diff --git a/neovim/lspconfig.lua b/neovim/lspconfig.lua index bda96da..5c63236 100644 --- a/neovim/lspconfig.lua +++ b/neovim/lspconfig.lua @@ -1,154 +1,170 @@ local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) local on_attach = function(client, bufnr) - local function nnoremap(key, command) - vim.keymap.set("n", key, command, { noremap = true, silent = true, buffer = bufnr }) - end + local function nnoremap(key, command) + vim.keymap.set("n", key, command, { noremap = true, silent = true, buffer = bufnr }) + end - local function format_buffer() - vim.lsp.buf.format({ - timeout_ms = 3000, - async = false, - filter = function(formatter) - return formatter.name ~= "tsserver" and formatter.name ~= "volar" - end - }) - end + local function format_buffer() + vim.lsp.buf.format({ + timeout_ms = 3000, + async = false, + filter = function(formatter) + return formatter.name ~= "tsserver" and formatter.name ~= "volar" + end + }) + end - require("lsp-inlayhints").on_attach(client, bufnr) + require("lsp-inlayhints").on_attach(client, bufnr) - local telescope = require("telescope.builtin") + local telescope = require("telescope.builtin") - nnoremap("gD", vim.lsp.buf.declaration) - nnoremap("gd", telescope.lsp_definitions) - nnoremap("gt", telescope.lsp_type_definitions) - nnoremap("gi", telescope.lsp_implementations) - nnoremap("gr", telescope.lsp_references) - nnoremap("K", vim.lsp.buf.hover) - nnoremap("rn", vim.lsp.buf.rename) - nnoremap("ca", vim.lsp.buf.code_action) - nnoremap("f", format_buffer) - nnoremap("d", telescope.diagnostics) - nnoremap("D", require("lsp_lines").toggle) - nnoremap("", vim.diagnostic.goto_prev) - nnoremap("", vim.diagnostic.goto_next) + nnoremap("gD", vim.lsp.buf.declaration) + nnoremap("gd", telescope.lsp_definitions) + nnoremap("gt", telescope.lsp_type_definitions) + nnoremap("gi", telescope.lsp_implementations) + nnoremap("gr", telescope.lsp_references) + nnoremap("K", vim.lsp.buf.hover) + nnoremap("rn", vim.lsp.buf.rename) + nnoremap("ca", vim.lsp.buf.code_action) + nnoremap("f", format_buffer) + nnoremap("d", telescope.diagnostics) + nnoremap("D", require("lsp_lines").toggle) + nnoremap("", vim.diagnostic.goto_prev) + nnoremap("", vim.diagnostic.goto_next) + nnoremap("", ":ClangdSwitchSourceHeader") - if client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - buffer = bufnr, - callback = format_buffer, - }) - end + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = format_buffer, + }) + end end require("lsp-inlayhints").setup({}) local lsp_status = require("lsp-status") lsp_status.config({ - current_function = false, - show_filename = false, - diagnostics = true, - status_symbol = "", + current_function = false, + show_filename = false, + diagnostics = true, + status_symbol = "", }) lsp_status.register_progress() -- setup lua language server for init.nvim and nvim plugin development require("neodev").setup({ - override = function(root_dir, options) - if require("neodev.util").has_file(root_dir, "/etc/nixos") then - options.enabled = true - options.plugins = true - end - end, + override = function(root_dir, options) + if require("neodev.util").has_file(root_dir, "/etc/nixos") then + options.enabled = true + options.plugins = true + end + end, }) local capabilities = require("cmp_nvim_lsp").default_capabilities(lsp_status.capabilities) local servers = { - ["bashls"] = {}, - ["clangd"] = {}, - ["cmake"] = {}, - ["dockerls"] = {}, - ["eslint"] = {}, - ["html"] = {}, - ["jsonls"] = {}, - ["lua_ls"] = { - Lua = { - runtime = { - version = "LuaJIT", - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - }, - telemetry = { - enable = false, - }, + ["bashls"] = {}, + ["bitbake_language_server"] = {}, + ["clangd"] = {}, + ["cmake"] = {}, + ["dockerls"] = {}, + ["eslint"] = {}, + ["html"] = {}, + ["jsonls"] = {}, + ["lua_ls"] = { + Lua = { + runtime = { + version = "LuaJIT", + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + telemetry = { + enable = false, + }, + format = { + enable = true, + defaultConfig = { + indent_style = "space", + indent_size = "2", }, + }, }, - ["marksman"] = {}, - ["nixd"] = {}, - ["pylsp"] = { - pylsp = { - plugins = { - pycodestyle = { - maxLineLength = 120 - } - } + }, + ["marksman"] = {}, + ["nixd"] = {}, + ["pylsp"] = { + pylsp = { + plugins = { + autopep8 = { + enabled = true + }, + flake8 = { + enabled = true + }, + pycodestyle = { + maxLineLength = 120, + enabled = true, } - }, - ["pyright"] = {}, - ["terraformls"] = {}, - ["texlab"] = {}, - ["tflint"] = {}, - ["tsserver"] = {}, - ["yamlls"] = { - yaml = { - keyOrdering = false - } - }, + } + } + }, + ["pyright"] = {}, + ["terraformls"] = {}, + ["texlab"] = {}, + ["tflint"] = {}, + ["tsserver"] = {}, + ["yamlls"] = { + yaml = { + keyOrdering = false + } + }, } local lspconfig = require("lspconfig") for lsp, settings in pairs(servers) do - lspconfig[lsp].setup({ - settings = settings, - on_attach = on_attach, - capabilities = capabilities, - }) + lspconfig[lsp].setup({ + settings = settings, + on_attach = on_attach, + capabilities = capabilities, + }) end -- setup rustaceanvim vim.g.rustaceanvim = { - server = { - on_attach = on_attach, - settings = { - ["rust-analyzer"] = { - cargo = { - loadOutDirsFromCheck = true, - }, - checkOnSave = { command = "clippy" }, - procMacro = { - enable = true, - }, - }, + server = { + on_attach = on_attach, + settings = { + ["rust-analyzer"] = { + cargo = { + loadOutDirsFromCheck = true, }, + checkOnSave = { command = "clippy" }, + procMacro = { + enable = true, + }, + }, }, + }, } -- setup null-ls for markdown formatting local null_ls = require("null-ls") null_ls.setup({ - sources = { - null_ls.builtins.formatting.prettier, - null_ls.builtins.diagnostics.tsc, - }, - on_attach = on_attach, + sources = { + null_ls.builtins.formatting.prettier, + null_ls.builtins.diagnostics.tsc, + }, + on_attach = on_attach, }) -- setup lsp_lines @@ -156,29 +172,29 @@ require("lsp_lines").setup() -- setup vim diagnostics vim.diagnostic.config({ - virtual_text = false, - signs = true, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - border = "rounded", - source = "always", - header = "", - prefix = "", - }, + virtual_text = false, + signs = true, + update_in_insert = true, + underline = true, + severity_sort = true, + float = { + border = "rounded", + source = true, + header = "", + prefix = "", + }, }) -- setup diagnostics signs local diagnostics_signs = { Error = "", Warn = "", Hint = "", Info = "" } for type, icon in pairs(diagnostics_signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end -- setup volar lspconfig["volar"].setup({ - filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json' }, - on_attach = on_attach, - capabilities = capabilities, + filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json' }, + on_attach = on_attach, + capabilities = capabilities, }) diff --git a/neovim/lualine.lua b/neovim/lualine.lua index 982987a..0c20c9b 100644 --- a/neovim/lualine.lua +++ b/neovim/lualine.lua @@ -1,7 +1,7 @@ require('lualine').setup({ - options = { globalstatus = true }, - sections = { - lualine_c = { { "filename", path = 1 }, "require('lsp-status').status()" } - }, - extensions = { "toggleterm" } + options = { globalstatus = true }, + sections = { + lualine_c = { { "filename", path = 1 }, "require('lsp-status').status()" } + }, + extensions = { "toggleterm" } }) diff --git a/neovim/neorg.lua b/neovim/neorg.lua index eb9fe84..4b33c51 100644 --- a/neovim/neorg.lua +++ b/neovim/neorg.lua @@ -1,16 +1,16 @@ local neorg = require("neorg") neorg.setup({ - load = { - ["core.defaults"] = {}, - ["core.concealer"] = {}, - ["core.dirman"] = { - config = { - workspaces = { - notes = "~/notes", - }, - default_workspace = "notes", - }, + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/notes", }, - } + default_workspace = "notes", + }, + }, + } }) diff --git a/neovim/nvim-cmp.lua b/neovim/nvim-cmp.lua index 7b0f78b..6be73a3 100644 --- a/neovim/nvim-cmp.lua +++ b/neovim/nvim-cmp.lua @@ -1,87 +1,87 @@ local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and - vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub( - col, col):match("%s") == nil + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and + vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub( + col, col):match("%s") == nil end local cmp = require("cmp") local luasnip = require("luasnip") cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end - }, - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "nvim_lsp_signature_help" }, - { name = "luasnip" }, - { name = "path" }, - { name = "buffer" }, - { name = "nvim-lua" }, - { name = "calc" }, - }), - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete({}), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - experimental = { ghost_text = true }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - formatting = { - fields = { "menu", "abbr", "kind" }, - format = function(entry, item) - local menu_icon = { - nvim_lsp = "λ", - luasnip = "⋗", - buffer = "Ω", - path = "🖿", - } + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end + }, + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "nvim_lsp_signature_help" }, + { name = "luasnip" }, + { name = "path" }, + { name = "buffer" }, + { name = "nvim-lua" }, + { name = "calc" }, + }), + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete({}), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + experimental = { ghost_text = true }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + formatting = { + fields = { "menu", "abbr", "kind" }, + format = function(entry, item) + local menu_icon = { + nvim_lsp = "λ", + luasnip = "⋗", + buffer = "Ω", + path = "🖿", + } - item.menu = menu_icon[entry.source.name] - return item - end, - }, + item.menu = menu_icon[entry.source.name] + return item + end, + }, }) -- `/` cmdline setup. cmp.setup.cmdline("/", { - sources = cmp.config.sources( - { name = "buffer" } - ) + sources = cmp.config.sources( + { name = "buffer" } + ) }) -- `:` cmdline setup. cmp.setup.cmdline(":", { - sources = cmp.config.sources( - { name = "path" }, - { name = "cmdline" } - ) + sources = cmp.config.sources( + { name = "path" }, + { name = "cmdline" } + ) }) diff --git a/neovim/options.lua b/neovim/options.lua index 5d9aa53..3ac11ae 100644 --- a/neovim/options.lua +++ b/neovim/options.lua @@ -5,8 +5,8 @@ vim.opt.termguicolors = true vim.opt.number = true -- tabwidth -vim.opt.tabstop = 4 -vim.opt.shiftwidth = 4 +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 -- indent with spaces vim.opt.expandtab = true diff --git a/neovim/telescope.lua b/neovim/telescope.lua index 2bb00cd..ef9245d 100644 --- a/neovim/telescope.lua +++ b/neovim/telescope.lua @@ -3,25 +3,25 @@ local actions = require("telescope.actions") local themes = require("telescope.themes") telescope.setup({ - defaults = { - mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.close, - [""] = actions.close - }, - n = { - [""] = actions.close, - [""] = actions.close - } - } - }, - extensions = { - ["ui-select"] = { - themes.get_dropdown({}) - }, + defaults = { + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + [""] = actions.close, + [""] = actions.close + }, + n = { + [""] = actions.close, + [""] = actions.close + } } + }, + extensions = { + ["ui-select"] = { + themes.get_dropdown({}) + }, + } }) telescope.load_extension("fzf") diff --git a/neovim/treesitter.lua b/neovim/treesitter.lua index eca7e14..a9750c6 100644 --- a/neovim/treesitter.lua +++ b/neovim/treesitter.lua @@ -1,14 +1,93 @@ require('nvim-treesitter.configs').setup({ - highlight = { - enable = true, + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + node_decremental = "", + scope_incremental = false, }, - incremental_selection = { + }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, + ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, + ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, + ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, + + ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, + ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, + + ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, + ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, + + ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, + ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, + + ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, + ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, + + ["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" }, + ["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" }, + + ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, + }, + move = { enable = true, - keymaps = { - init_selection = "v", - node_decremental = "<", - node_incremental = ">", - scope_incremental = false, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]f"] = { query = "@call.outer", desc = "Next function call start" }, + ["]m"] = { query = "@function.outer", desc = "Next method/function def start" }, + ["]c"] = { query = "@class.outer", desc = "Next class start" }, + ["]i"] = { query = "@conditional.outer", desc = "Next conditional start" }, + ["]l"] = { query = "@loop.outer", desc = "Next loop start" }, + + -- You can pass a query group to use query from `queries//.scm file in your runtime path. + -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. + ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, + ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, }, + goto_next_end = { + ["]F"] = { query = "@call.outer", desc = "Next function call end" }, + ["]M"] = { query = "@function.outer", desc = "Next method/function def end" }, + ["]C"] = { query = "@class.outer", desc = "Next class end" }, + ["]I"] = { query = "@conditional.outer", desc = "Next conditional end" }, + ["]L"] = { query = "@loop.outer", desc = "Next loop end" }, + }, + goto_previous_start = { + ["[f"] = { query = "@call.outer", desc = "Prev function call start" }, + ["[m"] = { query = "@function.outer", desc = "Prev method/function def start" }, + ["[c"] = { query = "@class.outer", desc = "Prev class start" }, + ["[i"] = { query = "@conditional.outer", desc = "Prev conditional start" }, + ["[l"] = { query = "@loop.outer", desc = "Prev loop start" }, + }, + goto_previous_end = { + ["[F"] = { query = "@call.outer", desc = "Prev function call end" }, + ["[M"] = { query = "@function.outer", desc = "Prev method/function def end" }, + ["[C"] = { query = "@class.outer", desc = "Prev class end" }, + ["[I"] = { query = "@conditional.outer", desc = "Prev conditional end" }, + ["[L"] = { query = "@loop.outer", desc = "Prev loop end" }, + }, + }, + lsp_interop = { + enable = true, + border = 'none', + floating_preview_opts = {}, + peek_definition_code = { + ["df"] = "@function.outer", + ["dF"] = "@class.outer", + }, + }, }, + }, }) diff --git a/picocom.nix b/picocom.nix new file mode 100644 index 0000000..3194059 --- /dev/null +++ b/picocom.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + home.packages = [ pkgs.picocom ]; +} diff --git a/podman.nix b/podman.nix new file mode 100644 index 0000000..8cdbd28 --- /dev/null +++ b/podman.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + home.packages = [ pkgs.podman ]; +} diff --git a/private.nix b/private.nix new file mode 100644 index 0000000..0194cc4 --- /dev/null +++ b/private.nix @@ -0,0 +1,38 @@ +{ pkgs, user, ... }: + +{ + home.username = user; + home.homeDirectory = "/home/${user}"; + + home.stateVersion = "24.05"; # Please read the comment before changing. + + home.packages = with pkgs; [ + pavucontrol + gnumake + gcc + thunderbird + keepassxc + light + element-desktop + darktable + kubectl + kubectx + simple-scan + calibre + libreoffice + gthumb + gimp + evince + inkscape + chromium + ]; + + programs.home-manager.enable = true; + + imports = [ + ./firefox.nix + ./kitty.nix + ./nextcloud.nix + ./sway + ]; +} diff --git a/bat.nix b/shell/bat.nix similarity index 100% rename from bat.nix rename to shell/bat.nix diff --git a/carapace.nix b/shell/carapace.nix similarity index 98% rename from carapace.nix rename to shell/carapace.nix index 2705a18..3b137ec 100644 --- a/carapace.nix +++ b/shell/carapace.nix @@ -5,4 +5,3 @@ enableZshIntegration = true; }; } - diff --git a/shell/default.nix b/shell/default.nix new file mode 100644 index 0000000..575337c --- /dev/null +++ b/shell/default.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + difftastic + htop + jq + unzip + xclip + ]; + + imports = [ + ./bat.nix + ./carapace.nix + ./direnv.nix + ./eza.nix + ./fzf.nix + ./ripgrep.nix + ./rsync.nix + ./shell_aliases.nix + ./starship.nix + ./tree.nix + ./zoxide.nix + ./zsh.nix + ]; +} diff --git a/direnv.nix b/shell/direnv.nix similarity index 100% rename from direnv.nix rename to shell/direnv.nix diff --git a/shell/eza.nix b/shell/eza.nix new file mode 100644 index 0000000..7422f80 --- /dev/null +++ b/shell/eza.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + programs.eza = { + enable = true; + git = true; + extraOptions = [ "--group-directories-first" ]; + }; +} diff --git a/fzf.nix b/shell/fzf.nix similarity index 100% rename from fzf.nix rename to shell/fzf.nix diff --git a/shell/ripgrep.nix b/shell/ripgrep.nix new file mode 100644 index 0000000..feb6335 --- /dev/null +++ b/shell/ripgrep.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + programs = { + ripgrep = { + enable = true; + }; + }; +} diff --git a/shell/rsync.nix b/shell/rsync.nix new file mode 100644 index 0000000..f1cef88 --- /dev/null +++ b/shell/rsync.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + home.packages = [ pkgs.rsync ]; +} diff --git a/shell/shell_aliases.nix b/shell/shell_aliases.nix new file mode 100644 index 0000000..762ac23 --- /dev/null +++ b/shell/shell_aliases.nix @@ -0,0 +1,11 @@ +{ ... }: + +{ + home.shellAliases = { + g = "git"; + gg = "git graph"; + gs = "git status"; + gd = "git diff"; + k = "kubectl"; + }; +} diff --git a/starship.nix b/shell/starship.nix similarity index 100% rename from starship.nix rename to shell/starship.nix diff --git a/shell/tree.nix b/shell/tree.nix new file mode 100644 index 0000000..0a8fb13 --- /dev/null +++ b/shell/tree.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + home.packages = [ pkgs.tree ]; +} diff --git a/zoxide.nix b/shell/zoxide.nix similarity index 98% rename from zoxide.nix rename to shell/zoxide.nix index 435b381..043ffeb 100644 --- a/zoxide.nix +++ b/shell/zoxide.nix @@ -6,4 +6,3 @@ enableZshIntegration = true; }; } - diff --git a/zsh.nix b/shell/zsh.nix similarity index 78% rename from zsh.nix rename to shell/zsh.nix index e95a159..f451771 100644 --- a/zsh.nix +++ b/shell/zsh.nix @@ -13,6 +13,10 @@ in highlight = zsh_autosuggest_highlight_style; }; + syntaxHighlighting = { + enable = true; + }; + initExtra = '' function set_win_title(){ local TITLE=$(git config --get remote.origin.url || echo "$PWD") @@ -21,11 +25,5 @@ in precmd_functions+=(set_win_title) ''; - - shellAliases = { - ls = "eza --group-directories-first --git"; - neovide = "neovide --multigrid"; - xclip = "xclip -selection clipboard"; - }; }; }