diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..9bb4830e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +trim_trailing_whitespace = true +charset = utf-8 +max_line_length = 100 +indent_style = space + +# We don't want to mess with encrypted files if they exist in the repo +[*.age] +indent_style = unset +indent_size = unset +tab_width = unset +end_of_line = unset +charset = unset +trim_trailing_whitespace = unset +insert_final_newline = unset +max_line_length = unset + +[{*.bash,.envrc}] +indent_style = tab + +[*.nix] +indent_size = 2 \ No newline at end of file diff --git a/.gitea/workflows/fmt.yaml b/.gitea/workflows/fmt.yaml index 2b9ca166..08d1f0d5 100644 --- a/.gitea/workflows/fmt.yaml +++ b/.gitea/workflows/fmt.yaml @@ -12,8 +12,4 @@ jobs: - name: Check formatting run: | - for f in **/flake.nix; do - nix flake lock --update-input "$(basename "$(dirname "$f")")" || true - done - nix flake lock --update-input Fmt nix --experimental-features "flakes nix-command" flake check diff --git a/.gitmodules b/.gitmodules index 2c63bc5e..6e983b51 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,27 +1,27 @@ [submodule "dots/.config/zsh/config/plugins/zsh-syntax-highlighting"] - path = dots/.config/zsh/config/plugins/zsh-syntax-highlighting + path = users/price/dots/.config/zsh/config/plugins/zsh-syntax-highlighting url = https://github.com/zsh-users/zsh-syntax-highlighting.git [submodule "dots/.config/zsh/config/plugins/zsh-completions"] - path = dots/.config/zsh/config/plugins/zsh-completions + path = users/price/dots/.config/zsh/config/plugins/zsh-completions url = https://github.com/zsh-users/zsh-completions.git [submodule "dots/.config/zsh/config/plugins/zsh-autosuggestions"] - path = dots/.config/zsh/config/plugins/zsh-autosuggestions + path = users/price/dots/.config/zsh/config/plugins/zsh-autosuggestions url = https://github.com/zsh-users/zsh-autosuggestions.git [submodule "dots/.config/zsh/config/plugins/fzf-tab"] - path = dots/.config/zsh/config/plugins/fzf-tab + path = users/price/dots/.config/zsh/config/plugins/fzf-tab url = https://github.com/Aloxaf/fzf-tab.git [submodule "dots/.config/zsh/config/plugins/z.lua"] - path = dots/.config/zsh/config/plugins/z.lua + path = users/price/dots/.config/zsh/config/plugins/z.lua url = https://github.com/skywind3000/z.lua.git [submodule "dots/.config/zsh/config/plugins/nix-zsh-completions"] - path = dots/.config/zsh/config/plugins/nix-zsh-completions + path = users/price/dots/.config/zsh/config/plugins/nix-zsh-completions url = https://github.com/spwhitt/nix-zsh-completions [submodule "dots/.config/zsh/config/themes/powerlevel10k"] - path = dots/.config/zsh/config/themes/powerlevel10k + path = users/price/dots/.config/zsh/config/themes/powerlevel10k url = https://github.com/romkatv/powerlevel10k.git [submodule "dots/.config/zsh/config/plugins/zsh-nix-shell"] - path = dots/.config/zsh/config/plugins/zsh-nix-shell + path = users/price/dots/.config/zsh/config/plugins/zsh-nix-shell url = https://github.com/chisui/zsh-nix-shell [submodule "dots/.config/zsh/config/plugins/powerlevel10k"] - path = dots/.config/zsh/config/plugins/powerlevel10k - url = https://github.com/romkatv/powerlevel10k.git + path = users/price/dots/.config/zsh/config/plugins/powerlevel10k + url = https://github.com/romkatv/powerlevel10k.git \ No newline at end of file diff --git a/dots/.config/Trolltech.conf b/dots/.config/Trolltech.conf deleted file mode 100644 index e1488966..00000000 --- a/dots/.config/Trolltech.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Qt] -style=GTK+ diff --git a/dots/.config/hypr/conf/core/env.conf b/dots/.config/hypr/conf/core/env.conf deleted file mode 100644 index caf03c37..00000000 --- a/dots/.config/hypr/conf/core/env.conf +++ /dev/null @@ -1,2 +0,0 @@ -env = QT_QPA_PLATFORMTHEME,gtk2 -env = GTK_THEME,Kanagawa-Borderless diff --git a/dots/.config/hypr/scripts/screen-cap.bash b/dots/.config/hypr/scripts/screen-cap.bash deleted file mode 100755 index fcd56a96..00000000 --- a/dots/.config/hypr/scripts/screen-cap.bash +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# Dependencies: -# - wf-recorder: https://github.com/ammen99/wf-recorder -# - notification daemon: https://archlinux.org/packages/?name=notification-daemon -# - wl-clipboard: https://github.com/bugaevc/wl-clipboard -# - gifski: https://github.com/sindresorhus/Gifski -# -# Some of this is hacky because I can't get wf-recorder to nicely output GIFs by itself :( - -mk-video() { - local program_name="Screen Capture" - local pid_file="/tmp/mk-gif-pid" - local output_type="${1:-mp4}" - - if [[ -f "${pid_file}" ]]; then - notify-send "Saving ${program_name}" "This May Take a Minute" -a "${program_name}" - if ! kill -SIGINT "$(cat "${pid_file}")" 2>/dev/null; then - notify-send "Failed ${program_name}" "Failed to Save Screen Capture" -u "critical" -a "${program_name}" - rm -rf "${pid_file}" - exit 1 - fi - inotifywait -e delete_self "${pid_file}" && - notify-send "Saved ${program_name}" "Successfully Saved Screen Capture to Clipboard" -a "${program_name}" - else - local input_tmpfile - notify-send "Starting ${program_name}" "Recording ${output_type^^} of Selected Region" -a "${program_name}" - ( - local tmp_dir - tmp_dir="$(mktemp -d)" - cd "${tmp_dir}" - input_tmpfile="${tmp_dir}/$(mktemp wf-recorder.XXXXXXXXXXX).mp4" - wf-recorder -g "$(slurp)" -f "${input_tmpfile}" -- & - printf "%s" $! >"${pid_file}" - wait - if [[ "${output_type}" == "gif" ]]; then - local gifski_tmpoutput - gifski_tmpoutput="${tmp_dir}/$(mktemp gifski.XXXXXXXXXXX).gif" - gifski --output "${gifski_tmpoutput}" "${input_tmpfile}" - wl-copy --type image/gif <"${gifski_tmpoutput}" - else - wl-copy --type video/mp4 <"${input_tmpfile}" - fi - rm -f "${pid_file}" - ) - fi -} - -mk-video "${@}" diff --git a/dots/.config/nvim/after/ftplugin/sh.lua b/dots/.config/nvim/after/ftplugin/sh.lua deleted file mode 100644 index cd9607f0..00000000 --- a/dots/.config/nvim/after/ftplugin/sh.lua +++ /dev/null @@ -1,9 +0,0 @@ -vim.opt_local.expandtab = false - -vim.keymap.set("n", "fr", function() - vim.cmd.write() - require("toggleterm").exec("bash " .. vim.api.nvim_buf_get_name(0)) -end, { - buffer = true, - desc = "Bash: Save and Run Current Buffer", -}) diff --git a/dots/.config/nvim/after/ftplugin/zsh.lua b/dots/.config/nvim/after/ftplugin/zsh.lua deleted file mode 100644 index 4d812a5f..00000000 --- a/dots/.config/nvim/after/ftplugin/zsh.lua +++ /dev/null @@ -1,9 +0,0 @@ -vim.opt_local.expandtab = false - -vim.keymap.set("n", "fr", function() - vim.cmd.write() - require("toggleterm").exec("zsh " .. vim.api.nvim_buf_get_name(0)) -end, { - buffer = true, - desc = "ZSH: Save and Run Current Buffer", -}) diff --git a/dots/.config/nvim/lua/plugins/configs/bufdelete.lua b/dots/.config/nvim/lua/plugins/configs/bufdelete.lua deleted file mode 100644 index 95cace1a..00000000 --- a/dots/.config/nvim/lua/plugins/configs/bufdelete.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "famiu/bufdelete.nvim", - keys = { - { "", "Bdelete", desc = "Close Buffer" }, - }, - }, -} diff --git a/dots/.config/nvim/lua/plugins/configs/vindent.lua b/dots/.config/nvim/lua/plugins/configs/vindent.lua deleted file mode 100644 index 8613bde4..00000000 --- a/dots/.config/nvim/lua/plugins/configs/vindent.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - dir = "~/Git/Neovim/virt-indent.nvim", - ft = { "org", "markdown" }, - }, -} diff --git a/dots/.config/nvim/spell/en.utf-8.add.spl b/dots/.config/nvim/spell/en.utf-8.add.spl deleted file mode 100644 index 4ec84476..00000000 Binary files a/dots/.config/nvim/spell/en.utf-8.add.spl and /dev/null differ diff --git a/flake.lock b/flake.lock index f54f42b5..2c04088f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,28 +1,10 @@ { "nodes": { - "Fmt": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1, - "narHash": "sha256-CosKaGnikx3sv4FurslvRT3G0a2VxruhsFNmgZ9duYg=", - "path": "pkgs/Fmt", - "type": "path" - }, - "original": { - "path": "pkgs/Fmt", - "type": "path" - } - }, "agenix": { "inputs": { "agenix": "agenix_2", "crane": "crane", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ], @@ -50,7 +32,7 @@ "agenix", "nixpkgs" ], - "systems": "systems_2" + "systems": "systems" }, "locked": { "lastModified": 1707830867, @@ -66,33 +48,35 @@ "type": "github" } }, - "bob": { + "blog": { "inputs": { - "bob": "bob_2", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1, - "narHash": "sha256-nZhwbnG+F9bPZXXk2+loWmkbpDZT3r6Vum+egDmigxg=", - "path": "./pkgs/bob-nvim", - "type": "path" + "lastModified": 1714589296, + "narHash": "sha256-D/+cMCmS9BdMNNtn7E0J1UDl/5Y2+lHIUjAcCczVYek=", + "ref": "refs/heads/Development", + "rev": "dd4ae987ef50a7ef2450cb951b23763817950209", + "revCount": 87, + "type": "git", + "url": "https://git.orion-technologies.io/blog/blog" }, "original": { - "path": "./pkgs/bob-nvim", - "type": "path" + "type": "git", + "url": "https://git.orion-technologies.io/blog/blog" } }, - "bob_2": { + "bob": { "flake": false, "locked": { - "lastModified": 1706612487, - "narHash": "sha256-OTmsb1tnautQTdO/oeqbwd5MmyHbG946/kPCGSluIrM=", + "lastModified": 1713374776, + "narHash": "sha256-jVRxvhUENyucRHN4TGV9xsWOs7mfPJCV90Lk/hD1xFE=", "owner": "MordechaiHadad", "repo": "bob", - "rev": "e521723d2c084f4b610c27d79f870f83e964fe95", + "rev": "e65ef1bfbcb846b12cc639a25f193c2ea9c72b12", "type": "github" }, "original": { @@ -145,6 +129,46 @@ "type": "github" } }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1711973905, + "narHash": "sha256-UFKME/N1pbUtn+2Aqnk+agUt8CekbpuqwzljivfIme8=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "88b3059b020da69cbe16526b8d639bd5e0b51c8b", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714612856, + "narHash": "sha256-W7+rtMzRmdovzndN2NYUv5xzkbMudtQ3jbyFuGk0O1E=", + "owner": "nix-community", + "repo": "disko", + "rev": "d57058eb09dd5ec00c746df34fe0a603ea744370", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -177,6 +201,38 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "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": { "nixpkgs-lib": [ @@ -185,11 +241,11 @@ ] }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1714641030, + "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", "type": "github" }, "original": { @@ -207,11 +263,11 @@ ] }, "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", "type": "github" }, "original": { @@ -219,9 +275,48 @@ "type": "indirect" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" }, "locked": { "lastModified": 1710146030, @@ -237,43 +332,7 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "flake-utils_3": { - "inputs": { - "systems": "systems_4" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { "inputs": { "systems": "systems_5" }, @@ -291,28 +350,10 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_4": { "inputs": { "systems": "systems_6" }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_6": { - "inputs": { - "systems": "systems_7" - }, "locked": { "lastModified": 1710146030, "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", @@ -327,7 +368,22 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_5": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -342,9 +398,9 @@ "type": "github" } }, - "flake-utils_8": { + "flake-utils_7": { "inputs": { - "systems": "systems_8" + "systems": "systems_7" }, "locked": { "lastModified": 1705309234, @@ -403,11 +459,11 @@ ] }, "locked": { - "lastModified": 1713722610, - "narHash": "sha256-kcZsbH1PQTG+sS22u/igLq2SaBEHJgmU5hoKzrT2ukI=", + "lastModified": 1713898448, + "narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "4615d28841e93f6f549fde9188caf493b3822668", + "rev": "c0302ec12d569532a6b6bd218f698bc402e93adc", "type": "github" }, "original": { @@ -445,11 +501,11 @@ ] }, "locked": { - "lastModified": 1713818326, - "narHash": "sha256-aw3xbVPJauLk/bbrlakIYxKpeuMWzA2feGrkIpIuXd8=", + "lastModified": 1714679908, + "narHash": "sha256-KzcXzDvDJjX34en8f3Zimm396x6idbt+cu4tWDVS2FI=", "owner": "nix-community", "repo": "home-manager", - "rev": "67de98ae6eed5ad6f91b1142356d71a87ba97f21", + "rev": "9036fe9ef8e15a819fa76f47a8b1f287903fb848", "type": "github" }, "original": { @@ -458,38 +514,34 @@ "type": "github" } }, - "kanagawa-gtk": { - "inputs": { - "flake-utils": "flake-utils_5", - "kanagawa-gtk": "kanagawa-gtk_2", - "nixpkgs": [ - "nixpkgs" - ] - }, + "impermanence": { "locked": { - "lastModified": 1, - "narHash": "sha256-ixRgLAGzQ7RcYRcyuOmY0mFgRw5ey+U39ccPg1izDXQ=", - "path": "./pkgs/kanagawa-gtk", - "type": "path" + "lastModified": 1708968331, + "narHash": "sha256-VUXLaPusCBvwM3zhGbRIJVeYluh2uWuqtj4WirQ1L9Y=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "a33ef102a02ce77d3e39c25197664b7a636f9c30", + "type": "github" }, "original": { - "path": "./pkgs/kanagawa-gtk", - "type": "path" + "owner": "nix-community", + "repo": "impermanence", + "type": "github" } }, - "kanagawa-gtk_2": { + "libgit2": { "flake": false, "locked": { - "lastModified": 1688426096, - "narHash": "sha256-BZRmjVas8q6zsYbXFk4bCk5Ec/3liy9PQ8fqFGHAXe0=", - "owner": "Fausto-Korpsvart", - "repo": "Kanagawa-GKT-Theme", - "rev": "35936a1e3bbd329339991b29725fc1f67f192c1e", + "lastModified": 1697646580, + "narHash": "sha256-oX4Z3S9WtJlwvj0uH9HlYcWv+x1hqp8mhXl7HsLu2f0=", + "owner": "libgit2", + "repo": "libgit2", + "rev": "45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5", "type": "github" }, "original": { - "owner": "Fausto-Korpsvart", - "repo": "Kanagawa-GKT-Theme", + "owner": "libgit2", + "repo": "libgit2", "type": "github" } }, @@ -512,7 +564,7 @@ }, "neovim-flake": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_4", "nixpkgs": [ "neovim-nightly-overlay", "nixpkgs" @@ -520,11 +572,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1713809929, - "narHash": "sha256-0GB//RpezlOsI9+1/oT8PkEIO8I4DGfAfw3KotTSnzQ=", + "lastModified": 1714683427, + "narHash": "sha256-SMfFU+VsRTZLVIkGpf67oOTZ29gWmFvxF0nGO6CRx/4=", "owner": "neovim", "repo": "neovim", - "rev": "39fc340276a4fdbe1f1bb4bfbe7328267ad7f9d6", + "rev": "01e4a70d668d54a7cefa3ff53ec97e39df516265", "type": "github" }, "original": { @@ -536,18 +588,18 @@ }, "neovim-nightly-overlay": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", "hercules-ci-effects": "hercules-ci-effects", "neovim-flake": "neovim-flake", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1713830781, - "narHash": "sha256-Xizkp8EgHpLlUZOhN4PpwRlMaL0xcVxdQORS4eGaKmg=", + "lastModified": 1714694802, + "narHash": "sha256-b0+Zrd2PDgRIEeeXbivzw3kcSaXCZItOvgOgdfRsyOo=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "7b0a51e51c4c116e540ed01e668d17023900b518", + "rev": "9b2c33c7fa0287db93868d955e7b3d0da3837a57", "type": "github" }, "original": { @@ -556,10 +608,33 @@ "type": "github" } }, + "nix": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts_3", + "libgit2": "libgit2", + "nixpkgs": "nixpkgs_3", + "nixpkgs-regression": "nixpkgs-regression", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1714701944, + "narHash": "sha256-trTxWfGElp0rkjquqG5I5RYVoxo8foCflxJFUtHwnOQ=", + "owner": "nixos", + "repo": "nix", + "rev": "00ca2b05b8fbbef09be5d1e4820857605d4c31b6", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nix", + "type": "github" + } + }, "nixgl": { "inputs": { - "flake-utils": "flake-utils_7", - "nixpkgs": "nixpkgs_2" + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1713543440, @@ -577,11 +652,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713714268, - "narHash": "sha256-ZJGnom7YthvNxUZLdUzy5VePTwYgDYcnnPpyHT4n9lY=", + "lastModified": 1702272962, + "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "69ee1d82f1fa4c70a3dc9a64111e7eef3b8e4527", + "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", "type": "github" }, "original": { @@ -591,7 +666,55 @@ "type": "github" } }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, "nixpkgs_2": { + "locked": { + "lastModified": 1714594348, + "narHash": "sha256-fL6twwN/npU94mvumU5ho/uhM/fwePCRQ9lwamm2lds=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1c74cc292b61614e74c1cf0d372f79d57fb4936b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1709083642, + "narHash": "sha256-7kkJQd4rZ+vFrzWu8sTRtta5D1kBG0LSRYAfhtmMlSo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b550fe4b4776908ac2a861124307045f8e717c8e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1660551188, "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", @@ -606,13 +729,13 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_5": { "locked": { - "lastModified": 1713714899, - "narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=", + "lastModified": 1714635257, + "narHash": "sha256-4cPymbty65RvF1DWQfc+Bc8B233A1BWxJnNULJKQ1EY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6143fc5eeb9c4f00163267708e26191d1e918932", + "rev": "63c3a29ca82437c87573e4c6919b09a24ea61b0f", "type": "github" }, "original": { @@ -622,17 +745,52 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": [ + "nix" + ], + "flake-utils": "flake-utils_5", + "gitignore": [ + "nix" + ], + "nixpkgs": [ + "nix", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712897695, + "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { - "Fmt": "Fmt", "agenix": "agenix", + "blog": "blog", "bob": "bob", - "flake-utils": "flake-utils_4", + "deploy-rs": "deploy-rs", + "disko": "disko", + "flake-utils": "flake-utils_3", "home-manager": "home-manager_2", - "kanagawa-gtk": "kanagawa-gtk", + "impermanence": "impermanence", "neovim-nightly-overlay": "neovim-nightly-overlay", + "nix": "nix", "nixgl": "nixgl", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_5", "waybar": "waybar", "wezterm": "wezterm" } @@ -792,34 +950,37 @@ "type": "github" } }, - "systems_8": { + "utils": { + "inputs": { + "systems": "systems_4" + }, "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, "waybar": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_4", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1713882185, - "narHash": "sha256-fmmYoOnBVJKvnrF3S95pftmBECaufhe40g5Qcdz9A08=", + "lastModified": 1714718861, + "narHash": "sha256-mCQdrn0Y3oOVZP/CileWAhuBX6aARBNrfxyqJBB4NxA=", "owner": "Alexays", "repo": "Waybar", - "rev": "08b0ed1b79462735cc040ba886136494e70867b2", + "rev": "231d6972d7a023e9358ab7deda509baac49006cb", "type": "github" }, "original": { @@ -830,7 +991,7 @@ }, "wezterm": { "inputs": { - "flake-utils": "flake-utils_8", + "flake-utils": "flake-utils_7", "freetype2": "freetype2", "harfbuzz": "harfbuzz", "libpng": "libpng", @@ -842,11 +1003,11 @@ }, "locked": { "dir": "nix", - "lastModified": 1712365750, - "narHash": "sha256-yaGmflPbC9V4gsLt2lvL4qaSojF29IpPmVKAxm/nCRg=", + "lastModified": 1714411698, + "narHash": "sha256-dut0b9FueToW3WGh3mPh+wfV88ZjTx+r8be3w9HZhAU=", "owner": "wez", "repo": "wezterm", - "rev": "cce0706b1f2a9e2d1f02c57f2d1cd367c91df1ae", + "rev": "0184e88e97b6521df613df4ccdb2e896ce8b0ad0", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index aeba9d00..d815ae76 100644 --- a/flake.nix +++ b/flake.nix @@ -2,19 +2,13 @@ description = "Price Hiller's home manager configuration"; inputs = { + nix.url = "github:nixos/nix"; + deploy-rs.url = "github:serokell/deploy-rs"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; - kanagawa-gtk = { - url = "path:./pkgs/kanagawa-gtk"; - inputs.nixpkgs.follows = "nixpkgs"; - }; bob = { - url = "path:./pkgs/bob-nvim"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - Fmt = { - url = "path:pkgs/Fmt"; - inputs.nixpkgs.follows = "nixpkgs"; + flake = false; + url = "github:MordechaiHadad/bob"; }; home-manager = { url = "github:nix-community/home-manager"; @@ -34,96 +28,249 @@ url = "github:yaxitech/ragenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + impermanence = { + url = "github:nix-community/impermanence"; + }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + blog = { + url = "git+https://git.orion-technologies.io/blog/blog"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = - inputs@{ - self, - home-manager, - nixpkgs, - ... - }: + inputs@{ self, nixpkgs, ... }: let - system = "x86_64-linux"; - username = "sam"; - pkgs = nixpkgs.legacyPackages.${system}; + inherit (self) outputs; + forAllSystems = + function: + nixpkgs.lib.genAttrs + [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ] + ( + system: + function ( + import nixpkgs { + inherit system; + overlays = [ + inputs.agenix.overlays.default + inputs.neovim-nightly-overlay.overlay + ]; + } + ) + ); + mkHomeCfg = + user: home-config: + let + username = "${builtins.head (builtins.match "(.+)(@.+)?" user)}"; + in + inputs.home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs; + }; + modules = [ + ({ + imports = [ inputs.agenix.homeManagerModules.default ]; + nixpkgs.overlays = [ + inputs.neovim-nightly-overlay.overlay + inputs.nixgl.overlay + self.overlays.modifications + self.overlays.additions + ]; + home = { + stateVersion = "24.05"; + username = "${username}"; + homeDirectory = "/home/${username}"; + }; + }) + home-config + ]; + }; in { - packages.x86_64-linux.default = home-manager.defaultPackage.x86_64-linux; - checks.${system} = { - formatting = - pkgs.runCommand "check-dot-file-formatting" - { - buildInputs = with pkgs; [ - findutils - inputs.Fmt.packages.x86_64-linux.default - ]; - } - '' - set -euo pipefail - cd ${self} - Fmt -- $(find . -type f) - printf "TEST COMPLETED!\n" > $out - ''; + formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); + packages = forAllSystems (pkgs: import ./pkgs pkgs); + homeConfigurations = builtins.mapAttrs (mkHomeCfg) { + "price@orion" = ./users/price/home.nix; + "sam" = ./users/sam/home.nix; }; - homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { - inherit inputs; - inherit self; - }; - modules = [ - ({ - imports = [ inputs.agenix.homeManagerModules.default ]; - nixpkgs.overlays = [ - inputs.neovim-nightly-overlay.overlay - inputs.bob.overlays.default - inputs.Fmt.overlays.default - inputs.kanagawa-gtk.overlays.default - inputs.nixgl.overlay - (final: prev: { - waybar = inputs.waybar.packages.${system}.default; - lxappearance = prev.lxappearance.overrideAttrs (oldAttrs: { - postInstall = '' - wrapProgram $out/bin/lxappearance --prefix GDK_BACKEND : x11 - ''; - }); - opensnitch-ui = prev.opensnitch-ui.overrideAttrs (oldAttrs: { - propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [ prev.python311Packages.qt-material ]; - }); - }) - ]; - home = { - username = "${username}"; - homeDirectory = "/home/${username}"; - stateVersion = "24.05"; - }; - }) - ./config - ]; - }; - } - // inputs.flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ inputs.agenix.overlays.default ]; - }; - in - { - devShells.default = pkgs.mkShell { + overlays = import ./overlays { inherit inputs; }; + devShells = forAllSystems (pkgs: { + default = pkgs.mkShell { packages = with pkgs; [ age age-plugin-yubikey pkgs.agenix nixos-rebuild + nixos-install-tools pkgs.deploy-rs ]; shellHook = '' export RULES="$PWD/secrets/secrets.nix" ''; }; - } - ); + }); + apps = forAllSystems (pkgs: { + home-manager-init = { + type = "app"; + program = "${ + pkgs.writeShellApplication { + name = "home-manager-init"; + runtimeInputs = with pkgs; [ + git + nix + ]; + text = '' + #!${pkgs.bash}/bin/bash + cd "$(git rev-parse --show-toplevel)" + nix run --extra-experimental-features 'nix-command flakes' github:nix-community/home-manager -- switch --extra-experimental-features 'nix-command flakes' --flake "git+file://$(pwd)?submodules=1" "$@" + ''; + } + }/bin/home-manager-init"; + }; + install-host = { + type = "app"; + program = "${ + pkgs.writeShellApplication { + name = "install-host"; + runtimeInputs = with pkgs; [ + openssh + coreutils-full + git + agenix + nix + ]; + text = ( + '' + #!${pkgs.bash}/bin/bash + # The below `cd` invocation ensures the installer is running from the toplevel of + # the flake and thus has correct paths available. + cd "$(git rev-parse --show-toplevel)" + '' + + builtins.readFile ./scripts/install-host.bash + ); + } + }/bin/install-host"; + }; + }); + nixosConfigurations = + let + lib = (import ./lib { lib = nixpkgs.lib; }) // nixpkgs.lib; + persist-dir = "/persist"; + defaults = { + config = { + nixpkgs.overlays = [ inputs.neovim-nightly-overlay.overlay ]; + environment.etc.machine-id.source = "${persist-dir}/ephemeral/etc/machine-id"; + environment.persistence.save = { + hideMounts = true; + persistentStoragePath = "${persist-dir}/save"; + }; + environment.persistence.ephemeral = { + persistentStoragePath = "${persist-dir}/ephemeral"; + hideMounts = true; + directories = [ + "/var/lib" + "/etc/nixos" + ]; + }; + }; + }; + in + { + orion = + let + hostname = "orion"; + in + nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit self; + inherit inputs; + inherit outputs; + inherit hostname; + inherit lib; + inherit persist-dir; + root-disk = "/dev/vda"; + }; + modules = [ + defaults + inputs.impermanence.nixosModules.impermanence + inputs.agenix.nixosModules.default + inputs.disko.nixosModules.disko + { + config = + (import "${self}/secrets" { + agenix = false; + inherit lib; + }).${hostname}; + } + ./hosts/${hostname} + ]; + }; + luna = + let + hostname = "luna"; + in + nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit self; + inherit inputs; + inherit hostname; + inherit nixpkgs; + inherit lib; + inherit persist-dir; + root-disk = "/dev/nvme0n1"; + fqdn = "orion-technologies.io"; + }; + modules = [ + defaults + inputs.impermanence.nixosModules.impermanence + inputs.agenix.nixosModules.default + inputs.disko.nixosModules.disko + { + config = + (import "${self}/secrets" { + agenix = false; + inherit lib; + }).${hostname}; + } + ./hosts/${hostname} + ]; + }; + }; + deploy.nodes = + let + deploy-rs = inputs.deploy-rs; + in + { + orion = { + hostname = "orion"; + fastConnection = true; + profiles.system = { + sshUser = "price"; + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos outputs.nixosConfigurations.orion; + }; + }; + luna = { + hostname = "luna.hosts.orion-technologies.io"; + fastConnection = true; + profiles.system = { + sshUser = "price"; + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos outputs.nixosConfigurations.luna; + }; + }; + }; + }; } diff --git a/hosts/.editorconfig b/hosts/.editorconfig new file mode 100644 index 00000000..9bb4830e --- /dev/null +++ b/hosts/.editorconfig @@ -0,0 +1,26 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +trim_trailing_whitespace = true +charset = utf-8 +max_line_length = 100 +indent_style = space + +# We don't want to mess with encrypted files if they exist in the repo +[*.age] +indent_style = unset +indent_size = unset +tab_width = unset +end_of_line = unset +charset = unset +trim_trailing_whitespace = unset +insert_final_newline = unset +max_line_length = unset + +[{*.bash,.envrc}] +indent_style = tab + +[*.nix] +indent_size = 2 \ No newline at end of file diff --git a/hosts/luna/README.md b/hosts/luna/README.md new file mode 100644 index 00000000..52e872bb --- /dev/null +++ b/hosts/luna/README.md @@ -0,0 +1,3 @@ +# Luna + +This is my primary server. diff --git a/hosts/luna/default.nix b/hosts/luna/default.nix new file mode 100644 index 00000000..6d24c80a --- /dev/null +++ b/hosts/luna/default.nix @@ -0,0 +1,10 @@ +{ lib, ... }: +{ + imports = ( + lib.recurseFilesInDirs [ + ./os + ./modules + ] ".nix" + ); + system.stateVersion = "24.05"; +} diff --git a/hosts/luna/modules/default.nix b/hosts/luna/modules/default.nix new file mode 100644 index 00000000..45c60fc0 --- /dev/null +++ b/hosts/luna/modules/default.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + time.timeZone = "America/Chicago"; + systemd.extraConfig = '' + DefaultTimeoutStopSec=10s + ''; +} diff --git a/hosts/luna/modules/docker/default.nix b/hosts/luna/modules/docker/default.nix new file mode 100644 index 00000000..79e48ac9 --- /dev/null +++ b/hosts/luna/modules/docker/default.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + docker + docker-compose + ]; + + virtualisation = { + oci-containers.backend = "docker"; + containers.enable = true; + docker = { + enable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + autoPrune.enable = true; + package = pkgs.docker; + }; + }; +} diff --git a/hosts/luna/modules/monitoring/auditd.nix b/hosts/luna/modules/monitoring/auditd.nix new file mode 100644 index 00000000..bcf65abe --- /dev/null +++ b/hosts/luna/modules/monitoring/auditd.nix @@ -0,0 +1,156 @@ +{ + persist-dir, + pkgs, + config, + ... +}: +let + laurel-user = "_laurel"; +in +{ + security = { + audit.enable = true; + wrappers.laurel = { + source = "${pkgs.laurel}/bin/laurel"; + owner = "root"; + group = "${laurel-user}"; + permissions = "u=rwx,g=rx,o="; + }; + auditd.enable = true; + }; + # Ensure the wrapped laurel service is available in time for auditd + systemd.services.suid-sgid-wrappers.before = [ "auditd.service" ]; + users.groups."${laurel-user}" = { }; + users.users."${laurel-user}" = { + isSystemUser = true; + createHome = true; + group = "${laurel-user}"; + home = "/var/log/laurel"; + }; + environment.etc = { + "laurel/config.toml" = { + user = "${laurel-user}"; + text = '' + # Write log files relative to this directory + directory = "${config.users.users."${laurel-user}".home}" + # Drop privileges from root to this user + user = "${laurel-user}" + # The periodical time window in seconds for status information to be printed to Syslog. + # Status report includes the running version, config and parsing stats. + # Default is 0 --> no status reports. + statusreport-period = 0 + # By default, audit events are read from stdin ("stdin"). Alternatively, they + # can be consumed from an existing UNIX domain socket ("unix:/path/to/socket") + input = "stdin" + + # A string that is written to the log on startup and + # whenever Laurel writes a status report. + # marker = "correct-horse-battery-staple" + + [auditlog] + # Base file name for the JSONL-based log file. Set to "-" to log to stdout. In this case + # other log file related settings will be ignored. + file = "audit.log" + # Rotate when log file reaches this size (in bytes) + size = 5000000 + # When rotating, keep this number of generations around + generations = 10 + # Grant read permissions on the log files to these users, using + [transform] + + # "array" (the default) causes EXECVE a0, a1, a2 … arguments to be + # output as a list of strings, "ARGV". This is the default, it allows + # analysts to reliably reproduce what was executed. + # + # "string" causes arguments to be concatenated into a single string, + # separated by space characters, "ARGV_STR". This form allows for + # easier grepping, but it is impossible to tell if space characters in + # the resulting string are a separator or were part of an individual + # argument in the original command line. + + execve-argv = [ "array" ] + + # execve-argv = [ "array", "string" ] + + # Trim excessively long EXECVE.ARGV and EXECVE.ARGV_STR entries. + # Excess is cut from the middle of the argument list and a marker + # indicating how many arguments / bytes have been cut is inserted. + + # execve-argv-limit-bytes = 10000 + + [translate] + + # Perform translations of numeric values that can also be done by + # auditd if configured with log_format=ENRICHED. + + # arch, syscall, sockaddr structures + universal = false + # UID, GID values + user-db = false + # Drop raw (numeric) syscall, arch, UID, GID values if they are translated + drop-raw = false + + [enrich] + + # Add context (event-id, comm, exe, ppid) for *pid entries + pid = true + + # List of environment variables to log for every EXECVE event + execve-env = [ "LD_PRELOAD", "LD_LIBRARY_PATH" ] + + # Add container context to SYSCALL-based events + container = true + + # Add script context to SYSCALL execve events + script = true + + # Add groups that the user (uid) is a member of. Default: true + user-groups = true + + [label-process] + + [filter] + filter-null-keys = false + filter-action = "drop" + ''; + }; + "audit/plugins.d/laurel.conf".text = '' + active = yes + direction = out + type = always + path = ${config.security.wrapperDir}/laurel + format = string + args = --config /etc/laurel/config.toml + ''; + }; + security.audit.rules = [ + # Program Executions + "-a exit,always -F arch=b64 -S execve -F key=progexec" + + # Home path access/modification + "-a always,exit -F arch=b64 -F dir=/home -F perm=war -F key=homeaccess" + + # Kexec usage + "-a always,exit -F arch=b64 -S kexec_load -F key=KEXEC" + + # Root directory access/modification + "-a always,exit -F arch=b64 -F dir=/root -F key=roothomeaccess -F perm=war" + + # Failed Modifications of critcal paths + "-a always,exit -F arch=b64 -S open -F dir=/etc -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=/bin -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=/var -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=/home -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=/srv -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=/opt -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=/boot -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=/nix -F success=0 -F key=unauthedfileaccess" + "-a always,exit -F arch=b64 -S open -F dir=${persist-dir} -F success=0 -F key=unauthedfileaccess" + + # File deletion events by users + "-a always,exit -F arch=b64 -S rmdir -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=-1 -F key=delete" + + # Root command executions + "-a always,exit -F arch=b64 -F euid=0 -F auid>=1000 -F auid!=-1 -S execve -F key=rootcmd" + ]; +} diff --git a/hosts/luna/modules/monitoring/grafana.nix b/hosts/luna/modules/monitoring/grafana.nix new file mode 100644 index 00000000..d9dc5137 --- /dev/null +++ b/hosts/luna/modules/monitoring/grafana.nix @@ -0,0 +1,31 @@ +{ + config, + pkgs, + fqdn, + ... +}: +let + grafana_host = "grafana.${fqdn}"; +in +{ + services = { + grafana = { + enable = true; + settings.server = { + domain = "${grafana_host}"; + http_addr = "127.0.0.1"; + http_port = 2342; + }; + }; + + nginx.virtualHosts."${grafana_host}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://${config.services.grafana.settings.server.http_addr}:${builtins.toString config.services.grafana.settings.server.http_port}"; + proxyWebsockets = true; + recommendedProxySettings = true; + }; + }; + }; +} diff --git a/hosts/luna/modules/monitoring/prometheus.nix b/hosts/luna/modules/monitoring/prometheus.nix new file mode 100644 index 00000000..555dad7c --- /dev/null +++ b/hosts/luna/modules/monitoring/prometheus.nix @@ -0,0 +1,97 @@ +{ + config, + fqdn, + pkgs, + ... +}: +let + prometheus_host = "prometheus.${fqdn}"; +in +{ + services = { + prometheus = { + enable = true; + port = 9000; + scrapeConfigs = [ + { + job_name = "node-exporter"; + static_configs = [ + { targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ]; } + ]; + } + ]; + exporters = { + node = { + enable = true; + port = 9001; + enabledCollectors = [ + "arp" + "bcache" + "btrfs" + "bonding" + "cpu" + "cpufreq" + "diskstats" + "edac" + "entropy" + "fibrechannel" + "filefd" + "filesystem" + "hwmon" + "ipvs" + "loadavg" + "meminfo" + "mdadm" + "netclass" + "netdev" + "netstat" + "nfs" + "nfsd" + "nvme" + "os" + "powersupplyclass" + "pressure" + "rapl" + "schedstat" + "sockstat" + "softnet" + "stat" + "thermal_zone" + "time" + "udp_queues" + "uname" + "vmstat" + "systemd" + ]; + }; + }; + }; + + nginx = { + additionalModules = [ pkgs.nginxModules.pam ]; + virtualHosts."${prometheus_host}" = { + enableACME = true; + forceSSL = true; + extraConfig = '' + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + ''; + locations."/" = { + proxyPass = "http://${config.services.prometheus.listenAddress}:${builtins.toString config.services.prometheus.port}"; + }; + }; + }; + }; + security.pam.services.nginx.setEnvironment = false; + systemd.services.nginx.serviceConfig = { + SupplementaryGroups = [ "shadow" ]; + }; + + environment.persistence.save.directories = [ + { + directory = "/var/lib/${config.services.prometheus.stateDir}"; + user = "prometheus"; + group = "prometheus"; + } + ]; +} diff --git a/hosts/luna/modules/networking.nix b/hosts/luna/modules/networking.nix new file mode 100755 index 00000000..63520f2c --- /dev/null +++ b/hosts/luna/modules/networking.nix @@ -0,0 +1,105 @@ +{ hostname, ... }: + +let + networks_dhcp_use_dns = "no"; + networks_dhcp = "ipv4"; + networks_multicast_dns = "no"; + networks_ipv6_privacy = "yes"; + networks_ipv6_accept_ra = "yes"; + networks_network_config = { + DHCP = networks_dhcp; + MulticastDNS = networks_multicast_dns; + IPv6PrivacyExtensions = networks_ipv6_privacy; + IPv6AcceptRA = networks_ipv6_accept_ra; + }; + resolved_nameservers = [ + "1.1.1.1#cloudflare-dns.com" + "9.9.9.9#dns.quad9.net" + "8.8.8.8#dns.google" + "2606:4700:4700::1111#cloudflare-dns.com" + "2620:fe::9#dns.quad9.net" + "2001:4860:4860::8888#dns.google" + ]; + resolved_fallback_nameservers = [ + "1.1.1.1#one.one.one.one" + "1.0.0.1#one.one.one.one" + ]; +in +{ + systemd.network = { + enable = true; + # HACK: Disable wait-online, check in on https://github.com/NixOS/nixpkgs/pull/258680 & + # https://github.com/NixOS/nixpkgs/issues/247608 + wait-online.enable = false; + networks = { + "10-wlan" = { + matchConfig.Name = [ "wl*" ]; + networkConfig = networks_network_config; + dhcpV4Config = { + RouteMetric = 600; + UseDNS = networks_dhcp_use_dns; + }; + ipv6AcceptRAConfig = { + RouteMetric = 600; + UseDNS = networks_dhcp_use_dns; + }; + }; + "10-ethernet" = { + matchConfig.Name = [ + "en*" + "eth*" + ]; + networkConfig = networks_network_config; + dhcpV4Config = { + RouteMetric = 100; + UseDNS = networks_dhcp_use_dns; + }; + ipv6AcceptRAConfig = { + RouteMetric = 100; + UseDNS = networks_dhcp_use_dns; + }; + }; + "10-wwan" = { + matchConfig.Name = [ "ww*" ]; + networkConfig = networks_network_config; + dhcpV4Config = { + RouteMetric = 700; + UseDNS = networks_dhcp_use_dns; + }; + ipv6AcceptRAConfig = { + RouteMetric = 700; + UseDNS = networks_dhcp_use_dns; + }; + }; + }; + }; + + services.resolved = { + enable = true; + dnssec = "allow-downgrade"; + domains = [ "~." ]; + fallbackDns = resolved_fallback_nameservers; + llmnr = "resolve"; + extraConfig = '' + MulticastDNS=yes + DNSOverTLS=yes + CacheFromLocalhost=no + Cache=yes + ''; + }; + networking = { + useNetworkd = true; + enableIPv6 = true; + nameservers = resolved_nameservers; + nftables.enable = true; + firewall = { + enable = true; + allowedTCPPorts = [ + 80 + 443 + 2200 + ]; + }; + hostName = "${hostname}"; + }; +} diff --git a/hosts/luna/modules/nix.nix b/hosts/luna/modules/nix.nix new file mode 100755 index 00000000..c927705d --- /dev/null +++ b/hosts/luna/modules/nix.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: +{ + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; + trusted-users = [ "@wheel" ]; + }; + gc = { + automatic = true; + dates = "daily"; + }; + }; +} diff --git a/hosts/luna/modules/programs.nix b/hosts/luna/modules/programs.nix new file mode 100755 index 00000000..242ab55c --- /dev/null +++ b/hosts/luna/modules/programs.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + nixpkgs.config.allowUnfree = true; + + programs = { + neovim = { + enable = true; + defaultEditor = true; + }; + }; + + environment.systemPackages = with pkgs; [ + vim + coreutils-full + nano + curl + wget + git + jq + rsync + ]; +} diff --git a/hosts/luna/modules/services/fail2ban.nix b/hosts/luna/modules/services/fail2ban.nix new file mode 100644 index 00000000..b0a22297 --- /dev/null +++ b/hosts/luna/modules/services/fail2ban.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services.fail2ban = { + enable = true; + maxretry = 10; + }; +} diff --git a/hosts/luna/modules/services/gitea.nix b/hosts/luna/modules/services/gitea.nix new file mode 100644 index 00000000..cd0adea3 --- /dev/null +++ b/hosts/luna/modules/services/gitea.nix @@ -0,0 +1,149 @@ +{ + config, + fqdn, + inputs, + pkgs, + ... +}: +let + gitea_host = "git.${fqdn}"; + # TODO: Move this docker image out to a separate package and NixOS Module + # Huge thank you to https://icewind.nl/entry/gitea-actions-nix/ -- wouldn't have figured this out + # without that post 🙂 + base = import (inputs.nix + "/docker.nix") { + inherit pkgs; + name = "nix-ci-base"; + maxLayers = 10; + extraPkgs = with pkgs; [ + nodejs_20 + bash + ]; + nixConf = { + substituters = [ + "https://cache.nixos.org/" + "https://nix-community.cachix.org" + # insert any other binary caches here + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + # insert the public keys for those binary caches here + ]; + # allow using the new flake commands in our workflows + experimental-features = [ + "nix-command" + "flakes" + ]; + }; + }; + runner = pkgs.dockerTools.buildImage { + name = "nix-runner"; + tag = "latest"; + + fromImage = base; + fromImageName = null; + fromImageTag = "latest"; + + copyToRoot = pkgs.buildEnv { + name = "image-root"; + paths = [ pkgs.coreutils-full ]; + pathsToLink = [ "/bin" ]; # add coreutuls (which includes sleep) to /bin + }; + }; +in +{ + virtualisation.oci-containers.containers = { + "nix-runner" = { + image = "nix-runner:latest"; + imageFile = runner; + autoStart = false; + }; + }; + + age.secrets.gitea-db-pass = { + owner = config.services.gitea.user; + group = config.services.gitea.group; + }; + + services = { + postgresql = { + enable = true; + ensureDatabases = [ config.services.gitea.user ]; + ensureUsers = [ + { + name = config.services.gitea.database.user; + ensureClauses = { + login = true; + createdb = true; + }; + ensureDBOwnership = true; + } + ]; + }; + + gitea = { + appName = "Gitea"; + enable = true; + dump.enable = true; + database = { + type = "postgres"; + passwordFile = config.age.secrets.gitea-db-pass.path; + }; + settings = { + service.DISABLE_REGISTRATION = true; + # Extend timeouts to 1 hour + "git.timeout" = { + DEFAULT = 3600; + MIGRATE = 3600; + MIRROR = 3600; + CLONE = 3600; + PULL = 3600; + GC = 3600; + }; + markup.ENABLED = true; + mirror.DEFAULT_INTERVAL = "1h"; + server = { + DOMAIN = "${gitea_host}"; + HTTP_ADDR = "127.0.0.1"; + ROOT_URL = "https://${gitea_host}/"; + SSH_PORT = 2220; + START_SSH_SERVER = true; + DISABLE_QUERY_AUTH_TOKEN = true; + }; + session.COOKIE_SECURE = true; + "repository.upload".FILE_MAX_SIZE = 1024; + }; + }; + gitea-actions-runner.instances = { + default = { + enable = true; + url = config.services.gitea.settings.server.ROOT_URL; + tokenFile = config.age.secrets.gitea-runner-token.path; + name = "Default"; + settings = { + runner.capacity = 8; + }; + labels = [ + "default:docker://nix-runner:latest" + "alpine:docker://alpine:latest" + "debian:docker://debian:latest" + ]; + }; + }; + nginx.virtualHosts."${gitea_host}" = { + enableACME = true; + forceSSL = true; + locations."/".proxyPass = "http://${config.services.gitea.settings.server.HTTP_ADDR}:${builtins.toString config.services.gitea.settings.server.HTTP_PORT}"; + }; + }; + + networking.firewall.allowedTCPPorts = [ config.services.gitea.settings.server.SSH_PORT ]; + + environment.persistence.save.directories = [ + { + directory = config.services.gitea.stateDir; + user = config.services.gitea.user; + group = config.services.gitea.group; + } + ]; +} diff --git a/hosts/luna/modules/services/journald.nix b/hosts/luna/modules/services/journald.nix new file mode 100644 index 00000000..a8902fe2 --- /dev/null +++ b/hosts/luna/modules/services/journald.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + services.journald = { + extraConfig = '' + SystemMaxUse=100G + ''; + }; +} diff --git a/hosts/luna/modules/services/nginx.nix b/hosts/luna/modules/services/nginx.nix new file mode 100644 index 00000000..651b8b84 --- /dev/null +++ b/hosts/luna/modules/services/nginx.nix @@ -0,0 +1,27 @@ +{ + inputs, + pkgs, + fqdn, + ... +}: +{ + services.nginx = { + enable = true; + recommendedProxySettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedTlsSettings = true; + }; + + security.acme = { + acceptTerms = true; + defaults.email = "price@orion-technologies.io"; + }; + + services.nginx.virtualHosts."blog.${fqdn}" = { + forceSSL = true; + enableACME = true; + root = inputs.blog.packages.${pkgs.system}.default; + locations."/".index = "home.html"; + }; +} diff --git a/hosts/luna/modules/services/openssh.nix b/hosts/luna/modules/services/openssh.nix new file mode 100644 index 00000000..689a265f --- /dev/null +++ b/hosts/luna/modules/services/openssh.nix @@ -0,0 +1,46 @@ +{ config, ... }: +{ + services.openssh = { + enable = true; + startWhenNeeded = true; + # We set the hostkeys manually so they persist through reboots + hostKeys = [ + { + path = ( + config.environment.persistence.ephemeral.persistentStoragePath + "/etc/ssh/ssh_host_ed25519_key" + ); + type = "ed25519"; + } + ]; + sftpFlags = [ + "-f AUTHPRIV" + "-l INFO" + ]; + settings = { + PasswordAuthentication = false; + AuthenticationMethods = "publickey"; + KbdInteractiveAuthentication = false; + PermitRootLogin = "no"; + X11Forwarding = false; + AllowAgentForwarding = false; + AllowStreamLocalForwarding = false; + LogLevel = "VERBOSE"; + AllowUsers = [ "price" ]; + }; + ports = [ 2200 ]; + banner = '' + ┌────────────────────────────────────────────────────┐ + │ Orion Technologies - Security Notice │ + │ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ │ + │ UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED │ + │ │ + │ You must have written, explicit, authorized │ + │ permission to access or configure this device. │ + │ Unauthorized attempts and actions to access or use │ + │ this system may result in civil and/or criminal │ + │ penalties. All activities performed on this device │ + │ are logged and monitored. │ + └────────────────────────────────────────────────────┘ + ''; + }; +} diff --git a/hosts/luna/modules/services/postgresql.nix b/hosts/luna/modules/services/postgresql.nix new file mode 100644 index 00000000..b932f108 --- /dev/null +++ b/hosts/luna/modules/services/postgresql.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + services.postgresqlBackup = { + location = "/var/backup/postgresql"; + backupAll = true; + }; + services.postgresql = { + enable = true; + # Explicitly setting the data dir so upgrades (changing version from 15 -> 16) don't end up + # getting lost on system reboots + dataDir = "/var/lib/postgresql"; + settings = { + log_connections = true; + log_disconnections = true; + logging_collector = true; + log_statement = "all"; + log_destination = lib.mkForce "syslog,jsonlog"; + }; + ensureUsers = [ + { + name = "root"; + ensureClauses.superuser = true; + } + ]; + }; + + environment.systemPackages = [ pkgs.pgloader ]; + + environment.persistence.save.directories = [ + { + directory = config.services.postgresql.dataDir; + user = "postgres"; + group = "postgres"; + } + { + directory = config.services.postgresqlBackup.location; + user = "postgres"; + group = "postgres"; + } + ]; +} diff --git a/hosts/luna/modules/system.nix b/hosts/luna/modules/system.nix new file mode 100644 index 00000000..30dcf32b --- /dev/null +++ b/hosts/luna/modules/system.nix @@ -0,0 +1,17 @@ +{ self, ... }: + +{ + system = { + autoUpgrade = { + enable = true; + dates = "05:00"; + allowReboot = true; + flake = self.outPath; + flags = [ + "--update-input" + "nixpkgs" + "-L" + ]; + }; + }; +} diff --git a/hosts/luna/modules/users.nix b/hosts/luna/modules/users.nix new file mode 100755 index 00000000..b979eb74 --- /dev/null +++ b/hosts/luna/modules/users.nix @@ -0,0 +1,26 @@ +{ pkgs, config, ... }: +{ + security.sudo.wheelNeedsPassword = false; + users.mutableUsers = false; + users.users = { + root.hashedPasswordFile = config.age.secrets.users-root-pw.path; + price = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + shell = pkgs.bash; + hashedPasswordFile = config.age.secrets.users-price-pw.path; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOkWsSntg1ufF40cALcIBA7WZhiU/f0cncqq0pcp+DZY openpgp:0x15993C90" + ]; + }; + }; + environment.persistence.ephemeral.users = { + price = { + files = [ ".bash_history" ]; + }; + root = { + home = "/root"; + files = [ ".bash_history" ]; + }; + }; +} diff --git a/hosts/luna/os/boot.nix b/hosts/luna/os/boot.nix new file mode 100644 index 00000000..c2abd14e --- /dev/null +++ b/hosts/luna/os/boot.nix @@ -0,0 +1,81 @@ +{ modulesPath, pkgs, ... }: +{ + + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot = { + tmp = { + useTmpfs = true; + cleanOnBoot = true; + }; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + kernelModules = [ "kvm-intel" ]; + kernelParams = [ "audit=1" ]; + extraModulePackages = [ ]; + initrd = { + availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "uas" + "sd_mod" + ]; + kernelModules = [ ]; + systemd = { + enable = true; + initrdBin = [ + pkgs.libuuid + pkgs.gawk + ]; + services.rollback = { + description = "Rollback btrfs root subvolume"; + wantedBy = [ "initrd.target" ]; + before = [ "sysroot.mount" ]; + after = [ "initrd-root-device.target" ]; + unitConfig.DefaultDependencies = "no"; + serviceConfig.Type = "oneshot"; + script = '' + mkdir -p /mnt + DISK_LABEL="NixOS-Primary" + FOUND_DISK=0 + ATTEMPTS=50 + printf "Attempting to find disk with label '%s'\n" "$DISK_LABEL" + while ((ATTEMPTS > 0)); do + if findfs LABEL="$DISK_LABEL"; then + FOUND_DISK=1 + printf "Found disk!\n" + break; + fi + ((ATTEMPTS--)) + sleep .1 + printf "Remaining disk discovery attempts: %s\n" "$ATTEMPTS" + done + if (( FOUND_DISK == 0 )); then + printf "Discovery of disk with label '%s' failed! Cannot rollback!\n" "$DISK_LABEL" + exit 1 + fi + + mount -t btrfs -o subvol=/ $(findfs LABEL="$DISK_LABEL") /mnt + btrfs subvolume list -to /mnt/root \ + | awk 'NR>2 { printf $4"\n" }' \ + | while read subvol; do + printf "Removing Subvolume: %s\n" "$subvol"; + btrfs subvolume delete "/mnt/$subvol" + done + + printf "Removing /root subvolume\n" + btrfs subvolume delete /mnt/root + + printf "Restoring base /root subvolume\n" + btrfs subvolume snapshot /mnt/root-base /mnt/root + + umount /mnt + ''; + }; + }; + }; + }; +} diff --git a/hosts/luna/os/default.nix b/hosts/luna/os/default.nix new file mode 100644 index 00000000..c0248b54 --- /dev/null +++ b/hosts/luna/os/default.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + zramSwap.enable = true; +} diff --git a/hosts/luna/os/fs.nix b/hosts/luna/os/fs.nix new file mode 100644 index 00000000..887782ee --- /dev/null +++ b/hosts/luna/os/fs.nix @@ -0,0 +1,117 @@ +{ + lib, + root-disk, + persist-dir, + ... +}: +{ + services = { + fstrim.enable = true; + btrfs.autoScrub = { + enable = true; + fileSystems = [ + "/" + "/nix" + "/persist" + ]; + }; + snapper = { + # NOTE: According to `snapper-config(5)` the default timeline count for all timelines is 10 + # (see TIMELINE_LIMIT_HOURLY, ...DAILY, etc.) + configs.persist = { + TIMELINE_CREATE = true; + TIMELINE_CLEANUP = true; + SUBVOLUME = "${persist-dir}"; + }; + }; + }; + + fileSystems."${persist-dir}".neededForBoot = true; + + disko.devices = { + disk.${lib.removePrefix "/dev/" root-disk} = { + type = "disk"; + device = "${root-disk}"; + content = { + type = "gpt"; + partitions = { + esp = + let + label = "NixOS-Boot"; + in + { + priority = 1; + size = "512M"; + type = "EF00"; + content = { + extraArgs = [ + "-n ${label}" + "-F 32" + ]; + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + "defaults" + ]; + }; + }; + root = + let + label = "NixOS-Primary"; + in + { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ + "-f" + "--label ${label}" + ]; + postCreateHook = '' + MOUNT="$(mktemp -d)" + mount "/dev/disk/by-label/${label}" "$MOUNT" -o subvol=/ + trap 'umount $MOUNT; rm -rf $MOUNT' EXIT + btrfs subvolume snapshot -r "$MOUNT/root" "$MOUNT/root-base" + ''; + subvolumes = { + "/root" = { + mountpoint = "/"; + }; + "/var-log" = { + mountpoint = "/var/log"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "${persist-dir}" = { + mountpoint = "${persist-dir}"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "${persist-dir}/.snapshots" = { + mountpoint = "${persist-dir}/.snapshots"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/luna/os/hardware.nix b/hosts/luna/os/hardware.nix new file mode 100644 index 00000000..7803acfd --- /dev/null +++ b/hosts/luna/os/hardware.nix @@ -0,0 +1,6 @@ +{ lib, config, ... }: +{ + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + services.fstrim.enable = true; +} diff --git a/hosts/luna/pubkey.nix b/hosts/luna/pubkey.nix new file mode 100644 index 00000000..8f98f270 --- /dev/null +++ b/hosts/luna/pubkey.nix @@ -0,0 +1 @@ +"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZzZ6q/V7f8zbb9Xm0uZPn4zfdXAj3QgwGkGKzEV9Q5 luna" diff --git a/hosts/orion/README.md b/hosts/orion/README.md new file mode 100644 index 00000000..fa2f30a2 --- /dev/null +++ b/hosts/orion/README.md @@ -0,0 +1,2 @@ +# Orion +This is my laptop and primary (and only) developer machine. diff --git a/hosts/orion/default.nix b/hosts/orion/default.nix new file mode 100644 index 00000000..c27a99ae --- /dev/null +++ b/hosts/orion/default.nix @@ -0,0 +1,14 @@ +{ pkgs, lib, ... }: +{ + imports = ( + lib.recurseFilesInDirs [ + ./os + ./modules + ] ".nix" + ); + system.stateVersion = "24.05"; + environment.systemPackages = with pkgs; [ + git + neovim + ]; +} diff --git a/hosts/orion/modules/audio.nix b/hosts/orion/modules/audio.nix new file mode 100644 index 00000000..f6b9f0b4 --- /dev/null +++ b/hosts/orion/modules/audio.nix @@ -0,0 +1,21 @@ +{ + inputs, + lib, + pkgs, + ... +}: + +{ + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + pulse.enable = true; + wireplumber.enable = true; + jack.enable = true; + }; +} diff --git a/hosts/orion/modules/bluetooth.nix b/hosts/orion/modules/bluetooth.nix new file mode 100644 index 00000000..e589a58b --- /dev/null +++ b/hosts/orion/modules/bluetooth.nix @@ -0,0 +1,36 @@ +{ + inputs, + lib, + pkgs, + ... +}: + +{ + hardware.bluetooth.enable = true; + services.blueman.enable = true; + environment.systemPackages = with pkgs; [ bluez ]; + + systemd.user.services.mpris-proxy = { + description = "Mpris proxy"; + after = [ + "network.target" + "sound.target" + ]; + wantedBy = [ "default.target" ]; + serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; + }; + + security.polkit.extraConfig = '' + /* Allow users in wheel group to use blueman feature requiring root without authentication */ + polkit.addRule(function(action, subject) { + if ((action.id == "org.blueman.network.setup" || + action.id == "org.blueman.dhcp.client" || + action.id == "org.blueman.rfkill.setstate" || + action.id == "org.blueman.pppd.pppconnect") && + subject.isInGroup("wheel")) { + + return polkit.Result.YES; + } + }); + ''; +} diff --git a/hosts/orion/modules/graphical.nix b/hosts/orion/modules/graphical.nix new file mode 100644 index 00000000..03c0afc8 --- /dev/null +++ b/hosts/orion/modules/graphical.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + services.displayManager.sddm = { + wayland.enable = true; + enable = true; + }; + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + xdg = { + autostart.enable = true; + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal + xdg-desktop-portal-gtk + ]; + }; + }; + hardware.opengl.enable = true; + services.spice-vdagentd.enable = true; +} diff --git a/hosts/orion/modules/hardware.nix b/hosts/orion/modules/hardware.nix new file mode 100644 index 00000000..63be4045 --- /dev/null +++ b/hosts/orion/modules/hardware.nix @@ -0,0 +1,30 @@ +{ + inputs, + lib, + pkgs, + ... +}: + +{ + # NOTE: Disable Nvidia GPU + boot.extraModprobeConfig = '' + blacklist nouveau + options nouveau iwlwifi power_save=1 modeset=0 + ''; + services.udev.extraRules = '' + # Remove NVIDIA USB xHCI Host Controller devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1" + # Remove NVIDIA USB Type-C UCSI devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1" + # Remove NVIDIA Audio devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" + # Remove NVIDIA VGA/3D controller devices + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1" + ''; + boot.blacklistedKernelModules = [ + "nouveau" + "nvidia" + "nvidia_drm" + "nvidia_modeset" + ]; +} diff --git a/hosts/orion/modules/networking.nix b/hosts/orion/modules/networking.nix new file mode 100644 index 00000000..8f28613c --- /dev/null +++ b/hosts/orion/modules/networking.nix @@ -0,0 +1,56 @@ +{ hostname, lib, ... }: + +let + default-network-cfg = + let + use-dhcp-dns = "no"; + in + { + networkConfig = { + DHCP = "yes"; + MulticastDNS = "yes"; + IPv6PrivacyExtensions = "yes"; + IPv6AcceptRA = "yes"; + }; + dhcpV4Config = { + RouteMetric = 600; + UseDNS = use-dhcp-dns; + }; + ipv6AcceptRAConfig = { + RouteMetric = 600; + UseDNS = use-dhcp-dns; + }; + }; +in +{ + systemd.network = { + enable = true; + networks = lib.attrsets.mapAttrs (name: value: value // default-network-cfg) { + "10-wlan".matchConfig.Name = [ "wl*" ]; + "10-ethernet".matchConfig.name = [ + "en*" + "eth*" + ]; + "10-wwan".matchConfig.name = [ "ww*" ]; + }; + }; + + services.resolved = { + enable = true; + domains = [ "~." ]; + extraConfig = '' + DNS=2a07:e340::2:853#dns.mullvad.net 194.242.2.2#dns.mullvad.net + FallbackDNS=1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com + Cache=yes + CacheFromLocalhost=no + DNSSEC=allow-downgrade + DNSOverTLS=yes + MulticastDNS=yes + ''; + }; + networking = { + hostName = hostname; + wireless.iwd.enable = true; + useNetworkd = true; + }; +} diff --git a/hosts/orion/modules/nix.nix b/hosts/orion/modules/nix.nix new file mode 100644 index 00000000..20355f04 --- /dev/null +++ b/hosts/orion/modules/nix.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; + trusted-users = [ "@wheel" ]; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + }; +} diff --git a/hosts/orion/modules/power.nix b/hosts/orion/modules/power.nix new file mode 100644 index 00000000..9b0522ad --- /dev/null +++ b/hosts/orion/modules/power.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + powerManagement.enable = true; + powerManagement.powertop.enable = true; + services.thermald.enable = true; +} diff --git a/hosts/orion/modules/programs.nix b/hosts/orion/modules/programs.nix new file mode 100644 index 00000000..86ac6a93 --- /dev/null +++ b/hosts/orion/modules/programs.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + programs = { + dconf.enable = true; + zsh.enable = true; + nix-ld.enable = true; + }; +} diff --git a/hosts/orion/modules/services/openssh.nix b/hosts/orion/modules/services/openssh.nix new file mode 100644 index 00000000..7ef90a70 --- /dev/null +++ b/hosts/orion/modules/services/openssh.nix @@ -0,0 +1,62 @@ +{ config, ... }: +{ + services.openssh = { + enable = true; + startWhenNeeded = true; + # We set the hostkeys manually so they persist through reboots + hostKeys = [ + { + path = ( + config.environment.persistence.ephemeral.persistentStoragePath + "/etc/ssh/ssh_host_ed25519_key" + ); + type = "ed25519"; + } + ]; + sftpFlags = [ + "-f AUTHPRIV" + "-l INFO" + ]; + extraConfig = '' + AllowUsers price + ''; + settings = { + PasswordAuthentication = false; + PermitRootLogin = "no"; + GatewayPorts = "yes"; + LogLevel = "VERBOSE"; + KexAlgorithms = [ + "curve25519-sha256" + "curve25519-sha256@libssh.org" + "diffie-hellman-group-exchange-sha256" + ]; + Ciphers = [ + "chacha20-poly1305@openssh.com" + "aes256-gcm@openssh.com" + "aes128-gcm@openssh.com" + "aes256-ctr" + "aes192-ctr" + "aes128-ctr" + ]; + Macs = [ + "hmac-sha2-512-etm@openssh.com" + "hmac-sha2-256-etm@openssh.com" + "umac-128-etm@openssh.com" + ]; + }; + ports = [ 2200 ]; + banner = '' + ┌────────────────────────────────────────────────────┐ + │ Orion Technologies - Security Notice │ + │ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ │ + │ UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED │ + │ │ + │ You must have written, explicit, authorized │ + │ permission to access or configure this device. │ + │ Unauthorized attempts and actions to access or use │ + │ this system may result in civil and/or criminal │ + │ penalties. All activities performed on this device │ + │ are logged and monitored. │ + └────────────────────────────────────────────────────┘ + ''; + }; +} diff --git a/hosts/orion/modules/users.nix b/hosts/orion/modules/users.nix new file mode 100644 index 00000000..92c0dd89 --- /dev/null +++ b/hosts/orion/modules/users.nix @@ -0,0 +1,33 @@ +{ pkgs, config, ... }: +{ + security.sudo.wheelNeedsPassword = false; + users.groups.price = { }; + users.users = { + root.hashedPasswordFile = config.age.secrets.users-root-pw.path; + price = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + group = "price"; + shell = pkgs.zsh; + createHome = true; + hashedPasswordFile = config.age.secrets.users-price-pw.path; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOkWsSntg1ufF40cALcIBA7WZhiU/f0cncqq0pcp+DZY openpgp:0x15993C90" + ]; + }; + }; + environment.persistence.ephemeral.directories = [ + { + directory = "/home/price"; + user = "price"; + group = "${config.users.users.price.group}"; + mode = "${config.users.users.price.homeMode}"; + } + ]; + environment.persistence.ephemeral.users = { + root = { + home = (config.users.users.root.home); + files = [ ".bash_history" ]; + }; + }; +} diff --git a/hosts/orion/os/boot.nix b/hosts/orion/os/boot.nix new file mode 100644 index 00000000..d8100779 --- /dev/null +++ b/hosts/orion/os/boot.nix @@ -0,0 +1,87 @@ +{ modulesPath, pkgs, ... }: +{ + + # imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + kernelModules = [ "kvm-intel" ]; + kernelParams = [ "audit=1" ]; + extraModulePackages = [ ]; + initrd = { + # VM modules + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + # Actual Host modules + # availableKernelModules = [ + # "xhci_pci" + # "thunderbolt" + # "vmd" + # "nvme" + # "usbhid" + # "rtsx_pci_sdmmc" + # ]; + systemd = { + enable = true; + initrdBin = [ + pkgs.libuuid + pkgs.gawk + ]; + services.rollback = { + description = "Rollback btrfs root subvolume"; + wantedBy = [ "initrd.target" ]; + before = [ "sysroot.mount" ]; + after = [ "initrd-root-device.target" ]; + unitConfig.DefaultDependencies = "no"; + serviceConfig.Type = "oneshot"; + script = '' + mkdir -p /mnt + DISK_LABEL="NixOS-Primary" + FOUND_DISK=0 + ATTEMPTS=50 + printf "Attempting to find disk with label '%s'\n" "$DISK_LABEL" + while ((ATTEMPTS > 0)); do + if findfs LABEL="$DISK_LABEL"; then + FOUND_DISK=1 + printf "Found disk!\n" + break; + fi + ((ATTEMPTS--)) + sleep .1 + printf "Remaining disk discovery attempts: %s\n" "$ATTEMPTS" + done + if (( FOUND_DISK == 0 )); then + printf "Discovery of disk with label '%s' failed! Cannot rollback!\n" "$DISK_LABEL" + exit 1 + fi + + mount -t btrfs -o subvol=/ $(findfs LABEL="$DISK_LABEL") /mnt + btrfs subvolume list -to /mnt/root \ + | awk 'NR>2 { printf $4"\n" }' \ + | while read subvol; do + printf "Removing Subvolume: %s\n" "$subvol"; + btrfs subvolume delete "/mnt/$subvol" + done + + printf "Removing /root subvolume\n" + btrfs subvolume delete /mnt/root + + printf "Restoring base /root subvolume\n" + btrfs subvolume snapshot /mnt/root-base /mnt/root + + umount /mnt + ''; + }; + }; + }; + }; +} diff --git a/hosts/orion/os/default.nix b/hosts/orion/os/default.nix new file mode 100644 index 00000000..7e7c4293 --- /dev/null +++ b/hosts/orion/os/default.nix @@ -0,0 +1,5 @@ +{ modulesPath, ... }: + +{ + zramSwap.enable = true; +} diff --git a/hosts/orion/os/fs.nix b/hosts/orion/os/fs.nix new file mode 100644 index 00000000..b4b8e9a4 --- /dev/null +++ b/hosts/orion/os/fs.nix @@ -0,0 +1,112 @@ +{ + modulesPath, + config, + lib, + root-disk, + persist-dir, + ... +}: +{ + services = { + fstrim.enable = true; + btrfs.autoScrub = { + enable = true; + fileSystems = [ + "/" + "/nix" + "/persist" + ]; + }; + snapper = { + # NOTE: According to `snapper-config(5)` the default timeline count for all timelines is 10 + # (see TIMELINE_LIMIT_HOURLY, ...DAILY, etc.) + configs.persist = { + TIMELINE_CREATE = true; + TIMELINE_CLEANUP = true; + SUBVOLUME = "${persist-dir}"; + }; + }; + }; + + fileSystems."${persist-dir}".neededForBoot = true; + + disko.devices = { + disk.${lib.removePrefix "/dev/" root-disk} = { + type = "disk"; + device = "${root-disk}"; + content = { + type = "gpt"; + partitions = { + esp = + let + label = "NixOS-Boot"; + in + { + priority = 1; + size = "512M"; + type = "EF00"; + content = { + extraArgs = [ + "-n ${label}" + "-F 32" + ]; + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + "defaults" + ]; + }; + }; + root = + let + label = "NixOS-Primary"; + in + { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + settings = { + allowDiscards = true; + }; + content = { + type = "btrfs"; + extraArgs = [ + "-f" + "--label ${label}" + ]; + postCreateHook = '' + MOUNT="$(mktemp -d)" + mount "/dev/disk/by-label/${label}" "$MOUNT" -o subvol=/ + trap 'umount $MOUNT; rm -rf $MOUNT' EXIT + btrfs subvolume snapshot -r "$MOUNT/root" "$MOUNT/root-base" + ''; + subvolumes = { + "/root" = { + mountpoint = "/"; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/orion/os/hardware.nix b/hosts/orion/os/hardware.nix new file mode 100644 index 00000000..7803acfd --- /dev/null +++ b/hosts/orion/os/hardware.nix @@ -0,0 +1,6 @@ +{ lib, config, ... }: +{ + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + services.fstrim.enable = true; +} diff --git a/hosts/orion/pubkey.nix b/hosts/orion/pubkey.nix new file mode 100644 index 00000000..87aeadac --- /dev/null +++ b/hosts/orion/pubkey.nix @@ -0,0 +1 @@ +"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB/mvAHcaWQv6m+F5o2wYg5DX+cOYCiqha/LustPcStf orion" diff --git a/install.bash b/install.bash deleted file mode 100755 index ca7819ee..00000000 --- a/install.bash +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env /bin/bash -nix run --extra-experimental-features 'nix-command flakes' . -- switch --extra-experimental-features 'nix-command flakes' --flake "git+file://$(pwd)?submodules=1" "${@}" diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 00000000..96d1d6df --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,16 @@ +{ inputs, ... }: +{ + additions = final: _prev: import ../pkgs { pkgs = final; }; + + modifications = final: prev: { + waybar = inputs.waybar.packages.${final.system}.default; + lxappearance = prev.lxappearance.overrideAttrs (oldAttrs: { + postInstall = '' + wrapProgram $out/bin/lxappearance --prefix GDK_BACKEND : x11 + ''; + }); + opensnitch-ui = prev.opensnitch-ui.overrideAttrs (oldAttrs: { + propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [ prev.python311Packages.qt-material ]; + }); + }; +} diff --git a/pkgs/Fmt/flake.lock b/pkgs/Fmt/flake.lock deleted file mode 100644 index ed4fd7f9..00000000 --- a/pkgs/Fmt/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1710534455, - "narHash": "sha256-huQT4Xs0y4EeFKn2BTBVYgEwJSv8SDlm82uWgMnCMmI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "9af9c1c87ed3e3ed271934cb896e0cdd33dae212", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "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", - "version": 7 -} diff --git a/pkgs/Fmt/flake.nix b/pkgs/Fmt/flake.nix deleted file mode 100644 index 851989c3..00000000 --- a/pkgs/Fmt/flake.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - description = "Flake for custom formatting script"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = - { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in - { - packages.default = pkgs.writeShellApplication { - name = "Fmt"; - runtimeInputs = with pkgs; [ - stylua - gnugrep - nixfmt-rfc-style - nodePackages.prettier - shfmt - ]; - text = ( - '' - #!${pkgs.bash}/bin/bash - '' - + builtins.readFile ./fmt.bash - ); - }; - } - ) - // { - overlays.default = final: prev: { Fmt = self.packages.${final.system}.default; }; - }; -} diff --git a/pkgs/bob-nvim.nix b/pkgs/bob-nvim.nix new file mode 100644 index 00000000..029c377b --- /dev/null +++ b/pkgs/bob-nvim.nix @@ -0,0 +1,14 @@ +{ rustPlatform, fetchFromGitHub }: + +rustPlatform.buildRustPackage rec { + pname = "bob"; + version = "2.9.1"; + + src = fetchFromGitHub { + owner = "MordechaiHadad"; + repo = "bob"; + rev = "v${version}"; + hash = "sha256-jVRxvhUENyucRHN4TGV9xsWOs7mfPJCV90Lk/hD1xFE="; + }; + cargoLock.lockFile = "${src}/Cargo.lock"; +} diff --git a/pkgs/bob-nvim/flake.lock b/pkgs/bob-nvim/flake.lock deleted file mode 100644 index 291c22c1..00000000 --- a/pkgs/bob-nvim/flake.lock +++ /dev/null @@ -1,78 +0,0 @@ -{ - "nodes": { - "bob": { - "flake": false, - "locked": { - "lastModified": 1706612487, - "narHash": "sha256-OTmsb1tnautQTdO/oeqbwd5MmyHbG946/kPCGSluIrM=", - "owner": "MordechaiHadad", - "repo": "bob", - "rev": "e521723d2c084f4b610c27d79f870f83e964fe95", - "type": "github" - }, - "original": { - "owner": "MordechaiHadad", - "repo": "bob", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1708151420, - "narHash": "sha256-MGT/4aGCWQPQiu6COqJdCj9kSpLPiShgbwpbC38YXC8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "6e2f00c83911461438301db0dba5281197fe4b3a", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "bob": "bob", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "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", - "version": 7 -} diff --git a/pkgs/bob-nvim/flake.nix b/pkgs/bob-nvim/flake.nix deleted file mode 100644 index f33e4376..00000000 --- a/pkgs/bob-nvim/flake.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - description = "Flake for bob-nvim, a Neovim version manager."; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - bob = { - flake = false; - url = "github:MordechaiHadad/bob"; - }; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = - { - self, - nixpkgs, - flake-utils, - bob, - }: - flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - rust-toolchain = pkgs.symlinkJoin { - name = "rust-toolchain"; - paths = with pkgs; [ - rustc - cargo - cargo-watch - rust-analyzer - rustfmt - ]; - }; - in - rec { - # This builds the blog binary then runs it and collects the output. Once done it throws away the binary and - # shoves the newly created static site into the result. - packages.default = pkgs.rustPlatform.buildRustPackage { - name = "bob-nvim"; - pname = "bob"; - src = "${bob}"; - cargoLock.lockFile = "${bob}/Cargo.lock"; - }; - - # Rust dev environment - devShells.default = pkgs.mkShell { - shellHook = '' - # For rust-analyzer 'hover' tooltips to work. - export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} - ''; - nativeBuildInputs = [ rust-toolchain ]; - }; - } - ) - // { - overlays.default = final: prev: { bob-nvim = self.packages.${final.system}.default; }; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 00000000..1ff2fe50 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + bob-nvim = pkgs.callPackage ./bob-nvim.nix { + rustPlatform = pkgs.rustPlatform; + fetchFromGitHub = pkgs.fetchFromGitHub; + }; + Fmt = pkgs.writeShellApplication { + name = "Fmt"; + runtimeInputs = with pkgs; [ + stylua + gnugrep + nixfmt-rfc-style + nodePackages.prettier + shfmt + ]; + text = ( + '' + #!${pkgs.bash}/bin/bash + '' + + builtins.readFile ./fmt.bash + ); + }; +} diff --git a/pkgs/Fmt/fmt.bash b/pkgs/fmt.bash similarity index 99% rename from pkgs/Fmt/fmt.bash rename to pkgs/fmt.bash index b4aa0bdc..8f07f050 100755 --- a/pkgs/Fmt/fmt.bash +++ b/pkgs/fmt.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # vim: ft=sh set -euo pipefail diff --git a/pkgs/kanagawa-gtk/flake.lock b/pkgs/kanagawa-gtk/flake.lock deleted file mode 100644 index c955db00..00000000 --- a/pkgs/kanagawa-gtk/flake.lock +++ /dev/null @@ -1,78 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "kanagawa-gtk": { - "flake": false, - "locked": { - "lastModified": 1688426096, - "narHash": "sha256-BZRmjVas8q6zsYbXFk4bCk5Ec/3liy9PQ8fqFGHAXe0=", - "owner": "Fausto-Korpsvart", - "repo": "Kanagawa-GKT-Theme", - "rev": "35936a1e3bbd329339991b29725fc1f67f192c1e", - "type": "github" - }, - "original": { - "owner": "Fausto-Korpsvart", - "repo": "Kanagawa-GKT-Theme", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1708151420, - "narHash": "sha256-MGT/4aGCWQPQiu6COqJdCj9kSpLPiShgbwpbC38YXC8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "6e2f00c83911461438301db0dba5281197fe4b3a", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "kanagawa-gtk": "kanagawa-gtk", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "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", - "version": 7 -} diff --git a/pkgs/kanagawa-gtk/flake.nix b/pkgs/kanagawa-gtk/flake.nix deleted file mode 100644 index 5b3cd605..00000000 --- a/pkgs/kanagawa-gtk/flake.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ - description = "Flake for the Kanagwa GTK Theme"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - kanagawa-gtk = { - flake = false; - url = "github:Fausto-Korpsvart/Kanagawa-GKT-Theme"; - }; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = - { - self, - nixpkgs, - flake-utils, - kanagawa-gtk, - }: - flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - lib = nixpkgs.lib; - in - rec { - # This builds the blog binary then runs it and collects the output. Once done it throws away the binary and - # shoves the newly created static site into the result. - packages.kanagawa-gtk-theme = pkgs.stdenvNoCC.mkDerivation rec { - pname = "kanagawa-gtk-theme"; - version = "unknown"; - - src = "${kanagawa-gtk}"; - - propagatedUserEnvPkgs = with pkgs; [ gtk-engine-murrine ]; - - nativeBuildInputs = with pkgs; [ gtk3 ]; - - installPhase = '' - runHook preInstall - mkdir -p $out/share/themes - cp -a themes/* $out/share/themes - runHook postInstall - ''; - meta = with lib; { - description = "A GTK theme with the Kanagawa colour palette. Borrowed with ❤️ from https://github.com/NixOS/nixpkgs/pull/277073."; - homepage = "https://github.com/Fausto-Korpsvart/Kanagawa-GKT-Theme"; - license = licenses.gpl3Only; - platforms = platforms.all; - }; - }; - packages.default = packages.kanagawa-gtk-theme; - - packages.kanagwa-icon-theme = pkgs.stdenvNoCC.mkDerivation rec { - pname = "kanagawa-icon-theme"; - version = "unknown"; - - src = "${kanagawa-gtk}"; - - nativeBuildInputs = with pkgs; [ gtk3 ]; - - propagatedBuildInputs = with pkgs; [ hicolor-icon-theme ]; - - dontDropIconThemeCache = true; - - installPhase = '' - runHook preInstall - - mkdir -p $out/share/icons - cp -a icons/* $out/share/icons - for theme in $out/share/icons/*; do - gtk-update-icon-cache -f $theme - done - - runHook postInstall - ''; - - meta = with lib; { - description = "An icon theme for the Kanagawa colour palette. Borrowed with ❤️ from https://github.com/NixOS/nixpkgs/pull/277073."; - homepage = "https://github.com/Fausto-Korpsvart/Kanagawa-GKT-Theme"; - license = licenses.gpl3Only; - platforms = platforms.all; - }; - }; - - # Rust dev environment - } - ) - // { - overlays.default = final: prev: { - kanagawa-gtk-theme = self.packages.${final.system}.kanagawa-gtk-theme; - kanagawa-gtk-icon-theme = self.packages.${final.system}.kanagwa-icon-theme; - }; - }; -} diff --git a/scripts/install-host.bash b/scripts/install-host.bash new file mode 100755 index 00000000..96914a47 --- /dev/null +++ b/scripts/install-host.bash @@ -0,0 +1,112 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail + +BASE_DIR="$PWD" + +gen-system-key() { + local system="${1:?"No system provided to generate a key for!"}" + local priv_key_path="${2:?"No private key path provided!"}" + local key_file="out-key" + local priv_key + local pub_key + + # Gen Key in a temp directory + pushd "$(mktemp -d)" >/dev/null + ssh-keygen -t ed25519 -f ./"${key_file}" -N '' -C "${system}" -q + priv_key="$(cat "${key_file}")" + pub_key="$(cat "${key_file}.pub")" + rm -f "${key_file}" "${key_file}.pub" >/dev/null + popd >/dev/null + + # Update public key for system and rekey secrets + printf "Rekeying for '%s' secrets with new system key!\n" "${system}" 1>&2 + local host_pubkey_path="${BASE_DIR}/hosts/${system}/pubkey.nix" + if [[ -r "${host_pubkey_path}" ]]; then + local backup_pub_key_path + backup_pub_key_path="${host_pubkey_path}.$(date +'%Y-%d-%m_%H:%M:%S')" + printf "Backing up old public key file to '%s'!\n" "${backup_pub_key_path}" 1>&2 + mv "${host_pubkey_path}" "${backup_pub_key_path}" + fi + printf '"%s"' "${pub_key}" >"${host_pubkey_path}" + git add "${host_pubkey_path}" 1>&2 + + pushd secrets >/dev/null + agenix -r -i "${priv_key_path}" 1>&2 + git add . 1>&2 + popd >/dev/null + + printf "%s" "${priv_key}" +} + +main() { + local persist_dir="/mnt/persist" + local flake_install_path="${persist_dir}/ephemeral/etc/nixos" + + local system="${1:?"Provide system to build!"}" + local flake=".#${system}" + local conn="${2:?"Provide ssh connection string! (E.g. root@myhost)"}" + local priv_key_path="${3:?Provide path to private key}" + local ssh_port="${4:-22}" + + if [[ ! -r "${priv_key_path}" ]]; then + printf "Unable a private key file at '%s'\n!" "${priv_key_path}" 1>&2 + exit 1 + elif [[ ! -r "${BASE_DIR}/hosts/${system}" ]]; then + printf "Could not find a system named '%s' in '%s'!\n" "${system}" "${BASE_DIR}/hosts" 1>&2 + exit 1 + fi + cat <<-__EOS__ + ───────────────────────────────── + Installing NixOS on Remote Host + ================================= + Host: "${conn}" + Flake: "${flake}" + ───────────────────────────────── + __EOS__ + printf "Generating system keys\n" + local new_sys_key + new_sys_key="$(gen-system-key "${system}" "${priv_key_path}")" + printf "Finished generating system keys\n" + local nixos_anywhere_log + nixos_anywhere_log="$(nix run github:nix-community/nixos-anywhere -- --flake "${flake}" "${conn}" --stop-after-disko -p "${ssh_port}" 2>&1 | tee >(cat >&2))" + local ssh_login_key="${nixos_anywhere_log##*$'\n'}" + ssh_login_key="${ssh_login_key#*\'}" + ssh_login_key="${ssh_login_key%\'*}" + local ssh_opts="-i ${ssh_login_key} -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${ssh_port} -l root" + local ssh_cmd="ssh ${conn} ${ssh_opts}" + local system_key_dest="${persist_dir}/ephemeral/etc/ssh/ssh_host_ed25519_key" + printf "SSH Command: %s\n" "${ssh_cmd}" + eval "${ssh_cmd}" <<-__EOS__ + mkdir -p "${persist_dir}/ephemeral/etc/ssh" + mkdir -p "${persist_dir}/save" + mkdir -p "${flake_install_path}" + printf "Putting new system key into place\n" + printf "%s\n" "${new_sys_key}" > "${system_key_dest}" + chmod 0600 "${system_key_dest}" + printf "Installing rsync for later stage\n" + nix-env -f '' -iA rsync + __EOS__ + printf "Copying flake to system\n" + local rsync_cmd="rsync -r '${BASE_DIR}'/ '${conn}:${flake_install_path}' -e 'ssh ${ssh_opts}' --info=PROGRESS2" + printf "Issuing rsync command: '%s\n'" "${rsync_cmd}" + eval "${rsync_cmd}" + printf "Doing final install\n" + eval "${ssh_cmd}" <<-__EOS__ + set -euo pipefail + cd "${flake_install_path}" + nix-env -f '' -iA git + sudo nixos-install --flake "git+file:${flake}" --no-root-password --no-channel-copy && reboot + __EOS__ + + cat <<-__EOS__ + ────────────────────────────────────────── + Finished Installing NixOS on Remote Host + ========================================== + Host: "${conn}" + Flake: "${flake}" + ────────────────────────────────────────── + __EOS__ +} + +main "${@}" diff --git a/secrets/default.nix b/secrets/default.nix index c60f5e71..a5991522 100644 --- a/secrets/default.nix +++ b/secrets/default.nix @@ -1,30 +1,60 @@ { - agenix ? true, + agenix ? false, lib ? import ../lib { }, }: let - keys = [ + masterKeys = [ "age1yubikey1qfnj0k4mkzrn8ef5llwh2sv6hd7ckr0qml3n9hzdpz9c59ypvryhyst87k0" "age1ur2lr3z6d2eftgxcalc6s5x9840ew9x43upl9k23wg0ugacrn5as4zl6sj" ]; - secrets = - let - dir = "files"; - in - { }; + hosts = { + luna = + let + secrets = "hosts/luna"; + in + { + users-root-pw = "${secrets}/users-root-pw.age"; + users-price-pw = "${secrets}/users-price-pw.age"; + gitea-db-pass = "${secrets}/gitea-db-pass.age"; + gitea-runner-token = "${secrets}/gitea-runner-token.age"; + }; + orion = + let + secrets = "hosts/orion"; + in + { + users-root-pw = "${secrets}/users-root-pw.age"; + users-price-pw = "${secrets}/users-price-pw.age"; + }; + }; in if agenix then (builtins.listToAttrs ( - builtins.concatMap (secretName: [ - { - name = builtins.toString secretName; - value.publicKeys = keys; - } - ]) (builtins.attrNames secrets) + builtins.concatMap ( + host: + let + hostSecrets = (builtins.getAttr host hosts); + in + (builtins.map ( + hostSecretName: + let + secret = (builtins.getAttr hostSecretName hostSecrets); + in + { + name = builtins.toString secret; + value = { + publicKeys = [ (import ./../hosts/${host}/pubkey.nix) ] ++ masterKeys; + }; + } + ) (builtins.attrNames hostSecrets)) + ) (builtins.attrNames hosts) )) else - (lib.recursiveMerge ( - builtins.map (secretName: { age.secrets.${secretName}.file = ./${secrets.${secretName}}; }) ( - builtins.attrNames secrets - ) - )) + (builtins.mapAttrs ( + host: secrets: + (lib.recursiveMerge ( + builtins.map (secretName: { age.secrets.${secretName}.file = ./${secrets.${secretName}}; }) ( + builtins.attrNames hosts.${host} + ) + )) + ) hosts) diff --git a/secrets/hosts/luna/gitea-db-pass.age b/secrets/hosts/luna/gitea-db-pass.age new file mode 100644 index 00000000..0b073f36 --- /dev/null +++ b/secrets/hosts/luna/gitea-db-pass.age @@ -0,0 +1,16 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFdvUU04QSBNYlI4 +SUFhY21vTTdES005Z2pRSHVPUlNaNU94bm5LMEcvL1pwbWQvYlRnCit5MEVsRTMz +K0RYc20wbGlzaXV4aDZGODRDdWFxNklwM3NjUFdHUU1zWVEKLT4gWDI1NTE5IDVC +aUJrWCtpdzZObE5ETlNobFVoNVUrdmo2dDBodVdpdVhLcjVCaXBkbk0KKy9HblBo +alh5ak5YNVEwb0ZsQk9kWGRhb1JkRkhjRkhJWUtnOFVEQ0piVQotPiBwaXYtcDI1 +NiBySnMxSEEgQXVHc3prNk42UmhwMW9PSTBtMk1jR2hVSXpxVkVyWFFQb29YYWZT +bUw4czkKOWhTRmFOUTBtVW5qbXB2Tk93QkJ6UnFacExkMkU0NzVONUlzbzRZOGxE +TQotPiBibXQtZ3JlYXNlIG0gVzBBZSBJQjsiUnAxfSAvQV84CjR3U2VaT1B1Tkxw +dFdSRzlPeURpZXY2QlUyNHJJMjE3Y3F2VUNWcVB4UQotLS0gc1h6WitwUkpsM0dL +T3B4Z3FNV09OVUZ1SGZQQUN2OHE3cmZuZEJleitTawov2e+ve9ZQV89nggvRV/yu +Kw0pNzog065lk3mVwNONqlfa3gGd1w78J06lndiZ6oF1/0VZHyRwXf+Rs8cMezzb +ITXuBHZ6GXZ0Nii/dhK0nN8sfHtCR3zpUcxBn8nkl5tNhW6MzLSK1yfIOQZMHatO +GM1f7BKFdLCLb+6VW6tDnqP+8uOFGLNbTcGepxiEAW6wnixnXHjRC+M9otGIUmfe +XdlANT4syDJhuqv5k/PmB10hgWBGByBlOtG3TiMmBgyZQbOVLAdZx0pNI7jg +-----END AGE ENCRYPTED FILE----- diff --git a/secrets/hosts/luna/gitea-runner-token.age b/secrets/hosts/luna/gitea-runner-token.age new file mode 100644 index 00000000..e840c100 --- /dev/null +++ b/secrets/hosts/luna/gitea-runner-token.age @@ -0,0 +1,14 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFdvUU04QSA0bys5 +cmx2R3Iva1ZxekhtcEtIdUdvRGpoRlN2V0ZWNnR1VmlXelAvZlRvCmUvMnZGNWlO +a0t4cnBBTUYxQ0EzVGRCYnh1K0YxV1IrdmU2d2hid29LN0EKLT4gWDI1NTE5IGYy +ZG4ranlyRExMeGJTZHFEVFh6N1g1a2ZncUZudzBIVDZ0a3BsMHk0a1kKdFNFa0Fl +ZTBJSE81UDJIbHRDeWFHQTRSVnRIczRKdjRxQkF2dGFwNi9EbwotPiBwaXYtcDI1 +NiBySnMxSEEgQStqWFJHZ0RULzRCWFN6aXF2bHAwODNlV29MTm5kTzlRbG5jdlVW +d08vdEUKbUQ4SXdtUGNLU0VtT1hSZXlEUnc0QW81Vm56VXBuYklOTWJBSmR3UDJG +OAotPiBNLWdyZWFzZSB9RSolSG9DCkt4Z0VzSk5GK3hHelZZQkx6M2g1NnJWcnVG +Z3hyZTJNb0lNK0UvZnY0TWFiCi0tLSBGdVIyZ0MybUtZQTFKcVJoUjR2ZG1HYmRi +NnZrdWFsdU1Gb3pLYVovODFFCjNwKkWh0MitzqcFXkocWHeE8tf9ZowVVk9sQ+TJ +RrbvTpTKP5KATDmG4+C2cn01WN0JorD9gGZk3ygV9sVm42hucvLa3AUMYelvcZHH +fxk= +-----END AGE ENCRYPTED FILE----- diff --git a/secrets/hosts/luna/users-price-pw.age b/secrets/hosts/luna/users-price-pw.age new file mode 100644 index 00000000..4145e057 --- /dev/null +++ b/secrets/hosts/luna/users-price-pw.age @@ -0,0 +1,15 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFdvUU04QSBwTzBk +ZWQrYklGYmVSK2diM1d0ZWkwNGZ0a2VTTC84SEFjajlreHRnOWdFCm80ckxBQlIr +M1UyNTBoUFBINzdEdzVBandQcEdDY3ZvbVpsejFRSTdyY0kKLT4gWDI1NTE5IGNH +RU44b3BpaGUzd2V5RFlOZlIyY0o5Z2NFYnAyWTU0NVg0K3lUYUxrR0UKcEVoMTVu +QVk1Z25LZlNqTW1EUTUySXdhdGU2Zm5yckhCa2Y4VkJEcHFCRQotPiBwaXYtcDI1 +NiBySnMxSEEgQWpnRVdYVTZOOElHYTYxOTJ3YnA5eWc3WHowS05NWUo3K0RUNVN3 +ZHdTTDEKU21UZE5rK3lqbTZ1TGpFWUc0STZxRExtSDVERC9kYjBnbkFmb0o4RzRY +QQotPiBGLWdyZWFzZSA/QSRvM1cgPlolCnhuQy81UnF5azEwUW9aTXhqUG8ydzYr +eDlPU293YkVKbkhVYnRMWXZQQ3VncWpYWUVtNlpxNjJCQVNVcgotLS0gbklXWlJK +MW9XUnY0MU1WMXhjcStjSUphMGlDTVVUbEJ5dHNCbkRDbjlycwoPTmZO09gCTAlk +QqFphkBQsaPus03eGrU7MFIjE8zpjKjkLfSQYilrgS5vv164RpWS/y8dMVqoFTsA +HKqHcjUkuDUnSgHTk4ZLtISi4y6zq3iDvVABM8K+zVJr9KvJuwCOzOoAxKfn/dSL +lvJ7k8CivrnviKc9FYn/Kf4gCtNLBhsQ0X2DOHfusFNG +-----END AGE ENCRYPTED FILE----- diff --git a/secrets/hosts/luna/users-root-pw.age b/secrets/hosts/luna/users-root-pw.age new file mode 100644 index 00000000..e6e017bb --- /dev/null +++ b/secrets/hosts/luna/users-root-pw.age @@ -0,0 +1,14 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFdvUU04QSBRUDUw +eWRxZ0xQVWc3UXB1dFFiTWhsM29lSkVSUW5QazNPRXhXeEI0SHc4ClFCREpHYTdz +RmRZdklUNnVmNHBNalVUdzkxTTc5L1pXK3QzdlQxZVhvMkEKLT4gWDI1NTE5IFBY +Z1FvNDdMOHZvYmJUZmlEbUwwbUFxVEc4c2pUa3F4VlZkQW8yQ3ZveVkKY0h0bThW +cEs1ZXFjaGZSbTFQZHVySEJ2b3A4bXRKWkI4b01GZ0g4aHdJcwotPiBwaXYtcDI1 +NiBySnMxSEEgQXp5dnpxWGp0SzVhVWpSYzZXWVU5NmZkcy9FN0R6ajJiWEdzK21p +V3A3WEIKYlBaVkw0WTQvWldrWlFUVkVlQVU2UFNKSW9VWlhTMFNuNnFicTA4L2U5 +bwotPiAhcS1ncmVhc2UgOypuJlwoc18gWl46ZSx0CnoyQ0x2dnVYcXpzRC9DZzNj +QQotLS0gT2RBL3ZlN1RYK3d4ZzUrZHI1TzJubllxbUFPbFUzbkI3ZlFldXFoVHly +ZwruN+Wtj/2dKzzE3qmapuWPJXpYw/fCdhoRu+Yv1uoqqwGTBAH7usQnO3DffOHo +2alpmoDkqlGjrLuJ+frvyWAh6xyggmN7zsD0cadR1a8BoxrBTktY0OFj/+u6MJDD +kpkYDB/umaol7aJM6x6f9x+twgdzVxYlsSgdrA+UR19GrX6BniR/fWC0SXZ0 +-----END AGE ENCRYPTED FILE----- diff --git a/secrets/hosts/orion/users-price-pw.age b/secrets/hosts/orion/users-price-pw.age new file mode 100644 index 00000000..70a80099 --- /dev/null +++ b/secrets/hosts/orion/users-price-pw.age @@ -0,0 +1,15 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IGxkdEhLZyBIWE1n +T0ZJaS8xb3JxUGE5VUdxaU9CT2paV1U5U0tCZWFUV0Z3WkdVbTNzCjZuN0lKeEh3 +UE5WVjVnSk9JYlJra1NDQU1ocWdnMVFoRmUzc0xkQlZ1R0UKLT4gWDI1NTE5IENt +NnpHN29KeklSWGpwaDRWNGg3MDh5SyszRXlUU0pnM1dQRGZBejdNMkUKdXdnSndV +VzBJbFQvV1JLVGt4TU0wR1ZuL0twcmFDV0NSL29JRGU5bWhoWQotPiBwaXYtcDI1 +NiBySnMxSEEgQXc2RWNaOHFXcDJ6UlpyZWk3Y3g2RDJvQkNKQ3FmQyt0dXoyWHZa +WTZvSTcKTmpmOEliRkV0NU92K2NTV3dBV0NwTEVTVi9vTTRYVVJVTUxUL0xBWkNB +MAotPiAiLGp4LWdyZWFzZSAhKTdzbi9XClY4aTVYUGYyOE9acGJyVGliL2krUEg0 +OFdUMHUKLS0tIEUwOU1YclcwNnBSUTFaalo4Wm9YaEFaOXZDa29YZjRZdTF2cmRi +VVQzZ0UKGip/2vrDDEHl0kh81TMmQXSCYi+gcyPk+CimiUgPuMvUsVWBfhEhVQSm +8k5SohQRurOcyTyKt66qO9sNLQf8i4n5uTe7j3mdP9xBMQSmQkFujtIDzO2ZA8kc +5J7DYDHyG4LwnC9Epyd8eBmE1Hhpqug+RqMG3C7NApxYJ626gB2t4WyZUEQuIYAT +Ew== +-----END AGE ENCRYPTED FILE----- diff --git a/secrets/hosts/orion/users-root-pw.age b/secrets/hosts/orion/users-root-pw.age new file mode 100644 index 00000000..c3287d7d --- /dev/null +++ b/secrets/hosts/orion/users-root-pw.age @@ -0,0 +1,17 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IGxkdEhLZyB5cUQ5 +MGdqVmpnKzFjak9iVk1BVWN6U0oyT3c5MUJ5cFdabnNEalovMmpvCkFVYVpwbXJi +dlhHdUtzZ1Y5U2pqVVlDbGhxcmtoUmN5dGNxNStwMkllTFUKLT4gWDI1NTE5IEty +OVVhTE1KRFgzWXl1T3NCR2FBK0w0YTJIcC91TUhJaXgyaTRBQ1hneTgKZWNNdDJp +STNEWkJxdUhsSk1SMXFSc0ZyNXJEenJ0b0VqZExsbUs2VUdkbwotPiBwaXYtcDI1 +NiBySnMxSEEgQW5LZCtmRFEvYUkrZHp0MVJJc0tjbW1GalNYYkttUXVPR0xDTWRn +dEtFSkcKaGYyZElrUzNyYWpqYUhTSERiZGVadlp1UU1RSnkrODFJTzFKVFRIeUdI +VQotPiAhM1Y+Xy1ncmVhc2UgbGY3UEt+RiAqcDxfYTBdIGJ7CnVyOVRDcytTb0h4 +d2pDYlpBSEpIZDA2NDdsOExGMGdDeXYzWXJCYUdUaGFBZHNmN1BpdmZJMEVIZWNV +c3lkWjQKTDhDSWo0NFVuQzVhZk1EUHhocHdhN1JZTkVpZUdSTUwxUzBjSFIrVnpr +SDAwTnpBSHNibUZhajVqVzQKLS0tIDVDY0FnRnJUc3hwbDgyYzJZazRmQ0pyVmV6 +dU45S2lDdStQc05kUXdoSDQKdNPcHQuexwFFJwGBkand8jVXS/8gbhycSEysX+Sj +s5BKORCExjyRkO8AkI//LZ/96ReoIYuHmUaIRIC6qtJCAvK89SsDm8iPbzyTigfL +OjHzW3UCX69spnohxKFgfYNmypFSwl/L9fQ9RVVj2HFXRwctMFdfYAke/CVIUzz+ +EAI9BuTRh+Wy9fwlcQ== +-----END AGE ENCRYPTED FILE----- diff --git a/dots/.config/bat/config b/users/price/dots/.config/bat/config similarity index 100% rename from dots/.config/bat/config rename to users/price/dots/.config/bat/config diff --git a/dots/.config/bat/themes/Kanagawa.tmTheme b/users/price/dots/.config/bat/themes/Kanagawa.tmTheme similarity index 100% rename from dots/.config/bat/themes/Kanagawa.tmTheme rename to users/price/dots/.config/bat/themes/Kanagawa.tmTheme diff --git a/dots/.config/chrome-flags.conf b/users/price/dots/.config/chrome-flags.conf similarity index 100% rename from dots/.config/chrome-flags.conf rename to users/price/dots/.config/chrome-flags.conf diff --git a/dots/.config/chromium-flags.conf b/users/price/dots/.config/chromium-flags.conf similarity index 100% rename from dots/.config/chromium-flags.conf rename to users/price/dots/.config/chromium-flags.conf diff --git a/dots/.config/direnv/direnvrc b/users/price/dots/.config/direnv/direnvrc similarity index 100% rename from dots/.config/direnv/direnvrc rename to users/price/dots/.config/direnv/direnvrc diff --git a/dots/.config/emacs/.gitignore b/users/price/dots/.config/emacs/.gitignore similarity index 100% rename from dots/.config/emacs/.gitignore rename to users/price/dots/.config/emacs/.gitignore diff --git a/dots/.config/emacs/early-init.el b/users/price/dots/.config/emacs/early-init.el similarity index 100% rename from dots/.config/emacs/early-init.el rename to users/price/dots/.config/emacs/early-init.el diff --git a/dots/.config/emacs/init.el b/users/price/dots/.config/emacs/init.el similarity index 100% rename from dots/.config/emacs/init.el rename to users/price/dots/.config/emacs/init.el diff --git a/dots/.config/hypr/conf/application/gromit-mpx.conf b/users/price/dots/.config/hypr/conf/application/gromit-mpx.conf similarity index 100% rename from dots/.config/hypr/conf/application/gromit-mpx.conf rename to users/price/dots/.config/hypr/conf/application/gromit-mpx.conf diff --git a/dots/.config/hypr/conf/core/appearance.conf b/users/price/dots/.config/hypr/conf/core/appearance.conf similarity index 100% rename from dots/.config/hypr/conf/core/appearance.conf rename to users/price/dots/.config/hypr/conf/core/appearance.conf diff --git a/dots/.config/hypr/conf/core/bindings.conf b/users/price/dots/.config/hypr/conf/core/bindings.conf similarity index 96% rename from dots/.config/hypr/conf/core/bindings.conf rename to users/price/dots/.config/hypr/conf/core/bindings.conf index a53c90cb..f0a05e10 100644 --- a/dots/.config/hypr/conf/core/bindings.conf +++ b/users/price/dots/.config/hypr/conf/core/bindings.conf @@ -101,11 +101,11 @@ bind = SUPER,j,movefocus,d bind = SUPERSHIFT,left,exec,~/.config/hypr/scripts/focus-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 )) bind = SUPERSHIFT,right,exec,~/.config/hypr/scripts/focus-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 )) -bind = SUPERCTRL,left,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 )) -bind = SUPERCTRL,right,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 )) +bind = SUPERCTRL,left,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 )) 1 +bind = SUPERCTRL,right,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 )) 1 -bind = SUPERSHIFTCTRL,left,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 )) 1 -bind = SUPERSHIFTCTRL,right,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 )) 1 +bind = SUPERSHIFTCTRL,left,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 )) +bind = SUPERSHIFTCTRL,right,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 )) bind = SUPER,1,exec,~/.config/hypr/scripts/focus-workspace-mon.bash 1 bind = SUPER,2,exec,~/.config/hypr/scripts/focus-workspace-mon.bash 2 @@ -125,4 +125,4 @@ bind = SUPERCTRL,5,exec,~/.config/hypr/scripts/move-workspace-mon.bash 5 bind = SUPERCTRL,6,exec,~/.config/hypr/scripts/move-workspace-mon.bash 6 bind = SUPERCTRL,7,exec,~/.config/hypr/scripts/move-workspace-mon.bash 7 bind = SUPERCTRL,8,exec,~/.config/hypr/scripts/move-workspace-mon.bash 8 -bind = SUPERCTRL,9,exec,~/.config/hypr/scripts/move-workspace-mon.bash 9 +bind = SUPERCTRL,9,exec,~/.config/hypr/scripts/move-workspace-mon.bash 9 \ No newline at end of file diff --git a/dots/.config/hypr/conf/core/colors.conf b/users/price/dots/.config/hypr/conf/core/colors.conf similarity index 100% rename from dots/.config/hypr/conf/core/colors.conf rename to users/price/dots/.config/hypr/conf/core/colors.conf diff --git a/dots/.config/hypr/conf/core/general.conf b/users/price/dots/.config/hypr/conf/core/general.conf similarity index 100% rename from dots/.config/hypr/conf/core/general.conf rename to users/price/dots/.config/hypr/conf/core/general.conf diff --git a/dots/.config/hypr/conf/core/monitors.conf b/users/price/dots/.config/hypr/conf/core/monitors.conf similarity index 100% rename from dots/.config/hypr/conf/core/monitors.conf rename to users/price/dots/.config/hypr/conf/core/monitors.conf diff --git a/dots/.config/hypr/conf/core/window-rules.conf b/users/price/dots/.config/hypr/conf/core/window-rules.conf similarity index 100% rename from dots/.config/hypr/conf/core/window-rules.conf rename to users/price/dots/.config/hypr/conf/core/window-rules.conf diff --git a/dots/.config/hypr/conf/init.conf b/users/price/dots/.config/hypr/conf/init.conf similarity index 77% rename from dots/.config/hypr/conf/init.conf rename to users/price/dots/.config/hypr/conf/init.conf index 8157880c..9c5f975f 100644 --- a/dots/.config/hypr/conf/init.conf +++ b/users/price/dots/.config/hypr/conf/init.conf @@ -1,7 +1,6 @@ $configDir = ~/.config/hypr/conf # --- Core Config --- -source = $configDir/core/env.conf source = $configDir/core/general.conf source = $configDir/core/bindings.conf source = $configDir/core/appearance.conf @@ -9,4 +8,4 @@ source = $configDir/core/monitors.conf source = $configDir/core/window-rules.conf # --- Application Specific --- -source = $configDir/application/gromit-mpx.conf +source = $configDir/application/gromit-mpx.conf \ No newline at end of file diff --git a/dots/.config/hypr/hyprland.conf b/users/price/dots/.config/hypr/hyprland.conf similarity index 84% rename from dots/.config/hypr/hyprland.conf rename to users/price/dots/.config/hypr/hyprland.conf index de41d14a..f0d69527 100644 --- a/dots/.config/hypr/hyprland.conf +++ b/users/price/dots/.config/hypr/hyprland.conf @@ -6,7 +6,7 @@ exec = systemd-run --user --unit=slimbookbattery slimbookbattery --minimize || s exec = systemd-run --user --unit=clight-gui clight-gui --tray || systemctl --user restart clight-gui exec = systemd-run --user --unit=events-monitor ~/.config/hypr/scripts/launchers/events-monitor.bash || systemctl --user restart events-monitor exec = systemd-run --user --unit=xwaylandvideobridge xwaylandvideobridge || systemctl --user restart xwaylandvideobridge -exec = systemd-run --user --unit=polkit-agent /usr/lib/polkit-kde-authentication-agent-1 || systemctl --user restart polkit-agent +exec = systemd-run --user --unit=polkit-agent /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 || systemctl --user restart polkit-agent exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP PATH exec = sleep 1 && systemctl --user restart compositor.target -exec-once = swaylock +exec-once = swaylock \ No newline at end of file diff --git a/users/price/dots/.config/hypr/scripts/#screen-cap.bash# b/users/price/dots/.config/hypr/scripts/#screen-cap.bash# new file mode 100755 index 00000000..51946e24 --- /dev/null +++ b/users/price/dots/.config/hypr/scripts/#screen-cap.bash# @@ -0,0 +1,74 @@ +#!/usr/bin/env -S nix shell github:nix-community/nixgl#nixGLIntel nixpkgs#bash nixpkgs#wl-screenrec nixpkgs#gifski nixpkgs#inotify-tools nixpkgs#libnotify nixpkgs#mktemp nixpkgs#slurp nixpkgs#slurp --command bash + +# Dependencies: +# - wl-screenrec: https://github.com/russelltg/wl-screenrec +# - notification daemon: https://archlinux.org/packages/?name=notification-daemon +# - wl-clipboard: https://github.com/bugaevc/wl-clipboard +# - gifski: https://github.com/sindresorhus/Gifski +# +# Gifski is necessary because `wl-screenrec` doesn't support gifs + +# set -euoE pipefail + +mk-screen-cap() { + local program_name="Screen Capture" + local pid_file="/tmp/mk-gif-pid" + local output_type="${1:-webm}" + + if [[ -f "$pid_file" ]]; then + printf "Ending screen capture\n" + notify-send "Saving ${program_name}" "This May Take a Minute" -a "$program_name" + if ! kill -SIGINT "$(cat "$pid_file")"; then + notify-send "Failed ${program_name}" "Failed to Save Screen Capture" -u "critical" -a "$program_name" + printf "Failed to save screen capture!\n" + rm -rf "$pid_file" + exit 1 + fi + else + printf -- "Beginning recording\n" + local tmp_file + notify-send "Starting ${program_name}" "Recording ${output_type^^} of Selected Region" -a "$program_name" + local tmp_diruullllllllllllllllllllllllllllllllllllllllllhhhhhjkklh + tmp_dir="$(mktemp -d)" + local file_extension="$output_type" + if [[ "$output_type" == "gif" ]]; then + file_extension="webm" + fi + local tmp_file + tmp_file="$(mktemp --tmpdir="$tmp_dir" recording.XXXXXXXXXXX).${file_extension}" + printf "Working temp file: '%s'\n" "$tmp_file" + + local geometry + geometry="$(slurp)" + nixGLIntel wl-screenrec --filename "$tmp_file" --geometry "$geometry" & + local pid="${!}" + printf "%s" "$pid" >"$pid_file" + printf "Putting pid: '%d' into pid file: '%s'\n" "$pid" "$pid_file" + wait -n "$pid" + + if [[ "$output_type" == "gif" ]]; then + printf "Converting recording to gif...\n" + local gifski_tmpout + gifski_tmpout="${tmp_dir}/$(mktemp --"$tmp_dir" gifski.XXXXXXXXXXX).gif" + gifski --output "$gifski_tmpout" "$tmp_file" + mv "$gifski_tmpout" "$tmp_file" + fi + + local save_path + save_path="${HOME}/Videos/Screen-Recordings" + mkdir -p "$save_path" + save_path="${save_path}/$(date --iso-8601="seconds").${output_type}" + printf "Recording ended, saving to: '%s'\n" "$save_path" + mv "$tmp_file" "$save_path" + + printf "Copying recording to clipboard\n" + local mimetype + mimetype="$(file -b --mime-type "$save_path")" + wl-copy --type="$mimetype" <"$save_path" + rm -f "$pid_file" + notify-send "Saved ${program_name}" "Successfully Saved Screen Capture to Clipboard" -a "$program_name" + printf "Finished Recording, exiting...\n" + fi +} + +mk-screen-cap "${@}" \ No newline at end of file diff --git a/dots/.config/hypr/scripts/disable-laptop-screen.bash b/users/price/dots/.config/hypr/scripts/disable-laptop-screen.bash similarity index 100% rename from dots/.config/hypr/scripts/disable-laptop-screen.bash rename to users/price/dots/.config/hypr/scripts/disable-laptop-screen.bash diff --git a/dots/.config/hypr/scripts/focus-workspace-mon.bash b/users/price/dots/.config/hypr/scripts/focus-workspace-mon.bash similarity index 100% rename from dots/.config/hypr/scripts/focus-workspace-mon.bash rename to users/price/dots/.config/hypr/scripts/focus-workspace-mon.bash diff --git a/dots/.config/hypr/scripts/launchers/events-monitor.bash b/users/price/dots/.config/hypr/scripts/launchers/events-monitor.bash similarity index 100% rename from dots/.config/hypr/scripts/launchers/events-monitor.bash rename to users/price/dots/.config/hypr/scripts/launchers/events-monitor.bash diff --git a/dots/.config/hypr/scripts/launchers/launch-desktop-portal.bash b/users/price/dots/.config/hypr/scripts/launchers/launch-desktop-portal.bash similarity index 100% rename from dots/.config/hypr/scripts/launchers/launch-desktop-portal.bash rename to users/price/dots/.config/hypr/scripts/launchers/launch-desktop-portal.bash diff --git a/dots/.config/hypr/scripts/launchers/launch-kbct.bash b/users/price/dots/.config/hypr/scripts/launchers/launch-kbct.bash similarity index 100% rename from dots/.config/hypr/scripts/launchers/launch-kbct.bash rename to users/price/dots/.config/hypr/scripts/launchers/launch-kbct.bash diff --git a/dots/.config/hypr/scripts/launchers/launch-swww.bash b/users/price/dots/.config/hypr/scripts/launchers/launch-swww.bash similarity index 100% rename from dots/.config/hypr/scripts/launchers/launch-swww.bash rename to users/price/dots/.config/hypr/scripts/launchers/launch-swww.bash diff --git a/dots/.config/hypr/scripts/launchers/launch-waybar.bash b/users/price/dots/.config/hypr/scripts/launchers/launch-waybar.bash similarity index 100% rename from dots/.config/hypr/scripts/launchers/launch-waybar.bash rename to users/price/dots/.config/hypr/scripts/launchers/launch-waybar.bash diff --git a/dots/.config/hypr/scripts/move-workspace-mon.bash b/users/price/dots/.config/hypr/scripts/move-workspace-mon.bash similarity index 91% rename from dots/.config/hypr/scripts/move-workspace-mon.bash rename to users/price/dots/.config/hypr/scripts/move-workspace-mon.bash index 7e0fd680..39dcc2ba 100755 --- a/dots/.config/hypr/scripts/move-workspace-mon.bash +++ b/users/price/dots/.config/hypr/scripts/move-workspace-mon.bash @@ -10,7 +10,7 @@ main() { hyprctl dispatch movetoworkspacesilent "${workspace_id}" hyprctl dispatch movecurrentworkspacetomonitor "${focused_monitor}" - if (( should_change_focus == 1 )); then + if ((should_change_focus == 1)); then hyprctl dispatch workspace "${workspace_id}" fi } diff --git a/users/price/dots/.config/hypr/scripts/screen-cap.bash b/users/price/dots/.config/hypr/scripts/screen-cap.bash new file mode 100755 index 00000000..d5030773 --- /dev/null +++ b/users/price/dots/.config/hypr/scripts/screen-cap.bash @@ -0,0 +1,74 @@ +#!/usr/bin/env -S nix shell github:nix-community/nixgl#nixGLIntel nixpkgs#bash nixpkgs#wl-screenrec nixpkgs#gifski nixpkgs#inotify-tools nixpkgs#libnotify nixpkgs#mktemp nixpkgs#slurp nixpkgs#slurp --command bash + +# Dependencies: +# - wl-screenrec: https://github.com/russelltg/wl-screenrec +# - notification daemon: https://archlinux.org/packages/?name=notification-daemon +# - wl-clipboard: https://github.com/bugaevc/wl-clipboard +# - gifski: https://github.com/sindresorhus/Gifski +# +# Gifski is necessary because `wl-screenrec` doesn't support gifs + +# set -euoE pipefail + +mk-screen-cap() { + local program_name="Screen Capture" + local pid_file="/tmp/mk-gif-pid" + local output_type="${1:-webm}" + + if [[ -f "$pid_file" ]]; then + printf "Ending screen capture\n" + notify-send "Saving ${program_name}" "This May Take a Minute" -a "$program_name" + if ! kill -SIGINT "$(cat "$pid_file")"; then + notify-send "Failed ${program_name}" "Failed to Save Screen Capture" -u "critical" -a "$program_name" + printf "Failed to save screen capture!\n" + rm -rf "$pid_file" + exit 1 + fi + else + printf -- "Beginning recording\n" + local tmp_file + notify-send "Starting ${program_name}" "Recording ${output_type^^} of Selected Region" -a "$program_name" + local tmp_dir + tmp_dir="$(mktemp -d)" + local file_extension="$output_type" + if [[ "$output_type" == "gif" ]]; then + file_extension="webm" + fi + local tmp_file + tmp_file="$(mktemp --tmpdir="$tmp_dir" recording.XXXXXXXXXXX).${file_extension}" + printf "Working temp file: '%s'\n" "$tmp_file" + + local geometry + geometry="$(slurp)" + nixGLIntel wl-screenrec --filename "$tmp_file" --geometry "$geometry" & + local pid="${!}" + printf "%s" "$pid" >"$pid_file" + printf "Putting pid: '%d' into pid file: '%s'\n" "$pid" "$pid_file" + wait -n "$pid" + + if [[ "$output_type" == "gif" ]]; then + printf "Converting recording to gif...\n" + local gifski_tmpout + gifski_tmpout="${tmp_dir}/$(mktemp --"$tmp_dir" gifski.XXXXXXXXXXX).gif" + gifski --output "$gifski_tmpout" "$tmp_file" + mv "$gifski_tmpout" "$tmp_file" + fi + + local save_path + save_path="${HOME}/Videos/Screen-Recordings" + mkdir -p "$save_path" + save_path="${save_path}/$(date --iso-8601="seconds").${output_type}" + printf "Recording ended, saving to: '%s'\n" "$save_path" + mv "$tmp_file" "$save_path" + + printf "Copying recording to clipboard\n" + local mimetype + mimetype="$(file -b --mime-type "$save_path")" + wl-copy --type="$mimetype" <"$save_path" + rm -f "$pid_file" + notify-send "Saved ${program_name}" "Successfully Saved Screen Capture to Clipboard" -a "$program_name" + printf "Finished Recording, exiting...\n" + fi +} + +mk-screen-cap "${@}" diff --git a/dots/.config/keyd/.gitignore b/users/price/dots/.config/keyd/.gitignore similarity index 100% rename from dots/.config/keyd/.gitignore rename to users/price/dots/.config/keyd/.gitignore diff --git a/dots/.config/keyd/app.conf b/users/price/dots/.config/keyd/app.conf similarity index 100% rename from dots/.config/keyd/app.conf rename to users/price/dots/.config/keyd/app.conf diff --git a/dots/.config/kitty/config/font.conf b/users/price/dots/.config/kitty/config/font.conf similarity index 100% rename from dots/.config/kitty/config/font.conf rename to users/price/dots/.config/kitty/config/font.conf diff --git a/dots/.config/kitty/config/mappings.conf b/users/price/dots/.config/kitty/config/mappings.conf similarity index 100% rename from dots/.config/kitty/config/mappings.conf rename to users/price/dots/.config/kitty/config/mappings.conf diff --git a/dots/.config/kitty/config/options.conf b/users/price/dots/.config/kitty/config/options.conf similarity index 100% rename from dots/.config/kitty/config/options.conf rename to users/price/dots/.config/kitty/config/options.conf diff --git a/dots/.config/kitty/config/os/mac.conf b/users/price/dots/.config/kitty/config/os/mac.conf similarity index 100% rename from dots/.config/kitty/config/os/mac.conf rename to users/price/dots/.config/kitty/config/os/mac.conf diff --git a/dots/.config/kitty/config/theme.conf b/users/price/dots/.config/kitty/config/theme.conf similarity index 100% rename from dots/.config/kitty/config/theme.conf rename to users/price/dots/.config/kitty/config/theme.conf diff --git a/dots/.config/kitty/kitty.conf b/users/price/dots/.config/kitty/kitty.conf similarity index 100% rename from dots/.config/kitty/kitty.conf rename to users/price/dots/.config/kitty/kitty.conf diff --git a/dots/.config/kitty/themes/Catppucin.conf b/users/price/dots/.config/kitty/themes/Catppucin.conf similarity index 100% rename from dots/.config/kitty/themes/Catppucin.conf rename to users/price/dots/.config/kitty/themes/Catppucin.conf diff --git a/dots/.config/kitty/themes/Space-Duck.conf b/users/price/dots/.config/kitty/themes/Space-Duck.conf similarity index 100% rename from dots/.config/kitty/themes/Space-Duck.conf rename to users/price/dots/.config/kitty/themes/Space-Duck.conf diff --git a/dots/.config/kitty/themes/kanagawa.conf b/users/price/dots/.config/kitty/themes/kanagawa.conf similarity index 100% rename from dots/.config/kitty/themes/kanagawa.conf rename to users/price/dots/.config/kitty/themes/kanagawa.conf diff --git a/dots/.config/kitty/themes/nightfox.conf b/users/price/dots/.config/kitty/themes/nightfox.conf similarity index 100% rename from dots/.config/kitty/themes/nightfox.conf rename to users/price/dots/.config/kitty/themes/nightfox.conf diff --git a/dots/.config/kitty/themes/tokyo-night.conf b/users/price/dots/.config/kitty/themes/tokyo-night.conf similarity index 100% rename from dots/.config/kitty/themes/tokyo-night.conf rename to users/price/dots/.config/kitty/themes/tokyo-night.conf diff --git a/dots/.config/kitty/themes/tokyo-storm.conf b/users/price/dots/.config/kitty/themes/tokyo-storm.conf similarity index 100% rename from dots/.config/kitty/themes/tokyo-storm.conf rename to users/price/dots/.config/kitty/themes/tokyo-storm.conf diff --git a/dots/.config/mako/config b/users/price/dots/.config/mako/config similarity index 100% rename from dots/.config/mako/config rename to users/price/dots/.config/mako/config diff --git a/dots/.config/neovide/config.toml b/users/price/dots/.config/neovide/config.toml similarity index 100% rename from dots/.config/neovide/config.toml rename to users/price/dots/.config/neovide/config.toml diff --git a/dots/.config/nix/nix.conf b/users/price/dots/.config/nix/nix.conf similarity index 100% rename from dots/.config/nix/nix.conf rename to users/price/dots/.config/nix/nix.conf diff --git a/dots/.config/nvim/.stylua.toml b/users/price/dots/.config/nvim/.stylua.toml similarity index 100% rename from dots/.config/nvim/.stylua.toml rename to users/price/dots/.config/nvim/.stylua.toml diff --git a/dots/.config/nvim/README.org b/users/price/dots/.config/nvim/README.org similarity index 100% rename from dots/.config/nvim/README.org rename to users/price/dots/.config/nvim/README.org diff --git a/dots/.config/nvim/after/ftplugin/NeogitCommitMessage.lua b/users/price/dots/.config/nvim/after/ftplugin/NeogitCommitMessage.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/NeogitCommitMessage.lua rename to users/price/dots/.config/nvim/after/ftplugin/NeogitCommitMessage.lua diff --git a/dots/.config/nvim/after/ftplugin/asm.lua b/users/price/dots/.config/nvim/after/ftplugin/asm.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/asm.lua rename to users/price/dots/.config/nvim/after/ftplugin/asm.lua diff --git a/dots/.config/nvim/after/ftplugin/azure-pipelines.lua b/users/price/dots/.config/nvim/after/ftplugin/azure-pipelines.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/azure-pipelines.lua rename to users/price/dots/.config/nvim/after/ftplugin/azure-pipelines.lua diff --git a/dots/.config/nvim/after/ftplugin/azure.lua b/users/price/dots/.config/nvim/after/ftplugin/azure.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/azure.lua rename to users/price/dots/.config/nvim/after/ftplugin/azure.lua diff --git a/dots/.config/nvim/after/ftplugin/cs.lua b/users/price/dots/.config/nvim/after/ftplugin/cs.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/cs.lua rename to users/price/dots/.config/nvim/after/ftplugin/cs.lua diff --git a/dots/.config/nvim/after/ftplugin/css.lua b/users/price/dots/.config/nvim/after/ftplugin/css.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/css.lua rename to users/price/dots/.config/nvim/after/ftplugin/css.lua diff --git a/dots/.config/nvim/after/ftplugin/dockerfile.lua b/users/price/dots/.config/nvim/after/ftplugin/dockerfile.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/dockerfile.lua rename to users/price/dots/.config/nvim/after/ftplugin/dockerfile.lua diff --git a/dots/.config/nvim/after/ftplugin/gitconfig.lua b/users/price/dots/.config/nvim/after/ftplugin/gitconfig.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/gitconfig.lua rename to users/price/dots/.config/nvim/after/ftplugin/gitconfig.lua diff --git a/dots/.config/nvim/after/ftplugin/html.lua b/users/price/dots/.config/nvim/after/ftplugin/html.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/html.lua rename to users/price/dots/.config/nvim/after/ftplugin/html.lua diff --git a/dots/.config/nvim/after/ftplugin/http.lua b/users/price/dots/.config/nvim/after/ftplugin/http.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/http.lua rename to users/price/dots/.config/nvim/after/ftplugin/http.lua diff --git a/dots/.config/nvim/after/ftplugin/hurl.lua b/users/price/dots/.config/nvim/after/ftplugin/hurl.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/hurl.lua rename to users/price/dots/.config/nvim/after/ftplugin/hurl.lua diff --git a/dots/.config/nvim/after/ftplugin/jinja2.lua b/users/price/dots/.config/nvim/after/ftplugin/jinja2.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/jinja2.lua rename to users/price/dots/.config/nvim/after/ftplugin/jinja2.lua diff --git a/dots/.config/nvim/after/ftplugin/json.lua b/users/price/dots/.config/nvim/after/ftplugin/json.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/json.lua rename to users/price/dots/.config/nvim/after/ftplugin/json.lua diff --git a/dots/.config/nvim/after/ftplugin/make.lua b/users/price/dots/.config/nvim/after/ftplugin/make.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/make.lua rename to users/price/dots/.config/nvim/after/ftplugin/make.lua diff --git a/dots/.config/nvim/after/ftplugin/man.lua b/users/price/dots/.config/nvim/after/ftplugin/man.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/man.lua rename to users/price/dots/.config/nvim/after/ftplugin/man.lua diff --git a/dots/.config/nvim/after/ftplugin/markdown.lua b/users/price/dots/.config/nvim/after/ftplugin/markdown.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/markdown.lua rename to users/price/dots/.config/nvim/after/ftplugin/markdown.lua diff --git a/dots/.config/nvim/after/ftplugin/nix.lua b/users/price/dots/.config/nvim/after/ftplugin/nix.lua similarity index 51% rename from dots/.config/nvim/after/ftplugin/nix.lua rename to users/price/dots/.config/nvim/after/ftplugin/nix.lua index 0b584caa..87289118 100644 --- a/dots/.config/nvim/after/ftplugin/nix.lua +++ b/users/price/dots/.config/nvim/after/ftplugin/nix.lua @@ -1,29 +1,33 @@ local opt_local = vim.opt_local +local utils = require("utils.funcs") opt_local.tabstop = 2 opt_local.shiftwidth = 2 opt_local.commentstring = "# %s" -vim.keymap.set("n", "fr", function() - local cmd = { +local nix_eval = function() + return table.concat({ "nix", "eval", - "--file", - vim.api.nvim_buf_get_name(0), - } - require("toggleterm").exec(table.concat(cmd, " ")) + "--expr", + '"$(cat << __EOS__\n' + .. vim.iter(vim.api.nvim_buf_get_lines(0, 0, -1, false) or {}):join("\n") + .. '\n__EOS__\n)"', + }, " ") +end + +vim.keymap.set("n", "fr", function() + vim.cmd.write() + require("toggleterm").exec("nix eval --file " .. vim.api.nvim_buf_get_name(0)) end, { buffer = true, desc = "Nix: Run with default output", }) vim.keymap.set("n", "fj", function() + vim.cmd.write() local cmd = { - "nix", - "eval", - "--json", - "--file", - vim.api.nvim_buf_get_name(0), + "nix eval --file " .. vim.api.nvim_buf_get_name(0), "|", "jq", } diff --git a/dots/.config/nvim/after/ftplugin/norg.lua b/users/price/dots/.config/nvim/after/ftplugin/norg.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/norg.lua rename to users/price/dots/.config/nvim/after/ftplugin/norg.lua diff --git a/dots/.config/nvim/after/ftplugin/octo.lua b/users/price/dots/.config/nvim/after/ftplugin/octo.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/octo.lua rename to users/price/dots/.config/nvim/after/ftplugin/octo.lua diff --git a/dots/.config/nvim/after/ftplugin/org.lua b/users/price/dots/.config/nvim/after/ftplugin/org.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/org.lua rename to users/price/dots/.config/nvim/after/ftplugin/org.lua diff --git a/dots/.config/nvim/after/ftplugin/orgagenda.lua b/users/price/dots/.config/nvim/after/ftplugin/orgagenda.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/orgagenda.lua rename to users/price/dots/.config/nvim/after/ftplugin/orgagenda.lua diff --git a/dots/.config/nvim/after/ftplugin/python.lua b/users/price/dots/.config/nvim/after/ftplugin/python.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/python.lua rename to users/price/dots/.config/nvim/after/ftplugin/python.lua diff --git a/dots/.config/nvim/after/ftplugin/rust.lua b/users/price/dots/.config/nvim/after/ftplugin/rust.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/rust.lua rename to users/price/dots/.config/nvim/after/ftplugin/rust.lua diff --git a/users/price/dots/.config/nvim/after/ftplugin/sh.lua b/users/price/dots/.config/nvim/after/ftplugin/sh.lua new file mode 100644 index 00000000..699db7a7 --- /dev/null +++ b/users/price/dots/.config/nvim/after/ftplugin/sh.lua @@ -0,0 +1,18 @@ +local write_file = require("utils.funcs").write_file + +vim.opt_local.expandtab = false + +vim.keymap.set("n", "fr", function() + vim.cmd.write() + require("toggleterm").exec( + write_file( + vim.fn.tempname(), + "0700", + { "#!/usr/bin/env", "-S", "nix", "shell", "nixpkgs#bash", "--command", "bash" }, + unpack(vim.api.nvim_buf_get_lines(0, 0, -1, false)) + ) + ) +end, { + buffer = true, + desc = "Bash: Run Current Buffer", +}) diff --git a/dots/.config/nvim/after/ftplugin/sql.lua b/users/price/dots/.config/nvim/after/ftplugin/sql.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/sql.lua rename to users/price/dots/.config/nvim/after/ftplugin/sql.lua diff --git a/dots/.config/nvim/after/ftplugin/sshdconfig.lua b/users/price/dots/.config/nvim/after/ftplugin/sshdconfig.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/sshdconfig.lua rename to users/price/dots/.config/nvim/after/ftplugin/sshdconfig.lua diff --git a/dots/.config/nvim/after/ftplugin/systemd.lua b/users/price/dots/.config/nvim/after/ftplugin/systemd.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/systemd.lua rename to users/price/dots/.config/nvim/after/ftplugin/systemd.lua diff --git a/dots/.config/nvim/after/ftplugin/termhistory.lua b/users/price/dots/.config/nvim/after/ftplugin/termhistory.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/termhistory.lua rename to users/price/dots/.config/nvim/after/ftplugin/termhistory.lua diff --git a/dots/.config/nvim/after/ftplugin/terraform.lua b/users/price/dots/.config/nvim/after/ftplugin/terraform.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/terraform.lua rename to users/price/dots/.config/nvim/after/ftplugin/terraform.lua diff --git a/dots/.config/nvim/after/ftplugin/tex.lua b/users/price/dots/.config/nvim/after/ftplugin/tex.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/tex.lua rename to users/price/dots/.config/nvim/after/ftplugin/tex.lua diff --git a/dots/.config/nvim/after/ftplugin/typescript.lua b/users/price/dots/.config/nvim/after/ftplugin/typescript.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/typescript.lua rename to users/price/dots/.config/nvim/after/ftplugin/typescript.lua diff --git a/dots/.config/nvim/after/ftplugin/typst.lua b/users/price/dots/.config/nvim/after/ftplugin/typst.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/typst.lua rename to users/price/dots/.config/nvim/after/ftplugin/typst.lua diff --git a/dots/.config/nvim/after/ftplugin/xml.lua b/users/price/dots/.config/nvim/after/ftplugin/xml.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/xml.lua rename to users/price/dots/.config/nvim/after/ftplugin/xml.lua diff --git a/dots/.config/nvim/after/ftplugin/yaml.lua b/users/price/dots/.config/nvim/after/ftplugin/yaml.lua similarity index 100% rename from dots/.config/nvim/after/ftplugin/yaml.lua rename to users/price/dots/.config/nvim/after/ftplugin/yaml.lua diff --git a/users/price/dots/.config/nvim/after/ftplugin/zsh.lua b/users/price/dots/.config/nvim/after/ftplugin/zsh.lua new file mode 100644 index 00000000..a311eee4 --- /dev/null +++ b/users/price/dots/.config/nvim/after/ftplugin/zsh.lua @@ -0,0 +1,17 @@ +local write_file = require("utils.funcs").write_file + +vim.opt_local.expandtab = false + +vim.keymap.set("n", "fr", function() + require("toggleterm").exec( + write_file( + vim.fn.tempname(), + "0700", + { "#!/usr/bin/env", "-S", "nix", "shell", "nixpkgs#zsh", "--command", "zsh" }, + unpack(vim.api.nvim_buf_get_lines(0, 0, -1, false)) + ) + ) +end, { + buffer = true, + desc = "Bash: Run Current Buffer", +}) diff --git a/dots/.config/nvim/after/queries/markdown/highlights.scm b/users/price/dots/.config/nvim/after/queries/markdown/highlights.scm similarity index 100% rename from dots/.config/nvim/after/queries/markdown/highlights.scm rename to users/price/dots/.config/nvim/after/queries/markdown/highlights.scm diff --git a/dots/.config/nvim/after/queries/org/folds.scm b/users/price/dots/.config/nvim/after/queries/org/folds.scm similarity index 100% rename from dots/.config/nvim/after/queries/org/folds.scm rename to users/price/dots/.config/nvim/after/queries/org/folds.scm diff --git a/dots/.config/nvim/after/queries/org/highlights.scm b/users/price/dots/.config/nvim/after/queries/org/highlights.scm similarity index 100% rename from dots/.config/nvim/after/queries/org/highlights.scm rename to users/price/dots/.config/nvim/after/queries/org/highlights.scm diff --git a/dots/.config/nvim/ftdetect/cf3.vim b/users/price/dots/.config/nvim/ftdetect/cf3.vim similarity index 100% rename from dots/.config/nvim/ftdetect/cf3.vim rename to users/price/dots/.config/nvim/ftdetect/cf3.vim diff --git a/dots/.config/nvim/ftdetect/log.lua b/users/price/dots/.config/nvim/ftdetect/log.lua similarity index 100% rename from dots/.config/nvim/ftdetect/log.lua rename to users/price/dots/.config/nvim/ftdetect/log.lua diff --git a/dots/.config/nvim/ftplugin/cf3.vim b/users/price/dots/.config/nvim/ftplugin/cf3.vim similarity index 100% rename from dots/.config/nvim/ftplugin/cf3.vim rename to users/price/dots/.config/nvim/ftplugin/cf3.vim diff --git a/dots/.config/nvim/ftplugin/lua.lua b/users/price/dots/.config/nvim/ftplugin/lua.lua similarity index 100% rename from dots/.config/nvim/ftplugin/lua.lua rename to users/price/dots/.config/nvim/ftplugin/lua.lua diff --git a/dots/.config/nvim/init.lua b/users/price/dots/.config/nvim/init.lua similarity index 100% rename from dots/.config/nvim/init.lua rename to users/price/dots/.config/nvim/init.lua diff --git a/dots/.config/nvim/lazy-lock.json b/users/price/dots/.config/nvim/lazy-lock.json similarity index 64% rename from dots/.config/nvim/lazy-lock.json rename to users/price/dots/.config/nvim/lazy-lock.json index f414075c..fffa7dda 100644 --- a/dots/.config/nvim/lazy-lock.json +++ b/users/price/dots/.config/nvim/lazy-lock.json @@ -1,12 +1,13 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, "actions-preview.nvim": { "branch": "master", "commit": "5072b1b1065a6b22bdd46b5c21780a91d6a08071" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, - "ccc.nvim": { "branch": "main", "commit": "1283eef5494c092a047baa34ed3e667f3cb2715e" }, + "ccc.nvim": { "branch": "main", "commit": "f388f1981d222967c741fe9927edf9ba5fa3bcbe" }, + "cmdbuf.nvim": { "branch": "main", "commit": "817aa166625d739498f8a9e6fce8502f5467d71c" }, "cmp-async-path": { "branch": "main", "commit": "9d581eec5acf812316913565c135b0d1ee2c9a71" }, "cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -21,119 +22,119 @@ "cmp-rg": { "branch": "master", "commit": "677a7874ee8f1afc648c2e7d63a97bc21a7663c5" }, "cmp-zsh": { "branch": "main", "commit": "c24db8e58fac9006ec23d93f236749288d00dec9" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "crates.nvim": { "branch": "main", "commit": "786d12a70c9b91fa2d0d102bb07df02be0db31a1" }, + "crates.nvim": { "branch": "main", "commit": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4" }, "csharpls-extended-lsp.nvim": { "branch": "master", "commit": "bde4aebe0dc74952188c2130c6831a1d8e4ce5c6" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, - "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, + "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, "exrc.nvim": { "branch": "master", "commit": "0427b0e087f25baae72088ea12e1334c991f0cb5" }, "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, - "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, "fuzzy.nvim": { "branch": "master", "commit": "67a42ad2fa6d5ff41f0ef3cf69bb247410da5d7a" }, - "gitlinker.nvim": { "branch": "master", "commit": "30ee1626632ce34a55d6a8c17cd2fcd9d984268f" }, - "gitsigns.nvim": { "branch": "main", "commit": "7e38f07cab0e5387f9f41e92474db174a63a4725" }, - "go.nvim": { "branch": "master", "commit": "cbc6aca611cdc664f9bfc3c0a9aa9f9912fa9720" }, - "guihua.lua": { "branch": "master", "commit": "3b3126ae87c254f6849e708549ba76c39e3f42f8" }, - "gx.nvim": { "branch": "main", "commit": "ea4cc715326a8bd060a450c24c3c9831cdee2f59" }, + "gitlinker.nvim": { "branch": "master", "commit": "542f51784f20107ef9ecdadc47825204837efed5" }, + "gitsigns.nvim": { "branch": "main", "commit": "9cafac31a091267838e1e90fd6e083d37611f516" }, + "go.nvim": { "branch": "master", "commit": "d5e2b8cdd84afdb0c49c42a6e8972acc645e0283" }, + "guihua.lua": { "branch": "master", "commit": "5204646be15997ed101631d75df02512ecd6c2bb" }, + "gx.nvim": { "branch": "main", "commit": "ea543829d7eb36c9bf80e43d7a27bd326bb8d3ed" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" }, "hex.nvim": { "branch": "master", "commit": "cbffd2ce4b8be089360e3c95d5909cd511d8840c" }, - "highlight-undo.nvim": { "branch": "main", "commit": "50a6884a8476be04ecce8f1c4ed692c5000ef0a1" }, + "highlight-undo.nvim": { "branch": "main", "commit": "a0dbc6afa19b438ca5a6f54bc7f1a10399f21a15" }, "hlargs.nvim": { "branch": "main", "commit": "0f2dbf02ff948e8fc8ebe07b215f3174a12bbe3c" }, - "hop.nvim": { "branch": "master", "commit": "6d853addd6e11df8338b26e869a29b36f2c3e893" }, - "hurl.nvim": { "branch": "main", "commit": "ba2f77ce98cfbeafa55809bd36f360e65a15b952" }, + "hop.nvim": { "branch": "master", "commit": "6ff23501a1fd1c75c91dfd99ff5befcfdb02c11d" }, + "hurl.nvim": { "branch": "main", "commit": "2406fa20ce55834f5645ac0f497456fc6ba90215" }, "hydra.nvim": { "branch": "main", "commit": "8578056a2226ed49fc608167edc143a87f75d809" }, - "inc-rename.nvim": { "branch": "main", "commit": "5e03e986625961d1fac296d1bf332a6510c3add6" }, + "inc-rename.nvim": { "branch": "main", "commit": "1d7d3f647d0928614c00ca9ef4ce695c45147c05" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "kanagawa.nvim": { "branch": "master", "commit": "bfa818c7bf6259152f1d89cf9fbfba3554c93695" }, + "kanagawa.nvim": { "branch": "master", "commit": "860e4f80df71221d18bf2cd9ef1deb4d364274d2" }, "keymap-layer.nvim": { "branch": "master", "commit": "e46840f9f377766e856964a49d7f351de3188a38" }, - "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, + "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "live-command.nvim": { "branch": "main", "commit": "d460067d47948725a6f25b20f31ea8bbfdfe4622" }, "lsp_lines.nvim": { "branch": "main", "commit": "6f3defec73f7c87939e800e9afa5d0571b19b401" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.nvim": { "branch": "main", "commit": "e623d29561746637b49d30d6434338f88f44e856" }, + "mini.nvim": { "branch": "main", "commit": "1549710d11927025add5aab75ffe1ebd8884457f" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "neo-tree.nvim": { "branch": "main", "commit": "25bfdbe802eb913276bb83874b043be57bd70347" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, "neoformat": { "branch": "master", "commit": "4372abb846f43ec121df40e620682c985ebc8286" }, "neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" }, - "neogit": { "branch": "nightly", "commit": "5b162854e775dd6a1e98073a7b8b837a7e911f8b" }, - "neoscroll.nvim": { "branch": "master", "commit": "c513218d864d4ccfdaaea991c6de67bdb84bc116" }, - "neotest": { "branch": "master", "commit": "f03a78cef74db5638e4312e18b767294a90de8da" }, + "neogit": { "branch": "nightly", "commit": "0cd089944e4a6ecc24913a9d8621071cb36f8f6f" }, + "neoscroll.nvim": { "branch": "master", "commit": "e78657719485c5663b88e5d96ffcfb6a2fe3eec0" }, + "neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" }, "neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" }, "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, - "netman.nvim": { "branch": "main", "commit": "d0ec9d4ca195b2c87bf46ab050130a2c806310c4" }, + "netman.nvim": { "branch": "main", "commit": "68eecb29d913d4f35efa9bd0e8636046f70f998f" }, "nibbler": { "branch": "main", "commit": "a69331d6af60dda6ae6459522134a5e365fb43b1" }, "no-neck-pain.nvim": { "branch": "main", "commit": "34625be12649666b7ccb08761087cc97bb788552" }, - "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, - "none-ls.nvim": { "branch": "main", "commit": "63457547ffb7c7223d0f91feb1145393cc7b6728" }, + "noice.nvim": { "branch": "main", "commit": "a35003dbdd9c8d6d05aa47064de2b76ace872ec4" }, + "none-ls.nvim": { "branch": "main", "commit": "f5632db2491fbe02b54f1a321a98548a8ba2bd15" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, - "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-cmp-lua-latex-symbols": { "branch": "master", "commit": "89345d6e333c700d13748e8a7ee6fe57279b7f88" }, "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, "nvim-dap-python": { "branch": "master", "commit": "3dffa58541d1f52c121fe58ced046268c838d802" }, - "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, + "nvim-dap-ui": { "branch": "master", "commit": "5934302d63d1ede12c0b22b6f23518bb183fc972" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" }, "nvim-fundo": { "branch": "main", "commit": "e236d66943349e026c1d42b23cc4fbd9f9c90af3" }, "nvim-highlight-colors": { "branch": "main", "commit": "432dc7a817a4973041f02b418169667c491f60fd" }, "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, - "nvim-lspconfig": { "branch": "master", "commit": "ed8b8a15acc441aec669f97d75f2c1f2ac8c8aa5" }, + "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" }, - "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, + "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, - "nvim-treesitter": { "branch": "master", "commit": "bc808622986b0ba8eb64780b94d30cdfbd7c6a9f" }, - "nvim-treesitter-context": { "branch": "master", "commit": "ba4289ad345ececd335a9cdd7b9616fd0bb6be92" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "60e8c288e011403f248b5f6478dde12bed8a6c55" }, + "nvim-surround": { "branch": "main", "commit": "6d0dc3dbb557bcc6a024969da461df4ba803fc48" }, + "nvim-treesitter": { "branch": "master", "commit": "96defe1cbd444cfedb0927796a6c0c1308e5b988" }, + "nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, - "nvim-various-textobjs": { "branch": "main", "commit": "6597cda458f67da2cec7ae7d43d7abb11d54be82" }, - "nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, + "nvim-various-textobjs": { "branch": "main", "commit": "674b7c97f2b50ac8b8876202622e52395cfdfe02" }, + "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, "octo.nvim": { "branch": "master", "commit": "5646539320cd62af6ff28f48ec92aeb724c68e18" }, "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "6e0aa6465f8fa8ac6c833f6ac4713adfee0202a0" }, - "orgmode": { "branch": "master", "commit": "389e91f6f935aa845bc0cd13dd80f75431c34751" }, + "orgmode": { "branch": "master", "commit": "d4cc3210f235a845de8d372d02482163d31ded93" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "7ef0766b5cd2f5cdf4fcb08886f0a2ebf65981fa" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, - "rustaceanvim": { "branch": "master", "commit": "2a53e2fe911e971fa90341af27d2fe1447c0cbd2" }, - "schemastore.nvim": { "branch": "main", "commit": "f7cae6f1b38cb296f48ce1a9c5ed1a419d912a42" }, - "sqlite.lua": { "branch": "master", "commit": "40701b6151f8883980c1548647116de39b763540" }, + "rustaceanvim": { "branch": "master", "commit": "cd35b0f7fb0c9fe6879b084096230a74fefa4da8" }, + "schemastore.nvim": { "branch": "main", "commit": "2ef728ff7e790431f1f71052bfd4c5568157e110" }, + "sqlite.lua": { "branch": "master", "commit": "d0ffd703b56d090d213b497ed4eb840495f14a11" }, "statuscol.nvim": { "branch": "main", "commit": "483b9a596dfd63d541db1aa51ee6ee9a1441c4cc" }, - "telescope-frecency.nvim": { "branch": "master", "commit": "94a532cb9c4713db83acf5432f5aadfd096e2af9" }, + "telescope-frecency.nvim": { "branch": "master", "commit": "6b6565e6584c86ca501bdac485cbdc2ca64556e4" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-orgmode.nvim": { "branch": "main", "commit": "47b485c57c0bc07003a41cc492580699a38df3f6" }, "telescope-smart-history.nvim": { "branch": "master", "commit": "81a4cceaa54d65d5f7c7c26178ee63b634d3e26d" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope-undo.nvim": { "branch": "main", "commit": "d19e2edc8b18d03283bd91f67310ac300ad003ce" }, + "telescope-undo.nvim": { "branch": "main", "commit": "95b61c01ea3a4c9e8747731148e905bbcf0ccaee" }, "telescope-z.nvim": { "branch": "main", "commit": "3a31d9741fe4353e5c8b59cfc4eda5420dc7f938" }, - "telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" }, + "telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" }, "telescope_find_directories": { "branch": "main", "commit": "30a29238eca7be1d2eeae7c814f6c0f20bc21931" }, - "tint.nvim": { "branch": "master", "commit": "862835626941d263466754b9c8e2ce2cb004f5ac" }, + "tint.nvim": { "branch": "master", "commit": "02bd0527a315a80e4e25bb2dd7b6994fb0daae01" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "toggleterm.nvim": { "branch": "main", "commit": "dca1c80fb8ec41c97e7c3ef308719d8143fbbb05" }, - "trouble.nvim": { "branch": "dev", "commit": "10eff94809ecd6ee6cc59f42e9521b9b8a14e9ce" }, + "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, + "trouble.nvim": { "branch": "dev", "commit": "b4b9a11b3578d510963f6f681fecb4631ae992c3" }, "typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" }, "typst-preview.nvim": { "branch": "master", "commit": "1394f5d16b4b3f771f5fc112fbb1eb4369f58cc1" }, "venn.nvim": { "branch": "main", "commit": "a5430d75875acbe93e9685cdeb78c6eb2a329ed5" }, - "vim-dadbod": { "branch": "master", "commit": "960bbb7de11b7282a68d579a64e838b487934493" }, + "vim-dadbod": { "branch": "master", "commit": "37523ffe0849b51db07fa7f48430c2aca5420a0e" }, "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, - "vim-dadbod-ui": { "branch": "master", "commit": "066922699bdf1c6e14d517b844454b12b93ce25a" }, + "vim-dadbod-ui": { "branch": "master", "commit": "5835df6497cc0e79cb149518d01f4f5c86dc546f" }, "vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" }, "vim-matchup": { "branch": "master", "commit": "2d660e4aa7c566014c667af2cda0458043527902" }, "vim-move": { "branch": "master", "commit": "3c4195de0748da9bba25c54d78d959d349e93c55" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-table-mode": { "branch": "master", "commit": "e4365bde024f73e205eefa2fb78e3029ddb92ea9" }, - "vim-visual-multi": { "branch": "master", "commit": "e2ff111f123da6cf97f95b96b10eb95854f953c9" }, - "vimtex": { "branch": "master", "commit": "4a0ea3fc7eb67fd1949aba6a9bbd91cb5c875743" }, + "vim-visual-multi": { "branch": "master", "commit": "b84a6d42c1c10678928b0bf8327f378c8bc8af5a" }, + "vimtex": { "branch": "master", "commit": "e4e659b088a082f6b7bb895ccbefb1f96a5b2710" }, "visual-whitespace.nvim": { "branch": "main", "commit": "e22d8508a0236f274dde39775ee127c85d30c0c0" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/dots/.config/nvim/lua/core/autocmds.lua b/users/price/dots/.config/nvim/lua/core/autocmds.lua similarity index 100% rename from dots/.config/nvim/lua/core/autocmds.lua rename to users/price/dots/.config/nvim/lua/core/autocmds.lua diff --git a/dots/.config/nvim/lua/core/cmds.lua b/users/price/dots/.config/nvim/lua/core/cmds.lua similarity index 100% rename from dots/.config/nvim/lua/core/cmds.lua rename to users/price/dots/.config/nvim/lua/core/cmds.lua diff --git a/dots/.config/nvim/lua/core/disabled.lua b/users/price/dots/.config/nvim/lua/core/disabled.lua similarity index 100% rename from dots/.config/nvim/lua/core/disabled.lua rename to users/price/dots/.config/nvim/lua/core/disabled.lua diff --git a/dots/.config/nvim/lua/core/filetypes.lua b/users/price/dots/.config/nvim/lua/core/filetypes.lua similarity index 96% rename from dots/.config/nvim/lua/core/filetypes.lua rename to users/price/dots/.config/nvim/lua/core/filetypes.lua index 5afcd152..6ee953b6 100644 --- a/dots/.config/nvim/lua/core/filetypes.lua +++ b/users/price/dots/.config/nvim/lua/core/filetypes.lua @@ -4,6 +4,7 @@ M.setup = function() vim.filetype.add({ filename = { [".dockerignore"] = "dockerignore", + [".envrc"] = "sh", }, pattern = { [".*%.dockerfile"] = "dockerfile", diff --git a/dots/.config/nvim/lua/core/globals.lua b/users/price/dots/.config/nvim/lua/core/globals.lua similarity index 100% rename from dots/.config/nvim/lua/core/globals.lua rename to users/price/dots/.config/nvim/lua/core/globals.lua diff --git a/dots/.config/nvim/lua/core/init.lua b/users/price/dots/.config/nvim/lua/core/init.lua similarity index 100% rename from dots/.config/nvim/lua/core/init.lua rename to users/price/dots/.config/nvim/lua/core/init.lua diff --git a/dots/.config/nvim/lua/core/lsp.lua b/users/price/dots/.config/nvim/lua/core/lsp.lua similarity index 100% rename from dots/.config/nvim/lua/core/lsp.lua rename to users/price/dots/.config/nvim/lua/core/lsp.lua diff --git a/dots/.config/nvim/lua/core/mappings.lua b/users/price/dots/.config/nvim/lua/core/mappings.lua similarity index 95% rename from dots/.config/nvim/lua/core/mappings.lua rename to users/price/dots/.config/nvim/lua/core/mappings.lua index bfe426a7..bbcc5726 100755 --- a/dots/.config/nvim/lua/core/mappings.lua +++ b/users/price/dots/.config/nvim/lua/core/mappings.lua @@ -119,6 +119,10 @@ M.setup = function() -- Keymap to toggle folds easier vim.keymap.set("n", "", "za", { silent = true, desc = "Toggle Fold" }) + + -- Alias / to toggle comments + vim.keymap.set("n", "/", "gcc", { silent = true, desc = "Comment: Toggle Line" }) + vim.keymap.set("v", "/", "gc", { silent = true, desc = "Comment: Toggle Selection" }) end return M diff --git a/dots/.config/nvim/lua/core/options.lua b/users/price/dots/.config/nvim/lua/core/options.lua similarity index 98% rename from dots/.config/nvim/lua/core/options.lua rename to users/price/dots/.config/nvim/lua/core/options.lua index 059797cf..2ce8cc79 100755 --- a/dots/.config/nvim/lua/core/options.lua +++ b/users/price/dots/.config/nvim/lua/core/options.lua @@ -63,7 +63,7 @@ M.setup = function() opt.undofile = true -- Better folding - opt.foldexpr = "nvim_treesitter#foldexpr()" + opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" opt.foldmethod = "expr" opt.fillchars = { eob = " ", fold = " ", foldopen = "", foldsep = " ", foldclose = "" } vim.o.foldcolumn = "1" diff --git a/dots/.config/nvim/lua/core/postload.lua b/users/price/dots/.config/nvim/lua/core/postload.lua similarity index 100% rename from dots/.config/nvim/lua/core/postload.lua rename to users/price/dots/.config/nvim/lua/core/postload.lua diff --git a/dots/.config/nvim/lua/core/winbar.lua b/users/price/dots/.config/nvim/lua/core/winbar.lua similarity index 100% rename from dots/.config/nvim/lua/core/winbar.lua rename to users/price/dots/.config/nvim/lua/core/winbar.lua diff --git a/dots/.config/nvim/lua/main.lua b/users/price/dots/.config/nvim/lua/main.lua similarity index 100% rename from dots/.config/nvim/lua/main.lua rename to users/price/dots/.config/nvim/lua/main.lua diff --git a/dots/.config/nvim/lua/neovide.lua b/users/price/dots/.config/nvim/lua/neovide.lua similarity index 96% rename from dots/.config/nvim/lua/neovide.lua rename to users/price/dots/.config/nvim/lua/neovide.lua index ad7ebe8c..63fd72d7 100644 --- a/dots/.config/nvim/lua/neovide.lua +++ b/users/price/dots/.config/nvim/lua/neovide.lua @@ -17,7 +17,7 @@ vim.g.neovide_fullscreen = false -- Allow clipboard copy paste in neovim vim.keymap.set({ "n", "v" }, "", '"+P') -- Paste normal and visual mode vim.keymap.set({ "i", "c" }, "", "+") -- Paste insert and command mode -vim.keymap.set("t", "", [["+P]]) -- Paste terminal mode +vim.keymap.set("t", "", [["+Pi]]) -- Paste terminal mode -- Next/prev tabs vim.keymap.set({ "", "!", "v", "t" }, "", "tabnext", { noremap = true, silent = true }) diff --git a/dots/.config/nvim/lua/plugins/autocmds.lua b/users/price/dots/.config/nvim/lua/plugins/autocmds.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/autocmds.lua rename to users/price/dots/.config/nvim/lua/plugins/autocmds.lua diff --git a/dots/.config/nvim/lua/plugins/configs/alpha.lua b/users/price/dots/.config/nvim/lua/plugins/configs/alpha.lua similarity index 99% rename from dots/.config/nvim/lua/plugins/configs/alpha.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/alpha.lua index 32830027..278bf390 100644 --- a/dots/.config/nvim/lua/plugins/configs/alpha.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/alpha.lua @@ -128,7 +128,7 @@ return { hl = "Function", } if keybind then - opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } } + opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true, nowait = true } } end return { diff --git a/dots/.config/nvim/lua/plugins/configs/autopairs.lua b/users/price/dots/.config/nvim/lua/plugins/configs/autopairs.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/autopairs.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/autopairs.lua diff --git a/dots/.config/nvim/lua/plugins/configs/bigfile.lua b/users/price/dots/.config/nvim/lua/plugins/configs/bigfile.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/bigfile.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/bigfile.lua diff --git a/users/price/dots/.config/nvim/lua/plugins/configs/bufdelete.lua b/users/price/dots/.config/nvim/lua/plugins/configs/bufdelete.lua new file mode 100644 index 00000000..56474766 --- /dev/null +++ b/users/price/dots/.config/nvim/lua/plugins/configs/bufdelete.lua @@ -0,0 +1,17 @@ +vim.api.nvim_create_autocmd("TermOpen", { + callback = function(args) + vim.keymap.set("n", "q", function() + require("bufdelete").bufdelete(0, true) + end, { silent = true, buffer = args.buf, remap = true, desc = "Close Terminal Buffer" }) + end, +}) + +return { + { + "famiu/bufdelete.nvim", + cmd = "Bdelete", + keys = { + { "", "Bdelete", desc = "Close Buffer" }, + }, + }, +} diff --git a/users/price/dots/.config/nvim/lua/plugins/configs/cmdbuf.lua b/users/price/dots/.config/nvim/lua/plugins/configs/cmdbuf.lua new file mode 100644 index 00000000..6128f00d --- /dev/null +++ b/users/price/dots/.config/nvim/lua/plugins/configs/cmdbuf.lua @@ -0,0 +1,58 @@ +vim.api.nvim_create_autocmd({ "User" }, { + group = vim.api.nvim_create_augroup("cmdbuf_setting", {}), + pattern = { "CmdbufNew" }, + callback = function() + vim.keymap.set("n", "dd", require("cmdbuf").delete, { buffer = true }) + end, +}) + +return { + { + "notomo/cmdbuf.nvim", + event = { "CmdlineEnter", "CmdwinEnter" }, + keys = { + { + "q:", + function() + require("cmdbuf").split_open(vim.o.cmdwinheight) + end, + }, + { + "q/", + function() + vim.notify("YUP!") + require("cmdbuf").split_open(vim.o.cmdwinheight, { type = "vim/search/forward" }) + end, + }, + { + "q?", + function() + vim.notify("YUP!") + require("cmdbuf").split_open(vim.o.cmdwinheight, { type = "vim/search/backward" }) + end, + }, + { + mode = "c", + "", + function() + require("cmdbuf").split_open( + vim.o.cmdwinheight, + { line = vim.fn.getcmdline(), column = vim.fn.getcmdpos() } + ) + vim.api.nvim_feedkeys(vim.keycode(""), "n", true) + end, + }, + { + mode = "c", + "", + function() + require("cmdbuf").split_open( + vim.o.cmdwinheight, + { line = vim.fn.getcmdline(), column = vim.fn.getcmdpos(), type = "lua/cmd" } + ) + vim.api.nvim_feedkeys(vim.keycode(""), "n", true) + end, + }, + }, + }, +} diff --git a/dots/.config/nvim/lua/plugins/configs/cmp.lua b/users/price/dots/.config/nvim/lua/plugins/configs/cmp.lua similarity index 98% rename from dots/.config/nvim/lua/plugins/configs/cmp.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/cmp.lua index 01ad8c5a..28ef5991 100644 --- a/dots/.config/nvim/lua/plugins/configs/cmp.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/cmp.lua @@ -295,7 +295,7 @@ return { end, }, performance = { - fetching_timeout = 100 + fetching_timeout = 100, }, view = { entries = { @@ -427,12 +427,12 @@ return { -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline("/", { mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ name = "fuzzy_buffer" }), + sources = cmp.config.sources({ { name = "fuzzy_buffer" } }), }) cmp.setup.cmdline("?", { mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ name = "fuzzy_buffer" }), + sources = cmp.config.sources({ { name = "fuzzy_buffer" } }), }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). @@ -447,9 +447,9 @@ return { }, }, priority = 100, + max_item_count = 5, }, { name = "cmdline_history", max_item_count = 3 }, - { name = "fuzzy_buffer", max_item_count = 3 }, }), }) end, diff --git a/dots/.config/nvim/lua/plugins/configs/comment.lua b/users/price/dots/.config/nvim/lua/plugins/configs/comment.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/comment.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/comment.lua diff --git a/dots/.config/nvim/lua/plugins/configs/dadbod.lua b/users/price/dots/.config/nvim/lua/plugins/configs/dadbod.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/dadbod.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/dadbod.lua diff --git a/dots/.config/nvim/lua/plugins/configs/dap.lua b/users/price/dots/.config/nvim/lua/plugins/configs/dap.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/dap.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/dap.lua diff --git a/dots/.config/nvim/lua/plugins/configs/exrc.lua b/users/price/dots/.config/nvim/lua/plugins/configs/exrc.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/exrc.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/exrc.lua diff --git a/dots/.config/nvim/lua/plugins/configs/flatten.lua b/users/price/dots/.config/nvim/lua/plugins/configs/flatten.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/flatten.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/flatten.lua diff --git a/dots/.config/nvim/lua/plugins/configs/fundo.lua b/users/price/dots/.config/nvim/lua/plugins/configs/fundo.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/fundo.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/fundo.lua diff --git a/dots/.config/nvim/lua/plugins/configs/git.lua b/users/price/dots/.config/nvim/lua/plugins/configs/git.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/git.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/git.lua diff --git a/dots/.config/nvim/lua/plugins/configs/github.lua b/users/price/dots/.config/nvim/lua/plugins/configs/github.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/github.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/github.lua diff --git a/dots/.config/nvim/lua/plugins/configs/go.lua b/users/price/dots/.config/nvim/lua/plugins/configs/go.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/go.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/go.lua diff --git a/dots/.config/nvim/lua/plugins/configs/gx.lua b/users/price/dots/.config/nvim/lua/plugins/configs/gx.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/gx.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/gx.lua diff --git a/dots/.config/nvim/lua/plugins/configs/headlines.lua b/users/price/dots/.config/nvim/lua/plugins/configs/headlines.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/headlines.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/headlines.lua diff --git a/dots/.config/nvim/lua/plugins/configs/heirline.lua b/users/price/dots/.config/nvim/lua/plugins/configs/heirline.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/heirline.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/heirline.lua diff --git a/dots/.config/nvim/lua/plugins/configs/hex.lua b/users/price/dots/.config/nvim/lua/plugins/configs/hex.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/hex.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/hex.lua diff --git a/dots/.config/nvim/lua/plugins/configs/highlight-colors.lua b/users/price/dots/.config/nvim/lua/plugins/configs/highlight-colors.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/highlight-colors.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/highlight-colors.lua diff --git a/dots/.config/nvim/lua/plugins/configs/highlight-undo.lua b/users/price/dots/.config/nvim/lua/plugins/configs/highlight-undo.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/highlight-undo.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/highlight-undo.lua diff --git a/dots/.config/nvim/lua/plugins/configs/hop.lua b/users/price/dots/.config/nvim/lua/plugins/configs/hop.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/hop.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/hop.lua diff --git a/dots/.config/nvim/lua/plugins/configs/hurl.lua b/users/price/dots/.config/nvim/lua/plugins/configs/hurl.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/hurl.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/hurl.lua diff --git a/dots/.config/nvim/lua/plugins/configs/hydra.lua b/users/price/dots/.config/nvim/lua/plugins/configs/hydra.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/hydra.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/hydra.lua diff --git a/dots/.config/nvim/lua/plugins/configs/illuminate.lua b/users/price/dots/.config/nvim/lua/plugins/configs/illuminate.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/illuminate.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/illuminate.lua diff --git a/dots/.config/nvim/lua/plugins/configs/indent-blankline.lua b/users/price/dots/.config/nvim/lua/plugins/configs/indent-blankline.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/indent-blankline.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/indent-blankline.lua diff --git a/dots/.config/nvim/lua/plugins/configs/kanagawa.lua b/users/price/dots/.config/nvim/lua/plugins/configs/kanagawa.lua similarity index 99% rename from dots/.config/nvim/lua/plugins/configs/kanagawa.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/kanagawa.lua index 3866a216..a1583271 100644 --- a/dots/.config/nvim/lua/plugins/configs/kanagawa.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/kanagawa.lua @@ -339,6 +339,8 @@ return { { "visual-whitespace", get_hl("Visual", { fg = colors.fujiGray }) }, -- Better hl for latex fragments in org files { "texMathZoneX", { fg = colors.surimiOrange } }, + -- Use underlines for urls + { "@string.special.url", get_hl("@string.special.url", { underline = true, undercurl = false }) }, } if vim.g.neovide then diff --git a/dots/.config/nvim/lua/plugins/configs/lastplace.lua b/users/price/dots/.config/nvim/lua/plugins/configs/lastplace.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/lastplace.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/lastplace.lua diff --git a/dots/.config/nvim/lua/plugins/configs/lib.lua b/users/price/dots/.config/nvim/lua/plugins/configs/lib.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/lib.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/lib.lua diff --git a/dots/.config/nvim/lua/plugins/configs/live-command.lua b/users/price/dots/.config/nvim/lua/plugins/configs/live-command.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/live-command.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/live-command.lua diff --git a/dots/.config/nvim/lua/plugins/configs/lsp.lua b/users/price/dots/.config/nvim/lua/plugins/configs/lsp.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/lsp.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/lsp.lua diff --git a/dots/.config/nvim/lua/plugins/configs/markdown.lua b/users/price/dots/.config/nvim/lua/plugins/configs/markdown.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/markdown.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/markdown.lua diff --git a/dots/.config/nvim/lua/plugins/configs/mini.lua b/users/price/dots/.config/nvim/lua/plugins/configs/mini.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/mini.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/mini.lua diff --git a/dots/.config/nvim/lua/plugins/configs/mkdir.lua b/users/price/dots/.config/nvim/lua/plugins/configs/mkdir.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/mkdir.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/mkdir.lua diff --git a/dots/.config/nvim/lua/plugins/configs/move.lua b/users/price/dots/.config/nvim/lua/plugins/configs/move.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/move.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/move.lua diff --git a/dots/.config/nvim/lua/plugins/configs/neo-tree.lua b/users/price/dots/.config/nvim/lua/plugins/configs/neo-tree.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/neo-tree.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/neo-tree.lua diff --git a/dots/.config/nvim/lua/plugins/configs/neoclip.lua b/users/price/dots/.config/nvim/lua/plugins/configs/neoclip.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/neoclip.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/neoclip.lua diff --git a/dots/.config/nvim/lua/plugins/configs/neoformat.lua b/users/price/dots/.config/nvim/lua/plugins/configs/neoformat.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/neoformat.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/neoformat.lua diff --git a/dots/.config/nvim/lua/plugins/configs/neoscroll.lua b/users/price/dots/.config/nvim/lua/plugins/configs/neoscroll.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/neoscroll.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/neoscroll.lua diff --git a/dots/.config/nvim/lua/plugins/configs/neotest.lua b/users/price/dots/.config/nvim/lua/plugins/configs/neotest.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/neotest.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/neotest.lua diff --git a/dots/.config/nvim/lua/plugins/configs/netman.lua b/users/price/dots/.config/nvim/lua/plugins/configs/netman.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/netman.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/netman.lua diff --git a/dots/.config/nvim/lua/plugins/configs/nftables.lua b/users/price/dots/.config/nvim/lua/plugins/configs/nftables.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/nftables.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/nftables.lua diff --git a/dots/.config/nvim/lua/plugins/configs/nibbler.lua b/users/price/dots/.config/nvim/lua/plugins/configs/nibbler.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/nibbler.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/nibbler.lua diff --git a/dots/.config/nvim/lua/plugins/configs/no-neck-pain.lua b/users/price/dots/.config/nvim/lua/plugins/configs/no-neck-pain.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/no-neck-pain.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/no-neck-pain.lua diff --git a/dots/.config/nvim/lua/plugins/configs/noice.lua b/users/price/dots/.config/nvim/lua/plugins/configs/noice.lua similarity index 99% rename from dots/.config/nvim/lua/plugins/configs/noice.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/noice.lua index 685720ad..e3a92829 100644 --- a/dots/.config/nvim/lua/plugins/configs/noice.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/noice.lua @@ -12,7 +12,6 @@ return { }, presets = { long_message_to_split = true, - inc_rename = true, command_palette = true, }, views = { diff --git a/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua b/users/price/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua diff --git a/dots/.config/nvim/lua/plugins/configs/org-mode.lua b/users/price/dots/.config/nvim/lua/plugins/configs/org-mode.lua similarity index 68% rename from dots/.config/nvim/lua/plugins/configs/org-mode.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/org-mode.lua index 9bfa5a64..55d2482c 100644 --- a/dots/.config/nvim/lua/plugins/configs/org-mode.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/org-mode.lua @@ -38,21 +38,42 @@ return { org_capture_templates = { t = { description = "Todo", - template = "* TODO %?\n %u", + template = "* TODO %?\n%u", + target = "~/Notes/todo/%<%Y-%m-%d>.org", }, n = { description = "Note", - template = "* %? :note:", - target = "~/Notes/notes.org", - }, - j = { - description = "Journal", - template = "\n* %? %U", + template = "* %?\n%u", target = "~/Notes/journal/%<%Y-%m-%d>.org", }, + s = { + description = "Snippet", + template = "* %? :snippet:\n%u", + target = "~/Notes/snippets/%<%Y-%m-%d>.org", + }, }, emacs_config = { - config_path = "$XDG_CONFIG_HOME/emacs/init.el", + config_path = (function() + local xdg_emacs_init_path = "/emacs/init.el" + + -- Use XDG_CONFIG_HOME by default + if vim.env.XDG_CONFIG_HOME then + return vim.env.XDG_CONFIG_HOME .. xdg_emacs_init_path + end + + -- Fallback to searching for the emacs config relative to the Neovim config + local nvim_cfg_dir = vim.fn.stdpath("config") + ---@diagnostic disable-next-line: param-type-mismatch + local cfg_dir = vim.fn.fnamemodify(nvim_cfg_dir, ":h") + if vim.uv.fs_stat(cfg_dir .. xdg_emacs_init_path) then + return cfg_dir .. xdg_emacs_init_path + end + + -- Failing that, fallback to pulling on `$HOME/.emacs/init.el` + local home_emacs_init = vim.env.HOME .. ".emacs/init.el" + assert(vim.uv.fs_stat(home_emacs_init), "Failed to locate a valid emacs configuration!") + return home_emacs_init + end)(), }, }) diff --git a/dots/.config/nvim/lua/plugins/configs/statuscol.lua b/users/price/dots/.config/nvim/lua/plugins/configs/statuscol.lua similarity index 97% rename from dots/.config/nvim/lua/plugins/configs/statuscol.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/statuscol.lua index 507d95f0..ecb50654 100644 --- a/dots/.config/nvim/lua/plugins/configs/statuscol.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/statuscol.lua @@ -11,9 +11,6 @@ return { return { setopt = true, relculright = false, - bt_ignore = { - "help", - }, segments = { { text = { "%s" }, click = "v:lua.ScSa" }, { text = { builtin.lnumfunc }, click = "v:lua.ScLa" }, diff --git a/dots/.config/nvim/lua/plugins/configs/surround.lua b/users/price/dots/.config/nvim/lua/plugins/configs/surround.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/surround.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/surround.lua diff --git a/dots/.config/nvim/lua/plugins/configs/telescope.lua b/users/price/dots/.config/nvim/lua/plugins/configs/telescope.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/telescope.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/telescope.lua diff --git a/dots/.config/nvim/lua/plugins/configs/tint.lua b/users/price/dots/.config/nvim/lua/plugins/configs/tint.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/tint.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/tint.lua diff --git a/dots/.config/nvim/lua/plugins/configs/toggleterm.lua b/users/price/dots/.config/nvim/lua/plugins/configs/toggleterm.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/toggleterm.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/toggleterm.lua diff --git a/dots/.config/nvim/lua/plugins/configs/treesitter.lua b/users/price/dots/.config/nvim/lua/plugins/configs/treesitter.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/treesitter.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/treesitter.lua diff --git a/dots/.config/nvim/lua/plugins/configs/trouble.lua b/users/price/dots/.config/nvim/lua/plugins/configs/trouble.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/trouble.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/trouble.lua diff --git a/dots/.config/nvim/lua/plugins/configs/typst.lua b/users/price/dots/.config/nvim/lua/plugins/configs/typst.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/typst.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/typst.lua diff --git a/dots/.config/nvim/lua/plugins/configs/various-textobjs.lua b/users/price/dots/.config/nvim/lua/plugins/configs/various-textobjs.lua similarity index 71% rename from dots/.config/nvim/lua/plugins/configs/various-textobjs.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/various-textobjs.lua index de0644e6..55165cb4 100644 --- a/dots/.config/nvim/lua/plugins/configs/various-textobjs.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/various-textobjs.lua @@ -3,7 +3,7 @@ return { "chrisgrieser/nvim-various-textobjs", opts = { useDefaultKeymaps = true, - disabledKeymaps = { "r", "R", "Q" }, + disabledKeymaps = { "r", "R", "Q", "gc" }, }, }, } diff --git a/dots/.config/nvim/lua/plugins/configs/vim-repeat.lua b/users/price/dots/.config/nvim/lua/plugins/configs/vim-repeat.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/vim-repeat.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/vim-repeat.lua diff --git a/dots/.config/nvim/lua/plugins/configs/vim-table-mode.lua b/users/price/dots/.config/nvim/lua/plugins/configs/vim-table-mode.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/vim-table-mode.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/vim-table-mode.lua diff --git a/dots/.config/nvim/lua/plugins/configs/vim-visual-multi.lua b/users/price/dots/.config/nvim/lua/plugins/configs/vim-visual-multi.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/vim-visual-multi.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/vim-visual-multi.lua diff --git a/dots/.config/nvim/lua/plugins/configs/vimtex.lua b/users/price/dots/.config/nvim/lua/plugins/configs/vimtex.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/vimtex.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/vimtex.lua diff --git a/dots/.config/nvim/lua/plugins/configs/visual-whitespace.lua b/users/price/dots/.config/nvim/lua/plugins/configs/visual-whitespace.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/visual-whitespace.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/visual-whitespace.lua diff --git a/dots/.config/nvim/lua/plugins/configs/which-key.lua b/users/price/dots/.config/nvim/lua/plugins/configs/which-key.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/configs/which-key.lua rename to users/price/dots/.config/nvim/lua/plugins/configs/which-key.lua diff --git a/dots/.config/nvim/lua/plugins/init.lua b/users/price/dots/.config/nvim/lua/plugins/init.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/init.lua rename to users/price/dots/.config/nvim/lua/plugins/init.lua diff --git a/dots/.config/nvim/lua/plugins/postload.lua b/users/price/dots/.config/nvim/lua/plugins/postload.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/postload.lua rename to users/price/dots/.config/nvim/lua/plugins/postload.lua diff --git a/dots/.config/nvim/lua/plugins/snippets/python.lua b/users/price/dots/.config/nvim/lua/plugins/snippets/python.lua similarity index 100% rename from dots/.config/nvim/lua/plugins/snippets/python.lua rename to users/price/dots/.config/nvim/lua/plugins/snippets/python.lua diff --git a/dots/.config/nvim/lua/utils/funcs.lua b/users/price/dots/.config/nvim/lua/utils/funcs.lua similarity index 66% rename from dots/.config/nvim/lua/utils/funcs.lua rename to users/price/dots/.config/nvim/lua/utils/funcs.lua index 8208341b..7ea05551 100755 --- a/dots/.config/nvim/lua/utils/funcs.lua +++ b/users/price/dots/.config/nvim/lua/utils/funcs.lua @@ -120,4 +120,41 @@ U.select_hl = function(name, fields) end end +---Parses a variable amount of strings or table of strings into a single string by concetanting them by spaces +---@vararg string Takes in a variable amount of strings and concatenates them by spaces +---@return string joined_args The built arguments as a single string +U.flatten_args = function(...) + return vim.iter({ ... }):flatten(math.huge):join(" ") +end + +---Synchronously write or overwrite a file with data. All data are joined by newlines and any data +---that are tables are first concatenated by spaces. +---@param path string A file path on the system +---@param mode string A octal mode, like 0700 +---@vararg string|string[] A single chunk of data or list of strings to write, if a list then the strings are concatenated by spaces +---@return string path The path written to +U.write_file = function(path, mode, ...) + local data = vim.iter({ ... }):map(U.flatten_args):join("\n") + local fd = vim.uv.fs_open(path, "w", tonumber(mode, 8)) + if fd then + vim.uv.fs_write(fd, data) + vim.uv.fs_close(fd) + else + error("Failed to acquire a file descriptor to write to!") + end + return path +end + +---Evalutes the provided cmd and places the result in a new window asynchronously. +--- +---Basic wrapper around `vim.system` +---@see vim.system +---@param cmd string[] The command to execute +---@param opts vim.systemOpts? Additional options to pass to `vim.system` +U.eval_current_buf = function(cmd, opts) + local curr_buf = vim.api.nvim_get_current_buf() + local buf_content = table.concat(vim.api.nvim_buf_get_lines(curr_buf, 0, -1, false), "\n") + vim.system(cmd, opts or {}, function(out) end) +end + return U diff --git a/dots/.config/nvim/spell/en.utf-8.add b/users/price/dots/.config/nvim/spell/en.utf-8.add similarity index 99% rename from dots/.config/nvim/spell/en.utf-8.add rename to users/price/dots/.config/nvim/spell/en.utf-8.add index b6350ac8..362ed621 100644 --- a/dots/.config/nvim/spell/en.utf-8.add +++ b/users/price/dots/.config/nvim/spell/en.utf-8.add @@ -316,3 +316,5 @@ internets DNS tokenizing tokenization +lookups +incrementing diff --git a/users/price/dots/.config/nvim/spell/en.utf-8.add.spl b/users/price/dots/.config/nvim/spell/en.utf-8.add.spl new file mode 100644 index 00000000..c0092466 Binary files /dev/null and b/users/price/dots/.config/nvim/spell/en.utf-8.add.spl differ diff --git a/dots/.config/nvim/syntax/cf3.vim b/users/price/dots/.config/nvim/syntax/cf3.vim similarity index 100% rename from dots/.config/nvim/syntax/cf3.vim rename to users/price/dots/.config/nvim/syntax/cf3.vim diff --git a/dots/.config/nvim/syntax/log.vim b/users/price/dots/.config/nvim/syntax/log.vim similarity index 100% rename from dots/.config/nvim/syntax/log.vim rename to users/price/dots/.config/nvim/syntax/log.vim diff --git a/dots/.config/powershell/Microsoft.PowerShell_profile.ps1 b/users/price/dots/.config/powershell/Microsoft.PowerShell_profile.ps1 similarity index 100% rename from dots/.config/powershell/Microsoft.PowerShell_profile.ps1 rename to users/price/dots/.config/powershell/Microsoft.PowerShell_profile.ps1 diff --git a/dots/.config/silicon/themes/kanagawa.tmTheme b/users/price/dots/.config/silicon/themes/kanagawa.tmTheme similarity index 100% rename from dots/.config/silicon/themes/kanagawa.tmTheme rename to users/price/dots/.config/silicon/themes/kanagawa.tmTheme diff --git a/dots/.config/stylua.toml b/users/price/dots/.config/stylua.toml similarity index 100% rename from dots/.config/stylua.toml rename to users/price/dots/.config/stylua.toml diff --git a/dots/.config/swappy/config b/users/price/dots/.config/swappy/config similarity index 100% rename from dots/.config/swappy/config rename to users/price/dots/.config/swappy/config diff --git a/dots/.config/sway/conf/appearance.conf b/users/price/dots/.config/sway/conf/appearance.conf similarity index 100% rename from dots/.config/sway/conf/appearance.conf rename to users/price/dots/.config/sway/conf/appearance.conf diff --git a/dots/.config/sway/conf/bindings.conf b/users/price/dots/.config/sway/conf/bindings.conf similarity index 100% rename from dots/.config/sway/conf/bindings.conf rename to users/price/dots/.config/sway/conf/bindings.conf diff --git a/dots/.config/sway/conf/colors.conf b/users/price/dots/.config/sway/conf/colors.conf similarity index 100% rename from dots/.config/sway/conf/colors.conf rename to users/price/dots/.config/sway/conf/colors.conf diff --git a/dots/.config/sway/conf/screens.conf b/users/price/dots/.config/sway/conf/screens.conf similarity index 100% rename from dots/.config/sway/conf/screens.conf rename to users/price/dots/.config/sway/conf/screens.conf diff --git a/dots/.config/sway/config b/users/price/dots/.config/sway/config similarity index 100% rename from dots/.config/sway/config rename to users/price/dots/.config/sway/config diff --git a/dots/.config/sway/scripts/laptop-clamshell.bash b/users/price/dots/.config/sway/scripts/laptop-clamshell.bash similarity index 100% rename from dots/.config/sway/scripts/laptop-clamshell.bash rename to users/price/dots/.config/sway/scripts/laptop-clamshell.bash diff --git a/dots/.config/sway/scripts/launch-waybar.bash b/users/price/dots/.config/sway/scripts/launch-waybar.bash similarity index 100% rename from dots/.config/sway/scripts/launch-waybar.bash rename to users/price/dots/.config/sway/scripts/launch-waybar.bash diff --git a/dots/.config/swaylock/config b/users/price/dots/.config/swaylock/config similarity index 100% rename from dots/.config/swaylock/config rename to users/price/dots/.config/swaylock/config diff --git a/dots/.config/waybar/config b/users/price/dots/.config/waybar/config similarity index 100% rename from dots/.config/waybar/config rename to users/price/dots/.config/waybar/config diff --git a/dots/.config/waybar/scripts/get-media.bash b/users/price/dots/.config/waybar/scripts/get-media.bash similarity index 100% rename from dots/.config/waybar/scripts/get-media.bash rename to users/price/dots/.config/waybar/scripts/get-media.bash diff --git a/dots/.config/waybar/scripts/get-pacman-package-updates.bash b/users/price/dots/.config/waybar/scripts/get-pacman-package-updates.bash similarity index 100% rename from dots/.config/waybar/scripts/get-pacman-package-updates.bash rename to users/price/dots/.config/waybar/scripts/get-pacman-package-updates.bash diff --git a/dots/.config/waybar/scripts/set-rfkill.bash b/users/price/dots/.config/waybar/scripts/set-rfkill.bash similarity index 100% rename from dots/.config/waybar/scripts/set-rfkill.bash rename to users/price/dots/.config/waybar/scripts/set-rfkill.bash diff --git a/dots/.config/waybar/style.css b/users/price/dots/.config/waybar/style.css similarity index 100% rename from dots/.config/waybar/style.css rename to users/price/dots/.config/waybar/style.css diff --git a/dots/.config/wezterm/.editorconfig b/users/price/dots/.config/wezterm/.editorconfig similarity index 100% rename from dots/.config/wezterm/.editorconfig rename to users/price/dots/.config/wezterm/.editorconfig diff --git a/dots/.config/wezterm/.stylua.toml b/users/price/dots/.config/wezterm/.stylua.toml similarity index 100% rename from dots/.config/wezterm/.stylua.toml rename to users/price/dots/.config/wezterm/.stylua.toml diff --git a/dots/.config/wezterm/config/events.lua b/users/price/dots/.config/wezterm/config/events.lua similarity index 100% rename from dots/.config/wezterm/config/events.lua rename to users/price/dots/.config/wezterm/config/events.lua diff --git a/dots/.config/wezterm/config/fonts.lua b/users/price/dots/.config/wezterm/config/fonts.lua similarity index 100% rename from dots/.config/wezterm/config/fonts.lua rename to users/price/dots/.config/wezterm/config/fonts.lua diff --git a/dots/.config/wezterm/config/gpu.lua b/users/price/dots/.config/wezterm/config/gpu.lua similarity index 100% rename from dots/.config/wezterm/config/gpu.lua rename to users/price/dots/.config/wezterm/config/gpu.lua diff --git a/dots/.config/wezterm/config/keybinds.lua b/users/price/dots/.config/wezterm/config/keybinds.lua similarity index 100% rename from dots/.config/wezterm/config/keybinds.lua rename to users/price/dots/.config/wezterm/config/keybinds.lua diff --git a/dots/.config/wezterm/config/misc.lua b/users/price/dots/.config/wezterm/config/misc.lua similarity index 100% rename from dots/.config/wezterm/config/misc.lua rename to users/price/dots/.config/wezterm/config/misc.lua diff --git a/dots/.config/wezterm/config/os/linux.lua b/users/price/dots/.config/wezterm/config/os/linux.lua similarity index 100% rename from dots/.config/wezterm/config/os/linux.lua rename to users/price/dots/.config/wezterm/config/os/linux.lua diff --git a/dots/.config/wezterm/config/os/windows.lua b/users/price/dots/.config/wezterm/config/os/windows.lua similarity index 100% rename from dots/.config/wezterm/config/os/windows.lua rename to users/price/dots/.config/wezterm/config/os/windows.lua diff --git a/dots/.config/wezterm/config/rendering.lua b/users/price/dots/.config/wezterm/config/rendering.lua similarity index 100% rename from dots/.config/wezterm/config/rendering.lua rename to users/price/dots/.config/wezterm/config/rendering.lua diff --git a/dots/.config/wezterm/config/tabbar.lua b/users/price/dots/.config/wezterm/config/tabbar.lua similarity index 100% rename from dots/.config/wezterm/config/tabbar.lua rename to users/price/dots/.config/wezterm/config/tabbar.lua diff --git a/dots/.config/wezterm/config/theme/colors.lua b/users/price/dots/.config/wezterm/config/theme/colors.lua similarity index 100% rename from dots/.config/wezterm/config/theme/colors.lua rename to users/price/dots/.config/wezterm/config/theme/colors.lua diff --git a/dots/.config/wezterm/config/theme/theme.lua b/users/price/dots/.config/wezterm/config/theme/theme.lua similarity index 100% rename from dots/.config/wezterm/config/theme/theme.lua rename to users/price/dots/.config/wezterm/config/theme/theme.lua diff --git a/dots/.config/wezterm/lib/inspect.lua b/users/price/dots/.config/wezterm/lib/inspect.lua similarity index 100% rename from dots/.config/wezterm/lib/inspect.lua rename to users/price/dots/.config/wezterm/lib/inspect.lua diff --git a/dots/.config/wezterm/lib/log.lua b/users/price/dots/.config/wezterm/lib/log.lua similarity index 100% rename from dots/.config/wezterm/lib/log.lua rename to users/price/dots/.config/wezterm/lib/log.lua diff --git a/dots/.config/wezterm/lib/wlib.lua b/users/price/dots/.config/wezterm/lib/wlib.lua similarity index 100% rename from dots/.config/wezterm/lib/wlib.lua rename to users/price/dots/.config/wezterm/lib/wlib.lua diff --git a/dots/.config/wezterm/wezterm.lua b/users/price/dots/.config/wezterm/wezterm.lua similarity index 100% rename from dots/.config/wezterm/wezterm.lua rename to users/price/dots/.config/wezterm/wezterm.lua diff --git a/dots/.config/wofi/cliphist.css b/users/price/dots/.config/wofi/cliphist.css similarity index 100% rename from dots/.config/wofi/cliphist.css rename to users/price/dots/.config/wofi/cliphist.css diff --git a/dots/.config/wofi/config b/users/price/dots/.config/wofi/config similarity index 100% rename from dots/.config/wofi/config rename to users/price/dots/.config/wofi/config diff --git a/dots/.config/wofi/style.css b/users/price/dots/.config/wofi/style.css similarity index 100% rename from dots/.config/wofi/style.css rename to users/price/dots/.config/wofi/style.css diff --git a/dots/.config/yay/config.json b/users/price/dots/.config/yay/config.json similarity index 100% rename from dots/.config/yay/config.json rename to users/price/dots/.config/yay/config.json diff --git a/dots/.config/zathura/zathurarc b/users/price/dots/.config/zathura/zathurarc similarity index 100% rename from dots/.config/zathura/zathurarc rename to users/price/dots/.config/zathura/zathurarc diff --git a/dots/.config/zsh/config/completions/completions/_Note b/users/price/dots/.config/zsh/config/completions/completions/_Note similarity index 100% rename from dots/.config/zsh/config/completions/completions/_Note rename to users/price/dots/.config/zsh/config/completions/completions/_Note diff --git a/dots/.config/zsh/config/completions/completions/_bat b/users/price/dots/.config/zsh/config/completions/completions/_bat similarity index 100% rename from dots/.config/zsh/config/completions/completions/_bat rename to users/price/dots/.config/zsh/config/completions/completions/_bat diff --git a/dots/.config/zsh/config/completions/completions/_bob b/users/price/dots/.config/zsh/config/completions/completions/_bob similarity index 100% rename from dots/.config/zsh/config/completions/completions/_bob rename to users/price/dots/.config/zsh/config/completions/completions/_bob diff --git a/dots/.config/zsh/config/completions/completions/_cargo b/users/price/dots/.config/zsh/config/completions/completions/_cargo similarity index 100% rename from dots/.config/zsh/config/completions/completions/_cargo rename to users/price/dots/.config/zsh/config/completions/completions/_cargo diff --git a/dots/.config/zsh/config/completions/completions/_cmake b/users/price/dots/.config/zsh/config/completions/completions/_cmake similarity index 100% rename from dots/.config/zsh/config/completions/completions/_cmake rename to users/price/dots/.config/zsh/config/completions/completions/_cmake diff --git a/dots/.config/zsh/config/completions/completions/_curl b/users/price/dots/.config/zsh/config/completions/completions/_curl similarity index 100% rename from dots/.config/zsh/config/completions/completions/_curl rename to users/price/dots/.config/zsh/config/completions/completions/_curl diff --git a/dots/.config/zsh/config/completions/completions/_delta b/users/price/dots/.config/zsh/config/completions/completions/_delta similarity index 100% rename from dots/.config/zsh/config/completions/completions/_delta rename to users/price/dots/.config/zsh/config/completions/completions/_delta diff --git a/dots/.config/zsh/config/completions/completions/_dotnet b/users/price/dots/.config/zsh/config/completions/completions/_dotnet similarity index 100% rename from dots/.config/zsh/config/completions/completions/_dotnet rename to users/price/dots/.config/zsh/config/completions/completions/_dotnet diff --git a/dots/.config/zsh/config/completions/completions/_eza b/users/price/dots/.config/zsh/config/completions/completions/_eza similarity index 100% rename from dots/.config/zsh/config/completions/completions/_eza rename to users/price/dots/.config/zsh/config/completions/completions/_eza diff --git a/dots/.config/zsh/config/completions/completions/_fail2ban-client b/users/price/dots/.config/zsh/config/completions/completions/_fail2ban-client similarity index 100% rename from dots/.config/zsh/config/completions/completions/_fail2ban-client rename to users/price/dots/.config/zsh/config/completions/completions/_fail2ban-client diff --git a/dots/.config/zsh/config/completions/completions/_fd b/users/price/dots/.config/zsh/config/completions/completions/_fd similarity index 100% rename from dots/.config/zsh/config/completions/completions/_fd rename to users/price/dots/.config/zsh/config/completions/completions/_fd diff --git a/dots/.config/zsh/config/completions/completions/_firewalld b/users/price/dots/.config/zsh/config/completions/completions/_firewalld similarity index 100% rename from dots/.config/zsh/config/completions/completions/_firewalld rename to users/price/dots/.config/zsh/config/completions/completions/_firewalld diff --git a/dots/.config/zsh/config/completions/completions/_gh b/users/price/dots/.config/zsh/config/completions/completions/_gh similarity index 100% rename from dots/.config/zsh/config/completions/completions/_gh rename to users/price/dots/.config/zsh/config/completions/completions/_gh diff --git a/dots/.config/zsh/config/completions/completions/_golang b/users/price/dots/.config/zsh/config/completions/completions/_golang similarity index 100% rename from dots/.config/zsh/config/completions/completions/_golang rename to users/price/dots/.config/zsh/config/completions/completions/_golang diff --git a/dots/.config/zsh/config/completions/completions/_j b/users/price/dots/.config/zsh/config/completions/completions/_j similarity index 100% rename from dots/.config/zsh/config/completions/completions/_j rename to users/price/dots/.config/zsh/config/completions/completions/_j diff --git a/dots/.config/zsh/config/completions/completions/_kind b/users/price/dots/.config/zsh/config/completions/completions/_kind similarity index 100% rename from dots/.config/zsh/config/completions/completions/_kind rename to users/price/dots/.config/zsh/config/completions/completions/_kind diff --git a/dots/.config/zsh/config/completions/completions/_kubectl b/users/price/dots/.config/zsh/config/completions/completions/_kubectl similarity index 100% rename from dots/.config/zsh/config/completions/completions/_kubectl rename to users/price/dots/.config/zsh/config/completions/completions/_kubectl diff --git a/dots/.config/zsh/config/completions/completions/_minikube b/users/price/dots/.config/zsh/config/completions/completions/_minikube similarity index 100% rename from dots/.config/zsh/config/completions/completions/_minikube rename to users/price/dots/.config/zsh/config/completions/completions/_minikube diff --git a/dots/.config/zsh/config/completions/completions/_mpv b/users/price/dots/.config/zsh/config/completions/completions/_mpv similarity index 100% rename from dots/.config/zsh/config/completions/completions/_mpv rename to users/price/dots/.config/zsh/config/completions/completions/_mpv diff --git a/dots/.config/zsh/config/completions/completions/_ninja b/users/price/dots/.config/zsh/config/completions/completions/_ninja similarity index 100% rename from dots/.config/zsh/config/completions/completions/_ninja rename to users/price/dots/.config/zsh/config/completions/completions/_ninja diff --git a/dots/.config/zsh/config/completions/completions/_nvim-env b/users/price/dots/.config/zsh/config/completions/completions/_nvim-env similarity index 100% rename from dots/.config/zsh/config/completions/completions/_nvim-env rename to users/price/dots/.config/zsh/config/completions/completions/_nvim-env diff --git a/dots/.config/zsh/config/completions/completions/_openssl b/users/price/dots/.config/zsh/config/completions/completions/_openssl similarity index 100% rename from dots/.config/zsh/config/completions/completions/_openssl rename to users/price/dots/.config/zsh/config/completions/completions/_openssl diff --git a/dots/.config/zsh/config/completions/completions/_passage b/users/price/dots/.config/zsh/config/completions/completions/_passage similarity index 100% rename from dots/.config/zsh/config/completions/completions/_passage rename to users/price/dots/.config/zsh/config/completions/completions/_passage diff --git a/dots/.config/zsh/config/completions/completions/_pgsql_utils b/users/price/dots/.config/zsh/config/completions/completions/_pgsql_utils similarity index 100% rename from dots/.config/zsh/config/completions/completions/_pgsql_utils rename to users/price/dots/.config/zsh/config/completions/completions/_pgsql_utils diff --git a/dots/.config/zsh/config/completions/completions/_poetry b/users/price/dots/.config/zsh/config/completions/completions/_poetry similarity index 100% rename from dots/.config/zsh/config/completions/completions/_poetry rename to users/price/dots/.config/zsh/config/completions/completions/_poetry diff --git a/dots/.config/zsh/config/completions/completions/_rg b/users/price/dots/.config/zsh/config/completions/completions/_rg similarity index 100% rename from dots/.config/zsh/config/completions/completions/_rg rename to users/price/dots/.config/zsh/config/completions/completions/_rg diff --git a/dots/.config/zsh/config/completions/completions/_rustup b/users/price/dots/.config/zsh/config/completions/completions/_rustup similarity index 100% rename from dots/.config/zsh/config/completions/completions/_rustup rename to users/price/dots/.config/zsh/config/completions/completions/_rustup diff --git a/dots/.config/zsh/config/completions/completions/_shellcheck b/users/price/dots/.config/zsh/config/completions/completions/_shellcheck similarity index 100% rename from dots/.config/zsh/config/completions/completions/_shellcheck rename to users/price/dots/.config/zsh/config/completions/completions/_shellcheck diff --git a/dots/.config/zsh/config/completions/completions/_vagrant b/users/price/dots/.config/zsh/config/completions/completions/_vagrant similarity index 100% rename from dots/.config/zsh/config/completions/completions/_vagrant rename to users/price/dots/.config/zsh/config/completions/completions/_vagrant diff --git a/dots/.config/zsh/config/completions/completions/_wezterm b/users/price/dots/.config/zsh/config/completions/completions/_wezterm similarity index 100% rename from dots/.config/zsh/config/completions/completions/_wezterm rename to users/price/dots/.config/zsh/config/completions/completions/_wezterm diff --git a/dots/.config/zsh/config/completions/completions/_yarn b/users/price/dots/.config/zsh/config/completions/completions/_yarn similarity index 100% rename from dots/.config/zsh/config/completions/completions/_yarn rename to users/price/dots/.config/zsh/config/completions/completions/_yarn diff --git a/dots/.config/zsh/config/completions/completions/_yt-dlp b/users/price/dots/.config/zsh/config/completions/completions/_yt-dlp similarity index 100% rename from dots/.config/zsh/config/completions/completions/_yt-dlp rename to users/price/dots/.config/zsh/config/completions/completions/_yt-dlp diff --git a/dots/.config/zsh/config/completions/init.zsh b/users/price/dots/.config/zsh/config/completions/init.zsh similarity index 62% rename from dots/.config/zsh/config/completions/init.zsh rename to users/price/dots/.config/zsh/config/completions/init.zsh index 04dcdd42..7367a099 100644 --- a/dots/.config/zsh/config/completions/init.zsh +++ b/users/price/dots/.config/zsh/config/completions/init.zsh @@ -4,12 +4,13 @@ init() { local wkdir="${BASE_ZSH_CONFIG_DIR}/config/completions" FPATH="${FPATH}:${wkdir}/completions" - autoload bashcompinit && bashcompinit - autoload -Uz compinit && compinit + autoload -Uz compinit bashcompinit + export ZSH_COMP_DUMPFILE="${XDG_CACHE_HOME}/zcompdump" + compinit -d "${ZSH_COMP_DUMPFILE}" if command -v aws_completer >/dev/null 2>&1; then complete -C "$(command -v aws_completer)" aws fi } -init +init \ No newline at end of file diff --git a/dots/.config/zsh/config/init.zsh b/users/price/dots/.config/zsh/config/init.zsh similarity index 87% rename from dots/.config/zsh/config/init.zsh rename to users/price/dots/.config/zsh/config/init.zsh index ad07195a..1a8bd8bf 100644 --- a/dots/.config/zsh/config/init.zsh +++ b/users/price/dots/.config/zsh/config/init.zsh @@ -5,7 +5,6 @@ configure() { export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" - export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}" } @@ -22,4 +21,4 @@ init() { init unset -f init -unset -f configure +unset -f configure \ No newline at end of file diff --git a/dots/.config/zsh/config/omz/init.zsh b/users/price/dots/.config/zsh/config/omz/init.zsh similarity index 100% rename from dots/.config/zsh/config/omz/init.zsh rename to users/price/dots/.config/zsh/config/omz/init.zsh diff --git a/dots/.config/zsh/config/plugins/fzf-tab b/users/price/dots/.config/zsh/config/plugins/fzf-tab similarity index 100% rename from dots/.config/zsh/config/plugins/fzf-tab rename to users/price/dots/.config/zsh/config/plugins/fzf-tab diff --git a/dots/.config/zsh/config/plugins/init.zsh b/users/price/dots/.config/zsh/config/plugins/init.zsh similarity index 88% rename from dots/.config/zsh/config/plugins/init.zsh rename to users/price/dots/.config/zsh/config/plugins/init.zsh index 3cf4ab03..aac07df0 100644 --- a/dots/.config/zsh/config/plugins/init.zsh +++ b/users/price/dots/.config/zsh/config/plugins/init.zsh @@ -16,16 +16,15 @@ init() { source "${wkdir}/nix-zsh-completions/nix.plugin.zsh" source "${wkdir}/zsh-nix-shell/nix-shell.plugin.zsh" - # export PATH="${PATH}:${wkdir}/forgit/bin" - # source "${wkdir}/forgit/forgit.plugin.zsh" - FPATH="${FPATH}:${wkdir}/nix-zsh-completions" + + export _ZL_DATA="${XDG_CACHE_HOME}/zlua" + touch "${_ZL_DATA}" eval "$(lua "${wkdir}/z.lua/z.lua" --init zsh enhanced once)" - # source fzf [[ -r "${XDG_CONFIG_HOME}/fzf/fzf.zsh" ]] && source "${XDG_CONFIG_HOME}/fzf/fzf.zsh" configure } -init +init \ No newline at end of file diff --git a/dots/.config/zsh/config/plugins/nix-zsh-completions b/users/price/dots/.config/zsh/config/plugins/nix-zsh-completions similarity index 100% rename from dots/.config/zsh/config/plugins/nix-zsh-completions rename to users/price/dots/.config/zsh/config/plugins/nix-zsh-completions diff --git a/dots/.config/zsh/config/plugins/powerlevel10k b/users/price/dots/.config/zsh/config/plugins/powerlevel10k similarity index 100% rename from dots/.config/zsh/config/plugins/powerlevel10k rename to users/price/dots/.config/zsh/config/plugins/powerlevel10k diff --git a/dots/.config/zsh/config/plugins/z.lua b/users/price/dots/.config/zsh/config/plugins/z.lua similarity index 100% rename from dots/.config/zsh/config/plugins/z.lua rename to users/price/dots/.config/zsh/config/plugins/z.lua diff --git a/dots/.config/zsh/config/plugins/zsh-autosuggestions b/users/price/dots/.config/zsh/config/plugins/zsh-autosuggestions similarity index 100% rename from dots/.config/zsh/config/plugins/zsh-autosuggestions rename to users/price/dots/.config/zsh/config/plugins/zsh-autosuggestions diff --git a/dots/.config/zsh/config/plugins/zsh-completions b/users/price/dots/.config/zsh/config/plugins/zsh-completions similarity index 100% rename from dots/.config/zsh/config/plugins/zsh-completions rename to users/price/dots/.config/zsh/config/plugins/zsh-completions diff --git a/dots/.config/zsh/config/plugins/zsh-nix-shell b/users/price/dots/.config/zsh/config/plugins/zsh-nix-shell similarity index 100% rename from dots/.config/zsh/config/plugins/zsh-nix-shell rename to users/price/dots/.config/zsh/config/plugins/zsh-nix-shell diff --git a/dots/.config/zsh/config/plugins/zsh-syntax-highlighting b/users/price/dots/.config/zsh/config/plugins/zsh-syntax-highlighting similarity index 100% rename from dots/.config/zsh/config/plugins/zsh-syntax-highlighting rename to users/price/dots/.config/zsh/config/plugins/zsh-syntax-highlighting diff --git a/dots/.config/zsh/config/profile/init.zsh b/users/price/dots/.config/zsh/config/profile/init.zsh similarity index 70% rename from dots/.config/zsh/config/profile/init.zsh rename to users/price/dots/.config/zsh/config/profile/init.zsh index b1749be8..3775f87b 100644 --- a/dots/.config/zsh/config/profile/init.zsh +++ b/users/price/dots/.config/zsh/config/profile/init.zsh @@ -5,12 +5,6 @@ configure() { } init() { - - # Enables bash completion compatability - autoload -U +X bashcompinit && bashcompinit - autoload -U +X compinit && compinit - - local wkdir="${BASE_ZSH_CONFIG_DIR}/config/profile" source "${wkdir}/profile/options.zsh" source "${wkdir}/profile/env.zsh" @@ -21,4 +15,4 @@ init() { configure } -init +init \ No newline at end of file diff --git a/dots/.config/zsh/config/profile/profile/aliases.zsh b/users/price/dots/.config/zsh/config/profile/profile/aliases.zsh similarity index 100% rename from dots/.config/zsh/config/profile/profile/aliases.zsh rename to users/price/dots/.config/zsh/config/profile/profile/aliases.zsh diff --git a/dots/.config/zsh/config/profile/profile/env.zsh b/users/price/dots/.config/zsh/config/profile/profile/env.zsh similarity index 99% rename from dots/.config/zsh/config/profile/profile/env.zsh rename to users/price/dots/.config/zsh/config/profile/profile/env.zsh index 7908c880..b6571da2 100644 --- a/dots/.config/zsh/config/profile/profile/env.zsh +++ b/users/price/dots/.config/zsh/config/profile/profile/env.zsh @@ -98,9 +98,6 @@ if [[ "$OSTYPE" = "darwin"* ]]; then # Zsh FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" _import_custom_bash_completions - - autoload -Uz compinit - compinit fi fi @@ -181,4 +178,3 @@ export POWERSHELL_TELEMETRY_OPTOUT=true ### NPM ### export NPM_CONFIG_PREFIX="${HOME}/.npm-global" export PATH="${PATH}:${NPM_CONFIG_PREFIX}/bin" - diff --git a/dots/.config/zsh/config/profile/profile/functions.zsh b/users/price/dots/.config/zsh/config/profile/profile/functions.zsh similarity index 100% rename from dots/.config/zsh/config/profile/profile/functions.zsh rename to users/price/dots/.config/zsh/config/profile/profile/functions.zsh diff --git a/dots/.config/zsh/config/profile/profile/keybinds.zsh b/users/price/dots/.config/zsh/config/profile/profile/keybinds.zsh similarity index 100% rename from dots/.config/zsh/config/profile/profile/keybinds.zsh rename to users/price/dots/.config/zsh/config/profile/profile/keybinds.zsh diff --git a/dots/.config/zsh/config/profile/profile/manpager_wrapper_func.bash b/users/price/dots/.config/zsh/config/profile/profile/manpager_wrapper_func.bash similarity index 100% rename from dots/.config/zsh/config/profile/profile/manpager_wrapper_func.bash rename to users/price/dots/.config/zsh/config/profile/profile/manpager_wrapper_func.bash diff --git a/dots/.config/zsh/config/profile/profile/options.zsh b/users/price/dots/.config/zsh/config/profile/profile/options.zsh similarity index 100% rename from dots/.config/zsh/config/profile/profile/options.zsh rename to users/price/dots/.config/zsh/config/profile/profile/options.zsh diff --git a/dots/.config/zsh/config/style/init.zsh b/users/price/dots/.config/zsh/config/style/init.zsh similarity index 100% rename from dots/.config/zsh/config/style/init.zsh rename to users/price/dots/.config/zsh/config/style/init.zsh diff --git a/dots/.config/zsh/config/themes/config.zsh b/users/price/dots/.config/zsh/config/themes/config.zsh similarity index 100% rename from dots/.config/zsh/config/themes/config.zsh rename to users/price/dots/.config/zsh/config/themes/config.zsh diff --git a/dots/.config/zsh/config/themes/init.zsh b/users/price/dots/.config/zsh/config/themes/init.zsh similarity index 100% rename from dots/.config/zsh/config/themes/init.zsh rename to users/price/dots/.config/zsh/config/themes/init.zsh diff --git a/dots/.config/zsh/config/themes/powerlevel10k b/users/price/dots/.config/zsh/config/themes/powerlevel10k similarity index 100% rename from dots/.config/zsh/config/themes/powerlevel10k rename to users/price/dots/.config/zsh/config/themes/powerlevel10k diff --git a/dots/.config/zsh/lib/colors.zsh b/users/price/dots/.config/zsh/lib/colors.zsh similarity index 100% rename from dots/.config/zsh/lib/colors.zsh rename to users/price/dots/.config/zsh/lib/colors.zsh diff --git a/dots/.config/zsh/zsh b/users/price/dots/.config/zsh/zsh similarity index 100% rename from dots/.config/zsh/zsh rename to users/price/dots/.config/zsh/zsh diff --git a/dots/.latexmkrc b/users/price/dots/.latexmkrc similarity index 100% rename from dots/.latexmkrc rename to users/price/dots/.latexmkrc diff --git a/dots/.local/share/wallpapers/Autumn-Leaves.jpg b/users/price/dots/.local/share/wallpapers/Autumn-Leaves.jpg similarity index 100% rename from dots/.local/share/wallpapers/Autumn-Leaves.jpg rename to users/price/dots/.local/share/wallpapers/Autumn-Leaves.jpg diff --git a/dots/.local/share/wallpapers/Industrial-Shaded.png b/users/price/dots/.local/share/wallpapers/Industrial-Shaded.png similarity index 100% rename from dots/.local/share/wallpapers/Industrial-Shaded.png rename to users/price/dots/.local/share/wallpapers/Industrial-Shaded.png diff --git a/dots/.local/share/wallpapers/Mountain-Retreat.jpg b/users/price/dots/.local/share/wallpapers/Mountain-Retreat.jpg similarity index 100% rename from dots/.local/share/wallpapers/Mountain-Retreat.jpg rename to users/price/dots/.local/share/wallpapers/Mountain-Retreat.jpg diff --git a/dots/.local/share/wallpapers/Nebula.jpg b/users/price/dots/.local/share/wallpapers/Nebula.jpg similarity index 100% rename from dots/.local/share/wallpapers/Nebula.jpg rename to users/price/dots/.local/share/wallpapers/Nebula.jpg diff --git a/dots/.local/share/wallpapers/Space-Mountains.png b/users/price/dots/.local/share/wallpapers/Space-Mountains.png similarity index 100% rename from dots/.local/share/wallpapers/Space-Mountains.png rename to users/price/dots/.local/share/wallpapers/Space-Mountains.png diff --git a/dots/.local/share/wallpapers/TokyoNight.jpg b/users/price/dots/.local/share/wallpapers/TokyoNight.jpg similarity index 100% rename from dots/.local/share/wallpapers/TokyoNight.jpg rename to users/price/dots/.local/share/wallpapers/TokyoNight.jpg diff --git a/dots/.local/share/wallpapers/kanagawa-alt.jpg b/users/price/dots/.local/share/wallpapers/kanagawa-alt.jpg similarity index 100% rename from dots/.local/share/wallpapers/kanagawa-alt.jpg rename to users/price/dots/.local/share/wallpapers/kanagawa-alt.jpg diff --git a/dots/.local/share/wallpapers/kanagawa-min.png b/users/price/dots/.local/share/wallpapers/kanagawa-min.png similarity index 100% rename from dots/.local/share/wallpapers/kanagawa-min.png rename to users/price/dots/.local/share/wallpapers/kanagawa-min.png diff --git a/dots/.omnisharp/omnisharp.json b/users/price/dots/.omnisharp/omnisharp.json similarity index 100% rename from dots/.omnisharp/omnisharp.json rename to users/price/dots/.omnisharp/omnisharp.json diff --git a/config/default.nix b/users/price/home.nix similarity index 80% rename from config/default.nix rename to users/price/home.nix index 87b584d2..7bf94e1b 100644 --- a/config/default.nix +++ b/users/price/home.nix @@ -5,47 +5,44 @@ ... }: let - dotsDir = "${config.home.homeDirectory}/.config/home-manager/dots"; + dotsDir = "${config.home.homeDirectory}/.config/home-manager/users/price/dots"; softLinkDots = dir: (builtins.listToAttrs ( - map - (n: { - name = "${dir + "/" + n}"; - value = { - source = config.lib.file.mkOutOfStoreSymlink "${dotsDir}/${dir}/${n}"; - force = true; - }; - }) - # HACK: We don't use the absolute path in readDir to respect pure evaluation in nix flakes. - (builtins.attrNames (builtins.readDir ../dots/${dir})) + map (n: { + name = "${dir + "/" + n}"; + value = { + source = config.lib.file.mkOutOfStoreSymlink "${dotsDir}/${dir}/${n}"; + force = true; + }; + }) (builtins.attrNames (builtins.readDir ./dots/${dir})) )); - nixGLWrap = - pkg: - pkgs.runCommand "${pkg.name}-nixgl-wrapper" { } '' - mkdir $out - ln -s ${pkg}/* $out - rm $out/bin - mkdir $out/bin - for bin in ${pkg}/bin/*; do - wrapped_bin=$out/bin/$(basename $bin) - echo "exec ${lib.getExe pkgs.nixgl.nixGLIntel} $bin \$@" > $wrapped_bin - chmod +x $wrapped_bin - done - ''; in { programs.home-manager.enable = true; + nixpkgs = { + config.allowUnfree = true; + }; home = { + language.base = "en_US.UTF-8"; packages = with pkgs; [ + mako + wl-clipboard + grim + unzip + bat Fmt nodePackages.prettier + cargo + rustc + rustfmt + python3 shfmt bob-nvim - (nixGLWrap neovide) - (nixGLWrap wezterm) + neovide + wezterm fontconfig emacs sqlite @@ -76,7 +73,6 @@ in ripgrep fd nixfmt-rfc-style - gtk2 lxappearance opensnitch-ui twitter-color-emoji @@ -97,7 +93,12 @@ in keyd tidal-hifi nix-output-monitor + sops ungoogled-chromium + tree-sitter + qt6Packages.qt6gtk2 + qt6Packages.qt6ct + libsForQt5.qt5ct ] ++ [ go @@ -108,40 +109,31 @@ in age-plugin-yubikey passage ] - ++ [ - libsForQt5.qtstyleplugins - libsForQt5.qtcurve - qt6Packages.qt6gtk2 - gtk-engine-murrine - gnome.gnome-themes-extra - gtk_engines - ] ++ [ ansible ansible-lint ] ++ [ - # gnumake - # cmake - # gcc - # glibc - # openssl.dev - # glibc.static - # llvm - # llvmPackages.libcxxStdenv + gnumake + cmake + gcc + glibc + glibc.static + llvm + llvmPackages.libcxxStdenv ]; file = { ".local/share/wallpapers" = { - source = ../dots/.local/share/wallpapers; + source = ./dots/.local/share/wallpapers; force = true; }; ".omnisharp" = { - source = ../dots/.omnisharp; + source = ./dots/.omnisharp; force = true; }; ".latexmkrc" = { - source = ../dots/.latexmkrc; + source = ./dots/.latexmkrc; force = true; }; } // softLinkDots ".config"; @@ -149,7 +141,13 @@ in sessionVariables = { TERMINFO_DIRS = "${config.home.homeDirectory}/.nix-profile/share/terminfo"; WSLENV = "TERMINFO_DIRS"; - LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; + GTK_PATH = "${pkgs.gtk-engine-murrine}/lib/gtk-2.0"; + # PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig:${pkgs.sqlite.dev}/lib/pkgconfig"; + # LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ + # openssl + # curl + # sqlite + # ]; }; sessionPath = [ "${config.xdg.dataHome}/bin" ]; }; @@ -159,40 +157,37 @@ in xdg = { enable = true; mime.enable = true; + systemDirs.data = [ "${config.home.homeDirectory}/.nix-profile/share/" ]; mimeApps = { enable = true; associations.added = { - "x-scheme-handler/http" = [ "firefoxdeveloperedition.desktop" ]; - "x-scheme-handler/https" = [ "firefoxdeveloperedition.desktop" ]; - "x-scheme-handler/chrome" = [ "firefoxdeveloperedition.desktop" ]; - "text/html" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-htm" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-html" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-shtml" = [ "firefoxdeveloperedition.desktop" ]; - "application/xhtml+xml" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-xhtml" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-xht" = [ "firefoxdeveloperedition.desktop" ]; + "x-scheme-handler/http" = [ "firefox-devedition.desktop" ]; + "x-scheme-handler/https" = [ "firefox-devedition.desktop" ]; + "x-scheme-handler/chrome" = [ "firefox-devedition.desktop" ]; + "text/html" = [ "firefox-devedition.desktop" ]; + "application/x-extension-htm" = [ "firefox-devedition.desktop" ]; + "application/x-extension-html" = [ "firefox-devedition.desktop" ]; + "application/x-extension-shtml" = [ "firefox-devedition.desktop" ]; + "application/xhtml+xml" = [ "firefox-devedition.desktop" ]; + "application/x-extension-xhtml" = [ "firefox-devedition.desktop" ]; + "application/x-extension-xht" = [ "firefox-devedition.desktop" ]; }; defaultApplications = { "application/pdf" = [ "org.pwmt.zathura.desktop" ]; - "x-scheme-handler/http" = [ "firefoxdeveloperedition.desktop" ]; - "x-scheme-handler/https" = [ "firefoxdeveloperedition.desktop" ]; - "x-scheme-handler/chrome" = [ "firefoxdeveloperedition.desktop" ]; - "text/html" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-htm" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-html" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-shtml" = [ "firefoxdeveloperedition.desktop" ]; - "application/xhtml+xml" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-xhtml" = [ "firefoxdeveloperedition.desktop" ]; - "application/x-extension-xht" = [ "firefoxdeveloperedition.desktop" ]; + "x-scheme-handler/http" = [ "firefox-devedition.desktop" ]; + "x-scheme-handler/https" = [ "firefox-devedition.desktop" ]; + "x-scheme-handler/chrome" = [ "firefox-devedition.desktop" ]; + "text/html" = [ "firefox-devedition.desktop" ]; + "application/x-extension-htm" = [ "firefox-devedition.desktop" ]; + "application/x-extension-html" = [ "firefox-devedition.desktop" ]; + "application/x-extension-shtml" = [ "firefox-devedition.desktop" ]; + "application/xhtml+xml" = [ "firefox-devedition.desktop" ]; + "application/x-extension-xhtml" = [ "firefox-devedition.desktop" ]; + "application/x-extension-xht" = [ "firefox-devedition.desktop" ]; }; }; - systemDirs.data = [ - "${config.home.homeDirectory}/.nix-profile/share" - "/usr/share" - "/usr/local/share" - ]; configFile = { + "hypr/hyprland.conf".enable = false; "fontconfig/fonts.conf".text = '' @@ -342,6 +337,10 @@ in qt = { enable = true; + style = { + name = "gtk2"; + package = pkgs.libsForQt5.breeze-qt5; + }; platformTheme.name = "gtk"; }; @@ -365,7 +364,7 @@ in }; iconTheme = { name = "Kanagawa"; - package = pkgs.kanagawa-gtk-icon-theme; + package = pkgs.kanagawa-icon-theme; }; font = { name = "Open Sans"; @@ -377,6 +376,7 @@ in }; services = { + # blueman-applet.enable = true; gromit-mpx = { enable = true; tools = [ @@ -463,6 +463,7 @@ in }; systemd.user = { + startServices = "sd-switch"; targets.compositor = { Unit = { Description = "Unit for DE to launch"; diff --git a/users/root/home.nix b/users/root/home.nix new file mode 100644 index 00000000..c915eb0a --- /dev/null +++ b/users/root/home.nix @@ -0,0 +1 @@ +{ ... }: { } diff --git a/users/sam/home.nix b/users/sam/home.nix new file mode 100644 index 00000000..d5e91a56 --- /dev/null +++ b/users/sam/home.nix @@ -0,0 +1,26 @@ +{ pkgs, lib, ... }: +let + nixGLWrap = + pkg: + pkgs.runCommand "${pkg.name}-nixgl-wrapper" { } '' + mkdir $out + ln -s ${pkg}/* $out + rm $out/bin + mkdir $out/bin + for bin in ${pkg}/bin/*; do + wrapped_bin=$out/bin/$(basename $bin) + echo "exec ${lib.getExe pkgs.nixgl.nixGLIntel} $bin \$@" > $wrapped_bin + chmod +x $wrapped_bin + done + ''; +in +{ + imports = [ ../price/home.nix ]; + xdg.systemDirs.data = [ "/usr/share" ]; + home = { + packages = with pkgs; [ + (lib.hiPrio (nixGLWrap neovide)) + (lib.hiPrio (nixGLWrap wezterm)) + ]; + }; +}