From a7b8255fd3e038633973d019c92c0784e6b5bace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Niemier?= Date: Tue, 30 Jan 2024 11:02:19 +0100 Subject: [PATCH] ft: big update for a lot of stuff --- Makefile | 2 +- certs/.gitignore | 6 - certs/Makefile | 62 --- dev_shells.nix | 6 +- flake.lock | 424 ++++++++++++++++-- flake.nix | 166 ++++--- git/.config/git/attributes | 30 -- git/.config/git/config | 132 ------ git/.config/git/hooks.d/email/pre-commit | 12 - git/.config/git/hooks.d/lfs/post-checkout | 3 - git/.config/git/hooks.d/lfs/post-commit | 3 - git/.config/git/hooks.d/lfs/post-merge | 3 - git/.config/git/hooks.d/lfs/pre-push | 3 - git/.config/git/hooks.d/swears/pre-commit | 5 - git/.config/git/hooks.d/swears/swears/en | 377 ---------------- git/.config/git/hooks.d/swears/swears/pl | 53 --- .../hooks.d/trailing-whitespaces/pre-commit | 25 -- .../git/hooks.d/unresolved-merge/pre-commit | 10 - git/.config/git/hooks.d/wip-check/pre-push | 58 --- git/.config/git/hooks/hook.sh | 88 ---- git/.config/git/hooks/post-checkout | 1 - git/.config/git/hooks/post-commit | 1 - git/.config/git/hooks/post-merge | 1 - git/.config/git/hooks/pre-commit | 1 - git/.config/git/hooks/pre-push | 1 - git/.config/git/hooks/prepare-commit-msg | 1 - git/.config/git/ignore | 82 ---- {nix => hosts/modules}/environment.nix | 9 - hosts/niuniobook.nix | 15 +- modules/common.nix | 21 +- modules/ctags.nix | 15 +- modules/curl.nix | 2 +- modules/darwin.nix | 3 +- modules/direnv.nix | 2 +- modules/email.nix | 33 ++ modules/fish.nix | 43 +- modules/git.nix | 80 +++- modules/git/ignore | 1 + modules/iosevka.nix | 41 +- modules/nixd.nix | 5 + modules/nvim.nix | 1 + modules/plan.nix | 2 +- modules/swiftbar.nix | 11 + modules/tools.nix | 10 + pkgs/default.nix | 30 +- pkgs/imbox.nix | 14 + pkgs/prr.nix | 35 ++ pkgs/ubin-client.nix | 17 + users/hauleth.nix | 35 ++ misc/.dir_colors => users/modules/dircolors | 0 users/modules/dircolors.nix | 7 + vim/.config/nvim/after/ftplugin/prr.vim | 3 + vim/.config/nvim/fnl/langclient.fnl | 9 +- vim/.config/nvim/fnl/plugins.fnl | 3 +- vim/.config/nvim/ftdetect/custom.vim | 1 + vim/.config/nvim/init.fnl | 4 +- vim/.config/nvim/plugin/pastebin.vim | 4 +- vim/.config/nvim/syntax/prr.vim | 41 ++ 58 files changed, 852 insertions(+), 1201 deletions(-) delete mode 100644 certs/.gitignore delete mode 100644 certs/Makefile delete mode 100644 git/.config/git/attributes delete mode 100644 git/.config/git/config delete mode 100755 git/.config/git/hooks.d/email/pre-commit delete mode 100755 git/.config/git/hooks.d/lfs/post-checkout delete mode 100755 git/.config/git/hooks.d/lfs/post-commit delete mode 100755 git/.config/git/hooks.d/lfs/post-merge delete mode 100755 git/.config/git/hooks.d/lfs/pre-push delete mode 100755 git/.config/git/hooks.d/swears/pre-commit delete mode 100644 git/.config/git/hooks.d/swears/swears/en delete mode 100644 git/.config/git/hooks.d/swears/swears/pl delete mode 100755 git/.config/git/hooks.d/trailing-whitespaces/pre-commit delete mode 100755 git/.config/git/hooks.d/unresolved-merge/pre-commit delete mode 100644 git/.config/git/hooks.d/wip-check/pre-push delete mode 100755 git/.config/git/hooks/hook.sh delete mode 120000 git/.config/git/hooks/post-checkout delete mode 120000 git/.config/git/hooks/post-commit delete mode 120000 git/.config/git/hooks/post-merge delete mode 120000 git/.config/git/hooks/pre-commit delete mode 120000 git/.config/git/hooks/pre-push delete mode 120000 git/.config/git/hooks/prepare-commit-msg delete mode 100644 git/.config/git/ignore rename {nix => hosts/modules}/environment.nix (77%) create mode 100644 modules/email.nix create mode 100644 modules/nixd.nix create mode 100644 modules/swiftbar.nix create mode 100644 modules/tools.nix create mode 100644 pkgs/imbox.nix create mode 100644 pkgs/prr.nix create mode 100644 pkgs/ubin-client.nix create mode 100644 users/hauleth.nix rename misc/.dir_colors => users/modules/dircolors (100%) create mode 100644 users/modules/dircolors.nix create mode 100644 vim/.config/nvim/after/ftplugin/prr.vim create mode 100644 vim/.config/nvim/syntax/prr.vim diff --git a/Makefile b/Makefile index a1a78c4..f12e99f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TARGETS ?= vim wm misc +TARGETS ?= vim all: nix $(TARGETS) diff --git a/certs/.gitignore b/certs/.gitignore deleted file mode 100644 index 3d1a9de..0000000 --- a/certs/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.key -*.csr -*.crt -*.pem -*.srl -*.conf diff --git a/certs/Makefile b/certs/Makefile deleted file mode 100644 index 78113cd..0000000 --- a/certs/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -DOMAIN ?= localhost -NAME ?= ${DOMAIN} - -CAKEY ?= CAkey.key -CACERT ?= CAcert.pem - -SIGN_REQ ?= ${NAME}.csr -CERT ?= ${NAME}.crt -PEM ?= ${NAME}.pem -KEY ?= ${NAME}.key - -CA = "/C=PL/ST=Wlkp/O=/localityName=Poznan/CN=Hauleth/emailAddress=lukasz@niemier.pl" - -SUBJECT = "/CN=*.${DOMAIN}" - -VERIFY_OPTS = -purpose sslserver -CAfile ${CACERT} - -verify: ${PEM} ${CACERT} - openssl version - openssl x509 -noout -text -in "$<" - openssl verify ${VERIFY_OPTS} -verify_hostname ${DOMAIN} $< - openssl verify ${VERIFY_OPTS} -verify_hostname test.${DOMAIN} $< - -clean: - $(RM) -f "${CERT}" "${SIGN_REQ}" "${PEM}" "${KEY}" - -${CAKEY}: - openssl genrsa -out "$@" 2048 - -${CACERT}: ${CAKEY} - openssl req -new -key "$<" -out "$@" \ - -subj ${CA} -x509 -nodes -sha256 -days 1825 - -installCA: ${CACERT} - security import "$<" - security add-trusted-cert "$<" - -cleanCA: - security remove-trusted-cert "${CACERT}" - $(RM) -f "${CACERT}" "${CAKEY}" - -config.conf: - echo 'subjectAltName=$${ENV::SAN}' > "$@" - -${KEY}: - openssl genrsa -out "$@" 2048 - -${SIGN_REQ}: ${KEY} - openssl req -new -sha256 -subj $(SUBJECT) -key "$<" -out "$@" \ - -addext "subjectAltName=DNS:${DOMAIN},DNS:*.${DOMAIN}" - -${CERT}: ${SIGN_REQ} ${CACERT} ${CAKEY} config.conf - SAN="DNS:${DOMAIN},DNS:*.${DOMAIN}" \ - openssl x509 -req -out "$@" -in ${SIGN_REQ} \ - -CA ${CACERT} -CAkey ${CAKEY} -CAcreateserial \ - -days 365 -sha256 \ - -extfile config.conf - -${PEM}: ${CERT} ${KEY} - cat ${CERT} ${KEY} > "$@" - -.PHONY: clean verify install installCA cleanCA diff --git a/dev_shells.nix b/dev_shells.nix index ef982cc..11fd38e 100644 --- a/dev_shells.nix +++ b/dev_shells.nix @@ -5,9 +5,11 @@ lib, stdenv, darwin, + lexical, + livebook, }: { livebook = pkgs.mkShell { - packages = with beam.packages.erlang; [ + packages = [ livebook ]; @@ -28,7 +30,7 @@ packages = [ elixir - elixir-ls + lexical ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.CoreFoundation diff --git a/flake.lock b/flake.lock index 101e4dc..8fb9cb4 100644 --- a/flake.lock +++ b/flake.lock @@ -2,19 +2,17 @@ "nodes": { "agnoster": { "inputs": { - "flake-utils": [ - "flake-utils" - ], + "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1625824140, - "narHash": "sha256-0/FgJlQULIXKhQIt3z3ugAGubgMlwFZa/cjGjiq7BcA=", + "lastModified": 1703255311, + "narHash": "sha256-M3qjuDNwApF/YgHOIoOm2tE7XMnfwYXqGXfYRBVGvEA=", "owner": "hauleth", "repo": "agnoster", - "rev": "7312ebb59769d5ff503fd06b174103f0f7ba368a", + "rev": "11e25b851f3087b8e64285e07cc6498cb2d6b6ff", "type": "github" }, "original": { @@ -23,6 +21,25 @@ "type": "github" } }, + "beam": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1705850239, + "narHash": "sha256-Mvnu0c+Hoahju/hI/2EdhrZCdU3r7Yhnp/wyEiVZFcU=", + "owner": "shanesveller", + "repo": "nix-beam-flakes", + "rev": "842337993cb8f7c52c723b3d4cb0bfa1b71a4299", + "type": "github" + }, + "original": { + "owner": "shanesveller", + "repo": "nix-beam-flakes", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -30,11 +47,11 @@ ] }, "locked": { - "lastModified": 1684148371, - "narHash": "sha256-CEVaArsziqantqU418XXruNDjPZN/HC3x1rqr2D4g+o=", + "lastModified": 1705915768, + "narHash": "sha256-+Jlz8OAqkOwJlioac9wtpsCnjgGYUhvLpgJR/5tP9po=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0dbf1c2fb1a5a0372a324eff1ba44f9da66febd2", + "rev": "1e706ef323de76236eb183d7784f3bd57255ec0b", "type": "github" }, "original": { @@ -43,21 +60,109 @@ "type": "github" } }, - "flake-utils": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { "inputs": { - "systems": "systems" + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1634851050, + "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "c91f3de5adaf1de973b797ef7485e441a65b8935", "type": "github" }, "original": { - "id": "flake-utils", - "type": "indirect" + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } }, "flake-utils_2": { @@ -75,6 +180,46 @@ "type": "github" } }, + "flake-utils_3": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -82,11 +227,11 @@ ] }, "locked": { - "lastModified": 1684061181, - "narHash": "sha256-EJpZ+Drpt3aHpowddpsQFBWsqLSJHyP6dnremTVMdWw=", + "lastModified": 1706221476, + "narHash": "sha256-T4b8YafVjHXvtDY8ARec1WrXO8uyyNZOpNgv9yoQy2M=", "owner": "nix-community", "repo": "home-manager", - "rev": "e4272987f785a8848205263abb4911b922c21e1b", + "rev": "c7ce343d9bf1a329056a4dd5b32ea8cc43b55e15", "type": "github" }, "original": { @@ -94,17 +239,79 @@ "type": "indirect" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705879479, + "narHash": "sha256-ZIohbyly1KOe+8I3gdyNKgVN/oifKdmeI0DzMfytbtg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2d47379ad591bcb14ca95a90b6964b8305f6c913", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "lexical": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_2", + "systems": "systems" + }, + "locked": { + "lastModified": 1705938621, + "narHash": "sha256-GV9nJu+D2OacTSubXrGyTU8m2XDyMC13wKLd9i7DQcw=", + "owner": "lexical-lsp", + "repo": "lexical", + "rev": "556958bc67ed8417425a0fb3cde9ea5d5bb49877", + "type": "github" + }, + "original": { + "owner": "lexical-lsp", + "repo": "lexical", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705915768, + "narHash": "sha256-+Jlz8OAqkOwJlioac9wtpsCnjgGYUhvLpgJR/5tP9po=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "1e706ef323de76236eb183d7784f3bd57255ec0b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-elixir": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1672929845, - "narHash": "sha256-wLd7006LmsVZJcok8QMzeHjFFS7bOivsKP52QNeR5UU=", + "lastModified": 1704300128, + "narHash": "sha256-G5qMIxeoKvcXjsBOP32E9UCh0Atjvc/mcatG8MH8QZ4=", "owner": "hauleth", "repo": "nix-elixir", - "rev": "b461d4d95a8797efc96c375bc82e88d849efabe6", + "rev": "fcdeded8314bed0ef21b7d9b25a17b2d290f2bc3", "type": "github" }, "original": { @@ -115,25 +322,108 @@ }, "nixpkgs": { "locked": { - "lastModified": 1669867399, - "narHash": "sha256-Z8RXSFYOsIsTG96ROKtV0eZ8Q7u4irFWm6ELqfw7mT8=", + "lastModified": 1705677747, + "narHash": "sha256-eyM3okYtMgYDgmYukoUzrmuoY4xl4FUujnsv/P6I/zI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bbe7d8f876fbbe7c959c90ba2ae2852220573261", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "38e591dd05ffc8bdf79dc752ba78b05e370416fa", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", "type": "github" }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "dir": "lib", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_3": { + "locked": { + "dir": "lib", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1699725108, + "narHash": "sha256-NTiPW4jRC+9puakU4Vi8WpFEirhp92kTOSThuZke+FA=", + "path": "/nix/store/1ryprai4bllkrna60cmcygxc4qyn79s1-source", + "rev": "911ad1e67f458b6bcf0278fa85e33bb9924fed7e", + "type": "path" + }, "original": { "id": "nixpkgs", "type": "indirect" } }, - "nixpkgs_2": { + "nixpkgs_3": { + "locked": { + "lastModified": 1704008649, + "narHash": "sha256-rGPSWjXTXTurQN9beuHdyJhB8O761w1Zc5BqSSmHvoM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d44d59d2b5bd694cd9d996fd8c51d03e3e9ba7f7", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_4": { "locked": { - "lastModified": 1684120848, - "narHash": "sha256-gIwJ5ac1FwZEkCRwjY+gLwgD4G1Bw3Xtr2jr2XihMPo=", + "lastModified": 1706173671, + "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0cb867999eec4085e1c9ca61c09b72261fa63bb4", + "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", "type": "github" }, "original": { @@ -142,14 +432,69 @@ "type": "indirect" } }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts_4", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1706281253, + "narHash": "sha256-MH9HOZCjeCGP5ZPiqYlO3X/HO+qLC/TqlL6+lPxJiV4=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "d13755597173dacd2023f48ac7724498402f2521", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_3", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705757126, + "narHash": "sha256-Eksr+n4Q8EYZKAN0Scef5JK4H6FcHc+TKNHb95CWm+c=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "f56597d53fd174f796b5a7d3ee0b494f9e2285cc", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "agnoster": "agnoster", + "beam": "beam", "darwin": "darwin", - "flake-utils": "flake-utils", + "flake-parts": "flake-parts_2", "home-manager": "home-manager", + "lexical": "lexical", "nix-elixir": "nix-elixir", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_4", + "nixvim": "nixvim" } }, "systems": { @@ -166,6 +511,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index f4f6720..a09389d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,8 @@ inputs = { nixpkgs.url = "nixpkgs/nixpkgs-unstable"; - flake-utils.url = "flake:flake-utils"; + flake-parts.url = "flake:flake-parts"; + home-manager = { url = "flake:home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -11,7 +12,6 @@ agnoster = { url = "github:hauleth/agnoster"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "flake-utils"; }; nix-elixir.url = "github:hauleth/nix-elixir"; # nix-elixir.url = "flake:nix-elixir"; @@ -19,53 +19,93 @@ url = "github:lnl7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; + + lexical.url = "github:lexical-lsp/lexical"; + + beam.url = "github:shanesveller/nix-beam-flakes"; + + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, - darwin, - nixpkgs, - home-manager, - agnoster, - flake-utils, - nix-elixir, + flake-parts, ... - } @ inputs: let - overlays = [ - agnoster.overlay - nix-elixir.overlay - (import ./pkgs) - ]; - in - flake-utils.lib.eachDefaultSystem - (system: let - pkgs = import nixpkgs {inherit system overlays;}; - in { - formatter = pkgs.alejandra; + } @ inputs: + flake-parts.lib.mkFlake {inherit inputs;} { + flake = { + lib = { + readFileWithComments = path: let + lib = inputs.nixpkgs.lib; + content = lib.strings.fileContents path; + notComment = line: !lib.strings.hasPrefix "#" line; + in + builtins.filter notComment (lib.strings.splitString "\n" content); + }; - packages = { - home = pkgs.writeScriptBin "activate-home" '' - ${home-manager.packages.${system}.default}/bin/home-manager --flake "${self}" "$@" - ''; + # TODO: Automatically discover and build that + darwinConfigurations."NiunioBook" = + (import ./hosts/niuniobook.nix {inherit inputs;}) + .system; + darwinConfigurations."MacBook-Pro" = + (import ./hosts/niuniobook.nix {inherit inputs;}) + .system; - system = let - emptyConfiguration = darwin.lib.darwinSystem { - inherit system; + homeConfigurations."hauleth" = + (import ./users/hauleth.nix {inherit inputs;}) + .home; - modules = []; + templates = { + elixir = { + path = ./templates/elixir; + description = "Basic requirements for Elixir applications"; }; - builder = - if pkgs.stdenv.isDarwin - then "${emptyConfiguration.system}/sw/bin/darwin-rebuild" - else pkgs.lib.getExe pkgs.nixos-rebuid; - in pkgs.writeScriptBin "activate-system" '' - ${builder} --flake "${self}#''$(hostname -s)" "$@" - ''; + }; }; - devShells = - (pkgs.callPackage ./dev_shells.nix {}) - // { + systems = ["x86_64-darwin" "aarch64-darwin"]; + + perSystem = { + self', + pkgs, + system, + inputs', + ... + }: { + formatter = pkgs.alejandra; + + packages = (pkgs.callPackage ./pkgs {}) // { + default = pkgs.writeScriptBin "activate" '' + echo ========= System ========= + ${pkgs.lib.getExe self'.packages.system} switch + echo + echo ========= Home ========= + ${pkgs.lib.getExe self'.packages.home} switch + ''; + + home = pkgs.writeScriptBin "activate-home" '' + ${pkgs.lib.getExe inputs'.home-manager.packages.default} --flake "${self}" "$@" + ''; + + system = let + builder = + if pkgs.stdenv.isDarwin + then pkgs.lib.getExe' inputs'.darwin.packages.darwin-rebuild "darwin-rebuild" + else pkgs.lib.getExe pkgs.nixos-rebuid; + in + pkgs.writeScriptBin "activate-system" '' + ${builder} --flake "${self}" "$@" + ''; + }; + + devShells = let + globalShells = pkgs.callPackage ./dev_shells.nix { + inherit (inputs'.lexical.packages) lexical; + inherit (inputs'.beam.packages) livebook; + }; default = pkgs.mkShell { packages = [ pkgs.fnlfmt @@ -73,56 +113,8 @@ pkgs.stow ]; }; - }; - }) - // { - lib = { - readFileWithComments = path: let - lib = nixpkgs.lib; - content = lib.strings.fileContents path; - notComment = line: !lib.strings.hasPrefix "#" line; in - builtins.filter notComment (lib.strings.splitString "\n" content); - }; - - # TODO: Automatically discover and build that - darwinConfigurations."NiunioBook" = - (import ./hosts/niuniobook.nix { - inherit inputs overlays; - }) - .system; - - homeConfigurations."hauleth" = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { - system = "x86_64-darwin"; - inherit overlays; - }; - - extraSpecialArgs = { - inherit inputs; - }; - - modules = [ - { - home.username = "hauleth"; - home.homeDirectory = "/Users/hauleth/"; - } - ./modules/fish.nix - ./modules/direnv.nix - ./modules/git.nix - ./modules/plan.nix - ./modules/ctags.nix - ./modules/curl.nix - { home.stateVersion = "22.11"; } - ]; - }; - - - templates = { - elixir = { - path = ./templates/elixir; - description = "Basic requirements for Elixir applications"; - }; + globalShells // {inherit default;}; }; }; } diff --git a/git/.config/git/attributes b/git/.config/git/attributes deleted file mode 100644 index 8aceb2f..0000000 --- a/git/.config/git/attributes +++ /dev/null @@ -1,30 +0,0 @@ -# Elixir -*.ex diff=elixir -*.exs diff=elixir -mix.lock merge=binary - -# Erlang -*.erl diff=erlang -*.hrl diff=erlang -rebar.lock merge=binary - -# TeX -*.tex diff=tex - -# Rust -*.rs diff=rust -Cargo.lock merge=binary - -# CSS -*.css diff=css - -# Ruby -*.rb diff=ruby - -# Python -*.py diff=python - -# Markdown -*.md diff=markdown -*.mdown diff=markdown -*.markdown diff=markdown diff --git a/git/.config/git/config b/git/.config/git/config deleted file mode 100644 index 4aa6d75..0000000 --- a/git/.config/git/config +++ /dev/null @@ -1,132 +0,0 @@ -[core] - commitGraph = true - -[pager] - difftool = true - diff = "diff-so-fancy | less --tabs=4 -RFX" - -[init] - defaultBranch = master - -[user] - useConfigOnly = true - -[feature] - experimental = true - manyFiles = true - -[alias] - ai = add -i - b = branch - ca = commit --amend - ci = commit - co = checkout - cob = checkout -b - lg = log --color --graph --abbrev-commit --pretty=simple-oneline - rci = commit --amend --reuse-message HEAD - squash = rebase --interactive --autosquash @{upstream} - rbase = "!git rebase --interactive --autosquash $(git merge-base $(git default-branch))" - st = status -sb - todo = grep -Ee '\\bTODO:?\\b' - fixme = grep -Ee '\\bFIX(ME)?:?\\b' - com = "!git checkout $(git default-branch)" - skip = update-index --skip-worktree - unskip = update-index --no-skip-worktree - default-branch = "!git symbolic-ref --short refs/remotes/origin/HEAD | sed 's|^origin/||'" - update = "!git rebase -i \"$(git merge-base HEAD \"$(git default-branch)\")\"" - cleanup = "!git branch --format=\"%(if:notequals=*)%(HEAD)%(then)%(if:notequals=${1:-$(git default-branch)})%(refname:lstrip=2)%(then)%(refname:lstrip=2)%(end)%(end)\" --merged "$(git default-branch)" | xargs -rpxL1 git branch -d" - -[pretty] - simple-oneline = "%C(yellow)%h%C(auto)%d %s [%C(green)%aN <%aE>%C(reset)] (%C(blue)%ar%C(reset))" - simple-oneline-sign = "%C(yellow)%h%C(auto)%d %s [%C(green)%aN <%aE>%C(reset)] (%C(blue)%ar%C(reset)) %G?" - -[merge] - conflictstyle = diff3 - -[branch] - autoSetupRebase = always -[push] - default = simple - autoSetupRemote = true - followTags = true - gpgSign = if-asked -[pull] - rebase = true - twohead = ort -[merge] - ff = false -[rebase] - autostash = true - autosquash = true - updateRefs = true -[fetch] - prune = true -[help] - autocorrect = 5 - -# Automatically sign all tags and commits -[tag] - forceSignAnnotated = true - sort = version:refname -[versionsort] - suffix = "" - suffix = "-rc" - suffix = "-pre" -[commit] - gpgSign = true - verbose = true - cleanup = scissors - -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true - -[rerere] - enabled = false - -[diff] - indentHeuristic = true - algorithm = histogram - mnemonicPrefix = true - tool = difftastic - -[diff "markdown"] - xfuncname = "^(#+\\s+.*)$" - -[difftool] - prompt = false - -[difftool "difftastic"] - cmd = difft "$LOCAL" "$REMOTE" - -[color] - ui = true - -[color.diff] - old = magenta - new = blue - -[color.diff-highlight] - oldNormal = "blue" - oldHighlight = "blue reverse" - newNormal = "yellow" - newHighlight = "yellow reverse" - -[pack] - useSparse = true - -[sendemail] - annotate = true - confirm = always - thread = true - supersscc = self - -[gpg] - ; format = ssh - -[gpg.ssh] - defaultKeyCommand = "ssh-add -L" - -# vim: ft=gitconfig noexpandtab sw=8 diff --git a/git/.config/git/hooks.d/email/pre-commit b/git/.config/git/hooks.d/email/pre-commit deleted file mode 100755 index db62611..0000000 --- a/git/.config/git/hooks.d/email/pre-commit +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -if ! git config --get user.email >/dev/null -then - printf "No identity set, set one using 'git identity '" \ - | cowsay -f dragon-and-cow -W 60 - echo "" - - git identity --list - - exit 1 -fi diff --git a/git/.config/git/hooks.d/lfs/post-checkout b/git/.config/git/hooks.d/lfs/post-checkout deleted file mode 100755 index 6467208..0000000 --- a/git/.config/git/hooks.d/lfs/post-checkout +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; } -git lfs post-checkout "$@" diff --git a/git/.config/git/hooks.d/lfs/post-commit b/git/.config/git/hooks.d/lfs/post-commit deleted file mode 100755 index be07131..0000000 --- a/git/.config/git/hooks.d/lfs/post-commit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; } -git lfs post-commit "$@" diff --git a/git/.config/git/hooks.d/lfs/post-merge b/git/.config/git/hooks.d/lfs/post-merge deleted file mode 100755 index 828b708..0000000 --- a/git/.config/git/hooks.d/lfs/post-merge +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; } -git lfs post-merge "$@" diff --git a/git/.config/git/hooks.d/lfs/pre-push b/git/.config/git/hooks.d/lfs/pre-push deleted file mode 100755 index 4eebedd..0000000 --- a/git/.config/git/hooks.d/lfs/pre-push +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; } -git lfs pre-push "$@" diff --git a/git/.config/git/hooks.d/swears/pre-commit b/git/.config/git/hooks.d/swears/pre-commit deleted file mode 100755 index ce7f444..0000000 --- a/git/.config/git/hooks.d/swears/pre-commit +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -SWEAR_DIR="$(dirname "${BASH_SOURCE[0]}")/swears" - -! find "${SWEAR_DIR}" -type f -print0 2> /dev/null | xargs -0 -n1 sh -c 'git diff --diff-filter=AR --cached | grep -wFf "$1"' -- diff --git a/git/.config/git/hooks.d/swears/swears/en b/git/.config/git/hooks.d/swears/swears/en deleted file mode 100644 index e6715c7..0000000 --- a/git/.config/git/hooks.d/swears/swears/en +++ /dev/null @@ -1,377 +0,0 @@ -2g1c -2 girls 1 cup -acrotomophilia -alabama hot pocket -alaskan pipeline -anal -anilingus -anus -apeshit -arsehole -ass -asshole -assmunch -auto erotic -autoerotic -babeland -baby batter -baby juice -ball gag -ball gravy -ball kicking -ball licking -ball sack -ball sucking -bangbros -bareback -barely legal -barenaked -bastard -bastardo -bastinado -bbw -bdsm -beaner -beaners -beaver cleaver -beaver lips -bestiality -big black -big breasts -big knockers -big tits -bimbos -birdlock -bitch -bitches -black cock -blonde action -blonde on blonde action -blowjob -blow job -blow your load -blue waffle -blumpkin -bollocks -bondage -boner -boob -boobs -booty call -brown showers -brunette action -bukkake -bulldyke -bullet vibe -bullshit -bung hole -bunghole -busty -butt -buttcheeks -butthole -camel toe -camgirl -camslut -camwhore -carpet muncher -carpetmuncher -chocolate rosebuds -circlejerk -cleveland steamer -clit -clitoris -clover clamps -clusterfuck -cock -cocks -coprolagnia -coprophilia -cornhole -coon -coons -creampie -cum -cumming -cunnilingus -cunt -darkie -date rape -daterape -deep throat -deepthroat -dendrophilia -dick -dildo -dingleberry -dingleberries -dirty pillows -dirty sanchez -doggie style -doggiestyle -doggy style -doggystyle -dog style -dolcett -domination -dominatrix -dommes -donkey punch -double dong -double penetration -dp action -dry hump -dvda -eat my ass -ecchi -ejaculation -erotic -erotism -escort -eunuch -faggot -fecal -felch -fellatio -feltch -female squirting -femdom -figging -fingerbang -fingering -fisting -foot fetish -footjob -frotting -fuck -fuck buttons -fuckin -fucking -fucktards -fudge packer -fudgepacker -futanari -gang bang -gay sex -genitals -giant cock -girl on -girl on top -girls gone wild -goatcx -goatse -god damn -gokkun -golden shower -goodpoop -goo girl -goregasm -grope -group sex -g-spot -guro -hand job -handjob -hard core -hardcore -hentai -homoerotic -honkey -hooker -hot carl -hot chick -how to kill -how to murder -huge fat -humping -incest -intercourse -jack off -jail bait -jailbait -jelly donut -jerk off -jigaboo -jiggaboo -jiggerboo -jizz -juggs -kike -kinbaku -kinkster -kinky -knobbing -leather restraint -leather straight jacket -lemon party -lolita -lovemaking -make me come -male squirting -masturbate -menage a trois -milf -missionary position -motherfucker -mound of venus -mr hands -muff diver -muffdiving -nambla -nawashi -negro -neonazi -nigga -nigger -nig nog -nimphomania -nipple -nipples -nsfw images -nude -nudity -nympho -nymphomania -octopussy -omorashi -one cup two girls -one guy one jar -orgasm -orgy -paedophile -paki -panties -panty -pedobear -pedophile -pegging -penis -phone sex -piece of shit -pissing -piss pig -pisspig -playboy -pleasure chest -pole smoker -ponyplay -poof -poon -poontang -punany -poop chute -poopchute -porn -porno -pornography -prince albert piercing -pthc -pubes -pussy -queaf -queef -quim -raghead -raging boner -rape -raping -rapist -rectum -reverse cowgirl -rimjob -rimming -rosy palm -rosy palm and her 5 sisters -rusty trombone -sadism -santorum -scat -schlong -scissoring -semen -sex -sexo -sexy -shaved beaver -shaved pussy -shemale -shibari -shit -shitblimp -shitty -shota -shrimping -skeet -slanteye -slut -s&m -smut -snatch -snowballing -sodomize -sodomy -spic -splooge -splooge moose -spooge -spread legs -spunk -strap on -strapon -strappado -strip club -style doggy -suck -sucks -suicide girls -sultry women -swastika -swinger -tainted love -taste my -tea bagging -threesome -throating -tied up -tight white -tit -tits -titties -titty -tongue in a -topless -tosser -towelhead -tranny -tribadism -tub girl -tubgirl -tushy -twat -twink -twinkie -two girls one cup -undressing -upskirt -urethra play -urophilia -vagina -venus mound -vibrator -violet wand -vorarephilia -voyeur -vulva -wank -wetback -wet dream -white power -wrapping men -wrinkled starfish -xx -xxx -yaoi -yellow showers -yiffy -zoophilia -🖕 diff --git a/git/.config/git/hooks.d/swears/swears/pl b/git/.config/git/hooks.d/swears/swears/pl deleted file mode 100644 index fa1a03c..0000000 --- a/git/.config/git/hooks.d/swears/swears/pl +++ /dev/null @@ -1,53 +0,0 @@ -burdel -burdelmama -chuj -chujnia -ciota -cipa -cyc -debil -dmuchać -do kurwy nędzy -dupa -dupek -duperele -dziwka -fiut -gówno -gówno prawda -huj -jajco -jajeczko -jajko -jajo -ja pierdolę -jebać -jebany -kurwa -kurwy -kutafon -kutas -lizać pałę -obciągać chuja -obciągać fiuta -obciągać loda -pieprzyć -pierdolec -pierdolić -pierdolnięty -pierdoła -pierdzieć -pizda -pojeb -popierdolony -robic loda -robić loda -ruchać -rzygać -skurwysyn -sraczka -srać -suka -syf -wkurwiać -zajebisty diff --git a/git/.config/git/hooks.d/trailing-whitespaces/pre-commit b/git/.config/git/hooks.d/trailing-whitespaces/pre-commit deleted file mode 100755 index b57da3d..0000000 --- a/git/.config/git/hooks.d/trailing-whitespaces/pre-commit +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# A git hook script to find and fix trailing whitespace -# in your commits. Bypass it with the --no-verify option -# to git-commit -# Ref - http://is.gd/PerowD -# - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# Find files with trailing whitespace -for FILE in $(exec git diff-index --check $against -- | sed '/^[+-]/d' | (sed -r 's/:[0-9]+:.*//' > /dev/null 2>&1 || sed -E 's/:[0-9]+:.*//') | uniq) ; do - # Fix them! - (sed -i 's/[[:space:]]*$//' "$FILE" > /dev/null 2>&1 || sed -i '' -E 's/[[:space:]]*$//' "$FILE") - git add "$FILE" - echo "NOTE: removed trailing whitespace from $FILE" -done - -exit diff --git a/git/.config/git/hooks.d/unresolved-merge/pre-commit b/git/.config/git/hooks.d/unresolved-merge/pre-commit deleted file mode 100755 index 412e875..0000000 --- a/git/.config/git/hooks.d/unresolved-merge/pre-commit +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -conflicts="$(git diff --cached --name-only -S'<<<<<<')" - -if [ -n "$conflicts" ] -then - echo "Unresolved merge conflicts in this commit:" - echo "$conflicts" - exit 1 -fi diff --git a/git/.config/git/hooks.d/wip-check/pre-push b/git/.config/git/hooks.d/wip-check/pre-push deleted file mode 100644 index 8b377ae..0000000 --- a/git/.config/git/hooks.d/wip-check/pre-push +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - - -z40=0000000000000000000000000000000000000000 - -IFS=' ' -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = "$z40" ] - then - # Handle delete - : - else - if [ "$remote_sha" = "$z40" ] - then - master_branch="$(git config --get riff.wip.master)" - # New branch, examine all commits - if [ -z "$master_branch" ] - then - range="$local_sha" - else - range="$local_sha...$master_branch" - fi - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit="$(git rev-list --count -i --grep '^WIP' "$range")" - if [ "$commit" -ne "0" ] - then - echo "Found WIP $commit commit(s) in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/git/.config/git/hooks/hook.sh b/git/.config/git/hooks/hook.sh deleted file mode 100755 index d3d2d6a..0000000 --- a/git/.config/git/hooks/hook.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -hooks=(post-checkout post-commit post-merge pre-commit pre-push prepare-commit-msg) - -usage() { - echo "$0 [install|help]" - echo 'Version 0.1.0' - echo 'Copyright (c) Łukasz Niemier ' - echo - echo 'Simple git hooks management system' - echo - echo 'install [hook_dir]' - echo ' Installs hooks for given repo.' - echo - echo ' [hook_dir] - directory where install hooks, defaults to .git/hooks' - echo ' in current Git working directory' - echo 'help' - echo ' display this message' - echo - echo 'To use this as default set of hooks when creating new repo then:' - echo - echo " 1. Run '$0 ~/.githooks'" - echo ' 2. Run 'git config --global core.hooksPath ~/.githooks'' - echo -} - -install() { - source="${BASH_SOURCE[0]}" - HOOK_DIR="${1:-"$(git rev-parse --show-toplevel)/.git/hooks"}" - - echo "Install handler" - echo - - mkdir -p "$HOOK_DIR" - cp -i "$source" "$HOOK_DIR/hook.sh" - - echo "Installing hooks" - echo - - for hook in "${hooks[@]}" - do - echo "Installing $hook" - ln -si "hook.sh" "$HOOK_DIR/$hook" - done -} - -hook() { - git_dir=$(git rev-parse --git-dir) - script="$(basename "$0")" - PLUG_DIRS=("$(command git config --global --get hooks.path)" "$git_dir/hooks/hooks.d" "$(command git config --worktree --get hooks.path)") - - test -d "$git_dir"/rebase-merge -o -d "$git_dir"/rebase-apply && exit 0 - - input="$(mktemp)" - touch "$input" - trap '{ rm -f "$input"; }' EXIT - cat - > "$input" - - for dir in "${PLUG_DIRS[@]}" - do - if [ -d "$dir" ] - then - find "$dir" -maxdepth 2 -and -name "$script" -print0 2>/dev/null \ - | xargs -0 -n1 -I% sh -c 'input="$1"; shift; if [ -x "$1" ]; then printf "\n## $(basename "$(dirname "$1")")\n" && "$@" < "$input" && echo ok; fi' -- "$input" % "$@" - retval="$?" - - if [ ! "$retval" -eq 0 ] - then - return "$retval" - fi - fi - done -} - -case "$1" in - install) - shift - install "$@" - exit - ;; - help|-h|--help|version|-v|-V|--version) - shift - usage - exit - ;; - *) - hook "$@" -esac diff --git a/git/.config/git/hooks/post-checkout b/git/.config/git/hooks/post-checkout deleted file mode 120000 index 4f8b6bb..0000000 --- a/git/.config/git/hooks/post-checkout +++ /dev/null @@ -1 +0,0 @@ -hook.sh \ No newline at end of file diff --git a/git/.config/git/hooks/post-commit b/git/.config/git/hooks/post-commit deleted file mode 120000 index 4f8b6bb..0000000 --- a/git/.config/git/hooks/post-commit +++ /dev/null @@ -1 +0,0 @@ -hook.sh \ No newline at end of file diff --git a/git/.config/git/hooks/post-merge b/git/.config/git/hooks/post-merge deleted file mode 120000 index 4f8b6bb..0000000 --- a/git/.config/git/hooks/post-merge +++ /dev/null @@ -1 +0,0 @@ -hook.sh \ No newline at end of file diff --git a/git/.config/git/hooks/pre-commit b/git/.config/git/hooks/pre-commit deleted file mode 120000 index 4f8b6bb..0000000 --- a/git/.config/git/hooks/pre-commit +++ /dev/null @@ -1 +0,0 @@ -hook.sh \ No newline at end of file diff --git a/git/.config/git/hooks/pre-push b/git/.config/git/hooks/pre-push deleted file mode 120000 index 4f8b6bb..0000000 --- a/git/.config/git/hooks/pre-push +++ /dev/null @@ -1 +0,0 @@ -hook.sh \ No newline at end of file diff --git a/git/.config/git/hooks/prepare-commit-msg b/git/.config/git/hooks/prepare-commit-msg deleted file mode 120000 index 4f8b6bb..0000000 --- a/git/.config/git/hooks/prepare-commit-msg +++ /dev/null @@ -1 +0,0 @@ -hook.sh \ No newline at end of file diff --git a/git/.config/git/ignore b/git/.config/git/ignore deleted file mode 100644 index d1efe2c..0000000 --- a/git/.config/git/ignore +++ /dev/null @@ -1,82 +0,0 @@ -# Compiled sources {{{ -*.com -*.class -*.dll -*.exe -*.o -*.so -# }}} -# Packages {{{ -*.7z -*.dmg -*.gz -*.iso -*.jar -*.rar -*.tar -*.xz -*.zip -# }}} -# Logs and databases {{{ -*.log -*.sqlite -# }}} -# OS generated files {{{ -.DS_Store -.DS_Store? -._* -.Trashes -ehthumbs.db -Thumbs.db -# }}} -# Codekits {{{ -.sass-cache/ -.codekit-config.json -config.codekit -# }}} -# Configs {{{ -.envrc -.direnv -.devenv -# }}} -# Editors {{{ -# VIM -Session.vim -.*.swo -.*.swp -*~ - -# Idea -.idea/ - -# Sublime -*.sublime-project - -# Atom -.tern-project -# }}} -# Temporary files {{{ -tmp/ -*.tmp -# }}} -# Other {{{ -.rake_tasks -.meteor/ -tags -tags.* -.gdb_history -perf.data* -oprofile_data -.tool-versions-e -# }}} - -# Tooling {{{ -.elixir_ls -.vagrant/ -# }}} - -# Stack {{{ -.stack-work -# }}} - -erl_crash.dump diff --git a/nix/environment.nix b/hosts/modules/environment.nix similarity index 77% rename from nix/environment.nix rename to hosts/modules/environment.nix index 88e106a..9f69bff 100644 --- a/nix/environment.nix +++ b/hosts/modules/environment.nix @@ -9,14 +9,12 @@ # _1password asciinema bat - comby coreutils entr findutils fswatch fzy gnupg - jq lima lnav neovim-remote @@ -25,17 +23,10 @@ # qmk rage ripgrep - rnix-lsp - senpai ]; environment.shells = [pkgs.fish pkgs.zsh]; - environment.variables = { - LESS = "-SRFXi"; - ERL_FLAGS = "-kernel shell_history enabled"; - }; - programs.nix-index.enable = true; programs.fish.enable = true; } diff --git a/hosts/niuniobook.nix b/hosts/niuniobook.nix index 4fb148f..1c8797b 100644 --- a/hosts/niuniobook.nix +++ b/hosts/niuniobook.nix @@ -1,15 +1,14 @@ -{ inputs -, overlays -, ... +{ + inputs, + ... }: { type = "darwin"; hostname = "NiunioBook"; system = inputs.darwin.lib.darwinSystem { - system = "x86_64-darwin"; + system = "aarch64-darwin"; modules = [ - { nixpkgs = { inherit overlays; }; } { # You should generally set this to the total number of logical cores in your system. # $ sysctl -n hw.ncpu @@ -19,7 +18,7 @@ ../modules/common.nix ../modules/darwin.nix ../modules/iosevka.nix - ../nix/environment.nix + ./modules/environment.nix ../modules/nvim.nix { system.stateVersion = 4; @@ -27,8 +26,6 @@ } ]; - inputs = { - dotfiles = inputs.self; - }; + inherit inputs; }; } diff --git a/modules/common.nix b/modules/common.nix index c6bfcef..cfc1805 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -1,5 +1,8 @@ -{ pkgs, inputs, ... }: { + pkgs, + inputs, + ... +}: { nixpkgs.config.allowUnfree = true; nix.useDaemon = true; @@ -9,12 +12,14 @@ pkgs.cachix ]; - nix.registry = { - nixpkgs.flake = inputs.nixpkgs; - dotfiles.flake = inputs.dotfiles; - } // pkgs.lib.optionals pkgs.stdenv.isDarwin { - darwin.flake = inputs.darwin; - }; + nix.registry = + { + nixpkgs.flake = inputs.nixpkgs; + dotfiles.flake = inputs.self; + } + // pkgs.lib.optionals pkgs.stdenv.isDarwin { + darwin.flake = inputs.darwin; + }; nix.package = pkgs.nixFlakes; nix.extraOptions = '' @@ -22,5 +27,7 @@ keep-derivations = true experimental-features = nix-command flakes + + extra-trusted-users = hauleth ''; } diff --git a/modules/ctags.nix b/modules/ctags.nix index a0535d7..906318c 100644 --- a/modules/ctags.nix +++ b/modules/ctags.nix @@ -1,10 +1,13 @@ -{ config, lib, pkgs, ... }: -let +{ + config, + lib, + pkgs, + ... +}: let toArg = k: v: "--${k}=${v}"; listToArgs = k: vs: map (toArg k) vs; attrsetToArgs = attr: lib.strings.concatStringsSep "\n" (lib.lists.flatten (lib.attrsets.mapAttrsToList listToArgs attr)); -in -{ +in { options.programs.ctags = { enable = lib.mkEnableOption "ctags"; @@ -17,7 +20,7 @@ in flags = lib.mkOption { type = lib.types.attrsOf lib.types.anything; - default = { }; + default = {}; }; }; @@ -60,7 +63,7 @@ in }; }; - home.packages = [ config.programs.ctags.package ]; + home.packages = [config.programs.ctags.package]; xdg.configFile.ctags = { target = "ctags/config.ctags"; diff --git a/modules/curl.nix b/modules/curl.nix index 2b720dc..69b7915 100644 --- a/modules/curl.nix +++ b/modules/curl.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { home.packages = [ pkgs.curl pkgs.curlie diff --git a/modules/darwin.nix b/modules/darwin.nix index 629d0dc..2af8669 100644 --- a/modules/darwin.nix +++ b/modules/darwin.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { nix.settings.extra-sandbox-paths = [ "/System/Library/Frameworks" "/System/Library/PrivateFrameworks" diff --git a/modules/direnv.nix b/modules/direnv.nix index 99792b1..a18a566 100644 --- a/modules/direnv.nix +++ b/modules/direnv.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs.direnv = { enable = true; diff --git a/modules/email.nix b/modules/email.nix new file mode 100644 index 0000000..461580f --- /dev/null +++ b/modules/email.nix @@ -0,0 +1,33 @@ +{pkgs, ...}: { + # programs.himalaya.enable = true; + programs.mbsync.enable = true; + programs.notmuch.enable = true; + programs.aerc.enable = true; + programs.aerc.extraConfig.general.unsafe-accounts-conf = true; + + accounts.email.accounts."hauleth" = { + realName = "Łukasz Niemier"; + userName = "hauleth"; + address = "~@hauleth.dev"; + primary = true; + + passwordCommand = "op item get i6gyiq3aro4lp2ys5xygfb7uwu --field password"; + + mbsync.enable = true; + notmuch.enable = true; + aerc.enable = true; + # himalaya.enable = true; + + imap = { + host = "mail.hauleth.dev"; + port = 993; + # tls = true; + }; + + smtp = { + host = "mail.hauleth.dev"; + port = 465; + # tls = true; + }; + }; +} diff --git a/modules/fish.nix b/modules/fish.nix index d33f193..2afa8dc 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -1,22 +1,45 @@ -{ config, pkgs, ... }: { +{ + config, + pkgs, + inputs, + ... +}: { + home.packages = [ + pkgs.eza + ]; + + programs.atuin = { + enable = true; + flags = ["--disable-up-arrow"]; + settings = { + style = "compact"; + inline_height = 15; + }; + }; + + # Disable home-manager provided man binary as it breaks on macOS + programs.man.enable = false; + + home.sessionVariables = { + PAGER = "${pkgs.less}/bin/less"; + LESS = "-SRFXi"; + ERL_FLAGS = "-kernel shell_history enabled"; + }; + programs.fish = { enable = true; plugins = [ { name = "agnoster"; - src = pkgs.fetchFromGitHub { - owner = "hauleth"; - repo = "agnoster"; - rev = "master"; - sha256 = "0/FgJlQULIXKhQIt3z3ugAGubgMlwFZa/cjGjiq7BcA="; - }; + src = inputs.agnoster; } ]; shellAliases = { git = "LC_CTYPE=UTF-8 LANG=C command git"; g = "git"; + ls = "eza"; }; functions = { @@ -24,10 +47,9 @@ if test (count $argv) -gt 0 && test -f $argv[1] || not isatty bat $argv else - ls -Alh $argv + eza -Alh --git $argv end ''; - ix = "curl --netrc-optional -F 'f:1=@-' ix.io | pbcopy"; }; loginShellInit = '' @@ -41,7 +63,8 @@ set -g fish_greeting function e --wraps nvim --description 'Run $EDITOR' - $EDITOR $argv + set -l cmd (string split ' ' $EDITOR) + eval $cmd[1] $cmd[2..] $argv end ulimit -n 10480 diff --git a/modules/git.nix b/modules/git.nix index ac83d9a..cff7ec2 100644 --- a/modules/git.nix +++ b/modules/git.nix @@ -1,4 +1,9 @@ -{ pkgs, inputs, ... }: { +{ + pkgs, + lib, + inputs, + ... +}: { programs.gh = { enable = true; @@ -9,24 +14,54 @@ ]; settings.aliases.co = "pr checkout"; + settings.version = "1"; }; - home.packages = - let - git-branchless-man = pkgs.runCommand "git-branchless-man" { } '' - mkdir -p $out/share/man - ${pkgs.git-branchless}/bin/git-branchless install-man-pages $out/share/man - ''; - in - [ - pkgs.git-absorb - pkgs.git-branchless - git-branchless-man - pkgs.git-gone - pkgs.git-revise - pkgs.gitAndTools.git-imerge - pkgs.gitAndTools.tig - ]; + # manual.manpages.enable = true; + + home.packages = let + git-branchless-man = pkgs.runCommand "git-branchless-man" {} '' + mkdir -p $out/share/man + ${pkgs.git-branchless}/bin/git-branchless install-man-pages $out/share/man + ''; + git-cliff = pkgs.rustPlatform.buildRustPackage { + pname = "git-cliff"; + version = "2.0.0-pre"; + + src = pkgs.fetchFromGitHub { + owner = "orhun"; + repo = "git-cliff"; + rev = "d408e6377a5157f6d285b2733e6640d36316cfd4"; + hash = "sha256-DqfcSSG/XmeFHckP9Mmv560WA9VJjhDhpYSkYT9YW9I="; + }; + + cargoHash = "sha256-Qw7ZHLWPgIKqCmjhHwJ4QEz/WQMxrR8eG3tAgAKN7v0="; + + buildNoDefaultFeatures = true; + buildFeatures = [ "github" ]; + + # attempts to run the program on .git in src which is not deterministic + doCheck = false; + + buildInputs = lib.optionals pkgs.stdenv.isDarwin [ + pkgs.darwin.apple_sdk.frameworks.CoreFoundation + pkgs.darwin.apple_sdk.frameworks.Security + pkgs.darwin.apple_sdk.frameworks.SystemConfiguration + ]; + }; + in [ + pkgs.git-absorb + pkgs.git-branchless + git-branchless-man + pkgs.git-gone + pkgs.git-chglog + git-cliff + pkgs.git-revise + pkgs.gitAndTools.git-imerge + pkgs.prr + pkgs.hut + inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.imbox + ]; programs.git = { enable = true; @@ -53,6 +88,10 @@ "*.md diff=markdown" "flake.lock merge=binary" + + "yarn.lock merge=binary" + + "*.lockb diff=lockb" ]; ignores = inputs.self.lib.readFileWithComments ./git/ignore; @@ -105,6 +144,11 @@ tool = "difftastic"; markdown.xfuncname = "^(#+\\s+.*)$"; + + lockb = { + textconv = "${pkgs.bun}/bin/bun"; + binary = true; + }; }; difftool = { @@ -122,7 +166,7 @@ sort = "version:refname"; }; - versionsort.suffix = [ "" "-rc" "-pre" ]; + versionsort.suffix = ["" "-rc" "-pre"]; push = { default = "simple"; diff --git a/modules/git/ignore b/modules/git/ignore index d1efe2c..bfc1bfe 100644 --- a/modules/git/ignore +++ b/modules/git/ignore @@ -72,6 +72,7 @@ oprofile_data # Tooling {{{ .elixir_ls +.lexical .vagrant/ # }}} diff --git a/modules/iosevka.nix b/modules/iosevka.nix index 637969c..5ff404d 100644 --- a/modules/iosevka.nix +++ b/modules/iosevka.nix @@ -1,11 +1,10 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let variants = { design = { i = "hooky"; l = "zshaped"; g = "single-storey-serifless"; - y = "straight"; + # y = "straight"; zero = "slashed"; dollar = "open"; percent = "dots"; @@ -46,44 +45,44 @@ let }; }; buildIosevka = pkgs.iosevka.override; - iosevka-ss09 = buildIosevka { + hosevka-ss09 = buildIosevka { set = "ss09"; privateBuildPlan = { - family = "Iosevka"; + family = "Hosevka"; inherit variants weights slopes; }; }; - iosevka-ss09-term = buildIosevka { + hosevka-ss09-term = buildIosevka { set = "ss09-term"; privateBuildPlan = { - family = "Iosevka Term"; + family = "Hosevka Term"; spacing = "term"; inherit variants weights slopes; }; }; - nf-patch = font: pkgs.stdenvNoCC.mkDerivation { - pname = "${font.pname}-nerd-font-patched"; - version = font.version; + nf-patch = font: + pkgs.stdenvNoCC.mkDerivation { + pname = "${font.pname}-nerd-font-patched"; + version = font.version; - src = font; + src = font; - nativeBuildInputs = [ pkgs.nerd-font-patcher ]; + nativeBuildInputs = [pkgs.nerd-font-patcher]; - buildPhase = '' - mkdir -p $out - find -name \*.ttf -exec nerd-font-patcher -o $out/share/fonts/truetype/ -c {} \; - ''; - installPhase = ""; - }; -in -{ + buildPhase = '' + mkdir -p $out + find -name \*.ttf -exec nerd-font-patcher -o $out/share/fonts/truetype/ -c {} \; + ''; + installPhase = ""; + }; +in { fonts = { fontDir.enable = true; fonts = [ pkgs.lato - (nf-patch iosevka-ss09-term) + (nf-patch hosevka-ss09-term) ]; }; } diff --git a/modules/nixd.nix b/modules/nixd.nix new file mode 100644 index 0000000..c6b91d8 --- /dev/null +++ b/modules/nixd.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + home.packages = [ + pkgs.nixd + ]; +} diff --git a/modules/nvim.nix b/modules/nvim.nix index 5074b80..ff6994b 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -1,6 +1,7 @@ { config, pkgs, + inputs, ... }: let nvim = pkgs.neovim.override { diff --git a/modules/plan.nix b/modules/plan.nix index 64676bf..02aef60 100644 --- a/modules/plan.nix +++ b/modules/plan.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { launchd.agents.plan-sync = { enable = pkgs.stdenv.isDarwin; config = { diff --git a/modules/swiftbar.nix b/modules/swiftbar.nix new file mode 100644 index 0000000..655eac1 --- /dev/null +++ b/modules/swiftbar.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + swiftbar + ]; + + targets.darwin.defaults = { + "com.ameba.SwiftBar" = { + PluginDirectory = "/Users/hauleth/.config/swift-bar/plugins/"; + }; + }; +} diff --git a/modules/tools.nix b/modules/tools.nix new file mode 100644 index 0000000..68e15e3 --- /dev/null +++ b/modules/tools.nix @@ -0,0 +1,10 @@ +{pkgs, inputs, config, ...}: { + home.packages = with pkgs; [ + # bfs + comby + senpai + jaq + jo + inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.ubin-client + ]; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 060c85a..330f732 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,30 +1,12 @@ -final: prev: { - beam = - prev.beam - // { - defaultVersion = "erlangR25"; +{callPackage, entr, ripgrep, writeShellApplication}: { + prr = callPackage ./prr.nix {}; + imbox = callPackage ./imbox.nix {}; + ubin-client = callPackage ./ubin-client.nix {}; - packages = - prev.beam.packages - // { - erlangR25 = prev.beam.packages.erlangR25.extend (efinal: eprev: { - elixir = eprev.elixir_1_14; - rebar3 = eprev.rebar3.overrideAttrs (_: { doCheck = false; }); - }); - }; - - packagesWith = erlang: - (prev.beam.packagesWith erlang).extend (efinal: eprev: { - livebook = eprev.livebook.override { elixir = efinal.elixir_1_14; }; - }); - }; - - livebook = final.beam.packages.livebook; - - fswatch = prev.writeShellApplication { + fswatch = writeShellApplication { name = "fswatch"; - runtimeInputs = [ final.entr final.ripgrep ]; + runtimeInputs = [entr ripgrep]; text = '' rg -l -t "$1" "" | entr -p echo /_ diff --git a/pkgs/imbox.nix b/pkgs/imbox.nix new file mode 100644 index 0000000..fcdb3b0 --- /dev/null +++ b/pkgs/imbox.nix @@ -0,0 +1,14 @@ +{ libressl, stdenv, fetchgit, lib, pkg-config }: stdenv.mkDerivation (self: { + pname = "imbox"; + version = "1.4"; + + src = fetchgit { + url = "https://git.causal.agency/imbox"; + rev = self.version; + hash = "sha256-y5GCH3miimOWSCvS+Kh/nOpNrIEpcoc9p8jlQqYuh7Q="; + }; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ libressl ]; + }) diff --git a/pkgs/prr.nix b/pkgs/prr.nix new file mode 100644 index 0000000..2d70033 --- /dev/null +++ b/pkgs/prr.nix @@ -0,0 +1,35 @@ +{ stdenv, rustPlatform, openssl, darwin, fetchFromGitHub, lib, pkg-config }: + +rustPlatform.buildRustPackage rec { + pname = "prr"; + version = "0.16.0"; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = + [ + openssl + ] + ++ lib.optional stdenv.isDarwin (with darwin.apple_sdk; [ + frameworks.Security + frameworks.SystemConfiguration + ]); + + src = fetchFromGitHub { + owner = "danobi"; + repo = pname; + rev = "v${version}"; + hash = lib.fakeHash; + }; + + cargoHash = lib.fakeHash; + + meta = with lib; { + description = "Mailing list style code reviews for GitHub"; + homepage = "https://github.com/danobi/prr"; + license = licenses.gpl2; + maintainers = []; + }; + } diff --git a/pkgs/ubin-client.nix b/pkgs/ubin-client.nix new file mode 100644 index 0000000..479cd28 --- /dev/null +++ b/pkgs/ubin-client.nix @@ -0,0 +1,17 @@ +{writeShellApplication, curl}: writeShellApplication { + name = "ubin"; + + runtimeInputs = [curl]; + + text = '' + URL="https://bin.hauleth.dev/" + + if [[ $# -eq 1 ]]; then + FILEPATH="$1" + fi + + PASTELINK=$(curl --netrc-optional --data-binary "@''${FILEPATH:-/dev/stdin}" --url "$URL") + + echo "$PASTELINK" + ''; +} diff --git a/users/hauleth.nix b/users/hauleth.nix new file mode 100644 index 0000000..35cbfb7 --- /dev/null +++ b/users/hauleth.nix @@ -0,0 +1,35 @@ +{ + inputs, + ... +}: { + username = "hauleth"; + + home = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = import inputs.nixpkgs { + system = "aarch64-darwin"; + }; + + extraSpecialArgs = { + inherit inputs; + }; + + modules = [ + { + home.username = "hauleth"; + home.homeDirectory = "/Users/hauleth/"; + } + ../modules/fish.nix + ../modules/direnv.nix + ../modules/git.nix + ../modules/plan.nix + ../modules/ctags.nix + ../modules/curl.nix + ../modules/tools.nix + ../modules/nixd.nix + ../modules/swiftbar.nix + ../modules/email.nix + ./modules/dircolors.nix + {home.stateVersion = "23.05";} + ]; + }; +} diff --git a/misc/.dir_colors b/users/modules/dircolors similarity index 100% rename from misc/.dir_colors rename to users/modules/dircolors diff --git a/users/modules/dircolors.nix b/users/modules/dircolors.nix new file mode 100644 index 0000000..fe46ae3 --- /dev/null +++ b/users/modules/dircolors.nix @@ -0,0 +1,7 @@ +{...}: { + programs.dircolors = { + enable = true; + + extraConfig = builtins.readFile ./dircolors; + }; +} diff --git a/vim/.config/nvim/after/ftplugin/prr.vim b/vim/.config/nvim/after/ftplugin/prr.vim new file mode 100644 index 0000000..b6b8773 --- /dev/null +++ b/vim/.config/nvim/after/ftplugin/prr.vim @@ -0,0 +1,3 @@ +setlocal foldmethod=syntax + +let b:undo_ftplugin = 'setl fdm&' diff --git a/vim/.config/nvim/fnl/langclient.fnl b/vim/.config/nvim/fnl/langclient.fnl index 6ea3bf0..b302a9b 100644 --- a/vim/.config/nvim/fnl/langclient.fnl +++ b/vim/.config/nvim/fnl/langclient.fnl @@ -25,7 +25,6 @@ (on LspAttach "*" (let [bufnr args.buf client (vim.lsp.get_client_by_id args.data.client_id)] - (cmd.packadd! :fidget.nvim) ((. (require :fidget) :setup) {}) (logger.inspect client) (local capable? @@ -69,16 +68,14 @@ (setup :rust_analyzer {:settings {:rust-analyzer {:files {:excludeDirs [".direnv"]}}}}) -; (setup :elixirls -; {:cmd [:elixir-ls] -; :settings {:elixirLS {:dialyzerEnabled false}}}) (setup :lexical {:cmd [:lexical :start]}) (setup :erlangls {:cmd [:erlang_ls]}) -; (setup :rnix -; {:autostart true}) +(setup :zls {}) + +(setup :nixd {:autostart true}) (augroup lsp-direnv (on User :DirenvLoaded (cmd.LspStart))) diff --git a/vim/.config/nvim/fnl/plugins.fnl b/vim/.config/nvim/fnl/plugins.fnl index 1906f5b..1f0823a 100644 --- a/vim/.config/nvim/fnl/plugins.fnl +++ b/vim/.config/nvim/fnl/plugins.fnl @@ -46,7 +46,7 @@ (pkg :nvim-treesitter/playground {:cmd [:TSPlaygroundToggle :TSHighlightCaputresUnderCursor]}) - (pkg :j-hui/fidget.nvim {:opt true}) + (pkg :j-hui/fidget.nvim {:tag :legacy}) ; Code manipulation (pkg :AndrewRadev/splitjoin.vim @@ -77,7 +77,6 @@ (pkg :hauleth/vim-backscratch {:cmd [:Scratch]}) (pkg "https://gitlab.com/hauleth/qfx.vim.git") (pkg "https://gitlab.com/hauleth/smart.vim.git") - (pkg :sgur/vim-editorconfig) (pkg :mbbill/undotree {:cmd [:UndotreeShow :UndotreeToggle]}) (pkg :tpope/vim-characterize {:keys [:ga]}) diff --git a/vim/.config/nvim/ftdetect/custom.vim b/vim/.config/nvim/ftdetect/custom.vim index f098a4d..4287a15 100644 --- a/vim/.config/nvim/ftdetect/custom.vim +++ b/vim/.config/nvim/ftdetect/custom.vim @@ -3,3 +3,4 @@ au BufRead,BufNewFile rebar.config,rebar.config.script,*.app.src setf erlang au BufRead,BufNewFile *.dhall setf dhall au BufRead,BufNewFile PULLREQ_EDITMSG setf gitcommit au BufRead,BufNewFile *.livemd setf markdown +au BufRead,BufNewFile *.prr setf prr diff --git a/vim/.config/nvim/init.fnl b/vim/.config/nvim/init.fnl index face90c..89ef635 100644 --- a/vim/.config/nvim/init.fnl +++ b/vim/.config/nvim/init.fnl @@ -13,7 +13,7 @@ (set vim.g.loaded_matchit true) (set vim.g.matchup_surround_enabled true)) -(set vim.g.choosewin_label :QWERTYUIOP) +(set vim.g.choosewin_label :QWERTASDF) (do ; Colors (cmd.colorscheme :blame) @@ -263,7 +263,7 @@ (setup :nvim-treesitter.configs {:highlight {:enable true ; Currently disable as it do not work as expected - :disable [:erlang :make]} + :disable [:erlang :make :diff]} :matchup {:enable true} :indent {:enable true} :incremental_selection {:enable true}}))) diff --git a/vim/.config/nvim/plugin/pastebin.vim b/vim/.config/nvim/plugin/pastebin.vim index 1c84e8a..212d3b5 100644 --- a/vim/.config/nvim/plugin/pastebin.vim +++ b/vim/.config/nvim/plugin/pastebin.vim @@ -6,11 +6,11 @@ let g:loaded_pastebin = 1 function s:pastebin(line1, line2) abort let l:filename = expand("%:p:t") let l:lines = getline(a:line1, a:line2) - let l:url = trim(system("curl --netrc-optional -F 'f:1=@-;filename=\"".l:filename."\"' ix.io", l:lines)) + let l:url = trim(system("ubin", l:lines)) let @+ = l:url echom "URL: ".l:url endfunction -command! -range=% IX call pastebin(, ) +command! -range=% Ubin call pastebin(, ) diff --git a/vim/.config/nvim/syntax/prr.vim b/vim/.config/nvim/syntax/prr.vim new file mode 100644 index 0000000..7fcb9bc --- /dev/null +++ b/vim/.config/nvim/syntax/prr.vim @@ -0,0 +1,41 @@ +" Vim syntax file +" Language: prr +" Maintainer: Daniel Xu +" Last Change: 2022 Mar 25 +" Credits: Bram Moolenaar +" +" This version is copied and edited from diff.vim + +" Check whether an earlier file has defined a syntax already +if exists("b:current_syntax") + finish +endif + +syn region prrFile start=/^> diff/ end=/^> diff/ms=s-1,me=s-1 transparent fold keepend contains=prrHeader,prrIndex,prrChunk + +syn region prrChunk start=/^> @@/ start=/^\n> /rs=e-2 end=/^> @@/ms=s-1,me=s-1 end=/^> diff/ms=s-1,me=s-1 end=/^$/ transparent fold keepend contains=CONTAINED,prrTag + +syn match prrAdded contained "^> +.*" +syn match prrRemoved contained "^> -.*" + +syn match prrHeader contained "^> diff.*" +syn match prrIndex contained "^> index.*" +syn match prrChunkH contained "^> @@.*" + +syn match prrTag "^@.*" contains=prrTagName,prrResult transparent + +syn match prrTagName contained "@prr" nextgroup=prrResult +syn keyword prrResult contained approve reject comment + +" Define the default highlighting. +" Only used when an item doesn't have highlighting yet +hi def link prrAdded Identifier +hi def link prrRemoved Special + +hi def link prrTagName Keyword +hi def link prrResult String +hi def link prrHeader Include +hi def link prrIndex Comment +hi def link prrChunkH Function + +let b:current_syntax = "prr" -- 2.51.2