From 0be86c7284e78ed00e1cd455ff06ab829f1448c2 Mon Sep 17 00:00:00 2001 From: kiri Date: Fri, 28 Nov 2025 01:41:57 +0100 Subject: [PATCH] Initial commit --- .gitignore | 2 + flake.lock | 1450 ++++++++++++++++++ flake.nix | 116 ++ home/programs/alacritty/default.nix | 12 + home/programs/bitwarden/default.nix | 11 + home/programs/direnv/default.nix | 7 + home/programs/discord/default.nix | 7 + home/programs/fetch/default.nix | 2 + home/programs/fetch/neofetch/default.nix | 148 ++ home/programs/fetch/nerdfetch/default.nix | 367 +++++ home/programs/ghostty/default.nix | 23 + home/programs/git/default.nix | 55 + home/programs/git/signing.nix | 12 + home/programs/gpg/default.nix | 20 + home/programs/kitty/default.nix | 89 ++ home/programs/lazygit/default.nix | 35 + home/programs/nixCats/.stylua.toml | 2 + home/programs/nixCats/default.nix | 155 ++ home/programs/nixCats/init.lua | 5 + home/programs/nixCats/lua/options.lua | 133 ++ home/programs/nixCats/lua/plugins/coding.lua | 263 ++++ home/programs/nixCats/lua/plugins/editor.lua | 170 ++ home/programs/nixCats/lua/plugins/lsp.lua | 166 ++ home/programs/nixCats/lua/plugins/ui.lua | 158 ++ home/programs/nvf/default.nix | 27 + home/programs/nvf/keymaps.nix | 173 +++ home/programs/nvf/languages.nix | 119 ++ home/programs/nvf/mini.nix | 13 + home/programs/nvf/options.nix | 41 + home/programs/nvf/picker.nix | 257 ++++ home/programs/nvf/snacks.nix | 19 + home/programs/nvf/utils.nix | 53 + home/programs/rclone/default.nix | 35 + home/programs/shell/default.nix | 4 + home/programs/shell/eza.nix | 13 + home/programs/shell/fzf.nix | 33 + home/programs/shell/starship.nix | 72 + home/programs/shell/zoxide.nix | 7 + home/programs/shell/zsh.nix | 214 +++ home/programs/spicetify/default.nix | 44 + home/programs/tailscale/default.nix | 7 + home/programs/thunar/default.nix | 137 ++ home/programs/thunderbird/default.nix | 87 ++ home/programs/zen-browser/default.nix | 8 + home/scripts/brightness/default.nix | 36 + home/scripts/caffeine/default.nix | 26 + home/scripts/default.nix | 15 + home/scripts/hyprfocus/default.nix | 52 + home/scripts/hyprpanel/default.nix | 45 + home/scripts/nerdfont-fzf/default.nix | 31 + home/scripts/night-shift/default.nix | 71 + home/scripts/nixy/default.nix | 77 + home/scripts/notification/default.nix | 31 + home/scripts/screenshot/default.nix | 32 + home/scripts/sounds/default.nix | 36 + home/scripts/system/default.nix | 69 + home/system/ashell/default.nix | 30 + home/system/hypridle/default.nix | 32 + home/system/hyprland/animations.nix | 52 + home/system/hyprland/bindings.nix | 75 + home/system/hyprland/default.nix | 184 +++ home/system/hyprland/polkitagent.nix | 6 + home/system/hyprlock/default.nix | 72 + home/system/hyprpanel/default.nix | 249 +++ home/system/hyprpaper/default.nix | 14 + home/system/hyprsunset/default.nix | 22 + home/system/mime/default.nix | 98 ++ home/system/udiskie/default.nix | 8 + home/system/vicinae/default.nix | 13 + home/system/wofi/default.nix | 102 ++ home/system/zathura/default.nix | 14 + hosts/altair/configuration.nix | 26 + hosts/altair/hardware-configuration.nix | 38 + hosts/altair/home.nix | 110 ++ hosts/altair/variables.nix | 57 + hosts/orion/configuration.nix | 29 + hosts/orion/disk-config.nix | 55 + hosts/orion/hardware-configuration.nix | 24 + hosts/orion/home.nix | 40 + hosts/orion/variables.nix | 42 + hosts/polaris/configuration.nix | 28 + hosts/polaris/hardware-configuration.nix | 39 + hosts/polaris/home.nix | 112 ++ hosts/polaris/secrets/default.nix | 42 + hosts/polaris/secrets/secrets.yaml | 22 + hosts/polaris/variables.nix | 59 + nixos/audio.nix | 21 + nixos/bluetooth.nix | 9 + nixos/docker.nix | 6 + nixos/fonts.nix | 27 + nixos/home-manager.nix | 9 + nixos/hyprland.nix | 15 + nixos/nix.nix | 58 + nixos/omen.nix | 63 + nixos/sddm.nix | 47 + nixos/systemd-boot.nix | 34 + nixos/users.nix | 19 + nixos/utils.nix | 134 ++ server-modules/adguardhome.nix | 20 + server-modules/arr.nix | 65 + server-modules/bitwarden.nix | 23 + server-modules/caddy.nix | 22 + server-modules/copyparty.nix | 14 + server-modules/eleakxir.nix | 35 + server-modules/firewall.nix | 9 + server-modules/glance-nixy.nix | 353 +++++ server-modules/glance.nix | 300 ++++ server-modules/home-assistant.nix | 48 + server-modules/mealie.nix | 19 + server-modules/nginx.nix | 45 + server-modules/ssh.nix | 23 + themes/catppuccin.nix | 91 ++ todo.md | 3 + 113 files changed, 8498 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/programs/alacritty/default.nix create mode 100644 home/programs/bitwarden/default.nix create mode 100644 home/programs/direnv/default.nix create mode 100644 home/programs/discord/default.nix create mode 100644 home/programs/fetch/default.nix create mode 100644 home/programs/fetch/neofetch/default.nix create mode 100644 home/programs/fetch/nerdfetch/default.nix create mode 100644 home/programs/ghostty/default.nix create mode 100644 home/programs/git/default.nix create mode 100644 home/programs/git/signing.nix create mode 100644 home/programs/gpg/default.nix create mode 100644 home/programs/kitty/default.nix create mode 100644 home/programs/lazygit/default.nix create mode 100644 home/programs/nixCats/.stylua.toml create mode 100644 home/programs/nixCats/default.nix create mode 100644 home/programs/nixCats/init.lua create mode 100644 home/programs/nixCats/lua/options.lua create mode 100644 home/programs/nixCats/lua/plugins/coding.lua create mode 100644 home/programs/nixCats/lua/plugins/editor.lua create mode 100644 home/programs/nixCats/lua/plugins/lsp.lua create mode 100644 home/programs/nixCats/lua/plugins/ui.lua create mode 100644 home/programs/nvf/default.nix create mode 100644 home/programs/nvf/keymaps.nix create mode 100644 home/programs/nvf/languages.nix create mode 100644 home/programs/nvf/mini.nix create mode 100644 home/programs/nvf/options.nix create mode 100644 home/programs/nvf/picker.nix create mode 100644 home/programs/nvf/snacks.nix create mode 100644 home/programs/nvf/utils.nix create mode 100644 home/programs/rclone/default.nix create mode 100644 home/programs/shell/default.nix create mode 100644 home/programs/shell/eza.nix create mode 100644 home/programs/shell/fzf.nix create mode 100644 home/programs/shell/starship.nix create mode 100644 home/programs/shell/zoxide.nix create mode 100644 home/programs/shell/zsh.nix create mode 100644 home/programs/spicetify/default.nix create mode 100644 home/programs/tailscale/default.nix create mode 100644 home/programs/thunar/default.nix create mode 100644 home/programs/thunderbird/default.nix create mode 100644 home/programs/zen-browser/default.nix create mode 100644 home/scripts/brightness/default.nix create mode 100644 home/scripts/caffeine/default.nix create mode 100644 home/scripts/default.nix create mode 100644 home/scripts/hyprfocus/default.nix create mode 100644 home/scripts/hyprpanel/default.nix create mode 100644 home/scripts/nerdfont-fzf/default.nix create mode 100644 home/scripts/night-shift/default.nix create mode 100644 home/scripts/nixy/default.nix create mode 100644 home/scripts/notification/default.nix create mode 100644 home/scripts/screenshot/default.nix create mode 100644 home/scripts/sounds/default.nix create mode 100644 home/scripts/system/default.nix create mode 100644 home/system/ashell/default.nix create mode 100644 home/system/hypridle/default.nix create mode 100644 home/system/hyprland/animations.nix create mode 100644 home/system/hyprland/bindings.nix create mode 100644 home/system/hyprland/default.nix create mode 100644 home/system/hyprland/polkitagent.nix create mode 100644 home/system/hyprlock/default.nix create mode 100644 home/system/hyprpanel/default.nix create mode 100644 home/system/hyprpaper/default.nix create mode 100644 home/system/hyprsunset/default.nix create mode 100644 home/system/mime/default.nix create mode 100644 home/system/udiskie/default.nix create mode 100644 home/system/vicinae/default.nix create mode 100644 home/system/wofi/default.nix create mode 100644 home/system/zathura/default.nix create mode 100644 hosts/altair/configuration.nix create mode 100644 hosts/altair/hardware-configuration.nix create mode 100644 hosts/altair/home.nix create mode 100644 hosts/altair/variables.nix create mode 100644 hosts/orion/configuration.nix create mode 100644 hosts/orion/disk-config.nix create mode 100644 hosts/orion/hardware-configuration.nix create mode 100644 hosts/orion/home.nix create mode 100644 hosts/orion/variables.nix create mode 100644 hosts/polaris/configuration.nix create mode 100644 hosts/polaris/hardware-configuration.nix create mode 100644 hosts/polaris/home.nix create mode 100644 hosts/polaris/secrets/default.nix create mode 100644 hosts/polaris/secrets/secrets.yaml create mode 100644 hosts/polaris/variables.nix create mode 100644 nixos/audio.nix create mode 100644 nixos/bluetooth.nix create mode 100644 nixos/docker.nix create mode 100644 nixos/fonts.nix create mode 100644 nixos/home-manager.nix create mode 100644 nixos/hyprland.nix create mode 100644 nixos/nix.nix create mode 100644 nixos/omen.nix create mode 100644 nixos/sddm.nix create mode 100644 nixos/systemd-boot.nix create mode 100644 nixos/users.nix create mode 100644 nixos/utils.nix create mode 100644 server-modules/adguardhome.nix create mode 100644 server-modules/arr.nix create mode 100644 server-modules/bitwarden.nix create mode 100644 server-modules/caddy.nix create mode 100644 server-modules/copyparty.nix create mode 100644 server-modules/eleakxir.nix create mode 100644 server-modules/firewall.nix create mode 100644 server-modules/glance-nixy.nix create mode 100644 server-modules/glance.nix create mode 100644 server-modules/home-assistant.nix create mode 100644 server-modules/mealie.nix create mode 100644 server-modules/nginx.nix create mode 100644 server-modules/ssh.nix create mode 100644 themes/catppuccin.nix create mode 100644 todo.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1749a01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.sops.yaml +old/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..dcfd5ac --- /dev/null +++ b/flake.lock @@ -0,0 +1,1450 @@ +{ + "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1763922789, + "narHash": "sha256-XnkWjCpeXfip9tqYdL0b0zzBDjq+dgdISvEdSVGdVyA=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "a20a0e67a33b6848378a91b871b89588d3a12573", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1754405784, + "narHash": "sha256-l9xHIy+85FN+bEo6yquq2IjD1rSg9fjfjpyGP1W8YXo=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1752979451, + "narHash": "sha256-0CQM+FkYy0fOO/sMGhOoNL80ftsAzYCg9VhIrodqusM=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "27cf1e66e50abc622fb76a3019012dc07c678fac", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "community-website": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764288398, + "narHash": "sha256-vWQbhksYr5qPOo3Zjughl2yYYmrciO4VSVXrkK2W8yY=", + "ref": "refs/heads/main", + "rev": "ff7f23ab0351dcf8b062d6a5a99c2c6cafcf24a0", + "revCount": 2, + "type": "git", + "url": "file:///home/kiri/dev/lab/community-website" + }, + "original": { + "type": "git", + "url": "file:///home/kiri/dev/lab/community-website" + } + }, + "copyparty": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764155739, + "narHash": "sha256-WVhJZiZ8VsTMAYYPYO0MpvMt2h2wgge15MLDZUrRMWE=", + "owner": "9001", + "repo": "copyparty", + "rev": "c7345308f5ef0e4375c9d6a305d4b8e14c9d7a5a", + "type": "github" + }, + "original": { + "owner": "9001", + "repo": "copyparty", + "type": "github" + } + }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764110879, + "narHash": "sha256-xanUzIb0tf3kJ+PoOFmXEXV1jM3PjkDT/TQ5DYeNYRc=", + "owner": "nix-community", + "repo": "disko", + "rev": "aecba248f9a7d68c5d1ed15de2d1c8a4c994a3c5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "eleakxir": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1762173278, + "narHash": "sha256-rw+n05+dgC1rLpQR5RKRTM57RPTuhjyVVsV4bvsbZc4=", + "owner": "anotherhadi", + "repo": "eleakxir", + "rev": "7a29929eb3bd0f89f2fd654405f9680bfd084151", + "type": "github" + }, + "original": { + "owner": "anotherhadi", + "repo": "eleakxir", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1758112371, + "narHash": "sha256-lizRM2pj6PHrR25yimjyFn04OS4wcdbc38DCdBVa2rk=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "0909cfe4a2af8d358ad13b20246a350e14c2473d", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1761588595, + "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1751685974, + "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", + "ref": "refs/heads/main", + "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", + "revCount": 92, + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nvf", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760948891, + "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_9" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "host": "gitlab.gnome.org", + "lastModified": 1762869044, + "narHash": "sha256-nwm/GJ2Syigf7VccLAZ66mFC8mZJFqpJmIxSGKl7+Ds=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "680e3d195a92203f28d4bf8c6e8bb537cc3ed4ad", + "type": "gitlab" + }, + "original": { + "host": "gitlab.gnome.org", + "owner": "GNOME", + "ref": "gnome-49", + "repo": "gnome-shell", + "type": "gitlab" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764194569, + "narHash": "sha256-iUM9ktarEzThkayyZrzQ7oycPshAY2XRQqVKz0xX/L0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "9651819d75f6c7ffaf8a9227490ac704f29659f0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "hyprpanel", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750798083, + "narHash": "sha256-DTCCcp6WCFaYXWKFRA6fiI2zlvOLCf5Vwx8+/0R8Wc4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ff31a4677c1a8ae506aa7e003a3dba08cb203f82", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753964049, + "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1763733840, + "narHash": "sha256-JnET78yl5RvpGuDQy3rCycOCkiKoLr5DN1fPhRNNMco=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "8f1bec691b2d198c60cccabca7a94add2df4ed1a", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-guiutils": "hyprland-guiutils", + "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems_3", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1764258724, + "narHash": "sha256-frlRI04fRjujZgx1UjZbIeleQdc7hSqqgn5q+0/2O3M=", + "ref": "refs/heads/main", + "rev": "a51918fd275badfa2b68d7c25fc7f4555a4a468e", + "revCount": 6657, + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + } + }, + "hyprland-guiutils": { + "inputs": { + "aquamarine": [ + "hyprland", + "aquamarine" + ], + "hyprgraphics": [ + "hyprland", + "hyprgraphics" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprtoolkit": "hyprtoolkit", + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1763727565, + "narHash": "sha256-vRff/2R1U1jzPBy4OODqh2kfUzmizW/nfV2ROzTDIKo=", + "owner": "hyprwm", + "repo": "hyprland-guiutils", + "rev": "7724d3a12a0453e7aae05f2ef39474219f05a4b4", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-guiutils", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1759610243, + "narHash": "sha256-+KEVnKBe8wz+a6dTLq8YDcF3UrhQElwsYJaVaHXJtoI=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "bd153e76f751f150a09328dbdeb5e4fab9d23622", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1763819661, + "narHash": "sha256-0jLarTR/BLWdGlboM86bPVP2zKJNI2jvo3JietnDkOM=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "a318deec0c12409ec39c68d2be8096b636dc2a5c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprpanel": { + "inputs": { + "flake-utils": "flake-utils_3", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1762493267, + "narHash": "sha256-W/eYgKKVqCh7SJLHk6Asc4LvU3YXvGtlL29yBMGymz4=", + "owner": "Jas-SinghFSU", + "repo": "HyprPanel", + "rev": "f9a04192e8fb90a48e1756989f582dc0baec2351", + "type": "github" + }, + "original": { + "owner": "Jas-SinghFSU", + "repo": "HyprPanel", + "type": "github" + } + }, + "hyprtoolkit": { + "inputs": { + "aquamarine": [ + "hyprland", + "hyprland-guiutils", + "aquamarine" + ], + "hyprgraphics": [ + "hyprland", + "hyprland-guiutils", + "hyprgraphics" + ], + "hyprlang": [ + "hyprland", + "hyprland-guiutils", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprland-guiutils", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprland-guiutils", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "hyprland-guiutils", + "nixpkgs" + ], + "systems": [ + "hyprland", + "hyprland-guiutils", + "systems" + ] + }, + "locked": { + "lastModified": 1763503177, + "narHash": "sha256-VPoiswJBBmTLVuNncvT/8FpFR+sYcAi/LgP/zTZ+5rA=", + "owner": "hyprwm", + "repo": "hyprtoolkit", + "rev": "f4e1e12755567ecf39090203b8f43eace8279630", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprtoolkit", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1763996058, + "narHash": "sha256-DsqzFZvrEV+aDmavjaD4/bk5qxeZwhGxPWBQdpFyM9Y=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "0168583075baffa083032ed13a8bea8ea12f281a", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1763640274, + "narHash": "sha256-Uan1Nl9i4TF/kyFoHnTq1bd/rsWh4GAK/9/jDqLbY5A=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "f6cf414ca0e16a4d30198fd670ec86df3c89f671", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "mnw": { + "locked": { + "lastModified": 1758834834, + "narHash": "sha256-Y7IvY4F8vajZyp3WGf+KaiIVwondEkMFkt92Cr9NZmg=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "cfbc7d1cc832e318d0863a5fc91d940a96034001", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, + "nixCats": { + "locked": { + "lastModified": 1764009888, + "narHash": "sha256-hJekfTiW1792txgRSM4LcHnz1lDSY87LYbsJEn2V378=", + "owner": "BirdeeHub", + "repo": "nixCats-nvim", + "rev": "16ac3281f322ea15d39843829e42a44d22da3715", + "type": "github" + }, + "original": { + "owner": "BirdeeHub", + "repo": "nixCats-nvim", + "type": "github" + } + }, + "nixarr": { + "inputs": { + "nixpkgs": "nixpkgs_4", + "vpnconfinement": "vpnconfinement", + "website-builder": "website-builder" + }, + "locked": { + "lastModified": 1764066022, + "narHash": "sha256-YY9UdoNN/Iu9HTYsUWuZQiuRyQYOtcvnsT5X/+LuV1M=", + "owner": "rasmus-kirk", + "repo": "nixarr", + "rev": "3ea7ad8a1ca9d67df206cda19775ce711a55add4", + "type": "github" + }, + "original": { + "owner": "rasmus-kirk", + "repo": "nixarr", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1764080039, + "narHash": "sha256-b1MtLQsQc4Ji1u08f+C6g5XrmLPkJQ1fhNkCt+0AERQ=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "da17006633ca9cda369be82893ae36824a2ddf1a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1757487488, + "narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1763966396, + "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1750776420, + "narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1761016216, + "narHash": "sha256-G/iC4t/9j/52i/nm+0/4ybBmAF4hzR8CNHC75qEhjHo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "481cf557888e05d3128a76f14c76397b7d7cc869", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1763966396, + "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1761880412, + "narHash": "sha256-QoJjGd4NstnyOG4mm4KXF+weBzA2AH/7gn1Pmpfcb0A=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a7fc11be66bdfb5cdde611ee5ce381c183da8386", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1762977756, + "narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1762111121, + "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758998580, + "narHash": "sha256-VLx0z396gDCGSiowLMFz5XRO/XuNV+4EnDYjdJhHvUk=", + "owner": "nix-community", + "repo": "NUR", + "rev": "ba8d9c98f5f4630bcb0e815ab456afd90c930728", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nvf": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts", + "mnw": "mnw", + "nixpkgs": "nixpkgs_6", + "systems": "systems_5" + }, + "locked": { + "lastModified": 1762622004, + "narHash": "sha256-NpzzgaoMK8aRHnndHWbYNKLcZN0r1y6icCoJvGoBsoE=", + "owner": "notashelf", + "repo": "nvf", + "rev": "09470524a214ed26633ddc2b6ec0c9bf31a8b909", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "nvf", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763988335, + "narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "community-website": "community-website", + "copyparty": "copyparty", + "disko": "disko", + "eleakxir": "eleakxir", + "home-manager": "home-manager", + "hyprland": "hyprland", + "hyprpanel": "hyprpanel", + "nixCats": "nixCats", + "nixarr": "nixarr", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs_5", + "nvf": "nvf", + "spicetify-nix": "spicetify-nix", + "stylix": "stylix", + "vicinae": "vicinae", + "zen-browser": "zen-browser", + "zentire-website": "zentire-website" + } + }, + "spicetify-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_6" + }, + "locked": { + "lastModified": 1763985453, + "narHash": "sha256-vUqODgLIjeyHN7DP8dVx7oH9yB/L8qcxpN//4EmMQcM=", + "owner": "Gerg-L", + "repo": "spicetify-nix", + "rev": "89cd40c646ec5b12e5c20c0e18f082e7629d4819", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "spicetify-nix", + "type": "github" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": "flake-parts_2", + "gnome-shell": "gnome-shell", + "nixpkgs": "nixpkgs_7", + "nur": "nur", + "systems": "systems_7", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1764254063, + "narHash": "sha256-V22JzkaTLF/GAL2LgqvOsJhAr8JbJsKaD8hnHjGwXfE=", + "owner": "danth", + "repo": "stylix", + "rev": "a1451bc40413870f0c7b576b751c1ca92055e323", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1757716333, + "narHash": "sha256-d4km8W7w2zCUEmPAPUoLk1NlYrGODuVa3P7St+UrqkM=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "317a5e10c35825a6c905d912e480dfe8e71c7559", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1757811970, + "narHash": "sha256-n5ZJgmzGZXOD9pZdAl1OnBu3PIqD+X3vEBUGbTi4JiI=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "d217ba31c846006e9e0ae70775b0ee0f00aa6b1e", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1757811247, + "narHash": "sha256-4EFOUyLj85NRL3OacHoLGEo0wjiRJzfsXtR4CZWAn6w=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "824fe0aacf82b3c26690d14e8d2cedd56e18404e", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "vicinae": { + "inputs": { + "nixpkgs": "nixpkgs_8", + "systems": "systems_8" + }, + "locked": { + "lastModified": 1763934927, + "narHash": "sha256-orsv0YJ6e6Sm6/ft56spin/npDf2xXKls1B7HauJ4dk=", + "owner": "vicinaehq", + "repo": "vicinae", + "rev": "63304cee4a967f30eeca7d875f6c9a8ff4454050", + "type": "github" + }, + "original": { + "owner": "vicinaehq", + "repo": "vicinae", + "type": "github" + } + }, + "vpnconfinement": { + "locked": { + "lastModified": 1759956062, + "narHash": "sha256-NUZu0Rb0fwUjfdp51zMm0xM3lcK8Kw4c97LLog7+JjA=", + "owner": "Maroka-chan", + "repo": "VPN-Confinement", + "rev": "fabe7247b720b5eb4c3c053e24a2b3b70e64c52b", + "type": "github" + }, + "original": { + "owner": "Maroka-chan", + "repo": "VPN-Confinement", + "type": "github" + } + }, + "website-builder": { + "inputs": { + "nixpkgs": [ + "nixarr", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1753958235, + "narHash": "sha256-Rd27XQJKv8Z4BCr3gdbaHFd0TmumiGxdjGRzsEf/mOg=", + "owner": "rasmus-kirk", + "repo": "website-builder", + "rev": "00a14b7ae7baef2197978ba7c3fe72dfca7bc475", + "type": "github" + }, + "original": { + "owner": "rasmus-kirk", + "repo": "website-builder", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1761431178, + "narHash": "sha256-xzjC1CV3+wpUQKNF+GnadnkeGUCJX+vgaWIZsnz9tzI=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "4b8801228ff958d028f588f0c2b911dbf32297f9", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "zen-browser": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764217570, + "narHash": "sha256-vgqUC6lI/gW70uekA0bpNFU6yR0tcZRfLIZcxGfN76g=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "3dc281d86044322f9182b20abbc21db8824c130a", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "type": "github" + } + }, + "zentire-website": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764288611, + "narHash": "sha256-jvUxp+9iZf+s/7T6Z2wHuKww34aIbcKNfW62QF6vHGc=", + "ref": "refs/heads/main", + "rev": "2d31ac12b63bd8ed4ebb83e2a6d9781978768d33", + "revCount": 4, + "type": "git", + "url": "file:///home/kiri/dev/lab/zentire-new" + }, + "original": { + "type": "git", + "url": "file:///home/kiri/dev/lab/zentire-new" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d0d6b4e --- /dev/null +++ b/flake.nix @@ -0,0 +1,116 @@ +{ + # https://github.com/anotherhadi/nixy + description = '' + Nixy simplifies and unifies the Hyprland ecosystem with a modular, easily customizable setup. + It provides a structured way to manage your system configuration and dotfiles with minimal effort. + ''; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + hyprpanel.url = "github:Jas-SinghFSU/HyprPanel"; + stylix.url = "github:danth/stylix"; + #apple-fonts.url = "github:Lyndeno/apple-fonts.nix"; + # sops-nix.url = "github:Mic92/sops-nix"; + nixarr.url = "github:rasmus-kirk/nixarr"; + vicinae.url = "github:vicinaehq/vicinae"; + nvf.url = "github:notashelf/nvf"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + eleakxir.url = "github:anotherhadi/eleakxir"; + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + copyparty = { + url = "github:9001/copyparty"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixCats.url = "github:BirdeeHub/nixCats-nvim"; + + # Websites + community-website = { + url = "git+file:///home/kiri/dev/lab/community-website"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + zentire-website = { + url = "git+file:///home/kiri/dev/lab/zentire-new"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + inputs@{ nixpkgs, ... }: + { + nixosConfigurations = { + polaris = nixpkgs.lib.nixosSystem { + modules = [ + { + nixpkgs.overlays = [ ]; + _module.args = { + inherit inputs; + }; + } + inputs.home-manager.nixosModules.home-manager + inputs.stylix.nixosModules.stylix + + inputs.nixos-hardware.nixosModules.common-pc + inputs.nixos-hardware.nixosModules.common-pc-ssd + inputs.nixos-hardware.nixosModules.common-cpu-amd + inputs.nixos-hardware.nixosModules.common-gpu-amd + + ./hosts/polaris/configuration.nix + ]; + }; + + altair = nixpkgs.lib.nixosSystem { + modules = [ + { + nixpkgs.overlays = [ ]; + _module.args = { inherit inputs; }; + } + inputs.home-manager.nixosModules.home-manager + inputs.stylix.nixosModules.stylix + + inputs.nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7-amdgpu + + ./hosts/altair/configuration.nix + ]; + }; + + orion = nixpkgs.lib.nixosSystem { + #system = "x86_64-linux"; + modules = [ + { + _module.args = { + inherit inputs; + }; + } + + inputs.stylix.nixosModules.stylix + inputs.home-manager.nixosModules.home-manager + inputs.copyparty.nixosModules.default + + inputs.disko.nixosModules.disko + ./hosts/orion/configuration.nix + ]; + }; + }; + }; +} diff --git a/home/programs/alacritty/default.nix b/home/programs/alacritty/default.nix new file mode 100644 index 0000000..4f02ad8 --- /dev/null +++ b/home/programs/alacritty/default.nix @@ -0,0 +1,12 @@ +# Alacritty is a fast, cross-platform, OpenGL terminal emulator. +{ + programs.alacritty = { + enable = true; + settings = { + window.padding = { + x = 10; + y = 10; + }; + }; + }; +} diff --git a/home/programs/bitwarden/default.nix b/home/programs/bitwarden/default.nix new file mode 100644 index 0000000..284c19c --- /dev/null +++ b/home/programs/bitwarden/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + programs.rbw = { + enable = true; + settings = { + base_url = "https://vault.jelles.net"; + email = "mail@jelles.net"; + pinentry = pkgs.pinentry-gnome3; + }; + }; +} diff --git a/home/programs/direnv/default.nix b/home/programs/direnv/default.nix new file mode 100644 index 0000000..fb7dffc --- /dev/null +++ b/home/programs/direnv/default.nix @@ -0,0 +1,7 @@ +{ + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; +} diff --git a/home/programs/discord/default.nix b/home/programs/discord/default.nix new file mode 100644 index 0000000..db5285a --- /dev/null +++ b/home/programs/discord/default.nix @@ -0,0 +1,7 @@ +# Discord is a popular chat application. +{ inputs, ... }: +{ + programs.discord = { + enable = true; + }; +} diff --git a/home/programs/fetch/default.nix b/home/programs/fetch/default.nix new file mode 100644 index 0000000..e7550e3 --- /dev/null +++ b/home/programs/fetch/default.nix @@ -0,0 +1,2 @@ +# Import all fetch scripts +{imports = [./neofetch ./nerdfetch];} diff --git a/home/programs/fetch/neofetch/default.nix b/home/programs/fetch/neofetch/default.nix new file mode 100644 index 0000000..c34f84c --- /dev/null +++ b/home/programs/fetch/neofetch/default.nix @@ -0,0 +1,148 @@ +# Legacy +{pkgs, ...}: { + home.packages = with pkgs; [neofetch]; + + xdg.configFile."neofetch/ascii.txt".text = '' + ''${c6} + ⡏⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠉⠉⠉⢹ + ⡇⢸⣿⡟⠛⢿⣷⠀⢸⣿⡟⠛⢿⣷⡄⢸⣿⡇⠀⢸⣿⡇⢸⣿⡇⠀⢸⣿⡇⢸ + ⡇⢸⣿⣧⣤⣾⠿⠀⢸⣿⣇⣀⣸⡿⠃⢸⣿⡇⠀⢸⣿⡇⢸⣿⣇⣀⣸⣿⡇⢸ + ⡇⢸⣿⡏⠉⢹⣿⡆⢸⣿⡟⠛⢻⣷⡄⢸⣿⡇⠀⢸⣿⡇⢸⣿⡏⠉⢹⣿⡇⢸ + ⡇⢸⣿⣧⣤⣼⡿⠃⢸⣿⡇⠀⢸⣿⡇⠸⣿⣧⣤⣼⡿⠁⢸⣿⡇⠀⢸⣿⡇⢸ + ⣇⣀⣀⣀⣀⣀⣀⣄⣀⣀⣀⣀⣀⣀⣀⣠⣀⡈⠉⣁⣀⣄⣀⣀⣀⣠⣀⣀⣀⣸ + ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ + ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ + ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ + ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ + ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ + ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ + ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ + ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ + ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ + ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ + ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ + ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ + ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ + ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ + ''; + + xdg.configFile."neofetch/config.conf".text = '' + # From: https://github.com/Chick2D/neofetch-themes/ + # Made by https://github.com/Dan1jel + + print_info() { + prin "\n" + info "\n \n OS" distro + info "\n \n Host" model + info "\n \n Kernel" kernel + info "\n \n Uptime" uptime + info "\n \n Packages" packages + info "\n \n Shell" shell + info "\n \n Resolution" resolution + info "\n \n DE" de + info "\n \n WM" wm + info "\n \n WM Theme" wm_theme + info "\n \n Theme" theme + info "\n \n Icons" icons + info "\n \n Terminal" term + info "\n \n Terminal Font" term_font + info "\n \n CPU" cpu + info "\n \n GPU" gpu + info "\n \n Memory" memory + info "\n \n Disk" disk + info "\n \n Battery" battery + info "\n \n Font" font + info "\n \n Song" song + [[ "$player" ]] && prin "\n \n Music Player" "$player" + info "\n \n Local IP" local_ip + prin "\n" + + # prin "\n \n ''${cl0}──''${cl1}────''${cl2}────''${cl3}────''${cl4}────''${cl5}────''${cl6}────''${cl7}──" + prin "\n \n \n \n \n \n ''${cl0}⬤ \n \n ''${cl1}⬤ \n \n ''${cl2}⬤ \n \n ''${cl3}⬤ \n \n ''${cl4}⬤ \n \n ''${cl5}⬤ \n \n ''${cl6}⬤ \n \n ''${cl7}⬤" + } + + reset="\033[0m" + gray="\033[1;90m" + red="\033[1;31m" + green="\033[1;32m" + yellow="\033[1;33m" + blue="\033[1;34m" + magenta="\033[1;35m" + cyan="\033[1;36m" + white="\033[1;37m" + + cl0="''${gray}" + cl1="''${red}" + cl2="''${green}" + cl3="''${yellow}" + cl4="''${blue}" + cl5="''${magenta}" + cl6="''${cyan}" + cl7="''${white}" + + title_fqdn="off" + kernel_shorthand="on" + distro_shorthand="off" + os_arch="off" + uptime_shorthand="on" + memory_percent="off" + memory_unit="mib" + package_managers="on" + shell_path="off" + shell_version="on" + speed_type="bios_limit" + speed_shorthand="off" + cpu_brand="on" + cpu_speed="on" + cpu_cores="logical" + cpu_temp="off" + gpu_brand="on" + gpu_type="all" + refresh_rate="off" + gtk_shorthand="off" + gtk2="on" + gtk3="on" + de_version="on" + disk_show=('/storage/emulated' '/' '/server') + disk_subtitle="none" + disk_percent="on" + music_player="auto" + song_format="%artist% - %album% - %title%" + song_shorthand="off" + mpc_args=() + bold="on" + underline_enabled="on" + underline_char="-" + separator=":" + block_range=(0 15) + color_blocks="on" + block_width=3 + block_height=1 + col_offset="auto" + bar_char_elapsed="-" + bar_char_total="=" + bar_border="on" + bar_length=15 + bar_color_elapsed="distro" + bar_color_total="distro" + cpu_display="off" + memory_display="off" + battery_display="off" + disk_display="off" + image_backend="ascii" + image_source="$HOME/.config/neofetch/ascii.txt" + ascii_distro="auto" + ascii_colors=(distro) + ascii_bold="on" + image_loop="off" + thumbnail_dir="''${XDG_CACHE_HOME:-''${HOME}/.cache}/thumbnails/neofetch" + crop_mode="normal" + crop_offset="center" + image_size="auto" + gap=2 + yoffset=0 + xoffset=0 + background_color= + stdout="off" + ''; +} diff --git a/home/programs/fetch/nerdfetch/default.nix b/home/programs/fetch/nerdfetch/default.nix new file mode 100644 index 0000000..ef92e43 --- /dev/null +++ b/home/programs/fetch/nerdfetch/default.nix @@ -0,0 +1,367 @@ +# Nerdfetch, a simple system info script written in bash +# Source: https://github.com/ThatOneCalculator/NerdFetch +{pkgs, ...}: let + nerdfetch = pkgs.writeShellScriptBin "nerdfetch" '' + ostype="$(uname)" + + version=8.1.1 + font=nerd + distrotype=none + osi="" + ki="" + ri="󰍛" + pi="󰏔" + ui="󰅶" + ci="" + + case $1 in + "-p") + font=phosphor + osi="" + ki="" + ri="" + pi="" + ui="" + ci="" + ;; + "-c") + font=cozette + ki="♥" + ri="" + pi="" + ui="" + ci="" + ;; + "-e") + font=emoji + osi="🐧" + ki="💓" + ri="🐐" + pi="📦" + ui="☕" + ci="🎨" + ;; + "-v") + echo "NerdFetch $version" + exit + ;; + "-h") + echo "Flags: + -c: Cozette font + -p: Phosphor font + -e: Emoji font + -v: Version" + exit + ;; + esac + + if command -v getprop 1>/dev/null; then + distrotype=android + fi + kernel="$(echo $(uname -r) | cut -d'-' -f1-1)" + case $ostype in + *"Linux"*) + if [ $distrotype = android ]; then + host="$(hostname)" + USER="$(whoami)" + os="Android $(getprop ro.build.version.release)" + case $font in + phosphor) osi="" ;; + emoji) osi="🤖" ;; + *) osi="󰀲" ;; + esac + else + host="$(cat /proc/sys/kernel/hostname)" + . /etc/os-release + if [ -f /bedrock/etc/bedrock-release ]; then + os="$(brl version)" + else + os="''${PRETTY_NAME}" + if [ $font = nerd ]; then + case $(echo $ID | sed 's/ .*//') in + debian) osi="" ;; + arch) osi="󰣇" ;; + endeavouros) osi="" ;; + fedora) osi="" ;; + gentoo) osi="" ;; + rhel) osi="" ;; + slackware) osi="" ;; + void) osi="" ;; + alpine) osi="" ;; + nixos) osi="󱄅" ;; + artix) osi="" ;; + exherbo) osi="󰆚" ;; + mageia) osi="" ;; + manjaro) osi="" ;; + opensuse) osi="" ;; + solus) osi="" ;; + ubuntu) osi="" ;; + mint) osi="󰣭" ;; + trisquel) osi="" ;; + puppy) osi="" ;; + coreos) osi="" ;; + mx) osi="" ;; + vanilla) osi="" ;; + pop_os) osi="" ;; + raspbian) osi="" ;; + deepin) osi="" ;; + almalinux) osi="" ;; + garuda) osi="" ;; + centos) osi="" ;; + rocky) osi="" ;; + esac + elif [ $font = cozette ]; then + case $(echo $ID | sed 's/ .*//') in + debian) osi="" ;; + arch) osi="" ;; + fedora) osi="" ;; + gentoo) osi="" ;; + slackware) osi="" ;; + void) osi="" ;; + alpine) osi="" ;; + nixos) osi="" ;; + mageia) osi="" ;; + manjaro) osi="" ;; + opensuse) osi="" ;; + ubuntu) osi="" ;; + mint) osi="" ;; + coreos) osi="" ;; + centos) osi="" ;; + esac + fi + fi + fi + shell=$(basename "$SHELL") + ;; + *"Darwin"*) + host="$(hostname -f | sed -e 's/^[^.]*\.//')" + mac_product="$(/usr/libexec/PlistBuddy -c "Print:ProductName" /System/Library/CoreServices/SystemVersion.plist)" + mac_version="$(/usr/libexec/PlistBuddy -c "Print:ProductVersion" /System/Library/CoreServices/SystemVersion.plist)" + os="''${mac_product} ''${mac_version}" + case $font in + nerd) osi="" ;; + phosphor) osi="" ;; + cozette) osi="" ;; + emoji) osi="🍎" ;; + esac + ;; + *"FreeBSD"*) + host="$(hostname)" + distrotype=bsd + os="FreeBSD $(freebsd-version | sed 's/-.*//')" + case $font in + nerd) osi="" ;; + phosphor) osi="" ;; + cozette) osi="" ;; + emoji) osi="😈" ;; + esac + ;; + *"OpenBSD"*) + host="$(hostname)" + distrotype=bsd + os="OpenBSD $(uname -r)" + case $font in + nerd) osi="" ;; + phosphor) osi="" ;; + cozette) osi="⌘" ;; + emoji) osi="🐡" ;; + esac + ;; + *"NetBSD"*) + host="$(hostname)" + distrotype=netbsd + os="NetBSD $(uname -r)" + case $font in + nerd) osi="󰉀" ;; + phosphor) osi="" ;; + cozette) osi="" ;; + emoji) osi="🚩" ;; + esac + ;; + *) + os="Unix-like" + host="host" + ;; + esac + + ## PACKAGE MANAGER AND PACKAGES DETECTION + + MANAGER=$(which nix-env pkg flatpak yum zypper dnf rpm dpkg-query brew port pacman xbps-query emerge cave apk kiss pmm /usr/sbin/slackpkg bulge birb yay paru pacstall cpm pmm eopkg getprop 2>/dev/null) + manager=$(basename "$MANAGER") + if [ $distrotype = netbsd ]; then + manager="pkg_info-netbsd" + fi + case $manager in + cpm) packages="$(cpm C)" ;; + flatpak) packages="$(flatpak list --app | wc -l)" ;; + brew) packages="$(printf '%s\n' "$(brew --cellar)/"* | wc -l)" ;; + port) packages="$(port installed | wc -l)" ;; + dpkg-query) packages="$(dpkg-query -f '${"binary:Package"}\n' -W | wc -l)" ;; + rpm) packages="$(rpm -qa --last | wc -l)" ;; + yum) packages="$(yum list installed | wc -l)" ;; + dnf) packages="$(dnf list installed | wc -l)" ;; + zypper) packages="$(zypper se | wc -l)" ;; + pacman) packages="$(pacman -Q | wc -l)" ;; + yay) packages="$(yay -Q | wc -l)" ;; + paru) packages="$(paru -Q | wc -l)" ;; + pacstall) packages="$(pacstall -L | wc -l)" ;; + kiss) packages="$(kiss list | wc -l)" ;; + emerge) packages="$(qlist -I | wc -l)" ;; + pkg) packages="$(pkg info | wc -l | tr -d ' ')" ;; + cave) packages="$(cave show installed-slots | wc -l)" ;; + xbps-query) packages="$(xbps-query -l | wc -l)" ;; + nix-env) packages="$(nix-store -q --requisites /run/current-system/sw | wc -l)" ;; + apk) packages="$(apk list --installed | wc -l)" ;; + pmm) packages="$(/bedrock/libexec/pmm pacman pmm -Q 2>/dev/null | wc -l)" ;; + eopkg) packages="$(eopkg li | wc -l)" ;; + /usr/sbin/slackpkg) packages="$(ls /var/log/packages | wc -l)" ;; + bulge) packages="$(bulge list | wc -l)" ;; + birb) packages="$(birb --list-installed | wc -l)" ;; + pkg_info) + packages="$(pkg_info -A | wc -l)" + manager="pkg" + ;; + pkg_info-netbsd) + packages="$(pkg_info -a | wc -l)" + manager="pkg" + ;; + *) + if [ $distrotype = android ]; then + packages="$(dpkg-query -f '${"binary:Package"}\n' -W | wc -l)" + manager="dpkg" + else + packages="$(ls /usr/bin | wc -l)" + manager="bin" + fi + ;; + esac + + packages="''${packages#"''${packages%%[![:space:]]*}"}" + manager=$(echo $manager | sed "s/-query//; s/\/usr\/.*\///") + + ## UPTIME DETECTION + + if [ $distrotype = android ]; then + uptime="$(echo $(uptime -p) | cut -c 4-)" + elif [ $distrotype = bsd ] || [ $distrotype = netbsd ]; then + uptime="$(uptime | sed -e 's/.* up //; s/, [0-9]* user.*//')" + else + case $ostype in + *"Linux"*) + IFS=. read -r s _ /dev/null 2>&1; then + mempercent="($(expr $(expr ''${mem_used} \* 100 / ''${mem_full}))%)" + fi + + ## DEFINE COLORS + + bold='' + black='' + red='' + green='' + yellow='' + blue='' + magenta='' + cyan='' + white='' + grey='' + reset='' + + ## USER VARIABLES -- YOU CAN CHANGE THESE + + lc="$reset$bold$magenta" # labels + nc="$reset$bold$magenta" # labels + hn="$reset$bold$magenta" # labels + ic="$reset$white" # info + c0="$reset$grey" # first color + c1="$reset$white" # second color + c2="$reset$yellow" # third color + + ## OUTPUT + + echo """ + ''${c0} ___ ''${nc}''${USER}''${grey}@''${reset}''${hn}''${host}''${reset} + ''${c0} (''${c1}.. ''${c0}\ ''${lc}''${osi} ''${ic}''${os}''${reset} + ''${c0} (''${c2}<> ''${c0}| ''${lc}''${ki} ''${ic}''${kernel}''${reset} + ''${c0} /''${c1}/ \\ ''${c0}\\ ''${lc}''${ri} ''${ic}''${RAM}''${memstat} ''${mempercent} + ''${c0} ( ''${c1}| | ''${c0}/| ''${lc}''${pi} ''${ic}''${packages} (''${manager})''${reset} + ''${c2} _''${c0}/\\ ''${c1}__)''${c0}/''${c2}_''${c0}) ''${lc}''${ui} ''${ic}''${uptime}''${reset} + ''${c2} \/''${c0}-____''${c2}\/''${reset} ''${lc}''${ci} ''${red}███''${green}███''${yellow}███''${blue}███''${magenta}███''${cyan}███''${reset} + """ + ''; +in {home.packages = [nerdfetch];} diff --git a/home/programs/ghostty/default.nix b/home/programs/ghostty/default.nix new file mode 100644 index 0000000..9526def --- /dev/null +++ b/home/programs/ghostty/default.nix @@ -0,0 +1,23 @@ +{ + programs.ghostty = { + enable = true; + installVimSyntax = true; + enableZshIntegration = true; + settings = { + font-feature = "-calt, -liga, -dlig"; + window-padding-x = 10; + window-padding-y = 10; + keybind = [ + "ctrl+j=goto_split:left" + "ctrl+i=goto_split:up" + "ctrl+k=goto_split:down" + "ctrl+l=goto_split:right" + "shift+ctrl+j=new_split:left" + "shift+ctrl+i=new_split:up" + "shift+ctrl+k=new_split:down" + "shift+ctrl+l=new_split:right" + "shift+ctrl+tab=new_tab" + ]; + }; + }; +} diff --git a/home/programs/git/default.nix b/home/programs/git/default.nix new file mode 100644 index 0000000..48bbe8c --- /dev/null +++ b/home/programs/git/default.nix @@ -0,0 +1,55 @@ +# Git configuration +{config, ...}: let + username = config.var.git.username; + email = config.var.git.email; +in { + programs.git = { + enable = true; + ignores = [ + ".cache/" + ".DS_Store" + ".idea/" + "*.swp" + "*.elc" + "auto-save-list" + ".direnv/" + "node_modules" + "result" + "result-*" + ]; + settings = { + user.name = username; + user.email = email; + init.defaultBranch = "main"; + pull.rebase = "false"; + push.autoSetupRemote = true; + color.ui = "1"; + alias = { + essa = "push --force"; + co = "checkout"; + fuck = "commit --amend -m"; + c = "commit -m"; + ca = "commit -am"; + forgor = "commit --amend --no-edit"; + graph = "log --all --decorate --graph --oneline"; + oops = "checkout --"; + l = "log"; + r = "rebase"; + s = "status --short"; + ss = "status"; + d = "diff"; + ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)"; + pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)"; + af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)"; + st = "status"; + br = "branch"; + df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}"; + hist = '' + log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all''; + llog = '' + log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative''; + edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`"; + }; + }; + }; +} diff --git a/home/programs/git/signing.nix b/home/programs/git/signing.nix new file mode 100644 index 0000000..95d6e0b --- /dev/null +++ b/home/programs/git/signing.nix @@ -0,0 +1,12 @@ +# This file is used to sign git commits using an SSH key. +{ + # Obviously, change this to your own SSH key. + home.file.".ssh/allowed_signers".text = "* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIINhWby7lUUXQNKbRu9/UOrGjWDf3fvoAwGHomWv/+lL"; + + programs.git.settings = { + commit.gpgsign = true; + gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers"; + gpg.format = "ssh"; + user.signingkey = "~/.ssh/key.pub"; + }; +} diff --git a/home/programs/gpg/default.nix b/home/programs/gpg/default.nix new file mode 100644 index 0000000..4d638d3 --- /dev/null +++ b/home/programs/gpg/default.nix @@ -0,0 +1,20 @@ +{ + config, + pkgs, + ... +}: { + programs.gpg = { + enable = true; + homedir = "${config.xdg.dataHome}/gnupg"; + }; + + services.gpg-agent = { + enable = true; + enableSshSupport = true; + enableZshIntegration = true; + pinentry = { + package = pkgs.pinentry-gnome3; + }; + sshKeys = ["CD848796822630B280FC6DFA55F24A20040F22B5"]; + }; +} diff --git a/home/programs/kitty/default.nix b/home/programs/kitty/default.nix new file mode 100644 index 0000000..ba92587 --- /dev/null +++ b/home/programs/kitty/default.nix @@ -0,0 +1,89 @@ +# Kitty is a fast, featureful, GPU based terminal emulator +{ + programs.kitty = { + enable = true; + keybindings = { + "ctrl+shift+tab" = "new_tab_with_cwd"; + "ctrl+shift+enter" = "new_window_with_cwd"; + "ctrl+j" = ''kitten pass_keys.py bottom ctrl+j''; + "ctrl+k" = ''kitten pass_keys.py top ctrl+k''; + "ctrl+h" = ''kitten pass_keys.py left ctrl+h''; + "ctrl+l" = ''kitten pass_keys.py right ctrl+l''; + }; + settings = { + scrollback_lines = 10000; + initial_window_width = 1200; + initial_window_height = 600; + update_check_interval = 0; + enable_audio_bell = false; + confirm_os_window_close = "0"; + remember_window_size = "no"; + disable_ligatures = "always"; + url_style = "curly"; + copy_on_select = "clipboard"; + cursor_shape = "Underline"; + cursor_underline_thickness = 3; + window_padding_width = 10; + open_url_with = "default"; + allow_remote_control = "yes"; + listen_on = "unix:/tmp/mykitty"; + }; + }; + + xdg.configFile = { + "kitty/pass_keys.py".text = '' + import re + + from kittens.tui.handler import result_handler + from kitty.key_encoding import KeyEvent, parse_shortcut + + def is_window_vim(window, vim_id): + fp = window.child.foreground_processes + return any(re.search(vim_id, p['cmdline'][0] if len(p['cmdline']) else "", re.I) for p in fp) + + def encode_key_mapping(window, key_mapping): + mods, key = parse_shortcut(key_mapping) + event = KeyEvent( + mods=mods, + key=key, + shift=bool(mods & 1), + alt=bool(mods & 2), + ctrl=bool(mods & 4), + super=bool(mods & 8), + hyper=bool(mods & 16), + meta=bool(mods & 32), + ).as_window_system_event() + + return window.encoded_key(event) + + def main(): + pass + + @result_handler(no_ui=True) + def handle_result(args, result, target_window_id, boss): + direction = args[1] + key_mapping = args[2] + vim_id = args[3] if len(args) > 3 else "n?vim" + + window = boss.window_id_map.get(target_window_id) + + if window is None: + return + if is_window_vim(window, vim_id): + for keymap in key_mapping.split(">"): + encoded = encode_key_mapping(window, keymap) + window.write_to_child(encoded) + else: + boss.active_tab.neighboring_window(direction) + ''; + "kitty/neighboring_window.py".text = '' + def main(): + pass + + def handle_result(args, result, target_window_id, boss): + return boss.active_tab.current_layout.name + + handle_result.no_ui = True + ''; + }; +} diff --git a/home/programs/lazygit/default.nix b/home/programs/lazygit/default.nix new file mode 100644 index 0000000..a330a09 --- /dev/null +++ b/home/programs/lazygit/default.nix @@ -0,0 +1,35 @@ +# Lazygit is a simple terminal UI for git commands. +{ + config, + lib, + ... +}: let + accent = "#${config.lib.stylix.colors.base0D}"; + muted = "#${config.lib.stylix.colors.base03}"; +in { + programs.lazygit = { + enable = true; + settings = lib.mkForce { + disableStartupPopups = true; + notARepository = "skip"; + promptToReturnFromSubprocess = false; + update.method = "never"; + git = { + commit.signOff = true; + overrideGpg = true; + parseEmoji = true; + }; + gui = { + theme = { + activeBorderColor = [accent "bold"]; + inactiveBorderColor = [muted]; + }; + showListFooter = false; + showRandomTip = false; + showCommandLog = false; + showBottomLine = false; + nerdFontsVersion = "3"; + }; + }; + }; +} diff --git a/home/programs/nixCats/.stylua.toml b/home/programs/nixCats/.stylua.toml new file mode 100644 index 0000000..0435f67 --- /dev/null +++ b/home/programs/nixCats/.stylua.toml @@ -0,0 +1,2 @@ +indent_type = "Spaces" +indent_width = 2 diff --git a/home/programs/nixCats/default.nix b/home/programs/nixCats/default.nix new file mode 100644 index 0000000..161ebf1 --- /dev/null +++ b/home/programs/nixCats/default.nix @@ -0,0 +1,155 @@ +{ inputs, config, ... }: +let + inherit (inputs.nixCats) utils; + luaPath = ./.; + categoryDefinitions = + { pkgs, ... }: + { + # to define and use a new category, simply add a new list to a set here, + # and later, you will include categoryname = true; in the set you + # provide when you build the package using this builder function. + # see :help nixCats.flake.outputs.packageDefinitions for info on that section. + + # lspsAndRuntimeDeps: + # this section is for dependencies that should be available + # at RUN TIME for plugins. Will be available to PATH within neovim terminal + # this includes LSPs + lspsAndRuntimeDeps = { + general = with pkgs; [ + universal-ctags + stdenv.cc.cc + ripgrep + fd + + stylua + lua-language-server + + nixd + nix-doc + nixfmt + + dafny + + typescript + typescript-language-server + + rust-analyzer + rustfmt + + markdownlint-cli2 + + basedpyright + black + isort + ]; + }; + + startupPlugins = { + general = with pkgs.vimPlugins; [ + lz-n + plenary-nvim + catppuccin-nvim + ]; + }; + + optionalPlugins = { + general = with pkgs.vimPlugins; [ + nvim-treesitter.withAllGrammars + nvim-treesitter-textobjects + nvim-treesitter-context + trouble-nvim + + guess-indent-nvim + gitsigns-nvim + which-key-nvim + + telescope-nvim + telescope-fzf-native-nvim + telescope-ui-select-nvim + + conform-nvim + blink-cmp + luasnip + friendly-snippets + + todo-comments-nvim + mini-nvim + + nvim-lspconfig + lazydev-nvim + nvim-autopairs + indent-blankline-nvim + nvim-lint + + render-markdown-nvim + + colorful-menu-nvim + ]; + }; + + sharedLibraries = { + general = with pkgs; [ ]; + }; + + environmentVariables = { }; + extraWrapperArgs = { }; + python3.libraries = { + test = (_: [ ]); + }; + extraLuaPackages = { + general = [ (_: [ ]) ]; + }; + extraCats = { }; + }; + + packageDefinitions = { + nixCats = + { pkgs, ... }: + { + settings = { + suffix-path = true; + suffix-LD = true; + aliases = [ + "nvim" + "vim" + "vi" + ]; + wrapRc = true; + configDirName = "nixCats"; + hosts.python3.enable = true; + hosts.node.enable = true; + }; + + categories = { + general = true; + }; + + extra = { + nixdExtras = { + nixpkgs = ''import ${pkgs.path} {}''; + nixos_options = ''(builtins.getFlake "path:///home/kiri/.config/nixos").nixosConfigurations.${toString config.var.hostname}.options''; + home_manager_options = ''(builtins.getFlake "path:///home/kiri/.config/nixos").nixosConfigurations.${toString config.var.hostname}.options.home-manager.users.type.getSubOptions []''; + }; + }; + }; + + }; + + defaultPackageName = "nixCats"; +in +{ + imports = [ + (utils.mkHomeModules { + inherit + defaultPackageName + luaPath + categoryDefinitions + packageDefinitions + ; + inherit (inputs) nixpkgs; + dependencyOverlays = [ (utils.standardPluginOverlay inputs) ]; + }) + ]; + + nixCats.enable = true; +} diff --git a/home/programs/nixCats/init.lua b/home/programs/nixCats/init.lua new file mode 100644 index 0000000..5d2a5fe --- /dev/null +++ b/home/programs/nixCats/init.lua @@ -0,0 +1,5 @@ +require("options") +require("plugins.ui") +require("plugins.editor") +require("plugins.coding") +require("plugins.lsp") diff --git a/home/programs/nixCats/lua/options.lua b/home/programs/nixCats/lua/options.lua new file mode 100644 index 0000000..aef1190 --- /dev/null +++ b/home/programs/nixCats/lua/options.lua @@ -0,0 +1,133 @@ +-- Set as the leader key +-- See `:help mapleader` +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- [[ Setting options ]] +-- See `:help vim.o` +-- NOTE: You can change these options as you wish! +-- For more options, you can see `:help option-list` + +-- Make line numbers default +vim.o.number = true +-- You can also add relative line numbers, to help with jumping. +-- Experiment for yourself to see if you like it! +-- vim.o.relativenumber = true + +-- Enable mouse mode, can be useful for resizing splits for example! +vim.o.mouse = "a" + +-- Don't show the mode, since it's already in the status line +vim.o.showmode = false + +vim.opt.shortmess:append("Wc") + +-- Sync clipboard between OS and Neovim. +-- Schedule the setting after `UiEnter` because it can increase startup-time. +-- Remove this option if you want your OS clipboard to remain independent. +-- See `:help 'clipboard'` +vim.schedule(function() + vim.o.clipboard = "unnamedplus" +end) + +-- Enable break indent +vim.o.breakindent = true + +-- Save undo history +vim.o.undofile = true + +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +vim.o.ignorecase = true +vim.o.smartcase = true + +-- Keep signcolumn on by default +vim.o.signcolumn = "yes" + +-- Decrease update time +vim.o.updatetime = 250 + +-- Decrease mapped sequence wait time +vim.o.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.o.splitright = true +vim.o.splitbelow = true + +-- Sets how neovim will display certain whitespace characters in the editor. +-- See `:help 'list'` +-- and `:help 'listchars'` +-- +-- Notice listchars is set using `vim.opt` instead of `vim.o`. +-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. +-- See `:help lua-options` +-- and `:help lua-options-guide` +vim.o.list = true +vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } + +-- Preview substitutions live, as you type! +vim.o.inccommand = "split" + +-- Show which line your cursor is on +vim.o.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.o.scrolloff = 10 + +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- See `:help 'confirm'` +vim.o.confirm = true + +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` + +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +vim.keymap.set("n", "", "nohlsearch") + +-- Diagnostic keymaps +vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) + +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- for people to discover. Otherwise, you normally need to press , which +-- is not what someone will guess without a bit more experience. +-- +-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping +-- or just use to exit terminal mode +vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) + +-- TIP: Disable arrow keys in normal mode +-- vim.keymap.set('n', '', 'echo "Use h to move!!"') +-- vim.keymap.set('n', '', 'echo "Use l to move!!"') +-- vim.keymap.set('n', '', 'echo "Use k to move!!"') +-- vim.keymap.set('n', '', 'echo "Use j to move!!"') + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +vim.keymap.set("n", "", "", { desc = "Move focus to the left window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the right window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the lower window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) + +-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes +-- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) +-- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) +-- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) +-- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) + +-- [[ Basic Autocommands ]] +-- See `:help lua-guide-autocommands` + +-- Highlight when yanking (copying) text +-- Try it with `yap` in normal mode +-- See `:help vim.hl.on_yank()` +vim.api.nvim_create_autocmd("TextYankPost", { + desc = "Highlight when yanking (copying) text", + group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }), + callback = function() + vim.hl.on_yank() + end, +}) diff --git a/home/programs/nixCats/lua/plugins/coding.lua b/home/programs/nixCats/lua/plugins/coding.lua new file mode 100644 index 0000000..73cdc6e --- /dev/null +++ b/home/programs/nixCats/lua/plugins/coding.lua @@ -0,0 +1,263 @@ +require("lz.n").load({ + -- { + -- "nvim-treesitter-context", + -- event = "BufReadPost", + -- after = function() + -- require("treesitter-context").setup({ + -- enable = true, + -- max_lines = 3, -- How many lines the window should span + -- }) + -- end, + -- }, + { + "nvim-lint", + event = { "BufReadPre", "BufNewFile" }, + after = function() + local lint = require("lint") + lint.linters_by_ft = { + markdown = { "markdownlint-cli2" }, + } + + -- Create autocommand which carries out the actual linting + -- on the specified events. + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + group = lint_augroup, + callback = function() + -- Only run the linter in buffers that you can modify in order to + -- avoid superfluous noise, notably within the handy LSP pop-ups that + -- describe the hovered symbol using Markdown. + if vim.bo.modifiable then + lint.try_lint() + end + end, + }) + end, + }, + { + "nvim-autopairs", + event = "InsertEnter", + after = function() + require("nvim-autopairs").setup({ + check_ts = true, + }) + end, + }, + { + "nvim-treesitter", + dep_of = "render-markdown.nvim", + -- cmd = { "" }, + event = "DeferredUIEnter", + -- ft = "", + -- keys = "", + -- colorscheme = "", + load = function(name) + vim.cmd.packadd(name) + vim.cmd.packadd("nvim-treesitter-textobjects") + end, + after = function() + -- [[ Configure Treesitter ]] + -- See `:help nvim-treesitter` + require("nvim-treesitter.configs").setup({ + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = "", + node_decremental = "", + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, + swap = { + enable = true, + swap_next = { + ["a"] = "@parameter.inner", + }, + swap_previous = { + ["A"] = "@parameter.inner", + }, + }, + }, + }) + end, + }, + { + "conform.nvim", + event = "BufWritePre", + cmd = "ConformInfo", + keys = { + { + "f", + function() + require("conform").format({ async = true, lsp_format = "fallback" }) + end, + mode = "", + desc = "[F]ormat buffer", + }, + }, + after = function() + require("conform").setup({ + notify_on_error = true, + format_on_save = function(bufnr) + -- Disable "format_on_save lsp_fallback" for languages that don't + -- have a well standardized coding style. You can add additional + -- languages here or re-enable it for the disabled ones. + local disable_filetypes = { c = true, cpp = true } + if disable_filetypes[vim.bo[bufnr].filetype] then + return nil + else + return { + timeout_ms = 500, + lsp_format = "fallback", + } + end + end, + formatters_by_ft = { + lua = { "stylua" }, + -- Conform can also run multiple formatters sequentially + python = { "isort", "black" }, + -- + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, + }, + }) + end, + }, + { + "friendly-snippets", + }, + { + "luasnip", + before = function() + require("lz.n").trigger_load("friendly-snippets") + end, + after = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + { + "blink.cmp", + before = function() + -- Trigger lazydev so it's ready for blink source + require("lz.n").trigger_load({ "lazydev.nvim", "luasnip" }) + end, + event = "VimEnter", + after = function() + require("blink.cmp").setup({ + keymap = { + preset = "default", + + -- [Up/Down] + [""] = { "select_next", "fallback" }, + [""] = { "select_prev", "fallback" }, -- Overrides Signature Help + + -- [Insert Suggestion] + [""] = { "select_and_accept", "fallback" }, + + -- [Remap Signature Help] + -- Since we took , let's move signature help to (optional) + [""] = { "show_signature", "hide_signature", "fallback" }, + }, + + appearance = { + nerd_font_variant = "mono", + }, + + completion = { + -- By default, you may press `` to show the documentation. + -- Optionally, set `auto_show = true` to show the documentation after a delay. + documentation = { + auto_show = true, + auto_show_delay_ms = 500, + window = { + border = "rounded", + }, + }, + menu = { + border = "rounded", + draw = { + columns = { { "kind_icon" }, { "label", gap = 1 } }, + components = { + label = { + text = function(ctx) + return require("colorful-menu").blink_components_text(ctx) + end, + highlight = function(ctx) + return require("colorful-menu").blink_components_highlight(ctx) + end, + }, + }, + }, + }, + }, + + cmdline = { + completion = { + menu = { + auto_show = true, + }, + }, + keymap = { preset = "inherit" }, + }, + + sources = { + default = { + "lsp", + "path", + "snippets", + "lazydev", + }, + providers = { + lazydev = { module = "lazydev.integrations.blink", score_offset = 100 }, + }, + }, + + snippets = { preset = "luasnip" }, + + fuzzy = { implementation = "prefer_rust_with_warning" }, + + -- Shows a signature help window while you type arguments for a function + signature = { + window = { border = "rounded" }, + enabled = true, + }, + }) + end, + }, +}) diff --git a/home/programs/nixCats/lua/plugins/editor.lua b/home/programs/nixCats/lua/plugins/editor.lua new file mode 100644 index 0000000..8e20b56 --- /dev/null +++ b/home/programs/nixCats/lua/plugins/editor.lua @@ -0,0 +1,170 @@ +require("lz.n").load({ + { + "guess-indent.nvim", + event = "BufReadPre", + after = function() + require("guess-indent").setup({}) + end, + }, + { + "gitsigns.nvim", + event = { "BufReadPre", "BufNewFile" }, + after = function() + require("gitsigns").setup({ + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + }, + on_attach = function(bufnr) + local gitsigns = require("gitsigns") + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map("n", "]c", function() + if vim.wo.diff then + vim.cmd.normal({ "]c", bang = true }) + else + gitsigns.nav_hunk("next") + end + end, { desc = "Jump to next git [c]hange" }) + + map("n", "[c", function() + if vim.wo.diff then + vim.cmd.normal({ "[c", bang = true }) + else + gitsigns.nav_hunk("prev") + end + end, { desc = "Jump to previous git [c]hange" }) + + -- Actions + -- visual mode + map("v", "hs", function() + gitsigns.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, { desc = "git [s]tage hunk" }) + map("v", "hr", function() + gitsigns.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, { desc = "git [r]eset hunk" }) + -- normal mode + map("n", "hs", gitsigns.stage_hunk, { desc = "git [s]tage hunk" }) + map("n", "hr", gitsigns.reset_hunk, { desc = "git [r]eset hunk" }) + map("n", "hS", gitsigns.stage_buffer, { desc = "git [S]tage buffer" }) + map("n", "hu", gitsigns.stage_hunk, { desc = "git [u]ndo stage hunk" }) + map("n", "hR", gitsigns.reset_buffer, { desc = "git [R]eset buffer" }) + map("n", "hp", gitsigns.preview_hunk, { desc = "git [p]review hunk" }) + map("n", "hb", gitsigns.blame_line, { desc = "git [b]lame line" }) + map("n", "hd", gitsigns.diffthis, { desc = "git [d]iff against index" }) + map("n", "hD", function() + gitsigns.diffthis("@") + end, { desc = "git [D]iff against last commit" }) + -- Toggles + map("n", "tb", gitsigns.toggle_current_line_blame, { desc = "[T]oggle git show [b]lame line" }) + map("n", "tD", gitsigns.preview_hunk_inline, { desc = "[T]oggle git show [D]eleted" }) + end, + }) + end, + }, + { + "telescope.nvim", + event = "VimEnter", + after = function() + local actions = require("telescope.actions") + + require("telescope").setup({ + defaults = { + path_display = { "truncate" }, + layout_strategy = "horizontal", + layout_config = { + prompt_position = "top", + }, + sorting_strategy = "ascending", + mappings = { + i = { + [""] = actions.move_selection_previous, -- Move up with Ctrl-k + [""] = actions.move_selection_next, -- Move down with Ctrl-j + [""] = actions.send_selected_to_qflist + actions.open_qflist, -- Send to quickfix + }, + }, + }, + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown(), + }, + }, + }) + + -- Enable Telescope extensions if they are installed + pcall(require("telescope").load_extension, "fzf") + pcall(require("telescope").load_extension, "ui-select") + + -- See `:help telescope.builtin` + local builtin = require("telescope.builtin") + vim.keymap.set("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) + vim.keymap.set("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) + vim.keymap.set("n", "sf", builtin.find_files, { desc = "[S]earch [F]iles" }) + vim.keymap.set("n", "ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" }) + vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[S]earch current [W]ord" }) + vim.keymap.set("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) + vim.keymap.set("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) + vim.keymap.set("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) + vim.keymap.set("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) + + -- Slightly advanced example of overriding default behavior and theme + vim.keymap.set("n", "/", function() + -- You can pass additional configuration to Telescope to change the theme, layout, etc. + builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ + winblend = 10, + previewer = false, + })) + end, { desc = "[/] Fuzzily search in current buffer" }) + + -- It's also possible to pass additional configuration options. + -- See `:help telescope.builtin.live_grep()` for information about particular keys + vim.keymap.set("n", "s/", function() + builtin.live_grep({ + grep_open_files = true, + prompt_title = "Live Grep in Open Files", + }) + end, { desc = "[S]earch [/] in Open Files" }) + + -- Shortcut for searching your Neovim configuration files + vim.keymap.set("n", "sn", function() + builtin.find_files({ cwd = vim.fn.stdpath("config") }) + end, { desc = "[S]earch [N]eovim files" }) + end, + }, + { + "trouble.nvim", + cmd = "Trouble", + keys = { + { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, + { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, + }, + after = function() + require("trouble").setup({ + focus = true, + }) + end, + }, + { + "todo-comments.nvim", + event = { "BufReadPre", "BufNewFile" }, + keys = { + { "st", "TodoTelescope", desc = "[S]earch [T]odos" }, + { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, + }, + after = function() + require("todo-comments").setup({ + signs = false, + }) + end, + }, +}) diff --git a/home/programs/nixCats/lua/plugins/lsp.lua b/home/programs/nixCats/lua/plugins/lsp.lua new file mode 100644 index 0000000..384aa96 --- /dev/null +++ b/home/programs/nixCats/lua/plugins/lsp.lua @@ -0,0 +1,166 @@ +require("lz.n").load({ + { + { + -- lazydev makes your lsp way better in your config without needing extra lsp configuration. + "lazydev.nvim", + cmd = "LazyDev", + ft = "lua", + after = function() + require("lazydev").setup({ + library = { + { words = { "nixCats" }, path = (nixCats.nixCatsPath or "") .. "/lua" }, + }, + }) + end, + }, + { + "nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + after = function() + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), + callback = function(args) + -- Get the client and buffer from the event arguments [cite: 119] + local client = vim.lsp.get_client_by_id(args.data.client_id) + local bufnr = args.buf + + local map = function(keys, func, desc, mode) + mode = mode or "n" + vim.keymap.set(mode, keys, func, { buffer = bufnr, desc = "LSP: " .. desc }) + end + + -- Mappings (Standard LSP functions from lsp-defaults) [cite: 20-23] + map("grn", vim.lsp.buf.rename, "[R]e[n]ame") + map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" }) + map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") + + -- Telescope Mappings + map("grr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") + map("gri", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") + map("grd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") + map("gO", require("telescope.builtin").lsp_document_symbols, "Open Document Symbols") + map("gW", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Open Workspace Symbols") + map("grt", require("telescope.builtin").lsp_type_definitions, "[G]oto [T]ype Definition") + + -- Highlight references (Document Highlight) + if client and client:supports_method("textDocument/documentHighlight", bufnr) then + local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false }) + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + buffer = bufnr, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { + buffer = bufnr, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd("LspDetach", { + group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }), + callback = function(event) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event.buf }) + end, + }) + end + + -- Inlay Hints + if client and client:supports_method("textDocument/inlayHint", bufnr) then + map("th", function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr })) + end, "[T]oggle Inlay [H]ints") + end + end, + }) + + -- 1. Setup Diagnostics (Visuals) + vim.diagnostic.config({ + severity_sort = true, + float = { border = "rounded", source = "if_many" }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = " ", + [vim.diagnostic.severity.WARN] = " ", + [vim.diagnostic.severity.INFO] = " ", + [vim.diagnostic.severity.HINT] = "󰠠 ", + }, + }, + virtual_text = { + source = "if_many", + spacing = 4, + prefix = "●", + format = function(diagnostic) + local diagnostic_message = { + [vim.diagnostic.severity.ERROR] = diagnostic.message, + [vim.diagnostic.severity.WARN] = diagnostic.message, + [vim.diagnostic.severity.INFO] = diagnostic.message, + [vim.diagnostic.severity.HINT] = diagnostic.message, + } + return diagnostic_message[diagnostic.severity] + end, + }, + }) + + vim.lsp.config("lua_ls", { + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + signatureHelp = { enabled = true }, + diagnostics = { globals = { "nixCats", "vim" } }, + telemetry = { enabled = false }, + completion = { callSnippet = "Replace" }, + }, + }, + }) + vim.lsp.enable("lua_ls") + + -- Nix + vim.lsp.config("nixd", { + settings = { + nixd = { + nixpkgs = { expr = nixCats.extra("nixdExtras.nixpkgs") }, + options = { + nixos = { expr = nixCats.extra("nixdExtras.nixos_options") }, + ["home-manager"] = { expr = nixCats.extra("nixdExtras.home_manager_options") }, + }, + formatting = { command = { "nixfmt" } }, + }, + }, + }) + vim.lsp.enable("nixd") + + -- Dafny + vim.lsp.enable("dafny") + + -- TypeScript/JS + vim.lsp.enable("ts_ls") + + -- Rust + vim.lsp.enable("rust_analyzer") + + -- Python + vim.lsp.config("basedpyright", { + settings = { + basedpyright = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = "openFilesOnly", + typeCheckingMode = "standard", + inlayHints = { + variableTypes = true, + callArgumentNames = true, + functionReturnTypes = true, + }, + }, + }, + }, + }) + vim.lsp.enable("basedpyright") + end, + }, + }, +}) diff --git a/home/programs/nixCats/lua/plugins/ui.lua b/home/programs/nixCats/lua/plugins/ui.lua new file mode 100644 index 0000000..f8e379c --- /dev/null +++ b/home/programs/nixCats/lua/plugins/ui.lua @@ -0,0 +1,158 @@ +require("lz.n").load({ + { + "catppuccin-nvim", + event = "VimEnter", + after = function() + require("catppuccin").setup({ + flavour = "mocha", + term_colors = true, + dim_inactive = { + enabled = true, + shade = "dark", + percentage = 0.15, + }, + integrations = { + gitsigns = true, + telescope = true, + treesitter = true, + treesitter_context = true, + markdown = true, + which_key = true, + blink_cmp = { + style = "bordered", + }, + }, + + native_lsp = { + enabled = true, + virtual_text = { + errors = { "italic" }, + hints = { "italic" }, + warnings = { "italic" }, + information = { "italic" }, + }, + underlines = { + errors = { "underline" }, + hints = { "underline" }, + warnings = { "underline" }, + information = { "underline" }, + }, + inlay_hints = { + background = true, + }, + }, + }) + + vim.cmd.colorscheme("catppuccin") + end, + }, + { + "colorful-menu.nvim", + after = function() + require("colorful-menu").setup({}) + end, + }, + { + "indent-blankline.nvim", + event = "User FileOpened", + after = function() + require("ibl").setup({ + indent = { char = "|" }, + scope = { + enabled = false, + show_start = false, + show_end = false, + }, + }) + end, + }, + { + "render-markdown.nvim", + before = function() + require("lz.n").trigger_load({ "nvim-treesitter", "mini.nvim" }) + end, + after = function() + require("render-markdown").setup({}) + end, + }, + { + "which-key.nvim", + event = "VimEnter", + before = function() + require("lz.n").trigger_load("nvim-web-devicons") + end, + after = function() + require("which-key").setup({ + preset = "modern", + delay = 200, + win = { + border = "rounded", + }, + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = true, + -- If you are using a Nerd Font: set icons.keys to an empty table which will use the + -- default which-key.nvim defined Nerd Font icons, otherwise define a string table + keys = {}, + }, + + -- Document existing key chains + spec = { + { "s", group = "[S]earch" }, + { "t", group = "[T]oggle" }, + { "h", group = "Git [H]unk", mode = { "n", "v" } }, + }, + }) + end, + }, + { + "mini.nvim", + after = function() + -- Better Around/Inside textobjects + require("mini.ai").setup({ n_lines = 500 }) + + -- Add/delete/replace surroundings (brackets, quotes, etc.) + require("mini.surround").setup() + + -- Simple and easy statusline. + local statusline = require("mini.statusline") + statusline.setup({ use_icons = true }) + statusline.section_location = function() + return "%2l:%-2v" + end + + local files = require("mini.files") + files.setup() + vim.keymap.set("n", "e", function() + if not files.close() then + files.open(vim.api.nvim_buf_get_name(0)) + end + end, { desc = "File [E]xplorer" }) + + local icons = require("mini.icons") + icons.setup() + icons.mock_nvim_web_devicons() + + local hipatterns = require("mini.hipatterns") + hipatterns.setup({ + highlighters = { + -- Highlight hex color strings (#rrggbb) using that color + hex_color = hipatterns.gen_highlighter.hex_color(), + }, + }) + + local indentscope = require("mini.indentscope") + indentscope.setup({ + symbol = "│", + -- draw = { animation = indentscope.gen_animation.linear({}) }, + }) + + vim.api.nvim_create_autocmd("FileType", { + pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, +}) diff --git a/home/programs/nvf/default.nix b/home/programs/nvf/default.nix new file mode 100644 index 0000000..cb59275 --- /dev/null +++ b/home/programs/nvf/default.nix @@ -0,0 +1,27 @@ +# NVF is a Neovim configuration that provides a minimal setup with essential plugins and configurations. +{ + inputs, + pkgs, + ... +}: +{ + imports = [ + inputs.nvf.homeManagerModules.default + ./options.nix + ./languages.nix + ./picker.nix + ./snacks.nix + ./keymaps.nix + ./utils.nix + ./mini.nix + ]; + + programs.nvf = { + enable = true; + settings.vim = { + startPlugins = [ + pkgs.vimPlugins.vim-kitty-navigator + ]; + }; + }; +} diff --git a/home/programs/nvf/keymaps.nix b/home/programs/nvf/keymaps.nix new file mode 100644 index 0000000..ed34631 --- /dev/null +++ b/home/programs/nvf/keymaps.nix @@ -0,0 +1,173 @@ +{ + programs.nvf.settings.vim = { + globals.mapleader = " "; + binds = { + whichKey = { + enable = true; + # TODO: registers + register = {}; + }; + }; + keymaps = [ + # General Mappings + { + key = "s"; + mode = "n"; + silent = true; + action = "lua require('flash').jump()"; + desc = "Flash"; + } + { + key = "K"; + mode = "n"; + silent = true; + action = "lua vim.lsp.buf.hover()"; + desc = "LSP Hover"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "bnext"; + desc = "Next Buffer"; + } + + # Kitty navigator + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateLeft"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateDown"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateUp"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateRight"; + } + + # Disable Arrow Keys in Normal Mode + { + key = ""; + mode = "n"; + silent = true; + action = ""; + desc = "Disable Up Arrow"; + } + { + key = ""; + mode = "n"; + silent = true; + action = ""; + desc = "Disable Down Arrow"; + } + { + key = ""; + mode = "n"; + silent = true; + action = ""; + desc = "Disable Left Arrow"; + } + { + key = ""; + mode = "n"; + silent = true; + action = ""; + desc = "Disable Right Arrow"; + } + + # UI + { + key = "uw"; + mode = "n"; + silent = true; + action = "set wrap!"; + desc = "Toggle word wrapping"; + } + { + key = "ul"; + mode = "n"; + silent = true; + action = "set linebreak!"; + desc = "Toggle linebreak"; + } + { + key = "us"; + mode = "n"; + silent = true; + action = "set spell!"; + desc = "Toggle spellLazyGitcheck"; + } + { + key = "uc"; + mode = "n"; + silent = true; + action = "set cursorline!"; + desc = "Toggle cursorline"; + } + { + key = "un"; + mode = "n"; + silent = true; + action = "set number!"; + desc = "Toggle line numbers"; + } + { + key = "ur"; + mode = "n"; + silent = true; + action = "set relativenumber!"; + desc = "Toggle relative line numbers"; + } + { + key = "ut"; + mode = "n"; + silent = true; + action = "set showtabline=2"; + desc = "Show tabline"; + } + { + key = "uT"; + mode = "n"; + silent = true; + action = "set showtabline=0"; + desc = "Hide tabline"; + } + + # Windows + { + key = "ws"; + mode = "n"; + silent = true; + action = "split"; + desc = "Split"; + } + { + key = "wv"; + mode = "n"; + silent = true; + action = "vsplit"; + desc = "VSplit"; + } + { + key = "wd"; + mode = "n"; + silent = true; + action = "close"; + desc = "Close"; + } + ]; + }; +} diff --git a/home/programs/nvf/languages.nix b/home/programs/nvf/languages.nix new file mode 100644 index 0000000..ce65bb1 --- /dev/null +++ b/home/programs/nvf/languages.nix @@ -0,0 +1,119 @@ +{ + lib, + pkgs, + ... +}: { + programs.nvf.settings.vim = { + diagnostics = { + enable = true; + config = { + signs = { + text = { + "vim.diagnostic.severity.Error" = " "; + "vim.diagnostic.severity.Warn" = " "; + "vim.diagnostic.severity.Hint" = " "; + "vim.diagnostic.severity.Info" = " "; + }; + }; + underline = true; + update_in_insert = true; + virtual_text = { + format = + lib.generators.mkLuaInline + /* + lua + */ + '' + function(diagnostic) + return string.format("%s", diagnostic.message) + --return string.format("%s (%s)", diagnostic.message, diagnostic.source) + end + ''; + }; + }; + nvim-lint = { + enable = true; + }; + }; + syntaxHighlighting = true; + treesitter = { + enable = true; + autotagHtml = true; + context.enable = true; + highlight.enable = true; + grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ + typescript # in language settings only tsx gets enabled, not typescript + ]; + }; + lsp = { + enable = true; + trouble.enable = true; + lspSignature.enable = true; + lspconfig.enable = true; + formatOnSave = true; + inlayHints.enable = true; + null-ls.enable = true; + servers.nixd.settings.nil.nix.autoArchive = true; + otter-nvim = { + enable = true; + setupOpts = { + buffers.set_filetype = true; + lsp = { + diagnostic_update_event = [ + "BufWritePost" + "InsertLeave" + ]; + }; + }; + }; + lspkind.enable = true; + lspsaga = { + enable = true; + setupOpts = { + ui = { + code_action = ""; + }; + lightbulb = { + sign = false; + virtual_text = true; + }; + breadcrumbs.enable = false; + }; + }; + }; + languages = { + enableDAP = true; + enableExtraDiagnostics = true; + enableFormat = true; + enableTreesitter = true; + + astro.enable = true; + go.enable = true; + markdown = { + enable = true; + format.type = "prettierd"; + extensions = { + markview-nvim = { + enable = true; + }; + }; + extraDiagnostics.enable = true; + }; + ts = { + enable = true; + extensions.ts-error-translator.enable = true; + }; + css.enable = true; + svelte.enable = true; + html.enable = true; + bash.enable = true; + nix.enable = true; + tailwind.enable = true; + }; + formatter = { + conform-nvim = { + enable = true; + }; + }; + }; +} diff --git a/home/programs/nvf/mini.nix b/home/programs/nvf/mini.nix new file mode 100644 index 0000000..2c0568b --- /dev/null +++ b/home/programs/nvf/mini.nix @@ -0,0 +1,13 @@ +{ + programs.nvf.settings.vim.mini = { + starter.enable = true; + comment.enable = true; + # cursorword.enable = true; + icons.enable = true; + indentscope.enable = true; + notify.enable = true; + pairs.enable = true; + diff.enable = true; + git.enable = true; + }; +} diff --git a/home/programs/nvf/options.nix b/home/programs/nvf/options.nix new file mode 100644 index 0000000..76b17a6 --- /dev/null +++ b/home/programs/nvf/options.nix @@ -0,0 +1,41 @@ +{ lib, ... }: +{ + programs.nvf.settings.vim = { + viAlias = false; + vimAlias = true; + withNodeJs = true; + # syntaxHighlighting = true; + options = { + autoindent = true; + smartindent = true; + shiftwidth = 2; + foldlevel = 99; + foldcolumn = "auto:1"; + mousescroll = "ver:1,hor:1"; + mousemoveevent = true; + fillchars = "eob:‿,fold: ,foldopen:▼,foldsep:⸽,foldclose:⏵"; + signcolumn = "yes"; + tabstop = 2; + softtabstop = 2; + wrap = false; + }; + globals = { + navic_silence = true; # navic tries to attach multiple LSPs and fails + suda_smart_edit = 1; # use super user write automatically + neovide_scale_factor = 0.7; + neovide_cursor_animation_length = 0.1; + neovide_cursor_short_animation_length = 0; + }; + clipboard = { + enable = true; + registers = "unnamedplus"; + providers.wl-copy.enable = true; + }; + theme = { + enable = true; + name = lib.mkForce "catppuccin"; + style = lib.mkForce "mocha"; + transparent = lib.mkForce true; + }; + }; +} diff --git a/home/programs/nvf/picker.nix b/home/programs/nvf/picker.nix new file mode 100644 index 0000000..c87033e --- /dev/null +++ b/home/programs/nvf/picker.nix @@ -0,0 +1,257 @@ +{ + programs.nvf.settings.vim = { + utility = { + oil-nvim.enable = true; + snacks-nvim = { + setupOpts = { + picker.enabled = true; + explorer.enabled = true; + }; + }; + }; + keymaps = [ + # Top Pickers & Explorer + { + key = " "; + mode = "n"; + silent = true; + action = "lua Snacks.picker.smart()"; + desc = "Smart Find Files"; + } + { + key = ","; + mode = "n"; + silent = true; + action = "lua Snacks.picker.buffers()"; + desc = "Buffers"; + } + { + key = "/"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep()"; + desc = "Grep"; + } + { + key = ":"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.command_history()"; + desc = "Command History"; + } + { + key = "e"; + mode = "n"; + silent = true; + action = "lua Snacks.explorer()"; + desc = "File Explorer"; + } + { + key = "-"; + mode = "n"; + silent = true; + action = "Oil"; + desc = "Oil"; + } + + # Find + { + key = "fb"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.buffers()"; + desc = "Buffers"; + } + { + key = "fc"; + mode = "n"; + silent = true; + action = '' + lua Snacks.picker.files({ cwd = vim.fn.stdpath("config") })''; + desc = "Find Config File"; + } + { + key = "ff"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.files()"; + desc = "Find Files"; + } + { + key = "fg"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_files()"; + desc = "Find Git Files"; + } + { + key = "fp"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.projects()"; + desc = "Projects"; + } + { + key = "fr"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.recent()"; + desc = "Recent"; + } + { + key = "fn"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.notifications()"; + desc = "Notification History"; + } + { + key = "fe"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.icons()"; + desc = "Emoji"; + } + + # Git + { + key = "gb"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_branches()"; + desc = "Git Branches"; + } + { + key = "gL"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_log()"; + desc = "Git Log Line"; + } + { + key = "gs"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_status()"; + desc = "Git Status"; + } + { + key = "gS"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_stash()"; + desc = "Git Stash"; + } + { + key = "gd"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_diff()"; + desc = "Git Diff (Hunks)"; + } + { + key = "gf"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_log_file()"; + desc = "Git Log File"; + } + + # Grep + { + key = "sb"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lines()"; + desc = "Buffer Lines"; + } + { + key = "st"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.todo_comments()"; + desc = "Todos"; + } + { + key = "sB"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep_buffers()"; + desc = "Grep Open Buffers"; + } + { + key = "sg"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep()"; + desc = "Grep"; + } + { + key = "sw"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep_word()"; + desc = "Visual selection or word"; + } + { + key = "sr"; + mode = "n"; + silent = true; + action = "nohlsearch"; + desc = "Reset search"; + } + + # LSP + { + key = "gd"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_definitions()"; + desc = "Goto Definition"; + } + { + key = "gD"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_declarations()"; + desc = "Goto Declaration"; + } + { + key = "gr"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_references()"; + desc = "References"; + nowait = true; + } + { + key = "gI"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_implementations()"; + desc = "Goto Implementation"; + } + { + key = "gy"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_type_definitions()"; + desc = "Goto Type Definition"; + } + { + key = "ss"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_symbols()"; + desc = "LSP Symbols"; + } + { + key = "sS"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_workspace_symbols()"; + desc = "LSP Workspace Symbols"; + } + ]; + }; +} diff --git a/home/programs/nvf/snacks.nix b/home/programs/nvf/snacks.nix new file mode 100644 index 0000000..0624537 --- /dev/null +++ b/home/programs/nvf/snacks.nix @@ -0,0 +1,19 @@ +{ + programs.nvf.settings.vim.utility.snacks-nvim = { + enable = true; + setupOpts = { + image = { + enabled = true; + doc = { + inline = false; + float = true; + }; + }; + quickfile.enabled = true; + statuscolumn.enabled = true; + zen.enabled = true; + bufdelete.enabled = true; + gitsigns.enabled = true; + }; + }; +} diff --git a/home/programs/nvf/utils.nix b/home/programs/nvf/utils.nix new file mode 100644 index 0000000..4a75491 --- /dev/null +++ b/home/programs/nvf/utils.nix @@ -0,0 +1,53 @@ +{pkgs, ...}: { + programs.nvf.settings.vim = { + undoFile.enable = true; + utility = { + motion.flash-nvim.enable = true; + outline.aerial-nvim.enable = true; + }; + tabline.nvimBufferline.enable = true; + notes.todo-comments.enable = true; + assistant.copilot = { + enable = true; + cmp.enable = true; + }; + statusline.lualine.enable = true; + + autocomplete = { + nvim-cmp = { + enable = true; + sources = { + buffer = "[Buffer]"; + nvim-cmp = null; + path = "[Path]"; + }; + sourcePlugins = [ + pkgs.vimPlugins.cmp-cmdline + ]; + }; + }; + + snippets.luasnip.enable = true; + ui = { + noice.enable = true; + colorizer.enable = true; + }; + git = { + enable = true; + gitsigns.enable = true; + }; + terminal.toggleterm = { + enable = true; + lazygit = { + enable = true; + mappings.open = "gl"; + }; + }; + visuals = { + rainbow-delimiters.enable = true; + nvim-scrollbar = { + enable = false; + }; + }; + }; +} diff --git a/home/programs/rclone/default.nix b/home/programs/rclone/default.nix new file mode 100644 index 0000000..8e87e99 --- /dev/null +++ b/home/programs/rclone/default.nix @@ -0,0 +1,35 @@ +{ + programs.rclone = { + enable = true; + remotes = { + gdrive = { + config = { + type = "drive"; + scope = "drive"; + + root_folder_id = ""; + }; + + secrets = { + token = "/home/kiri/.config/rclone/gdrive_token"; + + client_id = "/home/kiri/.config/rclone/gdrive_client_id"; + client_secret = "/home/kiri/.config/rclone/gdrive_client_secret"; #TODO: sops? + }; + + mounts = { + "/" = { + enable = true; + mountPoint = "/home/kiri/gdrive"; + + options = { + dir-cache-time = "5000h"; + poll-interval = "10s"; + vfs-cache-mode = "full"; + }; + }; + }; + }; + }; + }; +} diff --git a/home/programs/shell/default.nix b/home/programs/shell/default.nix new file mode 100644 index 0000000..aee5d89 --- /dev/null +++ b/home/programs/shell/default.nix @@ -0,0 +1,4 @@ +# Import all shell configurations +{ + imports = [./fzf.nix ./zsh.nix ./starship.nix ./zoxide.nix ./eza.nix]; +} diff --git a/home/programs/shell/eza.nix b/home/programs/shell/eza.nix new file mode 100644 index 0000000..dbf4c51 --- /dev/null +++ b/home/programs/shell/eza.nix @@ -0,0 +1,13 @@ +# Eza is a ls replacement +{ + programs.eza = { + enable = true; + icons = "auto"; + + extraOptions = [ + "--group-directories-first" + "--no-quotes" + "--icons=always" + ]; + }; +} diff --git a/home/programs/shell/fzf.nix b/home/programs/shell/fzf.nix new file mode 100644 index 0000000..9ad8965 --- /dev/null +++ b/home/programs/shell/fzf.nix @@ -0,0 +1,33 @@ +# Fzf is a general-purpose command-line fuzzy finder. +{ + config, + lib, + ... +}: let + accent = "#" + config.lib.stylix.colors.base0D; + foreground = "#" + config.lib.stylix.colors.base05; + muted = "#" + config.lib.stylix.colors.base03; +in { + programs.fzf = { + enable = true; + enableZshIntegration = true; + colors = lib.mkForce { + "fg+" = accent; + "bg+" = "-1"; + "fg" = foreground; + "bg" = "-1"; + "prompt" = muted; + "pointer" = accent; + }; + defaultOptions = [ + "--margin=1" + "--layout=reverse" + "--border=none" + "--info='hidden'" + "--header=''" + "--prompt='/ '" + "-i" + "--no-bold" + ]; + }; +} diff --git a/home/programs/shell/starship.nix b/home/programs/shell/starship.nix new file mode 100644 index 0000000..74471df --- /dev/null +++ b/home/programs/shell/starship.nix @@ -0,0 +1,72 @@ +# starship is a minimal, fast, and extremely customizable prompt for any shell! +{ + config, + lib, + ... +}: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background-alt = "#${config.lib.stylix.colors.base01}"; +in +{ + programs.starship = { + enable = true; + enableZshIntegration = true; + settings = { + add_newline = true; + + format = lib.concatStrings [ + "$nix_shell" + "$hostname" + "$directory" + "$git_branch" + "$git_state" + "$git_status" + "$line_break" + "$character" + ]; + + directory = { + style = accent; + truncation_length = 99; + truncate_to_repo = false; + }; + + character = { + success_symbol = "[❯](${accent})"; + error_symbol = "[❯](red)"; + vimcmd_symbol = "[❮](${accent})"; + }; + + nix_shell = { + format = "[$symbol]($style) "; + symbol = "🐚"; + style = ""; + }; + + git_branch = { + symbol = "[](${background-alt}) "; + style = "fg:${accent} bg:${background-alt}"; + format = "on [$symbol$branch]($style)[](${background-alt}) "; + }; + + git_status = { + format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)"; + style = "cyan"; + conflicted = ""; + renamed = ""; + deleted = ""; + stashed = "≡"; + }; + + git_state = { + format = "([$state( $progress_current/$progress_total)]($style)) "; + style = "bright-black"; + }; + + line_break = { + disabled = false; + }; + }; + }; +} diff --git a/home/programs/shell/zoxide.nix b/home/programs/shell/zoxide.nix new file mode 100644 index 0000000..4bf8749 --- /dev/null +++ b/home/programs/shell/zoxide.nix @@ -0,0 +1,7 @@ +# Zoxide is a cd replacement +{ + programs.zoxide = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/home/programs/shell/zsh.nix b/home/programs/shell/zsh.nix new file mode 100644 index 0000000..338d26d --- /dev/null +++ b/home/programs/shell/zsh.nix @@ -0,0 +1,214 @@ +# My shell configuration +{ + pkgs, + lib, + config, + ... +}: +let + fetch = config.theme.fetch; # neofetch, nerdfetch, pfetch +in +{ + home.packages = with pkgs; [ + bat + ripgrep + tldr + sesh + ]; + + # Add go binaries to the PATH + home.sessionPath = [ "$HOME/go/bin" ]; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting = { + enable = true; + highlighters = [ + "main" + "brackets" + "pattern" + "regexp" + "root" + "line" + ]; + }; + historySubstringSearch.enable = true; + + history = { + ignoreDups = true; + save = 10000; + size = 10000; + }; + + profileExtra = lib.optionalString (config.home.sessionPath != [ ]) '' + export PATH="$PATH''${PATH:+:}${lib.concatStringsSep ":" config.home.sessionPath}" + ''; + + shellAliases = { + c = "clear"; + clera = "clear"; + celar = "clear"; + e = "exit"; + cd = "z"; + ls = "eza --icons=always --no-quotes"; + tree = "eza --icons=always --tree --no-quotes"; + sl = "ls"; + open = "${pkgs.xdg-utils}/bin/xdg-open"; + cat = "bat --theme=base16 --color=always --paging=never --tabs=2 --wrap=never --plain"; + mkdir = "mkdir -p"; + + obsidian-no-gpu = "env ELECTRON_OZONE_PLATFORM_HINT=auto obsidian --ozone-platform=x11"; + wireguard-import = "nmcli connection import type wireguard file"; + + notes = "nvim ~/notes/index.md --cmd 'cd ~/notes' -c ':lua Snacks.picker.smart()'"; + note = "notes"; + tmp = "nvim /tmp/$(date | sed 's/ //g;s/\\.//g').md"; + + nix-shell = "nix-shell --command zsh"; + + # git + g = "lazygit"; + ga = "git add"; + gc = "git commit"; + gcu = "git add . && git commit -m 'Update'"; + gp = "git push"; + gpl = "git pull"; + gs = "git status"; + gd = "git diff"; + gco = "git checkout"; + gcb = "git checkout -b"; + gbr = "git branch"; + grs = "git reset HEAD~1"; + grh = "git reset --hard HEAD~1"; + + gaa = "git add ."; + gcm = "git commit -m"; + }; + + initContent = + # bash + '' + bindkey -v + export KEYTIMEOUT=1 + + ${ + if fetch == "neofetch" then + pkgs.neofetch + "/bin/neofetch" + else if fetch == "nerdfetch" then + "nerdfetch" + else if fetch == "pfetch" then + "echo; ${pkgs.pfetch}/bin/pfetch" + else + "" + } + + function sesh-sessions() { + session=$(sesh list -t -c | fzf --height 70% --reverse) + [[ -z "$session" ]] && return + sesh connect $session + } + + function chatgptfolder(){ + echo "################################" + echo "### TREE ###" + echo "################################" + ${pkgs.eza}/bin/eza --tree -aF --icons never + echo -e "\n\n" + echo "##############################" + echo "### CONTENT ###" + echo "##############################" + find . -type f -not -path '*/.git/*' -print0 | while IFS= read -r -d "" file; do + echo -e "\n--- DEBUT: $file ---\n" + cat "$file" + echo -e "\n--- FIN: $file ---\n" + done + } + + + function n4c() { + category=''${1:-all} + shift + args=''${*} + nix develop "github:nix4cyber/n4c#''${category}" ''${args} -c zsh + } + + zle -N sesh-sessions + bindkey -M emacs '\es' sesh-sessions + bindkey -M vicmd '\es' sesh-sessions + bindkey -M viins '\es' sesh-sessions + + # search history based on what's typed in the prompt + autoload -U history-search-end + zle -N history-beginning-search-backward-end history-search-end + zle -N history-beginning-search-forward-end history-search-end + bindkey "^[OA" history-beginning-search-backward-end + bindkey "^[OB" history-beginning-search-forward-end + + # General completion behavior + zstyle ':completion:*' completer _extensions _complete _approximate + + # Use cache + zstyle ':completion:*' use-cache on + zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache" + + # Complete the alias + zstyle ':completion:*' complete true + + # Autocomplete options + zstyle ':completion:*' complete-options true + + # Completion matching control + zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + zstyle ':completion:*' keep-prefix true + + # Group matches and describe + zstyle ':completion:*' menu select + zstyle ':completion:*' list-grouped false + zstyle ':completion:*' list-separator ''' + zstyle ':completion:*' group-name ''' + zstyle ':completion:*' verbose yes + zstyle ':completion:*:matches' group 'yes' + zstyle ':completion:*:warnings' format '%F{red}%B-- No match for: %d --%b%f' + zstyle ':completion:*:messages' format '%d' + zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' + zstyle ':completion:*:descriptions' format '[%d]' + + # Colors + zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} + + # case insensitive tab completion + zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories + zstyle ':completion:*:*:cd:*:directory-stack' menu yes select + zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand' + zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands + zstyle ':completion:*' special-dirs true + zstyle ':completion:*' squeeze-slashes true + + # Sort + zstyle ':completion:*' sort false + zstyle ":completion:*:git-checkout:*" sort false + zstyle ':completion:*' file-sort modification + zstyle ':completion:*:eza' sort false + zstyle ':completion:complete:*:options' sort false + zstyle ':completion:files' sort false + + ${lib.optionalString config.services.gpg-agent.enable '' + gnupg_path=$(ls $XDG_RUNTIME_DIR/gnupg) + export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/$gnupg_path/S.gpg-agent.ssh" + ''} + + # Allow foot to pipe command output + function precmd { + if ! builtin zle; then + print -n "\e]133;D\e\\" + fi + } + function preexec { + print -n "\e]133;C\e\\" + } + + ''; + }; +} diff --git a/home/programs/spicetify/default.nix b/home/programs/spicetify/default.nix new file mode 100644 index 0000000..f685aee --- /dev/null +++ b/home/programs/spicetify/default.nix @@ -0,0 +1,44 @@ +# Spicetify is a spotify client customizer +{ + pkgs, + config, + lib, + inputs, + ... +}: +let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; + accent = "${config.lib.stylix.colors.base0D}"; + background = "${config.lib.stylix.colors.base00}"; +in +{ + imports = [ inputs.spicetify-nix.homeManagerModules.default ]; + + stylix.targets.spicetify.enable = false; + + programs.spicetify = { + enable = true; + theme = lib.mkForce spicePkgs.themes.dribbblish; + + colorScheme = "custom"; + + customColorScheme = { + button = accent; + button-active = accent; + tab-active = accent; + player = background; + main = background; + sidebar = background; + }; + + enabledExtensions = with spicePkgs.extensions; [ + playlistIcons + lastfm + historyShortcut + hidePodcasts + adblock + fullAppDisplay + keyboardShortcut + ]; + }; +} diff --git a/home/programs/tailscale/default.nix b/home/programs/tailscale/default.nix new file mode 100644 index 0000000..e2c1471 --- /dev/null +++ b/home/programs/tailscale/default.nix @@ -0,0 +1,7 @@ +# Tailscale is a VPN service that works on top of WireGuard. +# It allows me to access my servers and devices from anywhere. +{inputs, ...}: { + home.packages = with inputs.nixpkgs-stable.legacyPackages.x86_64-linux; [tailscale tailscale-systray]; + + # wayland.windowManager.hyprland.settings.exec-once = ["${pkgs.tailscale-systray}/bin/tailscale-systray"]; +} diff --git a/home/programs/thunar/default.nix b/home/programs/thunar/default.nix new file mode 100644 index 0000000..8e2a8f8 --- /dev/null +++ b/home/programs/thunar/default.nix @@ -0,0 +1,137 @@ +# Thunar is a file explorer +{ + pkgs, + config, + ... +}: let + user = config.var.username; +in { + # ctrl + m to toggle the menubar + home.packages = with pkgs; [ + xfce.thunar + xfce.xfconf + xfce.tumbler + xfce.thunar-archive-plugin + xfce.thunar-volman + xfce.thunar-media-tags-plugin + p7zip + xarchiver + ]; + + gtk = { + iconTheme = { + name = "WhiteSur"; + package = pkgs.whitesur-icon-theme.override { + boldPanelIcons = true; + alternativeIcons = true; + }; + }; + }; + + home.sessionVariables = { + XDG_ICON_DIR = "${pkgs.whitesur-icon-theme}/share/icons/WhiteSur"; + }; + + # bookmarks for the side pane + gtk.gtk3.bookmarks = [ + "file:///home/${user}/Downloads Downloads" + "file:///home/${user}/Pictures Pictures" + "file:///home/${user}/.config/nixos NixOS" + "file:///home/${user}/dev Development" + ]; + + home.file.".config/xarchiver/xarchiverrc".text = '' + [xarchiver] + preferred_format=0 + prefer_unzip=true + confirm_deletion=true + sort_filename_content=false + advanced_isearch=true + auto_expand=true + store_output=false + icon_size=2 + show_archive_comment=false + show_sidebar=true + show_location_bar=true + show_toolbar=true + preferred_custom_cmd= + preferred_temp_dir=/tmp + preferred_extract_dir=/home/${user}/Downloads + allow_sub_dir=0 + ensure_directory=true + overwrite=false + full_path=2 + touch=false + fresh=false + update=false + store_path=false + updadd=true + freshen=false + recurse=true + solid_archive=false + remove_files=false + ''; + + home.file.".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml".text = '' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''; + + xdg.configFile."Thunar/uca.xml".text = '' + + + + utilities-terminal + Open Terminal Here + 1700000000000001 + kitty -d %f + Opens Kitty terminal in the selected folder + * + + + + + + Extract here + + 1689618425925956-3 + xarchiver -x . %f + Extracts the archive into the directory it is located in. + * + *.tar.bz2;*.tar.gz;*.tar.xz;*.tar.Z;*.tar;*.taz;*.tb2;*.tbz;*.tbz2;*.tgz;*.txz;*.zip;*.bz2;*.docx;*.apk;*.gz;*.odt; + + + + ''; +} diff --git a/home/programs/thunderbird/default.nix b/home/programs/thunderbird/default.nix new file mode 100644 index 0000000..3f691ad --- /dev/null +++ b/home/programs/thunderbird/default.nix @@ -0,0 +1,87 @@ +{ + accounts.email.accounts = { + Main = { + enable = true; + address = "mail@jelles.net"; + imap = { + authentication = "plain"; + host = "taylor.mxrouting.net"; + port = 993; + tls.enable = true; + }; + #passwordCommand = "rbw get \"Main E-Mail\""; #NOTE: Does not work for thunderbird + primary = true; + realName = "Jelle Spreeuwenberg"; + smtp = { + authentication = "plain"; + host = "taylor.mxrouting.net"; + port = 465; + tls.enable = true; + }; + thunderbird = { + enable = true; + }; + userName = "mail@jelles.net"; + }; + + Old = { + enable = true; + address = "mail@jellespreeuwenberg.nl"; + imap = { + authentication = "plain"; + host = "taylor.mxrouting.net"; + port = 993; + tls.enable = true; + }; + realName = "Jelle Spreeuwenberg"; + smtp = { + authentication = "plain"; + host = "taylor.mxrouting.net"; + port = 465; + tls.enable = true; + }; + thunderbird = { + enable = true; + }; + userName = "mail@jellespreeuwenberg.nl"; + }; + + Uni = { + # TODO: Thunderbird automatically uses normal password authentication instead of oauth, you have to manually change it + enable = true; + flavor = "outlook.office365.com"; + address = "j.spreeuwenberg@student.tue.nl"; + realName = "Jelle Spreeuwenberg"; + thunderbird = { + enable = true; + }; + userName = "j.spreeuwenberg@student.tue.nl"; + }; + + Work = { + # TODO: Thunderbird automatically uses normal password authentication instead of oauth, you have to manually change it + enable = true; + flavor = "outlook.office365.com"; + address = "jelle.spreeuwenberg@yookr.org"; + realName = "Jelle Spreeuwenberg"; + thunderbird = { + enable = true; + }; + userName = "jelle.spreeuwenberg@yookr.org"; + }; + }; + accounts.email.maildirBasePath = ".local/share/mail"; + + programs.thunderbird = { + enable = true; + profiles.default = { + accountsOrder = [ + "Main" + "Old" + "Uni" + "Work" + ]; + isDefault = true; + }; + }; +} diff --git a/home/programs/zen-browser/default.nix b/home/programs/zen-browser/default.nix new file mode 100644 index 0000000..fd46adc --- /dev/null +++ b/home/programs/zen-browser/default.nix @@ -0,0 +1,8 @@ +{ inputs, ... }: +{ + imports = [ + inputs.zen-browser.homeModules.twilight + ]; + + programs.zen-browser.enable = true; +} diff --git a/home/scripts/brightness/default.nix b/home/scripts/brightness/default.nix new file mode 100644 index 0000000..10d6ee6 --- /dev/null +++ b/home/scripts/brightness/default.nix @@ -0,0 +1,36 @@ +# - ## Brightness +#- +#- This module provides a set of scripts to control the brightness of the screen. +#- +#- - `brightness-up` increases the brightness by 5%. +#- - `brightness-down` decreases the brightness by 5%. +#- - `brightness-set [value]` sets the brightness to the given value. +#- - `brightness-change [up|down] [value]` increases or decreases the brightness by the given value. +{pkgs, ...}: let + increments = "5"; + + brightness-change = pkgs.writeShellScriptBin "brightness-change" '' + [[ $1 == "up" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%+ + [[ $1 == "down" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%- + ''; + + brightness-set = pkgs.writeShellScriptBin "brightness-set" '' + ${pkgs.brightnessctl}/bin/brightnessctl set ''${1-100}% + ''; + + brightness-up = pkgs.writeShellScriptBin "brightness-up" '' + brightness-change up ${increments} + ''; + + brightness-down = pkgs.writeShellScriptBin "brightness-down" '' + brightness-change down ${increments} + ''; +in { + home.packages = [ + pkgs.brightnessctl + brightness-change + brightness-up + brightness-down + brightness-set + ]; +} diff --git a/home/scripts/caffeine/default.nix b/home/scripts/caffeine/default.nix new file mode 100644 index 0000000..8941223 --- /dev/null +++ b/home/scripts/caffeine/default.nix @@ -0,0 +1,26 @@ +# - ## Caffeine +#- +#- Caffeine is a simple script that toggles hypridle (disable suspend & screenlock). +#- +#- - `caffeine-status` - Check if hypridle is running. (0/1) +#- - `caffeine-status-icon` - Check if hypridle is running. (icon) +#- - `caffeine` - Toggle hypridle. +{pkgs, ...}: let + caffeine-status = pkgs.writeShellScriptBin "caffeine-status" '' + [[ $(pidof "hypridle") ]] && echo "0" || echo "1" + ''; + + caffeine-status-icon = pkgs.writeShellScriptBin "caffeine-status-icon" '' + [[ $(pidof "hypridle") ]] && echo "󰾪" || echo "󰅶" + ''; + + caffeine = pkgs.writeShellScriptBin "caffeine" '' + if [[ $(pidof "hypridle") ]]; then + systemctl --user stop hypridle.service + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Caffeine On" --custom-icon="emblem-default" + else + systemctl --user start hypridle.service + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Caffeine Off" --custom-icon="emblem-default" + fi + ''; +in {home.packages = [caffeine-status caffeine caffeine-status-icon];} diff --git a/home/scripts/default.nix b/home/scripts/default.nix new file mode 100644 index 0000000..f8b36f7 --- /dev/null +++ b/home/scripts/default.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ./nixy + ./sounds + ./brightness + ./caffeine + ./hyprpanel + ./hyprfocus + ./night-shift + ./screenshot + ./nerdfont-fzf + ./notification + ./system + ]; +} diff --git a/home/scripts/hyprfocus/default.nix b/home/scripts/hyprfocus/default.nix new file mode 100644 index 0000000..3dfb55b --- /dev/null +++ b/home/scripts/hyprfocus/default.nix @@ -0,0 +1,52 @@ +# - ## Hyprfocus +#- +#- A simple script to toggle focus on few windows in Hyprland. +#- (disable gaps, border, shadow, opacity, etc.) +#- +#- - `hyprfocus-on` - Enable hyprfocus. +#- - `hyprfocus-off` - Disable hyprfocus. +#- - `hyprfocus-toggle` - Toggle hyprfocus. +{pkgs, ...}: let + hyprfocus-on = + pkgs.writeShellScriptBin "hyprfocus-on" + # bash + '' + hyprpanel-hide + + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword decoration:shadow:enabled 0;\ + keyword decoration:blur:enabled 0;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0;\ + keyword decoration:inactive_opacity 1;\ + keyword decoration:active_opacity 1" + + echo "1" > /tmp/hyprfocus + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Hyprfocus On" --custom-icon="emblem-default" + ''; + + hyprfocus-off = + pkgs.writeShellScriptBin "hyprfocus-off" + # bash + '' + hyprctl reload + hyprpanel-show + rm /tmp/hyprfocus + + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Hyprfocus Off" --custom-icon="emblem-default" + ''; + + hyprfocus-toggle = + pkgs.writeShellScriptBin "hyprfocus-toggle" + # bash + '' + if [ -f /tmp/hyprfocus ]; then + hyprfocus-off + else + hyprfocus-on + fi + ''; +in {home.packages = [hyprfocus-on hyprfocus-off hyprfocus-toggle];} diff --git a/home/scripts/hyprpanel/default.nix b/home/scripts/hyprpanel/default.nix new file mode 100644 index 0000000..ecd443f --- /dev/null +++ b/home/scripts/hyprpanel/default.nix @@ -0,0 +1,45 @@ +# - ## Hyprpanel +#- +#- Quick scripts to toggle, reload, hide & show hyprpanel. +#- +#- - `hyprpanel-toggle` - Toggle hyprpanel (hide/show). +#- - `hyprpanel-show` - Show hyprpanel. +#- - `hyprpanel-hide` - Hide hyprpanel. +#- - `hyprpanel-reload` - Reload hyprpanel. +{pkgs, ...}: let + hyprpanel-toggle = pkgs.writeShellScriptBin "hyprpanel-toggle" '' + hyprpanel toggleWindow bar-0 + hyprpanel toggleWindow bar-1 + hyprpanel toggleWindow bar-2 + hyprpanel toggleWindow bar-3 + ''; + + hyprpanel-hide = pkgs.writeShellScriptBin "hyprpanel-hide" '' + status=$(hyprpanel isWindowVisible bar-0) + if [[ $status == "true" ]]; then + hyprpanel toggleWindow bar-0 + fi + status=$(hyprpanel isWindowVisible bar-1) + if [[ $status == "true" ]]; then + hyprpanel toggleWindow bar-1 + fi + ''; + + hyprpanel-show = pkgs.writeShellScriptBin "hyprpanel-show" '' + status=$(hyprpanel isWindowVisible bar-0) + if [[ $status == "false" ]]; then + hyprpanel toggleWindow bar-0 + fi + status=$(hyprpanel isWindowVisible bar-1) + if [[ $status == "false" ]]; then + hyprpanel toggleWindow bar-1 + fi + ''; + + hyprpanel-reload = pkgs.writeShellScriptBin "hyprpanel-reload" '' + [ $(pgrep "hyprpanel") ] && pkill hyprpanel + hyprctl dispatch exec hyprpanel + ''; +in { + home.packages = [hyprpanel-toggle hyprpanel-reload hyprpanel-hide hyprpanel-show]; +} diff --git a/home/scripts/nerdfont-fzf/default.nix b/home/scripts/nerdfont-fzf/default.nix new file mode 100644 index 0000000..6066ece --- /dev/null +++ b/home/scripts/nerdfont-fzf/default.nix @@ -0,0 +1,31 @@ +# - ## Nerdfont FZF +#- +#- This module provides a script to search for Nerd Fonts icons using fzf. +#- +#- - `nerdfont-fzf` - Search for Nerd Fonts icons using fzf. +{ + pkgs, + config, + ... +}: let + nerdfont-fzf = pkgs.writeShellScriptBin "nerdfont-fzf" '' + icons=$(${pkgs.jq}/bin/jq -r 'to_entries[] | "\(.key):\(.value.char)"' "/home/${config.var.username}/.config/nerdfont_glyphnames.json" | awk -F: '{print "\033[95m "$2" \033[0m "$1}') + fzf_result=$(echo "$icons" | ${pkgs.fzf}/bin/fzf --ansi --border none | awk '{print $1}') + if [ -z "$fzf_result" ]; then + echo "No icon selected" + exit 1 + fi + + echo "Copied to clipboard: $fzf_result" + ${pkgs.wl-clipboard}/bin/wl-copy "$fzf_result" + ''; +in { + home.packages = [nerdfont-fzf]; + + xdg.configFile."nerdfont_glyphnames.json" = { + source = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/384b1825ea0037b0314f7f9c660a80c1ecdb219a/glyphnames.json"; + hash = "sha256-Ps0dyFcMs51RMTthBOVSOf/lafPV/53JxuNSKlmZ7cc="; + }; + }; +} diff --git a/home/scripts/night-shift/default.nix b/home/scripts/night-shift/default.nix new file mode 100644 index 0000000..1c6ca82 --- /dev/null +++ b/home/scripts/night-shift/default.nix @@ -0,0 +1,71 @@ +# - ## Night-Shift +#- +#- Night-Shift is a feature that reduces the amount of blue light emitted by your screen, which can help reduce eye strain and improve sleep quality. This module provides a set of scripts to control Night-Shift on your system. +#- It use hyprsunset to control the screen temperature. +#- +#- - `night-shift-on` activates Night-Shift. +#- - `night-shift-off` deactivates Night-Shift. +#- - `night-shift` toggles Night-Shift. +#- - `night-shift-status` checks if Night-Shift is active. (0/1) +#- - `night-shift-status-icon` checks if Night-Shift is active. (icon) +{pkgs, ...}: let + value = "4500"; # Default value for night-shift temperature + + night-shift-on = + pkgs.writeShellScriptBin "night-shift-on" + # bash + '' + ${pkgs.hyprsunset}/bin/hyprsunset -t ${value} & + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Night-Shift On" --custom-icon="emblem-default" + ''; + + night-shift-off = + pkgs.writeShellScriptBin "night-shift-off" + # bash + '' + pkill hyprsunset + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Night-Shift Off" --custom-icon="emblem-default" + ''; + + night-shift = + pkgs.writeShellScriptBin "night-shift" + # bash + '' + if pidof "hyprsunset"; then + night-shift-off + else + night-shift-on + fi + ''; + + night-shift-status = + pkgs.writeShellScriptBin "night-shift-status" + # bash + '' + if pidof "hyprsunset"; then + echo "1" + else + echo "0" + fi + ''; + + night-shift-status-icon = + pkgs.writeShellScriptBin "night-shift-status-icon" + # bash + '' + if pidof "hyprsunset"; then + echo "󰖔" + else + echo "󰖕" + fi + ''; +in { + home.packages = [ + pkgs.hyprsunset + night-shift-on + night-shift-off + night-shift + night-shift-status + night-shift-status-icon + ]; +} diff --git a/home/scripts/nixy/default.nix b/home/scripts/nixy/default.nix new file mode 100644 index 0000000..51f1c13 --- /dev/null +++ b/home/scripts/nixy/default.nix @@ -0,0 +1,77 @@ +# - ## Nixy +#- +#- Nixy is a simple script that I use to manage my NixOS system. It's a simple script that provides a menu to rebuild, test, update, collect garbage, clean boot menu, etc. +#- +#- - `nixy` - UI wizard to manage the system. +#- - `nixy rebuild` - Rebuild the system. +#- - `nixy ...` - ... see the script for more commands. +{ pkgs, config, ... }: +let + configDirectory = config.var.configDirectory; + + nixy = pkgs.writeShellScriptBin "nixy" + # bash + '' + function exec() { + $@ + } + + function ui(){ + DEFAULT_ICON="󰘳" + + # "icon;name;command"[] + apps=( + "󰑓;Rebuild;nixy rebuild" + "󰐊;Test;nixy test" + "󰚰;Update;nixy update" + ";Collect Garbage;nixy gc" + "󰍜;Clean Boot Menu;nixy cb" + ";List generation;nixy listgen" + "󰌌;Hyprland Keybindings;nvim ${configDirectory}/docs/KEYBINDINGS-HYPRLAND.md" + "󰋩;Wallpapers;zen https://github.com/anotherhadi/nixy-wallpapers" + ) + + # Apply default icons if empty: + for i in "''${!apps[@]}"; do + apps[i]=$(echo "''${apps[i]}" | sed 's/^;/'$DEFAULT_ICON';/') + done + + fzf_result=$(printf "%s\n" "''${apps[@]}" | awk -F ';' '{print $1" "$2}' | fzf) + [[ -z $fzf_result ]] && exit 0 + fzf_result=''${fzf_result/ /;} + line=$(printf "%s\n" "''${apps[@]}" | grep "$fzf_result") + command=$(echo "$line" | sed 's/^[^;]*;//;s/^[^;]*;//') + + exec "$command" + exit $? + } + + [[ $1 == "" ]] && ui + + if [[ $1 == "rebuild" ]];then + cd ${configDirectory} && git add . && sudo nixos-rebuild switch --flake + elif [[ $1 == "test" ]];then + cd ${configDirectory} && git add . && sudo nixos-rebuild test --flake + elif [[ $1 == "update" ]];then + cd ${configDirectory} && nix flake update + elif [[ $1 == "gc" ]];then + echo "Starting Nix garbage collection..." + cd ${configDirectory} && \ + echo "Cleaning up system garbage..." && \ + sudo nix-collect-garbage -d && \ + echo "Cleaning up user garbage..." && \ + nix-collect-garbage -d && \ + echo "Collecting garbage from Nix store..." && \ + nix-store --gc && \ + echo "Optimizing Nix store..." && \ + nix-store --optimise + echo "Nix garbage collection complete." + elif [[ $1 == "cb" ]];then + sudo /run/current-system/bin/switch-to-configuration boot + elif [[ $1 == "listgen" ]];then + sudo nix-env -p /nix/var/nix/profiles/system --list-generations + else + echo "Unknown argument" + fi + ''; +in { home.packages = [ nixy ]; } diff --git a/home/scripts/notification/default.nix b/home/scripts/notification/default.nix new file mode 100644 index 0000000..9b813ac --- /dev/null +++ b/home/scripts/notification/default.nix @@ -0,0 +1,31 @@ +# - ## Notif +#- +# This file provides a script to send custom notifications using `notify-send`. +#- +#- - `notif {id} {title} {description}` - Sends a notification +{pkgs, ...}: let + notif = + pkgs.writeShellScriptBin "notif" # bash + + '' + # Shell script to send custom notifications + # Usage: notif "sender_id" "message" ["description"] + NOTIF_FOLDER="/tmp/notif" + sender_id=$1 # To overwrite existing notifications + title=$2 + description=$3 + + [[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER + [[ -f "$NOTIF_FOLDER/$sender_id" ]] || (echo "0" > "$NOTIF_FOLDER/$sender_id") + + old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id") + [[ -z "$old_notification_id" ]] && old_notification_id=0 + + ${pkgs.libnotify}/bin/notify-send \ + --replace-id="$old_notification_id" --print-id \ + --app-name="$sender_id" \ + "$title" \ + "$description" \ + > "$NOTIF_FOLDER/$sender_id" + ''; +in {home.packages = [pkgs.libnotify notif];} diff --git a/home/scripts/screenshot/default.nix b/home/scripts/screenshot/default.nix new file mode 100644 index 0000000..78ebb11 --- /dev/null +++ b/home/scripts/screenshot/default.nix @@ -0,0 +1,32 @@ +# - ## Screenshot +#- +#- This module provides a script to take screenshots using `grimblast` and `swappy`. +#- +#- - `screenshot [region|window|monitor] [swappy]` - Take a screenshot of the region, window, or monitor. Optionally, use `swappy` to copy the screenshot to the clipboard. +{pkgs, ...}: let + screenshot = pkgs.writeShellScriptBin "screenshot" '' + if [[ $2 == "swappy" ]];then + folder="/tmp" + else + folder="$HOME/Pictures" + fi + filename="$(date +%Y-%m-%d_%H:%M:%S).png" + + if [[ $1 == "window" ]];then + mode="active" + elif [[ $1 == "region" ]];then + mode="area" + elif [[ $1 == "monitor" ]];then + mode="output" + fi + + ${pkgs.grimblast}/bin/grimblast --notify --freeze copysave $mode "$folder/$filename" || exit 1 + + if [[ $2 == "swappy" ]];then + ${pkgs.swappy}/bin/swappy -f "$folder/$filename" -o "$HOME/Pictures/$filename" + exit 0 + fi + ''; +in { + home.packages = [ screenshot pkgs.grim pkgs.grimblast ]; +} diff --git a/home/scripts/sounds/default.nix b/home/scripts/sounds/default.nix new file mode 100644 index 0000000..3d8ef1c --- /dev/null +++ b/home/scripts/sounds/default.nix @@ -0,0 +1,36 @@ +# - ## Sound +#- +#- This module provides a set of scripts to control the volume of the default audio sink using `wpctl`. +#- +#- - `sound-up` increases the volume by 5%. +#- - `sound-down` decreases the volume by 5%. +#- - `sound-set [value]` sets the volume to the given value. +#- - `sound-toggle` toggles the mute state of the default audio sink. +{pkgs, ...}: let + increments = "5"; + + sound-change = pkgs.writeShellScriptBin "sound-change" '' + [[ $1 == "mute" ]] && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + [[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%+ + [[ $1 == "down" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%- + [[ $1 == "set" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-100}% + ''; + + sound-up = pkgs.writeShellScriptBin "sound-up" '' + sound-change up ${increments} + ''; + + sound-set = pkgs.writeShellScriptBin "sound-set" '' + sound-change set ''${1-100} + ''; + + sound-down = pkgs.writeShellScriptBin "sound-down" '' + sound-change down ${increments} + ''; + + sound-toggle = pkgs.writeShellScriptBin "sound-toggle" '' + sound-change mute + ''; +in { + home.packages = [sound-change sound-up sound-down sound-toggle sound-set]; +} diff --git a/home/scripts/system/default.nix b/home/scripts/system/default.nix new file mode 100644 index 0000000..b37dcf4 --- /dev/null +++ b/home/scripts/system/default.nix @@ -0,0 +1,69 @@ +# - ## System +#- +#- Usefull quick scripts +#- +#- - `lock` - Lock the screen. (hyprlock) +#- - `powermode-toggle` - Toggle between performance and balanced power mode. (powerprofilesctl) +{pkgs, ...}: let + menu = + pkgs.writeShellScriptBin "menu" + # bash + '' + if pgrep wofi; then + pkill wofi + else + wofi -p "Apps" --show drun + fi + ''; + powermenu = + pkgs.writeShellScriptBin "powermenu" + # bash + '' + if pgrep wofi >/dev/null; then + pkill wofi + exit 0 + fi + + declare -A actions=( + ["󰌾 Lock"]="hyprlock" + ["󰍃 Logout"]="hyprctl dispatch exit" + [" Suspend"]="systemctl suspend" + ["󰑐 Reboot"]="systemctl reboot" + ["󰿅 Shutdown"]="systemctl poweroff" + ) + + selected_option=$( + printf '%s\n' "''${!actions[@]}" | wofi -p "Powermenu" --dmenu + ) + + if [[ -n "$selected_option" ]]; then + + action_command=''${actions["''$selected_option"]} + + if [[ -n "$action_command" ]]; then + eval "$action_command" + fi + fi + ''; + + lock = + pkgs.writeShellScriptBin "lock" + # bash + '' + ${pkgs.hyprlock}/bin/hyprlock + ''; + + powermode-toggle = + pkgs.writeShellScriptBin "powermode-toggle" + # bash + '' + current_profile=$(powerprofilesctl get) + if [ "$current_profile" = "performance" ]; then + powerprofilesctl set balanced + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Powermode set to balanced" --custom-icon="emblem-default" + else + powerprofilesctl set performance + ${pkgs.swayosd}/bin/swayosd-client --custom-message="Powermode set to performance" --custom-icon="emblem-default" + fi + ''; +in {home.packages = [lock powermode-toggle menu powermenu];} diff --git a/home/system/ashell/default.nix b/home/system/ashell/default.nix new file mode 100644 index 0000000..a7c49ae --- /dev/null +++ b/home/system/ashell/default.nix @@ -0,0 +1,30 @@ +{ + programs.ashell = { + enable = true; + settings = { + modules = { + center = [ + "Window Title" + ]; + + left = [ + "Workspaces" + ]; + + right = [ + "SystemInfo" + [ + "Clock" + "Privacy" + "Settings" + ] + ]; + }; + workspaces = { + visibilityMode = "MonitorSpecific"; + }; + }; + + systemd.enable = true; + }; +} diff --git a/home/system/hypridle/default.nix b/home/system/hypridle/default.nix new file mode 100644 index 0000000..63089b3 --- /dev/null +++ b/home/system/hypridle/default.nix @@ -0,0 +1,32 @@ +# Hypridle is a daemon that listens for user activity and runs commands when the user is idle. +{ + pkgs, + lib, + ... +}: { + services.hypridle = { + enable = true; + settings = { + general = { + ignore_dbus_inhibit = false; + lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + }; + + listener = [ + { + timeout = 600; + on-timeout = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + } + + { + timeout = 660; + on-timeout = "systemctl suspend"; + } + ]; + }; + }; + systemd.user.services.hypridle.Unit.After = + lib.mkForce "graphical-session.target"; +} diff --git a/home/system/hyprland/animations.nix b/home/system/hyprland/animations.nix new file mode 100644 index 0000000..a0a3952 --- /dev/null +++ b/home/system/hyprland/animations.nix @@ -0,0 +1,52 @@ +{config, ...}: let + animationSpeed = config.theme.animation-speed; + + animationDuration = + if animationSpeed == "slow" + then "4" + else if animationSpeed == "medium" + then "2.5" + else "1.5"; + borderDuration = + if animationSpeed == "slow" + then "10" + else if animationSpeed == "medium" + then "6" + else "3"; +in { + wayland.windowManager.hyprland.settings = { + animations = { + enabled = true; + bezier = [ + "linear, 0, 0, 1, 1" + "md3_standard, 0.2, 0, 0, 1" + "md3_decel, 0.05, 0.7, 0.1, 1" + "md3_accel, 0.3, 0, 0.8, 0.15" + "overshot, 0.05, 0.9, 0.1, 1.1" + "crazyshot, 0.1, 1.5, 0.76, 0.92" + "hyprnostretch, 0.05, 0.9, 0.1, 1.0" + "menu_decel, 0.1, 1, 0, 1" + "menu_accel, 0.38, 0.04, 1, 0.07" + "easeInOutCirc, 0.85, 0, 0.15, 1" + "easeOutCirc, 0, 0.55, 0.45, 1" + "easeOutExpo, 0.16, 1, 0.3, 1" + "softAcDecel, 0.26, 0.26, 0.15, 1" + "md2, 0.4, 0, 0.2, 1" + ]; + + animation = [ + "windows, 1, ${animationDuration}, md3_decel, popin 60%" + "windowsIn, 1, ${animationDuration}, md3_decel, popin 60%" + "windowsOut, 1, ${animationDuration}, md3_accel, popin 60%" + "border, 1, ${borderDuration}, default" + "fade, 1, ${animationDuration}, md3_decel" + "layersIn, 1, ${animationDuration}, menu_decel, slide" + "layersOut, 1, ${animationDuration}, menu_accel" + "fadeLayersIn, 1, ${animationDuration}, menu_decel" + "fadeLayersOut, 1, ${animationDuration}, menu_accel" + "workspaces, 1, ${animationDuration}, menu_decel, slide" + "specialWorkspace, 1, ${animationDuration}, md3_decel, slidevert" + ]; + }; + }; +} diff --git a/home/system/hyprland/bindings.nix b/home/system/hyprland/bindings.nix new file mode 100644 index 0000000..f3cb80b --- /dev/null +++ b/home/system/hyprland/bindings.nix @@ -0,0 +1,75 @@ +{ pkgs, ... }: +{ + wayland.windowManager.hyprland.settings = { + bind = [ + "$mod, return, exec, uwsm app -- ${pkgs.kitty}/bin/kitty" # Ghostty (terminal) + #"$mod,E, exec, uwsm app -- ${pkgs.xfce.thunar}/bin/thunar" # Thunar + "$mod, b, exec, uwsm app -- ${pkgs.brave}/bin/brave" # Brave Browser + "$mod, m, exec, uwsm app -- ${pkgs.thunderbird}/bin/thunderbird" # Proton Mail + #"$mod,L, exec, uwsm app -- ${pkgs.hyprlock}/bin/hyprlock" # Lock + "$mod, space, exec, vicinae toggle" # Launcher FIXME: broken + #"$mod,X, exec, powermenu" # Powermenu + #"$mod, space, exec, menu" # Launcher + + "$shiftMod, space, exec, hyprfocus-toggle" # Toggle HyprFocus + + "$mod, q, killactive," # Close window + "$mod, t, togglefloating," # Toggle Floating + "$mod, f, fullscreen" # Toggle Fullscreen + + "$mod, j, layoutmsg, cyclenext" # Move focus Down + "$mod, k, layoutmsg, cycleprev" # Move focus Up + "$altMod, j, layoutmsg, swapnext" # Move focus Down + "$altMod, k, layoutmsg, swapprev" # Move focus Up + + "$mod, x, focusmonitor, +1" # Focus next monitor + "$altMod, x, movewindow, mon:+1" + "$altMod, h, layoutmsg, addmaster" # Add to master + "$altMod, l, layoutmsg, removemaster" # Remove from master + + "$mod, print, exec, screenshot region" # Screenshot region + ", PRINT, exec, screenshot monitor" # Screenshot monitor + + "$mod, w, workspace, 1" + "$mod, e, workspace, 2" + "$mod, r, workspace, 3" + "$mod, i, workspace, 11" + "$mod, o, workspace, 12" + "$mod, p, workspace, 13" + + "$altMod, w, movetoworkspace, 1" + "$altMod, e, movetoworkspace, 2" + "$altMod, r, movetoworkspace, 3" + "$altMod, i, movetoworkspace, 11" + "$altMod, o, movetoworkspace, 12" + "$altMod, p, movetoworkspace, 13" + + "$mod, z, togglespecialworkspace, scratchpad" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" # Move Window (mouse) + "$mod, mouse:274, resizewindow" # Resize Window (mouse) + ]; + + binde = [ + "$mod, h, layoutmsg, mfact -0.01" # Move focus left + "$mod, l, layoutmsg, mfact +0.01" # Move focus Right + ]; + + bindl = [ + ",XF86AudioMute, exec, sound-toggle" # Toggle Mute + ",XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" # Play/Pause Song + ",XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" # Next Song + ",XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous" # Previous Song + ",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock when closing Lid + ]; + + bindle = [ + ",XF86AudioRaiseVolume, exec, sound-up" # Sound Up + ",XF86AudioLowerVolume, exec, sound-down" # Sound Down + ",XF86MonBrightnessUp, exec, brightness-up" # Brightness Up + ",XF86MonBrightnessDown, exec, brightness-down" # Brightness Down + ]; + }; +} diff --git a/home/system/hyprland/default.nix b/home/system/hyprland/default.nix new file mode 100644 index 0000000..e085798 --- /dev/null +++ b/home/system/hyprland/default.nix @@ -0,0 +1,184 @@ +# Hyprland is a dynamic tiling Wayland compositor that is highly customizable and performant. +{ + pkgs, + config, + lib, + ... +}: +let + border-size = config.theme.border-size; + gaps-in = config.theme.gaps-in; + gaps-out = config.theme.gaps-out; + active-opacity = config.theme.active-opacity; + inactive-opacity = config.theme.inactive-opacity; + rounding = config.theme.rounding; + blur = config.theme.blur; + keyboardLayout = config.var.keyboardLayout; + background = "rgb(" + config.lib.stylix.colors.base00 + ")"; +in +{ + imports = [ + ./animations.nix + ./bindings.nix + ./polkitagent.nix + ]; + + home.packages = with pkgs; [ + qt5.qtwayland + qt6.qtwayland + libsForQt5.qt5ct + qt6Packages.qt6ct + hyprshot + hyprpicker + swappy + imv + wf-recorder + wlr-randr + wl-clipboard + brightnessctl + gnome-themes-extra + libva + dconf + wayland-utils + wayland-protocols + glib + direnv + meson + ]; + + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + systemd = { + enable = false; + variables = [ + "--all" + ]; # https://wiki.hyprland.org/Nix/Hyprland-on-Home-Manager/#programs-dont-work-in-systemd-services-but-do-on-the-terminal + }; + package = null; + portalPackage = null; + + settings = { + "$mod" = "SUPER"; + "$shiftMod" = "SUPER_SHIFT"; + "$altMod" = "SUPER_ALT"; + + exec-once = [ + "systemctl --user enable --now hyprpaper.service &" + ]; + + monitor = config.var.hyprland.monitor; + + env = [ + "XDG_CURRENT_DESKTOP,Hyprland" + "MOZ_ENABLE_WAYLAND,1" + "ANKI_WAYLAND,1" + "DISABLE_QT5_COMPAT,0" + "NIXOS_OZONE_WL,1" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "QT_AUTO_SCREEN_SCALE_FACTOR,1" + "QT_QPA_PLATFORM=wayland,xcb" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "ELECTRON_OZONE_PLATFORM_HINT,auto" + "__GL_GSYNC_ALLOWED,0" + "__GL_VRR_ALLOWED,0" + "DISABLE_QT5_COMPAT,0" + "DIRENV_LOG_FORMAT," + "WLR_DRM_NO_ATOMIC,1" + "WLR_BACKEND,vulkan" + "WLR_RENDERER,vulkan" + "WLR_NO_HARDWARE_CURSORS,1" + "SDL_VIDEODRIVER,wayland" + "CLUTTER_BACKEND,wayland" + ]; + + workspace = config.var.hyprland.workspace ++ [ + "special:scratchpad, on-created-empty:[float; size monitor_w/1.5 monitor_h/1.5; center] $TERMINAL" + ]; + + cursor = { + no_hardware_cursors = true; + default_monitor = "0"; + }; + + general = { + resize_on_border = true; + gaps_in = gaps-in; + gaps_out = gaps-out; + border_size = border-size; + layout = "master"; + "col.inactive_border" = lib.mkForce background; + }; + + decoration = { + dim_special = 0.3; + active_opacity = active-opacity; + inactive_opacity = inactive-opacity; + rounding = rounding; + shadow = { + enabled = true; + range = 20; + render_power = 3; + }; + blur = { + enabled = if blur then "true" else "false"; + size = 18; + }; + }; + + master = { + new_status = true; + allow_small_split = true; + mfact = 0.65; + }; + + misc = { + vfr = true; + disable_hyprland_logo = true; + disable_splash_rendering = true; + disable_autoreload = false; + focus_on_activate = true; + new_window_takes_over_fullscreen = 2; + }; + + windowrule = [ + "match:title hyprpanel-settings, float on" + "match:class xdg-desktop-portal-gtk, float on, center on, size monitor_w/2 monitor_h/2" + # Bitwarden extension + + # idle inhibit while watching videos + #"idleinhibit focus, class:^(mpv|.+exe|celluloid)$" + #"idleinhibit focus, class:^(zen)$, title:^(.*YouTube.*)$" + #"idleinhibit fullscreen, class:^(zen)$" + + #"dimaround, class:^(gcr-prompter)$" + #"dimaround, class:^(xdg-desktop-portal-gtk)$" + #"dimaround, class:^(polkit-gnome-authentication-agent-1)$" + #"dimaround, class:^(zen)$, title:^(File Upload)$" + ]; + + layerrule = [ + "match:namespace vicinae, no_anim on, blur on, ignore_alpha 0" + #"no_anim, launcher" + #"no_anim, ^ags-.*" + ]; + + input = { + kb_layout = keyboardLayout; + + kb_options = "caps:escape"; + follow_mouse = 1; + sensitivity = 0.5; + repeat_delay = 300; + repeat_rate = 50; + numlock_by_default = true; + + touchpad = { + natural_scroll = true; + clickfinger_behavior = true; + }; + }; + }; + }; +} diff --git a/home/system/hyprland/polkitagent.nix b/home/system/hyprland/polkitagent.nix new file mode 100644 index 0000000..221d359 --- /dev/null +++ b/home/system/hyprland/polkitagent.nix @@ -0,0 +1,6 @@ +# HyprPolkitAgent is a simple polkit agent for wayland compositors +{pkgs, ...}: { + home.packages = with pkgs; [hyprpolkitagent]; + + wayland.windowManager.hyprland.settings.exec-once = ["systemctl --user start hyprpolkitagent"]; +} diff --git a/home/system/hyprlock/default.nix b/home/system/hyprlock/default.nix new file mode 100644 index 0000000..e6313e7 --- /dev/null +++ b/home/system/hyprlock/default.nix @@ -0,0 +1,72 @@ +# Hyprlock is a lockscreen for Hyprland +{ config, lib, ... }: +let + foreground = "rgba(${config.theme.textColorOnWallpaper}ee)"; + font = config.stylix.fonts.serif.name; +in { + programs.hyprlock = { + enable = true; + settings = { + general = { + ignore_empty_input = true; + hide_cursor = true; + }; + + background = { brightness = 0.7172; }; + + label = [ + { + # Day-Month-Date + monitor = ""; + text = ''cmd[update:1000] echo -e "$(date +"%A, %B %d")"''; + color = foreground; + font_size = 28; + font_family = font + " Bold"; + position = "0, 490"; + halign = "center"; + valign = "center"; + } + # Time + { + monitor = ""; + text = ''cmd[update:1000] echo "$(date +"%I:%M")"''; + color = foreground; + font_size = 160; + font_family = "steelfish outline regular"; + position = "0, 370"; + halign = "center"; + valign = "center"; + } + # USER + { + monitor = ""; + text = " $USER"; + color = foreground; + font_size = 18; + font_family = font + " Bold"; + position = "0, -180"; + halign = "center"; + valign = "center"; + } + ]; + + # INPUT FIELD + input-field = lib.mkForce { + size = "300, 60"; + outline_thickness = 2; + dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true; + outer_color = "rgba(25, 25, 25, 0)"; + inner_color = "rgba(25, 25, 25, 0.1)"; + font_color = foreground; + fade_on_empty = false; + font_family = font + " Bold"; + placeholder_text = "🔒 Enter Password"; + position = "0, -250"; + halign = "center"; + valign = "center"; + }; + }; + }; +} diff --git a/home/system/hyprpanel/default.nix b/home/system/hyprpanel/default.nix new file mode 100644 index 0000000..4342ca2 --- /dev/null +++ b/home/system/hyprpanel/default.nix @@ -0,0 +1,249 @@ +# Hyprpanel is the bar on top of the screen +# Display information like workspaces, battery, wifi, ... +{ config, ... }: +let + transparentButtons = config.theme.bar.transparentButtons; + + accent = "#${config.lib.stylix.colors.base0D}"; + accent-alt = "#${config.lib.stylix.colors.base03}"; + background = "#${config.lib.stylix.colors.base00}"; + background-alt = "#${config.lib.stylix.colors.base01}"; + foreground = "#${config.lib.stylix.colors.base05}"; + foregroundOnWallpaper = "#${config.theme.textColorOnWallpaper}"; + font = "${config.stylix.fonts.serif.name}"; + fontSizeForHyprpanel = "${toString config.stylix.fonts.sizes.desktop}px"; + + rounding = config.theme.rounding; + border-size = config.theme.border-size; + + gaps-out = config.theme.gaps-out; + gaps-in = config.theme.gaps-in; + + floating = config.theme.bar.floating; + transparent = config.theme.bar.transparent; + position = config.theme.bar.position; # "top" ou "bottom" + + notificationOpacity = 90; + + location = config.var.location; + + homeDir = "/home/${config.var.username}"; +in +{ + wayland.windowManager.hyprland.settings.exec-once = [ "hyprpanel" ]; + + programs.hyprpanel = { + enable = true; + + settings = { + bar.layouts = { + "*" = { + left = [ + "dashboard" + "workspaces" + "windowtitle" + ]; + middle = [ + "media" + ]; + right = [ + "systray" + "volume" + "bluetooth" + "battery" + "network" + "clock" + "notifications" + ]; + }; + }; + + theme.font.name = font; + theme.font.size = fontSizeForHyprpanel; + + theme.bar.outer_spacing = if floating && transparent then "0px" else "8px"; + theme.bar.buttons.y_margins = if floating && transparent then "0px" else "8px"; + theme.bar.buttons.spacing = "0.3em"; + theme.bar.buttons.radius = + (if transparent then toString rounding else toString (rounding - 8)) + "px"; + theme.bar.floating = floating; + theme.bar.buttons.padding_x = "0.8rem"; + theme.bar.buttons.padding_y = "0.4rem"; + + theme.bar.margin_top = (if position == "top" then toString (gaps-in * 2) else "0") + "px"; + theme.bar.margin_bottom = (if position == "top" then "0" else toString (gaps-in * 2)) + "px"; + theme.bar.margin_sides = toString gaps-out + "px"; + theme.bar.border_radius = toString rounding + "px"; + theme.bar.transparent = transparent; + theme.bar.location = position; + theme.bar.dropdownGap = "4.5em"; + theme.bar.menus.shadow = if transparent then "0 0 0 0" else "0px 0px 3px 1px #16161e"; + theme.bar.buttons.style = "default"; + theme.bar.buttons.monochrome = true; + theme.bar.menus.monochrome = true; + theme.bar.menus.card_radius = toString rounding + "px"; + theme.bar.menus.border.size = toString border-size + "px"; + theme.bar.menus.border.radius = toString rounding + "px"; + theme.bar.menus.menu.media.card.tint = 90; + + bar.launcher.icon = ""; + bar.workspaces.show_numbered = false; + bar.workspaces.workspaces = 3; + bar.workspaces.numbered_active_indicator = "color"; + bar.workspaces.monitorSpecific = true; + bar.workspaces.applicationIconEmptyWorkspace = ""; + bar.workspaces.showApplicationIcons = true; + bar.workspaces.showWsIcons = true; + bar.workspaces.ignored = "-98"; # NOTE: Ignore special:scratchpad workspace. Hyprpanel only supports workspace numbers + #bar.workspaces.ignoredWorkspaces = "/scratchpad/i"; + #bar.workspaces.ignored_workspaces = "/scratchpad/i"; + + bar.windowtitle.label = true; + bar.volume.label = false; + bar.network.truncation_size = 12; + bar.bluetooth.label = false; + bar.clock.format = "%a %b %d %H:%M"; + bar.notifications.show_total = true; + bar.media.show_active_only = true; + + bar.customModules.updates.pollingInterval = 1440000; + + notifications.position = "top right"; + notifications.showActionsOnHover = true; + theme.notification.opacity = notificationOpacity; + theme.notification.enableShadow = true; + theme.notification.border_radius = toString rounding + "px"; + + theme.osd.enable = true; + theme.osd.orientation = "vertical"; + theme.osd.location = "left"; + theme.osd.radius = toString rounding + "px"; + theme.osd.margins = "0px 0px 0px 10px"; + theme.osd.muted_zero = true; + + menus.clock.weather.location = location; + menus.clock.weather.unit = "metric"; + menus.dashboard.powermenu.confirmation = false; + menus.dashboard.powermenu.avatar.image = "~/.face.icon"; + + menus.dashboard.shortcuts.left.shortcut1.icon = ""; + menus.dashboard.shortcuts.left.shortcut1.command = "zen"; + menus.dashboard.shortcuts.left.shortcut1.tooltip = "Zen"; + menus.dashboard.shortcuts.left.shortcut2.icon = "󰅶"; + menus.dashboard.shortcuts.left.shortcut2.command = "caffeine"; + menus.dashboard.shortcuts.left.shortcut2.tooltip = "Caffeine"; + menus.dashboard.shortcuts.left.shortcut3.icon = "󰖔"; + menus.dashboard.shortcuts.left.shortcut3.command = "night-shift"; + menus.dashboard.shortcuts.left.shortcut3.tooltip = "Night-shift"; + menus.dashboard.shortcuts.left.shortcut4.icon = ""; + menus.dashboard.shortcuts.left.shortcut4.command = "menu"; + menus.dashboard.shortcuts.left.shortcut4.tooltip = "Search Apps"; + + menus.dashboard.shortcuts.right.shortcut1.icon = ""; + menus.dashboard.shortcuts.right.shortcut1.command = "hyprpicker -a"; + menus.dashboard.shortcuts.right.shortcut1.tooltip = "Color Picker"; + + menus.dashboard.shortcuts.right.shortcut3.icon = "󰄀"; + menus.dashboard.shortcuts.right.shortcut3.command = "screenshot region swappy"; + menus.dashboard.shortcuts.right.shortcut3.tooltip = "Screenshot"; + + menus.dashboard.directories.left.directory1.label = " Home"; + menus.dashboard.directories.left.directory1.command = "xdg-open ${homeDir}"; + + menus.dashboard.directories.left.directory2.label = "󰲂 Documents"; + menus.dashboard.directories.left.directory2.command = "xdg-open ${homeDir}/Documents"; + + menus.dashboard.directories.left.directory3.label = "󰉍 Downloads"; + menus.dashboard.directories.left.directory3.command = "xdg-open ${homeDir}/Downloads"; + + menus.dashboard.directories.right.directory1.label = " Desktop"; + menus.dashboard.directories.right.directory1.command = "xdg-open ${homeDir}/Desktop"; + + menus.dashboard.directories.right.directory2.label = " Videos"; + menus.dashboard.directories.right.directory2.command = "xdg-open ${homeDir}/Videos"; + + menus.dashboard.directories.right.directory3.label = "󰉏 Pictures"; + menus.dashboard.directories.right.directory3.command = "xdg-open ${homeDir}/Pictures"; + + menus.power.lowBatteryNotification = true; + + wallpaper.enable = false; + + # theme.bar.buttons.workspaces.hover = accent-alt; + # theme.bar.buttons.workspaces.active = accent; + # theme.bar.buttons.workspaces.available = accent-alt; + # theme.bar.buttons.workspaces.occupied = accent-alt; + # + # theme.bar.menus.background = background; + # theme.bar.menus.cards = background-alt; + # theme.bar.menus.label = foreground; + # theme.bar.menus.text = foreground; + # theme.bar.menus.border.color = accent; + # theme.bar.menus.popover.text = foreground; + # theme.bar.menus.popover.background = background-alt; + # theme.bar.menus.listitems.active = accent; + # theme.bar.menus.icons.active = accent; + # theme.bar.menus.switch.enabled = accent; + # theme.bar.menus.check_radio_button.active = accent; + # theme.bar.menus.buttons.default = accent; + # theme.bar.menus.buttons.active = accent; + # theme.bar.menus.iconbuttons.active = accent; + # theme.bar.menus.progressbar.foreground = accent; + # theme.bar.menus.slider.primary = accent; + # theme.bar.menus.tooltip.background = background-alt; + # theme.bar.menus.tooltip.text = foreground; + # theme.bar.menus.dropdownmenu.background = background-alt; + # theme.bar.menus.dropdownmenu.text = foreground; + + # theme.bar.background = + # background + # + ( + # if transparentButtons && transparent + # then "00" + # else "" + # ); + # theme.bar.buttons.text = + # if transparent && transparentButtons + # then foregroundOnWallpaper + # else foreground; + # theme.bar.buttons.background = + # ( + # if transparent + # then background + # else background-alt + # ) + # + ( + # if transparentButtons + # then "00" + # else "" + # ); + # theme.bar.buttons.icon = accent; + # + # theme.bar.buttons.notifications.background = background-alt; + # theme.bar.buttons.hover = background; + # theme.bar.buttons.notifications.hover = background; + # theme.bar.buttons.notifications.total = accent; + # theme.bar.buttons.notifications.icon = accent; + # + # theme.osd.bar_color = accent; + # theme.osd.bar_overflow_color = accent-alt; + # theme.osd.icon = background; + # theme.osd.icon_container = accent; + # theme.osd.label = accent; + # theme.osd.bar_container = background-alt; + # + # theme.bar.menus.menu.media.background.color = background-alt; + # theme.bar.menus.menu.media.card.color = background-alt; + # + # theme.notification.background = background-alt; + # theme.notification.actions.background = accent; + # theme.notification.actions.text = foreground; + # theme.notification.label = accent; + # theme.notification.border = background-alt; + # theme.notification.text = foreground; + # theme.notification.labelicon = accent; + # theme.notification.close_button.background = background-alt; + # theme.notification.close_button.label = "#f38ba8"; + }; + }; +} diff --git a/home/system/hyprpaper/default.nix b/home/system/hyprpaper/default.nix new file mode 100644 index 0000000..decc13b --- /dev/null +++ b/home/system/hyprpaper/default.nix @@ -0,0 +1,14 @@ +# Hyprpaper is used to set the wallpaper on the system +{lib, ...}: { + # The wallpaper is set by stylix + services.hyprpaper = { + enable = true; + settings = { + ipc = "on"; + splash = false; + splash_offset = 2.0; + }; + }; + systemd.user.services.hyprpaper.Unit.After = + lib.mkForce "graphical-session.target"; +} diff --git a/home/system/hyprsunset/default.nix b/home/system/hyprsunset/default.nix new file mode 100644 index 0000000..fa35f1d --- /dev/null +++ b/home/system/hyprsunset/default.nix @@ -0,0 +1,22 @@ +{ + services = { + hyprsunset = { + enable = true; + settings = { + max-gamma = 150; + + profile = [ + { + time = "7:30"; + identity = true; + } + { + time = "23:00"; + temperature = 3000; + gamma = 0.8; + } + ]; + }; + }; + }; +} diff --git a/home/system/mime/default.nix b/home/system/mime/default.nix new file mode 100644 index 0000000..5be0983 --- /dev/null +++ b/home/system/mime/default.nix @@ -0,0 +1,98 @@ +# Mime type associations for the system. +{ lib, ... }: +with lib; +let + defaultApps = { + # check desktop files here: `ls $(echo $XDG_DATA_DIRS| sed "s/:/ /g")` + browser = [ "brave-browser.desktop" ]; + text = [ "nixCats.desktop" ]; + image = [ "imv-dir.desktop" ]; + audio = [ "mpv.desktop" ]; + video = [ "mpv.desktop" ]; + directory = [ "thunar.desktop" ]; + office = [ "libreoffice.desktop" ]; + pdf = [ "org.pwmt.zathura.desktop" ]; + terminal = [ "kitty.desktop" ]; + discord = [ "discord.desktop" ]; + archive = [ "xarchiver.desktop" ]; + }; + + mimeMap = { + text = [ "text/plain" ]; + image = [ + "image/bmp" + "image/gif" + "image/jpeg" + "image/jpg" + "image/png" + "image/svg+xml" + "image/tiff" + "image/vnd.microsoft.icon" + "image/webp" + ]; + audio = [ + "audio/aac" + "audio/mpeg" + "audio/ogg" + "audio/opus" + "audio/wav" + "audio/webm" + "audio/x-matroska" + ]; + video = [ + "video/mp2t" + "video/mp4" + "video/mpeg" + "video/ogg" + "video/webm" + "video/x-flv" + "video/x-matroska" + "video/x-msvideo" + ]; + directory = [ "inode/directory" ]; + browser = [ + "text/html" + "x-scheme-handler/about" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/unknown" + ]; + office = [ + "application/vnd.oasis.opendocument.text" + "application/vnd.oasis.opendocument.spreadsheet" + "application/vnd.oasis.opendocument.presentation" + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + "application/msword" + "application/vnd.ms-excel" + "application/vnd.ms-powerpoint" + "application/rtf" + ]; + pdf = [ "application/pdf" ]; + terminal = [ "terminal" ]; + archive = [ + "application/zip" + "application/rar" + "application/7z" + "application/*tar" + ]; + discord = [ "x-scheme-handler/discord" ]; + }; + + associations = + with lists; + listToAttrs ( + flatten (mapAttrsToList (key: map (type: attrsets.nameValuePair type defaultApps."${key}")) mimeMap) + ); +in +{ + xdg = { + configFile."mimeapps.list".force = true; + mimeApps = { + enable = true; + associations.added = associations; + defaultApplications = associations; + }; + }; +} diff --git a/home/system/udiskie/default.nix b/home/system/udiskie/default.nix new file mode 100644 index 0000000..f87dc5b --- /dev/null +++ b/home/system/udiskie/default.nix @@ -0,0 +1,8 @@ +# Udiskie is a simple daemon that uses udisks to automatically mount removable storage devices. +{ + services.udiskie = { + enable = true; + notify = true; + automount = true; + }; +} diff --git a/home/system/vicinae/default.nix b/home/system/vicinae/default.nix new file mode 100644 index 0000000..016783a --- /dev/null +++ b/home/system/vicinae/default.nix @@ -0,0 +1,13 @@ +{ inputs, ... }: +{ + imports = [ inputs.vicinae.homeManagerModules.default ]; + + services.vicinae = { + enable = true; + autoStart = true; + }; + + wayland.windowManager.hyprland.settings.exec-once = [ + "systemctl enable --now --user vicinae.service" + ]; +} diff --git a/home/system/wofi/default.nix b/home/system/wofi/default.nix new file mode 100644 index 0000000..ea1aea9 --- /dev/null +++ b/home/system/wofi/default.nix @@ -0,0 +1,102 @@ +# Wofi is a launcher for Wayland, inspired by rofi. +{ + config, + pkgs, + lib, + ... +}: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background = "#${config.lib.stylix.colors.base00}"; + background-alt = "#${config.lib.stylix.colors.base01}"; + foreground = "#${config.lib.stylix.colors.base05}"; + font = config.stylix.fonts.serif.name; + rounding = config.theme.rounding; + font-size = config.stylix.fonts.sizes.popups; +in +{ + home.packages = with pkgs; [ wofi-emoji ]; + + programs.wofi = { + enable = true; + + settings = { + allow_markup = true; + width = 450; + show = "drun"; + prompt = "Apps"; + normal_window = true; + height = 305; + allow_images = true; + image_size = 24; + insensitive = true; + hide_scroll = true; + no_actions = true; + gtk_dark = true; + }; + + style = + lib.mkForce + # css + '' + * { + font-family: "${font}"; + font-weight: 500; + font-size: ${toString font-size}px; + } + + #window { + background-color: ${background}; + color: ${foreground}; + border-radius: ${toString rounding}px; + } + + #outer-box { + padding: 20px; + } + + #input { + background-color: ${background-alt}; + border: 0px solid ${accent}; + color: ${foreground}; + padding: 8px 12px; + } + + #scroll { + margin-top: 20px; + } + + #inner-box {} + + #img { + padding-right: 8px; + } + + #text { + color: ${foreground}; + } + + #text:selected { + color: ${foreground}; + } + + #entry { + padding: 6px; + } + + #entry:selected { + background-color: ${accent}; + color: ${foreground}; + } + + #unselected {} + + #selected {} + + #input, + #entry:selected { + border-radius: ${toString rounding}px; + } + ''; + }; +} diff --git a/home/system/zathura/default.nix b/home/system/zathura/default.nix new file mode 100644 index 0000000..8cb738a --- /dev/null +++ b/home/system/zathura/default.nix @@ -0,0 +1,14 @@ +# Zathura is a PDF viewer +{ + programs.zathura = { + enable = true; + + options = { + guioptions = "v"; + adjust-open = "width"; + statusbar-basename = true; + render-loading = false; + scroll-step = 120; + }; + }; +} diff --git a/hosts/altair/configuration.nix b/hosts/altair/configuration.nix new file mode 100644 index 0000000..17b350f --- /dev/null +++ b/hosts/altair/configuration.nix @@ -0,0 +1,26 @@ +{ config, ... }: +{ + imports = [ + # Mostly system related configuration + ../../nixos/audio.nix + ../../nixos/bluetooth.nix + ../../nixos/fonts.nix + ../../nixos/home-manager.nix + ../../nixos/nix.nix + ../../nixos/systemd-boot.nix + ../../nixos/sddm.nix + ../../nixos/users.nix + ../../nixos/utils.nix + ../../nixos/hyprland.nix + ../../nixos/hosts.nix + + # You should let those lines as is + ./hardware-configuration.nix + ./variables.nix + ]; + + home-manager.users."${config.var.username}" = import ./home.nix; + + # Don't touch this + system.stateVersion = "24.05"; +} diff --git a/hosts/altair/hardware-configuration.nix b/hosts/altair/hardware-configuration.nix new file mode 100644 index 0000000..c7e5d99 --- /dev/null +++ b/hosts/altair/hardware-configuration.nix @@ -0,0 +1,38 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/6d8f6f33-c9d9-4e90-b496-d5b3ef5e9aeb"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8797-B47E"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/altair/home.nix b/hosts/altair/home.nix new file mode 100644 index 0000000..e3a25ae --- /dev/null +++ b/hosts/altair/home.nix @@ -0,0 +1,110 @@ +{ + pkgs, + config, + inputs, + ... +}: +{ + imports = [ + # Mostly user-specific configuration + ./variables.nix + + # Programs + ../../home/programs/kitty + # ../../home/programs/alacritty + ../../home/programs/ghostty + #../../home/programs/nvf + ../../home/programs/shell + #../../home/programs/fetch + ../../home/programs/git + #../../home/programs/git/signing.nix + ../../home/programs/spicetify + ../../home/programs/thunar + #../../home/programs/lazygit + ../../home/programs/discord + #../../home/programs/tailscale + ../../home/programs/gpg + ../../home/programs/rclone + ../../home/programs/direnv + ../../home/programs/thunderbird + ../../home/programs/bitwarden + ../../home/programs/nixCats + #../../home/programs/zen-browser + + # Scripts + ../../home/scripts # All scripts + + # System (Desktop environment like stuff) + ../../home/system/hyprland + #../../home/system/hyprlock + ../../home/system/hyprpanel + #../../home/system/ashell + ../../home/system/hyprsunset + ../../home/system/hyprpaper + ../../home/system/zathura + ../../home/system/mime + ../../home/system/udiskie + ../../home/system/vicinae + ../../home/system/wofi + # ../../home/system/hypridle + ]; + + home = { + inherit (config.var) username; + homeDirectory = "/home/" + config.var.username; + + packages = with pkgs; [ + dotnet-runtime + dafny + + gemini-cli + + # Apps + bitwarden-desktop # Password manager + vlc # Video player + blanket # White-noise app + obsidian # Note taking app + planify # Todolists + textpieces # Manipulate texts + curtail # Compress images + resources # Ressource monitor + gnome-clocks # Clocks app + gnome-text-editor # Basic graphic text editor + mpv # Video player + brave # Web browser + + # Privacy + session-desktop # Session app, private messages + signal-desktop # Signal app, private messages + protonvpn-gui + proton-pass + proton-authenticator + ticktick # Privacy friendly todo app + + # Utils + zip + unzip + optipng + jpegoptim + pfetch + btop + fastfetch + + # Just cool + peaclock + cbonsai + pipes + cmatrix + + # Backup + vscode + + libreoffice-qt6-fresh + ]; + + # Don't touch this + stateVersion = "24.05"; + }; + + programs.home-manager.enable = true; +} diff --git a/hosts/altair/variables.nix b/hosts/altair/variables.nix new file mode 100644 index 0000000..3a8910e --- /dev/null +++ b/hosts/altair/variables.nix @@ -0,0 +1,57 @@ +{ + config, + lib, + ... +}: +{ + imports = [ + # Choose your theme here: + ../../themes/catppuccin.nix + ]; + + config.var = { + hostname = "altair"; + username = "kiri"; + configDirectory = "/home/" + config.var.username + "/.config/nixos"; # The path of the nixos configuration directory + + keyboardLayout = "us"; + + location = "Meterik"; + timeZone = "Europe/Amsterdam"; + defaultLocale = "en_US.UTF-8"; + timeLocale = "en_DK.UTF-8"; + numericLocale = "en_IE.UTF-8"; + otherLocale = "nl_NL.UTF-8"; + + git = { + username = "kiri"; + email = "mail@jelles.net"; + }; + + autoUpgrade = false; + autoGarbageCollector = true; + hyprland = { + workspace = [ + "1, monitor:0, persistent:true, default:true" + "2, monitor:0, persistent:true" + "3, monitor:0, persistent:true" + + "11, monitor:0, persistent:true" + "12, monitor:0, persistent:true" + "13, monitor:0, persistent:true" + ]; + + monitor = [ + ",preferred,auto,1.5" + ]; + }; + }; + + # Let this here + options = { + var = lib.mkOption { + type = lib.types.attrs; + default = { }; + }; + }; +} diff --git a/hosts/orion/configuration.nix b/hosts/orion/configuration.nix new file mode 100644 index 0000000..1f2369e --- /dev/null +++ b/hosts/orion/configuration.nix @@ -0,0 +1,29 @@ +{ modulesPath, config, ... }: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + (modulesPath + "/profiles/qemu-guest.nix") + + ../../nixos/home-manager.nix + ../../nixos/nix.nix + ../../nixos/users.nix + ../../nixos/utils.nix + + ../../server-modules/ssh.nix + ../../server-modules/caddy.nix + ../../server-modules/bitwarden.nix + ../../server-modules/firewall.nix + ../../server-modules/copyparty.nix + ../../server-modules/home-assistant.nix + ../../server-modules/glance.nix + + ./disk-config.nix + ./hardware-configuration.nix + ./variables.nix + ]; + + home-manager.users."${config.var.username}" = import ./home.nix; + + # Don't touch this + system.stateVersion = "24.05"; +} diff --git a/hosts/orion/disk-config.nix b/hosts/orion/disk-config.nix new file mode 100644 index 0000000..1641339 --- /dev/null +++ b/hosts/orion/disk-config.nix @@ -0,0 +1,55 @@ +{ lib, ... }: +{ + disko.devices = { + disk.disk1 = { + device = lib.mkDefault "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + esp = { + name = "ESP"; + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + name = "root"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/orion/hardware-configuration.nix b/hosts/orion/hardware-configuration.nix new file mode 100644 index 0000000..bb23f0b --- /dev/null +++ b/hosts/orion/hardware-configuration.nix @@ -0,0 +1,24 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/orion/home.nix b/hosts/orion/home.nix new file mode 100644 index 0000000..637e1f0 --- /dev/null +++ b/hosts/orion/home.nix @@ -0,0 +1,40 @@ +{ + pkgs, + config, + ... +}: +{ + imports = [ + # Mostly user-specific configuration + ./variables.nix + + # Programs + #../../home/programs/nvf + ../../home/programs/shell + #../../home/programs/fetch + ../../home/programs/git + #../../home/programs/lazygit + + # Scripts + #../../home/scripts # All scripts + ]; + + home = { + inherit (config.var) username; + homeDirectory = "/home/" + config.var.username; + + packages = with pkgs; [ + # Utils + btop + + # Provide relevant terminfo + kitty + ghostty + ]; + + # Don't touch this + stateVersion = "24.05"; + }; + + programs.home-manager.enable = true; +} diff --git a/hosts/orion/variables.nix b/hosts/orion/variables.nix new file mode 100644 index 0000000..60a54fd --- /dev/null +++ b/hosts/orion/variables.nix @@ -0,0 +1,42 @@ +{ + config, + lib, + ... +}: +{ + imports = [ + # Choose your theme here: + ../../themes/catppuccin.nix + ]; + + config.var = { + hostname = "orion"; + username = "kiri"; + configDirectory = "/home/" + config.var.username + "/.config/nixos"; # The path of the nixos configuration directory + + keyboardLayout = "us"; + + location = "Meterik"; + timeZone = "Europe/Amsterdam"; + defaultLocale = "en_US.UTF-8"; + timeLocale = "en_DK.UTF-8"; + numericLocale = "en_IE.UTF-8"; + otherLocale = "nl_NL.UTF-8"; + + git = { + username = "kiri"; + email = "mail@jelles.net"; + }; + + autoUpgrade = false; + autoGarbageCollector = true; + }; + + # Let this here + options = { + var = lib.mkOption { + type = lib.types.attrs; + default = { }; + }; + }; +} diff --git a/hosts/polaris/configuration.nix b/hosts/polaris/configuration.nix new file mode 100644 index 0000000..cb6be49 --- /dev/null +++ b/hosts/polaris/configuration.nix @@ -0,0 +1,28 @@ +{ config, ... }: +{ + imports = [ + # Mostly system related configuration + ../../nixos/audio.nix + ../../nixos/bluetooth.nix + ../../nixos/fonts.nix + ../../nixos/home-manager.nix + ../../nixos/nix.nix + ../../nixos/systemd-boot.nix + ../../nixos/sddm.nix + ../../nixos/users.nix + ../../nixos/utils.nix + #../../nixos/tailscale.nix + ../../nixos/hyprland.nix + ../../nixos/hosts.nix + #../../nixos/docker.nix + + # You should let those lines as is + ./hardware-configuration.nix + ./variables.nix + ]; + + home-manager.users."${config.var.username}" = import ./home.nix; + + # Don't touch this + system.stateVersion = "24.05"; +} diff --git a/hosts/polaris/hardware-configuration.nix b/hosts/polaris/hardware-configuration.nix new file mode 100644 index 0000000..5b9b649 --- /dev/null +++ b/hosts/polaris/hardware-configuration.nix @@ -0,0 +1,39 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/bda7f8b9-2b3d-4190-8518-baa50490227e"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/26FE-CA37"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp8s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/polaris/home.nix b/hosts/polaris/home.nix new file mode 100644 index 0000000..f9b7e80 --- /dev/null +++ b/hosts/polaris/home.nix @@ -0,0 +1,112 @@ +{ + pkgs, + config, + inputs, + ... +}: +{ + imports = [ + # Mostly user-specific configuration + ./variables.nix + + # Programs + ../../home/programs/kitty + # ../../home/programs/alacritty + ../../home/programs/ghostty + #../../home/programs/nvf + ../../home/programs/shell + #../../home/programs/fetch + ../../home/programs/git + #../../home/programs/git/signing.nix + ../../home/programs/spicetify + ../../home/programs/thunar + #../../home/programs/lazygit + ../../home/programs/discord + #../../home/programs/tailscale + ../../home/programs/gpg + ../../home/programs/rclone + ../../home/programs/direnv + ../../home/programs/thunderbird + ../../home/programs/bitwarden + ../../home/programs/nixCats + #../../home/programs/zen-browser + + # Scripts + ../../home/scripts # All scripts + + # System (Desktop environment like stuff) + ../../home/system/hyprland + #../../home/system/hyprlock + ../../home/system/hyprpanel + #../../home/system/ashell + ../../home/system/hyprpaper + ../../home/system/zathura + ../../home/system/mime + ../../home/system/udiskie + ../../home/system/vicinae + ../../home/system/wofi + # ../../home/system/hypridle + ]; + + home = { + inherit (config.var) username; + homeDirectory = "/home/" + config.var.username; + + packages = with pkgs; [ + dotnet-runtime + dafny + + gemini-cli + + # Apps + bitwarden-desktop # Password manager + vlc # Video player + blanket # White-noise app + obsidian # Note taking app + planify # Todolists + textpieces # Manipulate texts + curtail # Compress images + resources # Ressource monitor + gnome-clocks # Clocks app + gnome-text-editor # Basic graphic text editor + mpv # Video player + brave # Web browser + + # Privacy + session-desktop # Session app, private messages + signal-desktop # Signal app, private messages + protonvpn-gui + proton-pass + proton-authenticator + ticktick # Privacy friendly todo app + + # Utils + zip + unzip + optipng + jpegoptim + pfetch + btop + fastfetch + + # Just cool + peaclock + cbonsai + pipes + cmatrix + + # Backup + vscode + + libreoffice-qt6-fresh + ]; + + # Import my profile picture, used by the hyprpanel dashboard + #file.".face.icon" = {source = ./profile_picture.png;}; + + # Don't touch this + stateVersion = "24.05"; + }; + + programs.home-manager.enable = true; +} diff --git a/hosts/polaris/secrets/default.nix b/hosts/polaris/secrets/default.nix new file mode 100644 index 0000000..ba5746a --- /dev/null +++ b/hosts/polaris/secrets/default.nix @@ -0,0 +1,42 @@ +# Those are my secrets, encrypted with sops +# You shouldn't import this file, unless you edit it +{ + pkgs, + inputs, + ... +}: { + imports = [inputs.sops-nix.homeManagerModules.sops]; + + sops = { + age.keyFile = "/home/hadi/.config/sops/age/keys.txt"; + defaultSopsFile = ./secrets.yaml; + secrets = { + sshconfig = {path = "/home/hadi/.ssh/config";}; + github-key = {path = "/home/hadi/.ssh/github";}; + gitlab-key = {path = "/home/hadi/.ssh/gitlab";}; + jack-key = {path = "/home/hadi/.ssh/jack";}; + signing-key = {path = "/home/hadi/.ssh/key";}; + signing-pub-key = {path = "/home/hadi/.ssh/key.pub";}; + pia = {path = "/home/hadi/.config/pia/pia.ovpn";}; + }; + }; + + home.file.".config/nixos/.sops.yaml".text = '' + keys: + - &primary age12yvtj49pfh3fqzqflscm0ek4yzrjhr6cqhn7x89gdxnlykq0xudq5c7334 + creation_rules: + - path_regex: hosts/laptop/secrets/secrets.yaml$ + key_groups: + - age: + - *primary + - path_regex: hosts/server/secrets/secrets.yaml$ + key_groups: + - age: + - *primary + ''; + + systemd.user.services.mbsync.Unit.After = ["sops-nix.service"]; + home.packages = with pkgs; [sops age]; + + wayland.windowManager.hyprland.settings.exec-once = ["systemctl --user start sops-nix"]; +} diff --git a/hosts/polaris/secrets/secrets.yaml b/hosts/polaris/secrets/secrets.yaml new file mode 100644 index 0000000..4428ca9 --- /dev/null +++ b/hosts/polaris/secrets/secrets.yaml @@ -0,0 +1,22 @@ +pia: ENC[AES256_GCM,data:0bnhHeVqKSLHVimd78a94ShHlO3+LUoZ4oiKD3cnBYkaZsw=,iv:S+/IChlFlqdI+PyFF+Ti4AJUkch2MS0qKiqHL1Q3RMk=,tag:+v2kV70ou84eIc01dKnAhA==,type:str] +sshconfig: ENC[AES256_GCM,data:1EY0vnJ6NHb/GODYkiOKVR6i0UoojFPileQW1/ZokxDswGnz6P0eicS72wkMjwsw9tY5l0OM0NNbTIyYkqgE+q0HJw8IkRHvmvBq4AX/6o+2++YJuDTMpCcDkMAp4BNtrzqpBkKaqXJgMbxTpEPRNTnSpg96sinluCtuASEZaI8Ej+QKq/pEeELIGnkYkUr9d8/M8ZavzZ59oQmUsOxOCtYBsCi5BHMpATfVg+WqyXv3uptMB2PoTwsJiJ9IiQTJHWgkpe+WpIIsi4Dc49YpX3O2pHytimfuuy8D5DESKTOtcqg8qIL/xcR8iJl8ISJAA9IZg8eJ1FYdEpfTruwfiPYo6Ce5zH4W/BVm3iQ8B3Tuzi+gvRBwffcRpYkdAS4c7tk7cgF3U7sr1L7yLL6OmuBXaNSnALyHO2W5b3tefGY0YmwGUfh6M5FMI8/5SfxcMfSOAZKxhcckRL1CpFMzmKkAdY/PRCghmEWobU1KswBPiYWQ6vfubbdN1Yx1mng4z6zmkXmiqrc5IQfOBpbY71VnUoXh384Et9PM3cti4K6SmZFYX1uZStP7KXLhw4ZnVZ0J0fIks4RZ11A3NWtE1yak9z7QXj7k/PtdfrsNtIphVZ7LsZEvOvdgIlUToYNcyvagYsRRlreQPqhLSc7ninjIbRaL4a/s6kIdrr3qovPNSlE3R3HRGTBOjTEF9Bmp+oGb5L9HvBBu6NmNwHQ76gySAXbMnRa34JuXtzpEIZ5yo4AI5i2eDPeM2Dx6jUSl7OJm3wT6cVMF/2rLj0zHzp8B1bYOsf7VaMzHCYEhXMu7REMmmfDKwtb9zsuf/r1zlPXJcukDCrtJ3Z/mFl03,iv:0hS7g9gVVntWVSRSPCgZ3rjGcMf2RzQPjMpgSz0GlxE=,tag:mnDakNZiG28H4jmnZH00eg==,type:str] +github-key: ENC[AES256_GCM,data:xUgFMlBo8e+3eXqNscxbby1dWug3SgUagDiNUe/IGVbU6cczkaJ3uOaB0OuRBQ8AYhOLkzXj0pIKjUrElHwmYrhURtS1aF4SFEGJsjhhobNA//j3E2/5/nLVjfco+lRzyHdwmsNhEUCqEhsXrrodJMb39H4b5oip3z0rjc729YveiWUKQxXVZVPurp3nq9yNnix9R4CA6XYFRW6T6MNqgPD5qhbcDlhxLb/SN+uI5h+5eZIS24VDWlKaTaCLL5KLhZmfuA37SquOQ+edi9Yg8MnfrZkMrp/3qmAjP2rSQLMOc4QdQCLQBQSf0/snpydgLwY+FoJmMSztwtkqUdIZWOfDUJbJxegEOrAR68jLTNbp+GYiDn3thtOZDiK5p/M1amjCT+A9qeFMed5WS+aZHNTRbR9UcfiP6+48MGZFt1mr7q+/CoL04/DTp0w6tUf6/SZD31NvTJDqngkhpc0ZH9Dh5+2JcnBWpq25AM36kZTn1hIQCLNTr/oGWZXSLA2tksAhQCaUcFj4IIh6Bl96,iv:GEJsAs5NriwENYTV/VShgJF6iMmrtTwNiXOvfXyEP8E=,tag:nfZgsFqaet075GjQAoVZxQ==,type:str] +gitlab-key: ENC[AES256_GCM,data:6271Tg7LIJsXAw7Co32vva+iUWv+eRAfVfXaGkoirHxiPTAgZfq8yDpGJwti2D/aFnLvbURcUgp3B5zy1aURu9puXi6QMu3orJOE2Zx0dX3lyeHyIhOZ1hAWsQxwBDkJYODuMZbIKHNrF26Mkk6smFF9SrGoADZGxY7XSou/iopw6yrLvQAXP6lN55PQvoP5/ek/QzKNwjJAbAjp7FjjtPqPUbUdj7bfIfr9avs6gpRYnRzb2H3auyhb5qvyuRWnKu4+FeZUofC7HnfRU1eSI8UzG49Rg4f2b1Xqr0JtsjvEmuRx7lbptINXEAjW7zaSZ2B9NgotWPIzkNZRNZkuTEaOulBf5iH3wJ9GM1FcbUu2gpCt6y+CMIk5QkVvETYtKuALLbcPx9/sc90doiH1411LeKQCs5l88BBILG9KPkKmXiGGUVNxzFtjbRYQIUEmmyl95kPPEdCkkzGzHXNfE3F9HRu4MCGKPK2yZPZtCXd3Jp1b21wKSIRNYqLqxru+J8eLSljd3czO0SuTG/Vx,iv:E+y3aVLaiStlPLTQBqyfJuEXtAQyOvDUYS+XfuOHuA0=,tag:6d1IAsGcmcpgL1pE9dDcbw==,type:str] +jack-key: ENC[AES256_GCM,data:VfCl3wH0MMBc8QDyjLDFeSvzSEsf7uGpfJvRjFrmjW+bPRUXBpZhJV8a9VQIAz7z7zZXvzARMfCeI0ydyC57CW81GH5/H5pneJ4b+xreINjVfdLbL1nC1thelo/O64jda/L+xVKhgE+QQi8/zt4JmXGghkP+74nYcTTaMpmcbgWw354J1ybXqyCEY+88nsJ1d2s+M7M2bplx4fGb7sLUs6sqdsad3sENzhH/0HQCFXreHTtgsLbIs8ccmdRgFNKM8/wD0OoW76rOQsJoA9JY4yOTQNVoX5M8+Olj6+wVlt6QBrWrYRuEztGnHrHvzxiHXtmEkMwVNfoPpEflQyRYRa0rVp/66REOkMckGx6/LbxKFgrxnifRlsK3kWd28v2bRGVQOghUluYUtVkaJ+eh6o6ik0NQKx8/H6BznBSDE6MjDwbLv434LHBfDtAqhWN1eMbOlunFivsl5Hb/6rl9kydHlcCS6FY8cUHoKQ90gDaUuDrvUifwmdO5hU0GH5tgvGi1ReK9ndcpQsrHptG6,iv:oC1xU5Tu3The105VYRmxIw4kEwDoqe8T/EH6mmqpqwQ=,tag:Pu8c536u6W7ALrqjRsvXDw==,type:str] +signing-key: ENC[AES256_GCM,data:NvLqmt7NzrWkbQQqFfosmSMvEv8C8+MDDpxSoDo3zZ3MR6WXr9B+6CnUc6rtevM230wgE17VC9XlmcQxX+PjJsWq6gZteK5THTIcrR5zPJVNlVCEyeLKoFj/6m7qBgyyoN3OjCNjgMkhsm009jwBgNk0qJMAYebOGo8eoP/al+4ytm7dhna+iX5WZabAg0J4z4JMDQonqQl3SaDnCEdHvk9m7ZEP2vUFscPkbLj4ewgFq+bUCHOOQb2uqRJoEgcR/NetRFcQfzcU6lp7JxobaICaO3zdmomUm7oabIUTrc3Kom3Wjw8ryqfqC1/SC0SHr5XGk2ygk0WnlQ4kNshqriL2dwbWAzy1Z/cTX9+aB/KNtC0U6zWG1bpnL3dgSgvhRiocIis/eNg1HWsLWVicmdebL/lXHztxFMdTuX/gWgQBotggTmx+OFGZfP9ZGlF3635mDxM/fEOCtTyA195dMicCUsjEpBegNtXsp+oOtxyRI0jSW47MBcXFP09f5ywELTPyz4eOUHO8sQ6UfJ6X,iv:KNQUlMPaiR4x1Fw+HZe/EOmh/gfsrqlefpq23uflz/8=,tag:illu42HKunQXnijjsUIvnQ==,type:str] +signing-pub-key: ENC[AES256_GCM,data:XuokZmCsnaNQ0rvVa3k81T4vtxw//r63xp1yHDLaNAMwA2r2bh6addl9WoAmm76g1rweqZrAAIw1PXDb90ubPaBP1iEHSkGZpwUpy/tOTePRdHMW2WtVvidpHQ==,iv:auB/bA89cJK6DnQi1BK2uldXRPyJfo+r7nl5qOLefUk=,tag:/I3kB6El1yesBMGOjJ+oHA==,type:str] +sops: + age: + - recipient: age12yvtj49pfh3fqzqflscm0ek4yzrjhr6cqhn7x89gdxnlykq0xudq5c7334 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBHVWN4YjZqczB3Q21WL1lz + ckROWkhRditHblVHVEpOS0E0aGVqdW14M0ZvCkNzRXlCOWFBWmQwTGpTYVdFRlpq + bFdOR2pSTEZpUVpvUHo2NklrQm5EU1kKLS0tIFZ5ZWhYcHg1Z0hTOTZIdHR1QUxv + cmVxVC8rVDlWMUdZaGw3bmdOaWZGS1EKYahBlc8XpB5UdKZQkvxbLcKQ/xkFJjWo + FSfQWnjhe/a7BJtJEcKZkjOQU0mYqlSu+uT2RA9diCQeRUJPRF+nAw== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2025-09-27T13:28:57Z" + mac: ENC[AES256_GCM,data:XMPDLGHwTYIxgEz9Stj7j+lWgAOpzkEsnoRdWVVs4798m1sQRIyUuvEiCgbHoAktajrAAzXq3GZ4HJ1dfE1fDWGh+B7WwRoJKxtP6qI8Ub4h7lSiDsxJhr8ieqm5bzmHZkn8VJkrqBrSSXesirLprRLR5yZOVLAgco0lg9boM1Y=,iv:pYA5oz8cldKw1Ai7k2LCQBipE2keZa49L3SHcL+eDp0=,tag:4kVsC95SSPCCSZDf6qDeqA==,type:str] + unencrypted_suffix: _unencrypted + version: 3.10.2 diff --git a/hosts/polaris/variables.nix b/hosts/polaris/variables.nix new file mode 100644 index 0000000..890a4e7 --- /dev/null +++ b/hosts/polaris/variables.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + ... +}: +{ + imports = [ + # Choose your theme here: + ../../themes/catppuccin.nix + ]; + + config.var = { + hostname = "polaris"; + username = "kiri"; + configDirectory = "/home/" + config.var.username + "/.config/nixos"; # The path of the nixos configuration directory + + keyboardLayout = "us"; + + location = "Meterik"; + timeZone = "Europe/Amsterdam"; + defaultLocale = "en_US.UTF-8"; + timeLocale = "en_DK.UTF-8"; + numericLocale = "en_IE.UTF-8"; + otherLocale = "nl_NL.UTF-8"; + + git = { + username = "kiri"; + email = "mail@jelles.net"; + }; + + autoUpgrade = false; + autoGarbageCollector = true; + + hyprland = { + workspace = [ + "1, monitor:0, persistent:true, default:true" + "2, monitor:0, persistent:true" + "3, monitor:0, persistent:true" + + "11, monitor:1, persistent:true" + "12, monitor:1, persistent:true" + "13, monitor:1, persistent:true" + ]; + + monitor = [ + "desc:LG Electronics LG ULTRAGEAR 103NTYT8R290,2560x1440@144,0x0,1" + "desc:LG Electronics LG ULTRAGEAR 103NTJJ8R332,2560x1440@144,2560x0,1" + ]; + }; + }; + + # Let this here + options = { + var = lib.mkOption { + type = lib.types.attrs; + default = { }; + }; + }; +} diff --git a/nixos/audio.nix b/nixos/audio.nix new file mode 100644 index 0000000..1e87bef --- /dev/null +++ b/nixos/audio.nix @@ -0,0 +1,21 @@ +# Audio configuration for NixOS using PipeWire +{ + security.rtkit.enable = true; + services.pulseaudio.enable = false; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + wireplumber = { + enable = true; + extraConfig = { + "10-disable-camera" = { + "wireplumber.profiles" = {main."monitor.libcamera" = "disabled";}; + }; + }; + }; + }; +} diff --git a/nixos/bluetooth.nix b/nixos/bluetooth.nix new file mode 100644 index 0000000..2ee6bfa --- /dev/null +++ b/nixos/bluetooth.nix @@ -0,0 +1,9 @@ +# Bluetooth configuration for NixOS +{pkgs, ...}: { + environment.systemPackages = with pkgs; [blueman]; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.blueman.enable = true; +} diff --git a/nixos/docker.nix b/nixos/docker.nix new file mode 100644 index 0000000..163db66 --- /dev/null +++ b/nixos/docker.nix @@ -0,0 +1,6 @@ +# Docker is a containerization platform that allows you to run applications in isolated environments called containers. +{ config, ... }: +{ + virtualisation.docker.enable = true; + users.users."${config.var.username}".extraGroups = [ "docker" ]; +} diff --git a/nixos/fonts.nix b/nixos/fonts.nix new file mode 100644 index 0000000..6b0c208 --- /dev/null +++ b/nixos/fonts.nix @@ -0,0 +1,27 @@ +# Fonts configuration for NixOS +{ pkgs, ... }: +{ + fonts = { + packages = with pkgs; [ + roboto + work-sans + comic-neue + source-sans + comfortaa + inter + lato + lexend + jost + dejavu_fonts + noto-fonts + noto-fonts-cjk-sans + noto-fonts-color-emoji + nerd-fonts.fira-code + nerd-fonts.meslo-lg + openmoji-color + twemoji-color-font + ]; + + enableDefaultPackages = false; + }; +} diff --git a/nixos/home-manager.nix b/nixos/home-manager.nix new file mode 100644 index 0000000..7913cc0 --- /dev/null +++ b/nixos/home-manager.nix @@ -0,0 +1,9 @@ +# Home-manager configuration for NixOS +{inputs, ...}: { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "hm-backup"; + extraSpecialArgs = {inherit inputs;}; + }; +} diff --git a/nixos/hyprland.nix b/nixos/hyprland.nix new file mode 100644 index 0000000..e1b7158 --- /dev/null +++ b/nixos/hyprland.nix @@ -0,0 +1,15 @@ +# Hyprland is a dynamic tiling Wayland compositor. +{ + inputs, + pkgs, + ... +}: +{ + programs.hyprland = { + enable = true; + withUWSM = true; + package = inputs.hyprland.packages."${pkgs.stdenv.hostPlatform.system}".hyprland; + portalPackage = + inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + }; +} diff --git a/nixos/nix.nix b/nixos/nix.nix new file mode 100644 index 0000000..940f6f9 --- /dev/null +++ b/nixos/nix.nix @@ -0,0 +1,58 @@ +# Nix configuration for NixOS +{ + config, + inputs, + ... +}: +let + autoGarbageCollector = config.var.autoGarbageCollector; +in +{ + security.sudo.extraRules = [ + { + users = [ config.var.username ]; + commands = [ + { + command = "/run/current-system/sw/bin/nixos-rebuild"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; + nixpkgs.config.allowUnfree = true; + nix = { + nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + channel.enable = false; + extraOptions = '' + warn-dirty = false + ''; + settings = { + download-buffer-size = 262144000; # 250 MB (250 * 1024 * 1024) + auto-optimise-store = true; + trusted-users = [ config.var.username ]; # Allows remote nixos-rebuild to vps + experimental-features = [ + "nix-command" + "flakes" + ]; + substituters = [ + # high priority since it's almost always used + "https://cache.nixos.org?priority=10" + + "https://hyprland.cachix.org" + "https://nix-community.cachix.org" + "https://numtide.cachix.org" + ]; + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + ]; + }; + gc = { + automatic = autoGarbageCollector; + persistent = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + }; +} diff --git a/nixos/omen.nix b/nixos/omen.nix new file mode 100644 index 0000000..794f8b6 --- /dev/null +++ b/nixos/omen.nix @@ -0,0 +1,63 @@ +# Omen laptop configuration for NixOS +# Import this only if you have an HP Omen laptop +{ + config, + pkgs, + ... +}: let + hp-omen-linux-module = + pkgs.callPackage + ({ + kernel ? config.boot.kernelPackages.kernel, + stdenv, + fetchFromGitHub, + }: + stdenv.mkDerivation (finalAttrs: { + pname = "hp-omen-linux-module"; + version = "rebase-6.14"; + src = fetchFromGitHub { + owner = "ranisalt"; + repo = "hp-omen-linux-module"; + rev = finalAttrs.version; + sha256 = "sha256-2zCm29bdboSjRm/caMjBPGNc0tZXPUnIIYlHxxfhAok="; + }; + setSourceRoot = '' + export sourceRoot=$(pwd)/${finalAttrs.src.name}/src + ''; + nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = [ + "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; + installPhase = '' + runHook preInstall + install hp-wmi.ko -Dm444 -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/platform/x86/hp/ + runHook postInstall + ''; + })) {kernel = config.boot.kernelPackages.kernel;}; +in { + boot.extraModulePackages = [hp-omen-linux-module]; + boot.kernelModules = ["hp-wmi"]; + + users.groups.omen-rgb = {}; + users.users.${config.var.username}.extraGroups = ["omen-rgb"]; + + systemd.tmpfiles.rules = [ + "w /sys/devices/platform/hp-wmi/rgb_zones/zone00 0660 root omen-rgb -" + "w /sys/devices/platform/hp-wmi/rgb_zones/zone01 0660 root omen-rgb -" + "w /sys/devices/platform/hp-wmi/rgb_zones/zone02 0660 root omen-rgb -" + "w /sys/devices/platform/hp-wmi/rgb_zones/zone03 0660 root omen-rgb -" + ]; + + services.udev.extraRules = '' + SUBSYSTEM=="platform", KERNEL=="hp-wmi", ACTION=="add", \ + RUN+="${pkgs.coreutils-full}/bin/sleep 2", \ + RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone00", \ + RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone00", \ + RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone01", \ + RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone01", \ + RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone02", \ + RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone02", \ + RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone03", \ + RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone03" + ''; +} diff --git a/nixos/sddm.nix b/nixos/sddm.nix new file mode 100644 index 0000000..efe0d58 --- /dev/null +++ b/nixos/sddm.nix @@ -0,0 +1,47 @@ +# SDDM is a display manager for X11 and Wayland +{ + pkgs, + inputs, + config, + ... +}: +let + foreground = config.theme.textColorOnWallpaper; + sddm-astronaut = pkgs.sddm-astronaut.override { + embeddedTheme = "purple_leaves"; + themeConfig = { + HeaderTextColor = "#${foreground}"; + DateTextColor = "#${foreground}"; + TimeTextColor = "#${foreground}"; + LoginFieldTextColor = "#${foreground}"; + PasswordFieldTextColor = "#${foreground}"; + UserIconColor = "#${foreground}"; + PasswordIconColor = "#${foreground}"; + WarningColor = "#${foreground}"; + LoginButtonBackgroundColor = "#${foreground}"; + SystemButtonsIconsColor = "#${foreground}"; + SessionButtonTextColor = "#${foreground}"; + VirtualKeyboardButtonTextColor = "#${foreground}"; + DropdownBackgroundColor = "#${foreground}"; + HighlightBackgroundColor = "#${foreground}"; + }; + }; +in +{ + services.displayManager = { + sddm = { + package = pkgs.kdePackages.sddm; + extraPackages = [ sddm-astronaut ]; + enable = true; + wayland.enable = true; + theme = "sddm-astronaut-theme"; + settings = { + Wayland.SessionDir = "${ + inputs.hyprland.packages."${pkgs.stdenv.hostPlatform.system}".hyprland + }/share/wayland-sessions"; + }; + }; + }; + + environment.systemPackages = [ sddm-astronaut ]; +} diff --git a/nixos/systemd-boot.nix b/nixos/systemd-boot.nix new file mode 100644 index 0000000..7cdaafd --- /dev/null +++ b/nixos/systemd-boot.nix @@ -0,0 +1,34 @@ +# Systemd-boot configuration for NixOS +{ pkgs, ... }: +{ + boot = { + bootspec.enable = true; + loader = { + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + consoleMode = "auto"; + configurationLimit = 5; + }; + }; + tmp.cleanOnBoot = true; + kernelPackages = pkgs.linuxPackages_latest; # _zen, _hardened, _rt, _rt_latest, etc. + + # Silent boot + kernelParams = [ + "quiet" + "splash" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + "boot.shell_on_fail" + ]; + consoleLogLevel = 0; + initrd.verbose = false; + }; + + # To avoid systemd services hanging on shutdown + systemd.settings.Manager = { + DefaultTimeoutStopSec = "10s"; + }; +} diff --git a/nixos/users.nix b/nixos/users.nix new file mode 100644 index 0000000..25a7a01 --- /dev/null +++ b/nixos/users.nix @@ -0,0 +1,19 @@ +# Users configuration for NixOS +{ + config, + pkgs, + ... +}: let + username = config.var.username; +in { + programs.zsh.enable = true; + users = { + defaultUserShell = pkgs.zsh; + + users.${username} = { + isNormalUser = true; + description = "${username} account"; + extraGroups = ["networkmanager" "wheel"]; + }; + }; +} diff --git a/nixos/utils.nix b/nixos/utils.nix new file mode 100644 index 0000000..872fcb5 --- /dev/null +++ b/nixos/utils.nix @@ -0,0 +1,134 @@ +# Misc +{ + pkgs, + config, + ... +}: +let + hostname = config.var.hostname; + keyboardLayout = config.var.keyboardLayout; + configDir = config.var.configDirectory; + timeZone = config.var.timeZone; + defaultLocale = config.var.defaultLocale; + otherLocale = config.var.otherLocale; + numericLocale = config.var.numericLocale; + timeLocale = config.var.timeLocale; + autoUpgrade = config.var.autoUpgrade; +in +{ + networking.hostName = hostname; + + networking.networkmanager.enable = true; + systemd.services.NetworkManager-wait-online.enable = false; + + # system.autoUpgrade = { + # enable = autoUpgrade; + # dates = "04:00"; + # flake = "${configDir}"; + # flags = [ + # "--update-input" + # "nixpkgs" + # "--commit-lock-file" + # ]; + # allowReboot = false; + # }; + + time = { + timeZone = timeZone; + }; + i18n.defaultLocale = defaultLocale; + i18n.extraLocaleSettings = { + LC_ADDRESS = otherLocale; + LC_IDENTIFICATION = otherLocale; + LC_MEASUREMENT = otherLocale; + LC_MONETARY = numericLocale; + LC_NAME = otherLocale; + LC_NUMERIC = numericLocale; + LC_PAPER = otherLocale; + LC_TELEPHONE = otherLocale; + LC_TIME = timeLocale; + }; + + services = { + xserver = { + enable = true; + xkb.layout = keyboardLayout; + xkb.variant = ""; + }; + # gnome.gnome-keyring.enable = true; + # psd = { + # enable = true; + # resyncTimer = "10m"; + # }; + }; + console.keyMap = keyboardLayout; + + environment.variables = { + XDG_DATA_HOME = "$HOME/.local/share"; + PASSWORD_STORE_DIR = "$HOME/.local/share/password-store"; + EDITOR = "nvim"; + TERMINAL = "kitty"; + TERM = "kitty"; + BROWSER = "brave"; + }; + + services.libinput.enable = true; + programs.dconf.enable = true; + services = { + dbus = { + enable = true; + implementation = "broker"; + packages = with pkgs; [ + gcr + gnome-settings-daemon + ]; + }; + gvfs.enable = true; + upower.enable = true; + power-profiles-daemon.enable = true; + udisks2.enable = true; + }; + + # enable zsh autocompletion for system packages (systemd, etc) + environment.pathsToLink = [ "/share/zsh" ]; + + # Faster rebuilding + documentation = { + enable = true; + doc.enable = true; + man.enable = true; + dev.enable = true; + info.enable = true; + nixos.enable = true; + }; + + environment.systemPackages = with pkgs; [ + hyprland-qtutils + xdg-utils + ]; + + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + config = { + common.default = [ "gtk" ]; + hyprland.default = [ + "gtk" + "hyprland" + ]; + }; + + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + security = { + # allow wayland lockers to unlock the screen + pam.services.hyprlock.text = "auth include login"; + + # userland niceness + rtkit.enable = true; + + # don't ask for password for wheel group + sudo.wheelNeedsPassword = false; + }; +} diff --git a/server-modules/adguardhome.nix b/server-modules/adguardhome.nix new file mode 100644 index 0000000..af3c52a --- /dev/null +++ b/server-modules/adguardhome.nix @@ -0,0 +1,20 @@ +# Adguard is a network-wide ad blocker +# When installed, open localhost:3000 to setup +{config, ...}: let + domain = "adguard.hadi.diy"; +in { + services = { + adguardhome = { + enable = true; + port = 3000; + }; + + nginx.virtualHosts."${domain}" = { + useACMEHost = "hadi.diy"; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.adguardhome.port}"; + }; + }; + }; +} diff --git a/server-modules/arr.nix b/server-modules/arr.nix new file mode 100644 index 0000000..ee7ccfc --- /dev/null +++ b/server-modules/arr.nix @@ -0,0 +1,65 @@ +# *arr is a collection of media management applications. +# See https://github.com/rasmus-kirk/nixarr +# Setup guide: https://nixarr.com/wiki/setup/ +{config, ...}: let + domain = "hadi.diy"; + mkVirtualHost = port: { + useACMEHost = domain; + forceSSL = true; + locations."/" = {proxyPass = "http://127.0.0.1:${toString port}";}; + }; + username = config.var.username; +in { + # Add my secrets + sops.secrets = { + recyclarr = { + owner = "recyclarr"; + mode = "0777"; + }; + wireguard-pia = { + group = "media"; + mode = "0600"; + }; + }; + + nixarr = { + enable = true; + + mediaUsers = [username]; + mediaDir = "/mnt/data/media"; + stateDir = "/mnt/data/.state/nixarr"; + + vpn = { + enable = true; + wgConf = config.sops.secrets.wireguard-pia.path; + }; + + jellyfin.enable = true; + jellyseerr.enable = true; + prowlarr.enable = true; + radarr.enable = true; + sonarr.enable = true; + bazarr.enable = true; + readarr.enable = true; + transmission = { + enable = true; + extraSettings = {trash-original-torrent-files = true;}; + vpn.enable = true; + }; + recyclarr = { + enable = true; + configFile = config.sops.secrets.recyclarr.path; + }; + }; + + services.nginx.virtualHosts = { + "jellyfin.${domain}" = mkVirtualHost 8096; + "jellyseerr.${domain}" = mkVirtualHost 5055; + "bazarr.${domain}" = mkVirtualHost 6767; + "prowlarr.${domain}" = mkVirtualHost 9696; + "radarr.${domain}" = mkVirtualHost 7878; + "sonarr.${domain}" = mkVirtualHost 8989; + "transmission.${domain}" = mkVirtualHost 9091; + "readarr.${domain}" = mkVirtualHost 8787; + }; +} diff --git a/server-modules/bitwarden.nix b/server-modules/bitwarden.nix new file mode 100644 index 0000000..ea74f95 --- /dev/null +++ b/server-modules/bitwarden.nix @@ -0,0 +1,23 @@ +# Bitwarden (or vaultwarden) is a self-hosted password manager. +{ config, ... }: +let + domain = "vault.jelles.net"; +in +{ + services = { + vaultwarden = { + enable = true; + backupDir = "/var/backup/vaultwarden"; + config = { + DOMAIN = "https://" + domain; + SIGNUPS_ALLOWED = true; + ROCKET_PORT = 8100; + ROCKET_LOG = "critical"; + }; + }; + + caddy.virtualHosts."vault.jelles.net".extraConfig = + "reverse_proxy :${toString config.services.vaultwarden.config.ROCKET_PORT}"; + }; + +} diff --git a/server-modules/caddy.nix b/server-modules/caddy.nix new file mode 100644 index 0000000..360296b --- /dev/null +++ b/server-modules/caddy.nix @@ -0,0 +1,22 @@ +{ inputs, pkgs, ... }: +{ + services.caddy = { + enable = true; + virtualHosts."community.jelles.net".extraConfig = '' + root * ${inputs.community-website.packages.${pkgs.stdenv.hostPlatform.system}.default} + file_server + ''; + virtualHosts."zentire.jelles.net".extraConfig = '' + root * ${inputs.zentire-website.packages.${pkgs.stdenv.hostPlatform.system}.default} + file_server + ''; + email = "mail@jelles.net"; + }; + + networking.firewall = { + allowedTCPPorts = [ + 80 + 443 + ]; + }; +} diff --git a/server-modules/copyparty.nix b/server-modules/copyparty.nix new file mode 100644 index 0000000..2cf7087 --- /dev/null +++ b/server-modules/copyparty.nix @@ -0,0 +1,14 @@ +{ + services = { + copyparty = { + enable = true; + + settings = { + e2dsa = true; + no-cfg = true; + }; + }; + + caddy.virtualHosts."files.jelles.net".extraConfig = "reverse_proxy :3923"; + }; +} diff --git a/server-modules/eleakxir.nix b/server-modules/eleakxir.nix new file mode 100644 index 0000000..270c386 --- /dev/null +++ b/server-modules/eleakxir.nix @@ -0,0 +1,35 @@ +{ + config, + inputs, + pkgs, + ... +}: +{ + users.groups.eleakxir = { }; + users.users.hadi.extraGroups = [ "eleakxir" ]; + + services.eleakxir = { + enable = true; + port = 9198; + user = "eleakxir"; + group = "eleakxir"; + limit = 1000; + folders = [ + "/var/lib/eleakxir/leaks/" + "/mnt/data/clean-leak/" + ]; + debug = true; + }; + + environment.systemPackages = [ + inputs.eleakxir.packages.${pkgs.stdenv.hostPlatform.system}.leak-utils + ]; + + services.nginx.virtualHosts."eleakxir-back.hadi.diy" = { + useACMEHost = "hadi.diy"; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.eleakxir.port}"; + }; + }; +} diff --git a/server-modules/firewall.nix b/server-modules/firewall.nix new file mode 100644 index 0000000..b3a346f --- /dev/null +++ b/server-modules/firewall.nix @@ -0,0 +1,9 @@ +# Firewall configuration for NixOS +{ + networking.firewall = { + enable = true; + allowPing = false; + }; + + networking.nftables.enable = true; +} diff --git a/server-modules/glance-nixy.nix b/server-modules/glance-nixy.nix new file mode 100644 index 0000000..d7c06a1 --- /dev/null +++ b/server-modules/glance-nixy.nix @@ -0,0 +1,353 @@ +# Glance is a self-hosted homepage/dashboard service. +{ + config, + lib, + ... +}: let + domain = "start.hadi.diy"; + + rgb-to-hsl = color: let + r = ((lib.toInt config.lib.stylix.colors."${color}-rgb-r") * 100.0) / 255; + g = ((lib.toInt config.lib.stylix.colors."${color}-rgb-g") * 100.0) / 255; + b = ((lib.toInt config.lib.stylix.colors."${color}-rgb-b") * 100.0) / 255; + max = lib.max r (lib.max g b); + min = lib.min r (lib.min g b); + delta = max - min; + fmod = base: int: base - (int * builtins.floor (base / int)); + h = + if delta == 0 + then 0 + else if max == r + then 60 * (fmod ((g - b) / delta) 6) + else if max == g + then 60 * (((b - r) / delta) + 2) + else if max == b + then 60 * (((r - g) / delta) + 4) + else 0; + l = (max + min) / 2; + s = + if delta == 0 + then 0 + else 100 * delta / (100 - lib.max (2 * l - 100) (100 - (2 * l))); + roundToString = value: toString (builtins.floor (value + 0.5)); + in + lib.concatMapStringsSep " " roundToString [h s l]; +in { + # TODO: Add tailscale custom widget + services = { + glance = { + enable = true; + settings = { + theme = { + contrast-multiplier = lib.mkForce 1.4; + }; + pages = [ + { + hide-desktop-navigation = true; + columns = [ + { + size = "small"; + widgets = [ + { + type = "clock"; + hour-format = "24h"; + } + { + type = "weather"; + location = "Paris, France"; + } + { + type = "markets"; + markets = [ + { + symbol = "BTC-USD"; + name = "Bitcoin"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:BTCUSD"; + } + { + symbol = "SOL-USD"; + name = "Solana"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:SOLUSD"; + } + { + symbol = "ETH-USD"; + name = "Ethereum"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:ETHUSD"; + } + ]; + } + { + type = "dns-stats"; + service = "adguard"; + url = "https://adguard.hadi.diy"; + username = "hadi"; + password = "\${secret:adguard-pwd}"; + } + ]; + } + { + size = "full"; + widgets = [ + { + type = "search"; + search-engine = "duckduckgo"; + } + { + type = "bookmarks"; + groups = [ + { + title = ""; + same-tab = true; + color = "200 50 50"; + links = [ + { + title = "ProtonMail"; + url = "https://proton.me/mail"; + } + { + title = "Github"; + url = "https://github.com"; + } + { + title = "Youtube"; + url = "https://youtube.com"; + } + { + title = "Figma"; + url = "https://figma.com"; + } + ]; + } + { + title = "Docs"; + same-tab = true; + color = "200 50 50"; + links = [ + { + title = "Nixpkgs repo"; + url = "https://github.com/NixOS/nixpkgs"; + } + { + title = "Nixvim"; + url = "https://nix-community.github.io/nixvim/"; + } + { + title = "Hyprland wiki"; + url = "https://wiki.hyprland.org/"; + } + { + title = "Search NixOS"; + url = "https://search-nixos.hadi.diy"; + } + ]; + } + { + title = "Homelab"; + same-tab = true; + color = "100 50 50"; + links = [ + { + title = "Router"; + url = "http://192.168.1.254/"; + } + { + title = "Cloudflare"; + url = "https://dash.cloudflare.com/"; + } + ]; + } + { + title = "Work"; + same-tab = true; + color = "50 50 50"; + links = [ + { + title = "Outlook"; + url = "https://outlook.office.com/"; + } + { + title = "Teams"; + url = "https://teams.microsoft.com/"; + } + { + title = "Office"; + url = "https://www.office.com/"; + } + ]; + } + { + title = "Cyber"; + same-tab = true; + color = rgb-to-hsl "base09"; + links = [ + { + title = "CyberChef"; + url = "https://cyberchef.org/"; + } + { + title = "TryHackMe"; + url = "https://tryhackme.com/"; + } + { + title = "RootMe"; + url = "https://www.root-me.org/"; + } + { + title = "Exploit-DB"; + url = "https://www.exploit-db.com/"; + } + { + title = "CrackStation"; + url = "https://crackstation.net/"; + } + ]; + } + { + title = "Misc"; + same-tab = true; + color = rgb-to-hsl "base01"; + links = [ + { + title = "Svgl"; + url = "https://svgl.app/"; + } + { + title = "Excalidraw"; + url = "https://excalidraw.com/"; + } + { + title = "Cobalt (Downloader)"; + url = "https://cobalt.tools/"; + } + { + title = "Mazanoke (Image optimizer)"; + url = "https://mazanoke.com/"; + } + { + title = "Vert (File converter)"; + url = "https://vert.sh/"; + } + ]; + } + ]; + } + { + type = "server-stats"; + servers = [ + { + type = "local"; + name = "Jack"; + } + ]; + } + { + type = "group"; + widgets = [ + { + type = "monitor"; + title = "Services"; + cache = "1m"; + sites = [ + { + title = "Vaultwarden"; + url = "https://vault.hadi.diy"; + icon = "si:bitwarden"; + } + { + title = "Nextcloud"; + url = "https://cloud.hadi.diy"; + icon = "si:nextcloud"; + } + { + title = "Adguard"; + url = "https://adguard.hadi.diy"; + icon = "si:adguard"; + } + { + title = "Mealie"; + url = "https://mealie.hadi.diy"; + icon = "si:mealie"; + } + ]; + } + { + type = "monitor"; + title = "*arr"; + cache = "1m"; + sites = [ + { + title = "Jellyfin"; + url = "https://jellyfin.hadi.diy"; + icon = "si:jellyfin"; + } + { + title = "Jellyseerr"; + url = "https://jellyseerr.hadi.diy"; + icon = "si:odysee"; + } + { + title = "Radarr"; + url = "https://radarr.hadi.diy"; + icon = "si:radarr"; + } + { + title = "Sonarr"; + url = "https://sonarr.hadi.diy"; + icon = "si:sonarr"; + } + { + title = "Prowlarr"; + url = "https://prowlarr.hadi.diy"; + icon = "si:podcastindex"; + } + { + title = "Transmission"; + url = "https://transmission.hadi.diy"; + icon = "si:transmission"; + } + ]; + } + ]; + } + ]; + } + ]; + name = "Home"; + } + ]; + server = {port = 5678;}; + }; + }; + nginx.virtualHosts."${domain}" = { + useACMEHost = "hadi.diy"; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${ + toString config.services.glance.settings.server.port + }"; + }; + }; + }; + + systemd.services.glance = { + serviceConfig = { + DynamicUser = lib.mkForce false; + User = "glance"; + Group = "glance"; + }; + }; + + users = { + groups.glance = {}; + users.glance = { + isSystemUser = true; + description = "Glance user"; + group = "glance"; + }; + }; + + sops.secrets.adguard-pwd = { + owner = "glance"; + mode = "0600"; + }; +} diff --git a/server-modules/glance.nix b/server-modules/glance.nix new file mode 100644 index 0000000..9e15005 --- /dev/null +++ b/server-modules/glance.nix @@ -0,0 +1,300 @@ +{ config, lib, ... }: +let + rgb-to-hsl = + color: + let + r = ((lib.toInt config.lib.stylix.colors."${color}-rgb-r") * 100.0) / 255; + g = ((lib.toInt config.lib.stylix.colors."${color}-rgb-g") * 100.0) / 255; + b = ((lib.toInt config.lib.stylix.colors."${color}-rgb-b") * 100.0) / 255; + max = lib.max r (lib.max g b); + min = lib.min r (lib.min g b); + delta = max - min; + fmod = base: int: base - (int * builtins.floor (base / int)); + h = + if delta == 0 then + 0 + else if max == r then + 60 * (fmod ((g - b) / delta) 6) + else if max == g then + 60 * (((b - r) / delta) + 2) + else if max == b then + 60 * (((r - g) / delta) + 4) + else + 0; + l = (max + min) / 2; + s = if delta == 0 then 0 else 100 * delta / (100 - lib.max (2 * l - 100) (100 - (2 * l))); + roundToString = value: toString (builtins.floor (value + 0.5)); + in + lib.concatMapStringsSep " " roundToString [ + h + s + l + ]; +in +{ + services = { + glance = { + enable = true; + settings = { + server.port = 8101; + pages = [ + { + hide-desktop-navigation = true; + columns = [ + { + size = "small"; + widgets = [ + { + type = "clock"; + hour-format = "24h"; + } + { + type = "weather"; + location = "Paris, France"; + } + { + type = "markets"; + markets = [ + { + symbol = "BTC-USD"; + name = "Bitcoin"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:BTCUSD"; + } + { + symbol = "SOL-USD"; + name = "Solana"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:SOLUSD"; + } + { + symbol = "ETH-USD"; + name = "Ethereum"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:ETHUSD"; + } + ]; + } + ]; + } + { + size = "full"; + widgets = [ + { + type = "search"; + search-engine = "google"; + } + { + type = "bookmarks"; + groups = [ + { + title = ""; + same-tab = true; + color = "200 50 50"; + links = [ + { + title = "Github"; + url = "https://github.com"; + } + { + title = "Youtube"; + url = "https://youtube.com"; + } + { + title = "Figma"; + url = "https://figma.com"; + } + ]; + } + { + title = "Docs"; + same-tab = true; + color = "200 50 50"; + links = [ + { + title = "Nixpkgs repo"; + url = "https://github.com/NixOS/nixpkgs"; + } + { + title = "Nixvim"; + url = "https://nix-community.github.io/nixvim/"; + } + { + title = "Hyprland wiki"; + url = "https://wiki.hyprland.org/"; + } + { + title = "Search NixOS"; + url = "https://search-nixos.hadi.diy"; + } + ]; + } + { + title = "Homelab"; + same-tab = true; + color = "100 50 50"; + links = [ + { + title = "Router"; + url = "http://192.168.1.254/"; + } + { + title = "Cloudflare"; + url = "https://dash.cloudflare.com/"; + } + ]; + } + { + title = "Work"; + same-tab = true; + color = "50 50 50"; + links = [ + { + title = "Outlook"; + url = "https://outlook.office.com/"; + } + { + title = "Teams"; + url = "https://teams.microsoft.com/"; + } + { + title = "Office"; + url = "https://www.office.com/"; + } + ]; + } + { + title = "Cyber"; + same-tab = true; + color = rgb-to-hsl "base09"; + links = [ + { + title = "CyberChef"; + url = "https://cyberchef.org/"; + } + { + title = "TryHackMe"; + url = "https://tryhackme.com/"; + } + { + title = "RootMe"; + url = "https://www.root-me.org/"; + } + { + title = "Exploit-DB"; + url = "https://www.exploit-db.com/"; + } + { + title = "CrackStation"; + url = "https://crackstation.net/"; + } + ]; + } + { + title = "Misc"; + same-tab = true; + color = rgb-to-hsl "base01"; + links = [ + { + title = "Svgl"; + url = "https://svgl.app/"; + } + { + title = "Excalidraw"; + url = "https://excalidraw.com/"; + } + { + title = "Cobalt (Downloader)"; + url = "https://cobalt.tools/"; + } + { + title = "Mazanoke (Image optimizer)"; + url = "https://mazanoke.com/"; + } + { + title = "Vert (File converter)"; + url = "https://vert.sh/"; + } + ]; + } + ]; + } + { + type = "server-stats"; + servers = [ + { + type = "local"; + name = "orion"; + } + ]; + } + { + type = "group"; + widgets = [ + { + type = "monitor"; + title = "Services"; + cache = "1m"; + sites = [ + { + title = "Vaultwarden"; + url = "https://vault.jelles.net"; + icon = "si:bitwarden"; + } + { + title = "Files"; + url = "https://fiels.jelles.net"; + icon = "si:nextcloud"; + } + ]; + } + { + type = "monitor"; + title = "*arr"; + cache = "1m"; + sites = [ + { + title = "Jellyfin"; + url = "https://jellyfin.hadi.diy"; + icon = "si:jellyfin"; + } + { + title = "Jellyseerr"; + url = "https://jellyseerr.hadi.diy"; + icon = "si:odysee"; + } + { + title = "Radarr"; + url = "https://radarr.hadi.diy"; + icon = "si:radarr"; + } + { + title = "Sonarr"; + url = "https://sonarr.hadi.diy"; + icon = "si:sonarr"; + } + { + title = "Prowlarr"; + url = "https://prowlarr.hadi.diy"; + icon = "si:podcastindex"; + } + { + title = "Transmission"; + url = "https://transmission.hadi.diy"; + icon = "si:transmission"; + } + ]; + } + ]; + } + ]; + } + ]; + name = "Home"; + } + ]; + }; + }; + + caddy.virtualHosts."jelles.net".extraConfig = + "reverse_proxy :${toString config.services.glance.settings.server.port}"; + }; + +} diff --git a/server-modules/home-assistant.nix b/server-modules/home-assistant.nix new file mode 100644 index 0000000..1d8c06d --- /dev/null +++ b/server-modules/home-assistant.nix @@ -0,0 +1,48 @@ +{ config, ... }: +{ + services = { + home-assistant = { + enable = true; + openFirewall = false; + + extraComponents = [ + "evohome" # The Honeywell TCC (Europe) component + "met" # Default weather + "radio_browser" # Default radio + ]; + + # Configuration for components that support YAML (like Evohome) + config = { + homeassistant = { + name = "My Home"; + latitude = 51.5; # Update with your actual location + longitude = 5.9; # Update with your actual location + unit_system = "metric"; + time_zone = config.var.timeZone; + }; + + # Honeywell TCC (Europe) / Evohome configuration + # https://www.home-assistant.io/integrations/evohome/ + evohome = { + username = "!secret honeywell_username"; + password = "!secret honeywell_password"; + }; + + # Basic default setup + default_config = { }; + http = { + server_port = 8123; + server_host = "127.0.0.1"; + use_x_forwarded_for = true; + trusted_proxies = [ + "127.0.0.1" + "::1" + ]; + }; + }; + }; + + caddy.virtualHosts."home.jelles.net".extraConfig = + "reverse_proxy :${toString config.services.home-assistant.config.http.server_port}"; + }; +} diff --git a/server-modules/mealie.nix b/server-modules/mealie.nix new file mode 100644 index 0000000..78007f7 --- /dev/null +++ b/server-modules/mealie.nix @@ -0,0 +1,19 @@ +# Mealie is a recipe management and meal planning application. +{config, ...}: let + domain = "mealie.hadi.diy"; +in { + services = { + mealie = { + enable = true; + port = 8092; + }; + + nginx.virtualHosts."${domain}" = { + useACMEHost = "hadi.diy"; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.mealie.port}"; + }; + }; + }; +} diff --git a/server-modules/nginx.nix b/server-modules/nginx.nix new file mode 100644 index 0000000..0f0bb24 --- /dev/null +++ b/server-modules/nginx.nix @@ -0,0 +1,45 @@ +# Nginx is a web server that can also be used as a reverse proxy, load balancer, and HTTP cache. +{config, ...}: let + domain = "hadi.diy"; +in { + security.acme = { + acceptTerms = true; + defaults.email = config.var.git.email; + certs."${domain}" = { + domain = "${domain}"; + extraDomainNames = ["*.${domain}"]; + group = "nginx"; + dnsProvider = "cloudflare"; + dnsPropagationCheck = true; + credentialsFile = config.sops.secrets.cloudflare-dns-token.path; + }; + }; + + # Return 444 for all requests not matching a used subdomain. + services.nginx = { + enable = true; + virtualHosts = { + "default" = { + default = true; + locations."/" = {return = 444;}; + }; + "*.${domain}" = { + useACMEHost = domain; + forceSSL = true; + locations."/" = {return = 444;}; + }; + "aaaaaa.${domain}" = { + useACMEHost = domain; + forceSSL = true; + locations."/" = {return = 444;}; + }; + }; + }; + + networking.firewall = { + allowedTCPPorts = [80 443]; + allowedUDPPorts = [80 443]; + }; + + sops.secrets.cloudflare-dns-token = {path = "/etc/cloudflare/dnskey.txt";}; +} diff --git a/server-modules/ssh.nix b/server-modules/ssh.nix new file mode 100644 index 0000000..0e0e809 --- /dev/null +++ b/server-modules/ssh.nix @@ -0,0 +1,23 @@ +# SSH configuration +{ config, ... }: +let + username = config.var.username; +in +{ + services.openssh = { + enable = true; + ports = [ 22 ]; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + AllowUsers = [ username ]; + }; + }; + + # Add my public SSH key to my user + users.users."${username}" = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAU2LydkXRTtNFY7oyX8JQURwXLVhB71DeK8XzrXeFX1 openpgp:0xA490D93A" + ]; + }; +} diff --git a/themes/catppuccin.nix b/themes/catppuccin.nix new file mode 100644 index 0000000..2079692 --- /dev/null +++ b/themes/catppuccin.nix @@ -0,0 +1,91 @@ +{ + lib, + pkgs, + config, + ... +}: +{ + options.theme = lib.mkOption { + type = lib.types.attrs; + default = { + rounding = 17; + gaps-in = 5; + gaps-out = 10; + active-opacity = 1; + inactive-opacity = 1; + blur = true; + border-size = 3; + animation-speed = "fast"; # "fast" | "medium" | "slow" + fetch = "none"; # "nerdfetch" | "neofetch" | "pfetch" | "none" + textColorOnWallpaper = config.lib.stylix.colors.base01; # Color of the text displayed on the wallpaper (Lockscreen, display manager, ...) + + bar = { + # Hyprpanel + position = "top"; # "top" | "bottom" + transparent = true; + transparentButtons = false; + floating = true; + }; + }; + description = "Theme configuration options"; + }; + + config.stylix = { + enable = true; + + # Mocha + # See https://tinted-theming.github.io/tinted-gallery/ for more schemes + base16Scheme = { + base00 = "0F0F15"; # Default Background + base01 = "15151A"; # Lighter Background (Used for status bars, line number and folding marks) + base02 = "313244"; # Selection Background + base03 = "45475a"; # Comments, Invisibles, Line Highlighting + base04 = "585b70"; # Dark Foreground (Used for status bars) + base05 = "cdd6f4"; # Default Foreground, Caret, Delimiters, Operators + base06 = "f5e0dc"; # Light Foreground (Not often used) + base07 = "b4befe"; # Light Background (Not often used) + base08 = "f38ba8"; # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted + base09 = "fab387"; # Integers, Boolean, Constants, XML Attributes, Markup Link Url + base0A = "f9e2af"; # Classes, Markup Bold, Search Text Background + base0B = "a6e3a1"; # Strings, Inherited Class, Markup Code, Diff Inserted + base0C = "94e2d5"; # Support, Regular Expressions, Escape Characters, Markup Quotes + base0D = "89b4fa"; # Functions, Methods, Attribute IDs, Headings, Accent color + base0E = "cba6f7"; # Keywords, Storage, Selector, Markup Italic, Diff Changed + base0F = "f2cdcd"; # Deprecated, Opening/Closing Embedded Language Tags, e.g. + }; + + cursor = { + name = "phinger-cursors-light"; + package = pkgs.phinger-cursors; + size = 28; + }; + + fonts = { + monospace = { + package = pkgs.nerd-fonts.jetbrains-mono; + name = "JetBrains Mono Nerd Font"; + }; + sansSerif = { + package = pkgs.source-sans-pro; + name = "Source Sans Pro"; + }; + serif = config.stylix.fonts.sansSerif; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + }; + sizes = { + applications = 13; + desktop = 13; + popups = 15; + terminal = 11.5; + }; + }; + + polarity = "dark"; + image = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/anotherhadi/awesome-wallpapers/refs/heads/main/app/static/wallpapers/leef_dark_purple_minimalist.png"; + sha256 = "sha256-q6ufFdC/tMSb+mllw7XhilkAObemXXyps2SBlnMt7mY="; + }; + }; +} diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..1d07140 --- /dev/null +++ b/todo.md @@ -0,0 +1,3 @@ +- Look into how nvf does things and copy what I like +- Integrate nixcats flake into main system flake +- Create config for laptop