diff options
35 files changed, 1860 insertions, 229 deletions
@@ -48,21 +48,6 @@ "type": "github" } }, - "crane_2": { - "locked": { - "lastModified": 1727974419, - "narHash": "sha256-WD0//20h+2/yPGkO88d2nYbb23WMWYvnRyDQ9Dx4UHg=", - "owner": "ipetkov", - "repo": "crane", - "rev": "37e4f9f0976cb9281cd3f0c70081e5e0ecaee93f", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -97,24 +82,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -159,72 +126,13 @@ "type": "github" } }, - "helix_2": { - "inputs": { - "crane": "crane_2", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2", - "rust-overlay": "rust-overlay_2" - }, - "locked": { - "lastModified": 1730313564, - "narHash": "sha256-1RBs/WOH3gp2ETDruEbM2vq2tPiJmqQ3wrjiKREE5NU=", - "owner": "helix-editor", - "repo": "helix", - "rev": "38faf74febf3332fb119302324bfd21229d39e14", - "type": "github" - }, - "original": { - "owner": "helix-editor", - "ref": "master", - "repo": "helix", - "type": "github" - } - }, - "home-jras": { - "inputs": { - "helix": "helix_2", - "home-manager": "home-manager", - "nixpkgs": "nixpkgs_3", - "zen-browser": "zen-browser" - }, - "locked": { - "lastModified": 1731154497, - "narHash": "sha256-X3SrdZTW/kptvyEKw5FXgA0lJA+/PeO9dLoky0NE22A=", - "path": "/home/jras/home-manager", - "type": "path" - }, - "original": { - "path": "/home/jras/home-manager", - "type": "path" - } - }, "home-manager": { "inputs": { "nixpkgs": [ - "home-jras", "nixpkgs" ] }, "locked": { - "lastModified": 1730016908, - "narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "e83414058edd339148dc142a8437edb9450574c8", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager_2": { - "inputs": { - "nixpkgs": "nixpkgs_5" - }, - "locked": { "lastModified": 1726989464, "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", "owner": "nix-community", @@ -276,17 +184,17 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems_3", + "systems": "systems_2", "xdph": "xdph" }, "locked": { - "lastModified": 1730969692, - "narHash": "sha256-4Ly9zkqnRB6qLjMeddfUyd4iRLvq+RDspBWABS8DGN4=", + "lastModified": 1731119644, + "narHash": "sha256-tQytm74mti64PmF0BbLdFUip9OD/nJwSiGuwAGlSAZY=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "e58e97b0a38b8ccc87a4304c9e4e2b37c9966875", + "rev": "cca227a53e10b9101d2fbcfb99e6360b416d7168", "type": "github" }, "original": { @@ -433,70 +341,6 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1728018373, - "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1730200266, - "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1727348695, - "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1716542732, - "narHash": "sha256-0Y9fRr0CUqWT4KgBITmaGwlnNIGMYuydu2L8iLTfHU4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d12251ef6e8e6a46e05689eeccd595bdbd3c9e60", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { - "locked": { "lastModified": 1730785428, "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", "owner": "NixOS", @@ -511,13 +355,13 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_3": { "locked": { - "lastModified": 1730883749, - "narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=", + "lastModified": 1730963269, + "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "dba414932936fde69f0606b4f1d87c5bc0003ede", + "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc", "type": "github" }, "original": { @@ -527,7 +371,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_4": { "locked": { "lastModified": 1727348695, "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", @@ -570,11 +414,10 @@ "root": { "inputs": { "helix": "helix", - "home-jras": "home-jras", - "home-manager": "home-manager_2", + "home-manager": "home-manager", "hyprland": "hyprland", - "nixpkgs": "nixpkgs_7", - "zen-browser": "zen-browser_2" + "nixpkgs": "nixpkgs_3", + "zen-browser": "zen-browser" } }, "rust-overlay": { @@ -598,28 +441,6 @@ "type": "github" } }, - "rust-overlay_2": { - "inputs": { - "nixpkgs": [ - "home-jras", - "helix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1728268235, - "narHash": "sha256-lJMFnMO4maJuNO6PQ5fZesrTmglze3UFTTBuKGwR1Nw=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "25685cc2c7054efc31351c172ae77b21814f2d42", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -637,21 +458,6 @@ }, "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", @@ -723,24 +529,6 @@ "repo": "zen-browser-flake", "type": "github" } - }, - "zen-browser_2": { - "inputs": { - "nixpkgs": "nixpkgs_8" - }, - "locked": { - "lastModified": 1727721329, - "narHash": "sha256-QYlWZwUSwrM7BuO+dXclZIwoPvBIuJr6GpFKv9XKFPI=", - "owner": "MarceColl", - "repo": "zen-browser-flake", - "rev": "e6ab73f405e9a2896cce5956c549a9cc359e5fcc", - "type": "github" - }, - "original": { - "owner": "MarceColl", - "repo": "zen-browser-flake", - "type": "github" - } } }, "root": "root", @@ -4,13 +4,13 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; home-manager.url = "github:nix-community/home-manager/release-24.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; helix.url = "github:helix-editor/helix/master"; - home-jras.url = "path:/home/jras/home-manager"; zen-browser.url = "github:MarceColl/zen-browser-flake"; hyprland.url = "github:hyprwm/Hyprland"; }; - outputs = { self, nixpkgs, home-manager, home-jras, ... }@inputs: { + outputs = { nixpkgs, home-manager, ... }@inputs: { nixosConfigurations.tarrel = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; @@ -26,10 +26,11 @@ ./nvidia.nix ./virt.nix - home-manager.nixosModules.home-manager { + home-manager.nixosModules.home-manager + { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.jras = import "${home-jras}/entrypoints/personal.nix"; + home-manager.users.jras = import ./home-manager/entrypoints/personal.nix; home-manager.extraSpecialArgs = { inherit inputs; }; } diff --git a/home-manager/.git-crypt/.gitattributes b/home-manager/.git-crypt/.gitattributes new file mode 100644 index 0000000..665b10e --- /dev/null +++ b/home-manager/.git-crypt/.gitattributes @@ -0,0 +1,4 @@ +# Do not edit this file. To specify the files to encrypt, create your own +# .gitattributes file in the directory where your files are. +* !filter !diff +*.gpg binary diff --git a/home-manager/.git-crypt/keys/default/0/844D7850F2DE85C196A58AEBD7A1D5673C1190F2.gpg b/home-manager/.git-crypt/keys/default/0/844D7850F2DE85C196A58AEBD7A1D5673C1190F2.gpg Binary files differnew file mode 100644 index 0000000..9f09198 --- /dev/null +++ b/home-manager/.git-crypt/keys/default/0/844D7850F2DE85C196A58AEBD7A1D5673C1190F2.gpg diff --git a/home-manager/.gitattributes b/home-manager/.gitattributes new file mode 100644 index 0000000..4d4d4df --- /dev/null +++ b/home-manager/.gitattributes @@ -0,0 +1,2 @@ +secrets/** filter=git-crypt diff=git-crypt +flake.lock filter=git-crypt diff=git-crypt diff --git a/home-manager/alacritty/argonout.json b/home-manager/alacritty/argonout.json new file mode 100644 index 0000000..a31e323 --- /dev/null +++ b/home-manager/alacritty/argonout.json @@ -0,0 +1,29 @@ +{ + "colors": { + "primary": { + "background": "0x292C3E", + "foreground": "0xEBEBEB" + }, + "normal": { + "black": "0x0d0d0d", + "red": "0xFF301B", + "green": "0xA0E521", + "yellow": "0xFFC620", + "blue": "0x1BA6FA", + "magenta": "0x8763B8", + "cyan": "0x21DEEF", + "white": "0xEBEBEB" + }, + "bright": { + "black": "0x6D7070", + "red": "0xFF4352", + "green": "0xB8E466", + "yellow": "0xFFD750", + "blue": "0x1BA6FA", + "magenta": "0xA578EA", + "cyan": "0x73FBF1", + "white": "0xFEFEF8" + } + } +} + diff --git a/home-manager/alacritty/catppuccin-frappe.json b/home-manager/alacritty/catppuccin-frappe.json new file mode 100644 index 0000000..e465a9b --- /dev/null +++ b/home-manager/alacritty/catppuccin-frappe.json @@ -0,0 +1,82 @@ +{ + "colors": { + "primary": { + "background": "#303446", + "foreground": "#C6D0F5", + "dim_foreground": "#C6D0F5", + "bright_foreground": "#C6D0F5" + }, + "cursor": { + "text": "#303446", + "cursor": "#F2D5CF" + }, + "vi_mode_cursor": { + "text": "#303446", + "cursor": "#BABBF1" + }, + "search": { + "matches": { + "foreground": "#303446", + "background": "#A5ADCE" + }, + "focused_match": { + "foreground": "#303446", + "background": "#A6D189" + } + }, + "hints": { + "start": { + "foreground": "#303446", + "background": "#E5C890" + }, + "end": { + "foreground": "#303446", + "background": "#A5ADCE" + } + }, + "selection": { + "text": "#303446", + "background": "#F2D5CF" + }, + "normal": { + "black": "#51576D", + "red": "#E78284", + "green": "#A6D189", + "yellow": "#E5C890", + "blue": "#8CAAEE", + "magenta": "#F4B8E4", + "cyan": "#81C8BE", + "white": "#B5BFE2" + }, + "bright": { + "black": "#626880", + "red": "#E78284", + "green": "#A6D189", + "yellow": "#E5C890", + "blue": "#8CAAEE", + "magenta": "#F4B8E4", + "cyan": "#81C8BE", + "white": "#A5ADCE" + }, + "dim": { + "black": "#51576D", + "red": "#E78284", + "green": "#A6D189", + "yellow": "#E5C890", + "blue": "#8CAAEE", + "magenta": "#F4B8E4", + "cyan": "#81C8BE", + "white": "#B5BFE2" + }, + "indexed_colors": [ + { + "index": 16, + "color": "#EF9F76" + }, + { + "index": 17, + "color": "#F2D5CF" + } + ] + } +} diff --git a/home-manager/alacritty/catppuccin-latte.json b/home-manager/alacritty/catppuccin-latte.json new file mode 100644 index 0000000..f4a9b2b --- /dev/null +++ b/home-manager/alacritty/catppuccin-latte.json @@ -0,0 +1,86 @@ +{ + "colors": { + "primary": { + "background": "#EFF1F5", + "foreground": "#4C4F69", + "dim_foreground": "#4C4F69", + "bright_foreground": "#4C4F69" + }, + "cursor": { + "text": "#EFF1F5", + "cursor": "#DC8A78" + }, + "vi_mode_cursor": { + "text": "#EFF1F5", + "cursor": "#7287FD" + }, + "search": { + "matches": { + "foreground": "#EFF1F5", + "background": "#6C6F85" + }, + "focused_match": { + "foreground": "#EFF1F5", + "background": "#40A02B" + }, + "footer_bar": { + "foreground": "#EFF1F5", + "background": "#6C6F85" + } + }, + "hints": { + "start": { + "foreground": "#EFF1F5", + "background": "#DF8E1D" + }, + "end": { + "foreground": "#EFF1F5", + "background": "#6C6F85" + } + }, + "selection": { + "text": "#EFF1F5", + "background": "#DC8A78" + }, + "normal": { + "black": "#5C5F77", + "red": "#D20F39", + "green": "#40A02B", + "yellow": "#DF8E1D", + "blue": "#1E66F5", + "magenta": "#EA76CB", + "cyan": "#179299", + "white": "#ACB0BE" + }, + "bright": { + "black": "#6C6F85", + "red": "#D20F39", + "green": "#40A02B", + "yellow": "#DF8E1D", + "blue": "#1E66F5", + "magenta": "#EA76CB", + "cyan": "#179299", + "white": "#BCC0CC" + }, + "dim": { + "black": "#5C5F77", + "red": "#D20F39", + "green": "#40A02B", + "yellow": "#DF8E1D", + "blue": "#1E66F5", + "magenta": "#EA76CB", + "cyan": "#179299", + "white": "#ACB0BE" + }, + "indexed_colors": [ + { + "index": 16, + "color": "#FE640B" + }, + { + "index": 17, + "color": "#DC8A78" + } + ] + } +} diff --git a/home-manager/alacritty/kanagawa.json b/home-manager/alacritty/kanagawa.json new file mode 100644 index 0000000..3ed1a40 --- /dev/null +++ b/home-manager/alacritty/kanagawa.json @@ -0,0 +1,43 @@ +{ + "colors": { + "primary": { + "background": "0x1f1f28", + "foreground": "0xdcd7ba" + }, + "normal": { + "black": "0x090618", + "red": "0xc34043", + "green": "0x76946a", + "yellow": "0xc0a36e", + "blue": "0x7e9cd8", + "magenta": "0x957fb8", + "cyan": "0x6a9589", + "white": "0xc8c093" + }, + "bright": { + "black": "0x727169", + "red": "0xe82424", + "green": "0x98bb6c", + "yellow": "0xe6c384", + "blue": "0x7fb4ca", + "magenta": "0x938aa9", + "cyan": "0x7aa89f", + "white": "0xdcd7ba" + }, + "selection": { + "background": "0x2d4f67", + "foreground": "0xc8c093" + }, + "indexed_colors": [ + { + "index": 16, + "color": "0xffa066" + }, + { + "index": 17, + "color": "0xff5d62" + } + ] + } +} + diff --git a/home-manager/alacritty/retrowave.json b/home-manager/alacritty/retrowave.json new file mode 100644 index 0000000..63559cf --- /dev/null +++ b/home-manager/alacritty/retrowave.json @@ -0,0 +1,42 @@ +{ + "colors": { + "primary": { + "background": "0x070825", + "foreground": "0x46BDFF" + }, + "normal": { + "black": "0x181A1F", + "red": "0xFF16B0", + "green": "0x929292", + "yellow": "0xfcee54", + "blue": "0xffffff", + "magenta": "0xFF92DF", + "cyan": "0xdf81fc", + "white": "0xFFFFFF" + }, + "bright": { + "black": "0xFF16B0", + "red": "0xf85353", + "green": "0xfcee54", + "yellow": "0xffffff", + "blue": "0x46BDFF", + "magenta": "0xFF92DF", + "cyan": "0xff901f", + "white": "0xffffff" + }, + "selection": { + "background": "0x2d4f67", + "foreground": "0xc8c093" + }, + "indexed_colors": [ + { + "index": 16, + "color": "0xffa066" + }, + { + "index": 17, + "color": "0xff5d62" + } + ] + } +} diff --git a/home-manager/alacritty/solarized.yaml b/home-manager/alacritty/solarized.yaml new file mode 100644 index 0000000..1f9591c --- /dev/null +++ b/home-manager/alacritty/solarized.yaml @@ -0,0 +1,28 @@ +# Colors (Solarized Light) +colors: + # Default colors + primary: + background: '0xfdf6e3' + foreground: '0x586e75' + + # Normal colors + normal: + black: '0x073642' + red: '0xdc322f' + green: '0x859900' + yellow: '0xb58900' + blue: '0x268bd2' + magenta: '0xd33682' + cyan: '0x2aa198' + white: '0xeee8d5' + + # Bright colors + bright: + black: '0x002b36' + red: '0xcb4b16' + green: '0x586e75' + yellow: '0x657b83' + blue: '0x839496' + magenta: '0x6c71c4' + cyan: '0x93a1a1' + white: '0xfdf6e3' diff --git a/home-manager/alacritty/tokyonight.json b/home-manager/alacritty/tokyonight.json new file mode 100644 index 0000000..a918eb0 --- /dev/null +++ b/home-manager/alacritty/tokyonight.json @@ -0,0 +1,39 @@ +{ + "colors": { + "primary": { + "background": "0x24283b", + "foreground": "0xc0caf5" + }, + "normal": { + "black": "0x1d202f", + "red": "0xf7768e", + "green": "0x9ece6a", + "yellow": "0xe0af68", + "blue": "0x7aa2f7", + "magenta": "0xbb9af7", + "cyan": "0x7dcfff", + "white": "0xa9b1d6" + }, + "bright": { + "black": "0x414868", + "red": "0xf7768e", + "green": "0x9ece6a", + "yellow": "0xe0af68", + "blue": "0x7aa2f7", + "magenta": "0xbb9af7", + "cyan": "0x7dcfff", + "white": "0xc0caf5" + }, + "indexed_colors": [ + { + "index": 16, + "color": "0xff9e64" + }, + { + "index": 17, + "color": "0xdb4b4b" + } + ] + } +} + diff --git a/home-manager/common.nix b/home-manager/common.nix new file mode 100644 index 0000000..9fa996d --- /dev/null +++ b/home-manager/common.nix @@ -0,0 +1,373 @@ +{ lib, pkgs, inputs, ... }: { + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + home.packages = [ + pkgs.gnumake + inputs.zen-browser.packages.${pkgs.system}.specific + pkgs.git-crypt + pkgs.maim + pkgs.xkcdpass + pkgs.speedtest-cli + pkgs.bitwarden-cli + # Language servers + pkgs.nixfmt-rfc-style + pkgs.nixd + pkgs.pyright + pkgs.gopls + pkgs.lua-language-server + pkgs.ansible-language-server + pkgs.ansible-lint + # --- + pkgs.fd + pkgs.glow + pkgs.eza + pkgs.openssh + + pkgs.cobra-cli + pkgs.yq-go + + # Programming languages + pkgs.gleam + pkgs.erlang_26 + pkgs.elixir_1_15 + pkgs.elixir_ls + + # Python formatted and linter + pkgs.python313 + pkgs.black + pkgs.ruff + ]; + + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + home.file = { }; + + # You can also manage environment variables but you will have to manually + # source + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/jras/etc/profile.d/hm-session-vars.sh + # + # if you don't want to manage your shell through Home Manager. + home.sessionVariables = { EDITOR = "hx"; }; + home.sessionPath = [ "$GOBIN" ]; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + programs.ripgrep.enable = true; + programs.bat.enable = true; + programs.btop.enable = true; + programs.go = { + enable = true; + goPath = "go"; + goBin = "go/bin"; + }; + + programs.zoxide = { + enable = true; + options = [ "--cmd cd" ]; + }; + programs.fzf.enable = true; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.zsh = { + enable = true; + defaultKeymap = "emacs"; + envExtra = '' + export ZVM_VI_INSERT_ESCAPE_BINDKEY="jk" + ''; + initExtra = '' + # https://github.com/jeffreytse/zsh-vi-mode + source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh + ''; + shellAliases = { + g = "git"; + }; + }; + + programs.git = { + enable = true; + aliases = { + f = "fetch"; + p = "pull"; + s = "status"; + co = "checkout"; + pu = "push"; + lg = + "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + praise = "blame"; + bump = "!git bump"; + ae = "!git add -A && git commit --amend"; + ac = "!git add -A && git commit"; + rmbs = + "!git branch | grep -wv master | grep -wv main | xargs git branch -D"; + nb = "!git checkout -b"; + }; + extraConfig = { + pull.rebase = false; + init.defaultBranch = "main"; + }; + }; + + programs.tmux = { + enable = true; + shortcut = "a"; + newSession = true; + terminal = "tmux-256color"; + extraConfig = '' + # Recommended by NeoVim's checkhealth + set-option -sg escape-time 10 + set-option -g default-shell ${pkgs.zsh}/bin/zsh + + # # Set vim keymode + set-window-option -g mode-keys vi + bind-key -T copy-mode-vi v send -X begin-selection + bind-key -T copy-mode-vi V send -X select-line + bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection clipboard' + ''; + plugins = with pkgs.tmuxPlugins; [ + vim-tmux-navigator + + { + plugin = catppuccin; + extraConfig = '' + set -g @catppuccin_flavour 'frappe' + set -g @catppuccin_powerline_theme_enabled 'on' + set -g @catppuccin_l_left_separator '' + set -g @catppuccin_l_right_separator '' + set -g @catppuccin_r_left_separator '' + set -g @catppuccin_r_right_separator '' + ''; + } + ]; + }; + + programs.neovim = { + enable = true; + vimAlias = true; + plugins = with pkgs.vimPlugins; [ + gleam-vim + plenary-nvim + telescope-file-browser-nvim + vim-tmux-navigator + nui-nvim + # Colors + catppuccin-nvim + # LSP + nvim-lspconfig + trouble-nvim + # Completion + luasnip + nvim-cmp + cmp-nvim-lsp + cmp-nvim-lua + cmp-buffer + cmp-path + cmp_luasnip + + { + plugin = lsp-zero-nvim; + type = "lua"; + config = builtins.readFile (./neovim/lsp-zero-nvim.lua); + } + { + plugin = nvim-web-devicons; + type = "lua"; + config = builtins.readFile (./neovim/nvim-web-devicons.lua); + } + { + plugin = nvim-treesitter.withAllGrammars; + type = "lua"; + config = builtins.readFile (./neovim/nvim-treesitter.lua); + } + { + plugin = telescope-nvim; + type = "lua"; + config = builtins.readFile (./neovim/telescope-nvim.lua); + } + { + plugin = harpoon; + type = "lua"; + config = builtins.readFile (./neovim/harpoon.lua); + } + #{ + # plugin = copilot-vim; + # type = "lua"; + # config = builtins.readFile (./neovim/copilot-vim.lua); + #} + ]; + extraLuaConfig = builtins.readFile (./neovim/init.lua); + extraConfig = '' + set shiftwidth=4 smarttab + set expandtab + set tabstop=4 softtabstop=0 + + inoremap jk <ESC> + let mapleader=" " " remap the mapleader + + syntax on " syntax highlighting + set number " show line numbers + set relativenumber " relative line numbers + set noswapfile " disable the swap file + set hlsearch " highlight all results + set ignorecase " ignore case in search + set incsearch " show search results as you type + + " disable mouse + set mouse= + + autocmd BufWritePost *.nix !nixfmt % + autocmd BufWritePost *.go !gofmt -w % + ''; + }; + + programs.starship = { + enable = true; + settings = { + directory.style = "blue"; + + format = lib.concatStrings [ + "$username" + "$hostname" + "$directory" + "$git_branch" + "$git_state" + "$git_status" + "$cmd_duration" + "$line_break" + "$python" + "$openstack" + "$character" + ]; + + character = { + success_symbol = "[❯](purple)"; + error_symbol = "[❯](red)"; + vimcmd_symbol = "[❮](green)"; + }; + + git_branch = { + format = "[$branch]($style)"; + style = "bright-black"; + }; + + git_status = { + format = + "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)"; + style = "cyan"; + conflicted = ""; + untracked = ""; + modified = ""; + staged = ""; + renamed = ""; + deleted = ""; + stashed = "≡"; + }; + + git_state = { + format = "'([$state( $progress_current/$progress_total)]($style))' "; + style = "bright-black"; + }; + + cmd_duration = { + format = "[$duration]($style) "; + style = "yellow"; + }; + + python = { + format = "[$virtualenv]($style) "; + style = "bright-black"; + }; + }; + }; + + programs.helix = { + enable = true; + package = inputs.helix.packages."${pkgs.system}".helix; + defaultEditor = true; + languages = { + language = [ + { + name = "python"; + language-servers = [ "pyright" "ruff" ]; + formatter = { command = "black"; args = ["--line-length" "88" "--quiet" "-"]; }; + auto-format = true; + } + { + name = "elixir"; + language-servers = [ "elixir-ls" ]; + formatter = { command = "mix format"; }; + auto-format = true; + } + ]; + language-server.pyright.config.python.analysis = { typeCheckingMode = "basic"; }; + language-server.ruff = { command = "ruff"; }; + language-server.ruff.config.setting = { args = ["--ignore" "E501" ]; }; + language-server.intelephense = with pkgs.nodePackages; { + command = "${intelephense}/bin/intelephense"; + }; + }; + settings = { + keys.normal = { + space.F = "file_picker_in_current_buffer_directory"; + }; + editor = { + line-number = "relative"; + bufferline = "always"; + lsp = { + enable = true; + display-messages = true; + }; + indent-guides = { + render = true; + skip-levels = 1; + }; + auto-save = false; + }; + }; + }; + + services.ssh-agent.enable = true; + programs.ssh = { + enable = true; + package = "${pkgs.openssh}"; + addKeysToAgent = "yes"; + }; + + programs.alacritty = { + settings = { + window = { + padding = { x = 5; y = 5; }; + }; + env = { TERM = "alacritty-direct"; }; + shell = { + program = "${pkgs.zsh}/bin/zsh"; + args = [ "-l" ]; + }; + } // builtins.fromJSON (builtins.readFile ./alacritty/catppuccin-frappe.json); + }; + + programs.taskwarrior = { + enable = true; + package = "${pkgs.taskwarrior3}"; + }; +} diff --git a/home-manager/compositor/hyprland.nix b/home-manager/compositor/hyprland.nix new file mode 100644 index 0000000..55133a4 --- /dev/null +++ b/home-manager/compositor/hyprland.nix @@ -0,0 +1,108 @@ +{ pkgs, ... }: +{ + wayland.windowManager.hyprland.enable = true; + wayland.windowManager.hyprland.systemd.enable = true; + wayland.windowManager.hyprland.settings = { + "$terminal" = "alacritty"; + "$mod" = "SUPER"; + + exec-once = [ + "waybar" + ]; + + general = { + "border_size" = 2; + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + }; + + monitor = [ + "Unknown-1, disable" + ",preferred,auto,auto" + ]; + + animations = { + bezier = [ + "easeOutQuint,0.23,1,0.32,1" + "easeInOutCubic,0.65,0.05,0.36,1" + "linear,0,0,1,1" + "almostLinear,0.5,0.5,0.75,1.0" + "quick,0.15,0,0.1,1" + ]; + animation = [ + "global, 1, 10, default" + "border, 1, 5.39, easeOutQuint" + "windows, 1, 4.79, easeOutQuint" + "windowsIn, 1, 4.1, easeOutQuint, popin 87%" + "windowsOut, 1, 1.49, linear, popin 87%" + "fadeIn, 1, 1.73, almostLinear" + "fadeOut, 1, 1.46, almostLinear" + "fade, 1, 3.03, quick" + "layers, 1, 3.81, easeOutQuint" + "layersIn, 1, 4, easeOutQuint, fade" + "layersOut, 1, 1.5, linear, fade" + "fadeLayersIn, 1, 1.79, almostLinear" + "fadeLayersOut, 1, 1.39, almostLinear" + "workspaces, 1, 1.94, almostLinear, fade" + ]; + }; + + decoration = { + "rounding" = 5; + "inactive_opacity" = 0.8; + }; + + bind = + [ + "$mod, D, exec, ${pkgs.rofi-wayland-unwrapped}/bin/rofi -show drun" + "$mod SHIFT, D, exec, ${pkgs.rofi-rbw}/bin/rofi-rbw" + "$mod, F, fullscreen, 1" + "$mod, Return, exec, alacritty" + "$mod SHIFT, Q, killactive" + "$mod, h, movefocus, l" + "$mod, j, movefocus, d" + "$mod, k, movefocus, u" + "$mod, l, movefocus, r" + "$mod SHIFT, h, swapwindow, l" + "$mod SHIFT, j, swapwindow, d" + "$mod SHIFT, k, swapwindow, u" + "$mod SHIFT, l, swapwindow, r" + ] + ++ ( + builtins.concatLists (builtins.genList (i: + let ws = i + 1; + in [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" + ] + ) + 9) + ); + }; + + programs.waybar.settings = { + mainBar = { + layer = "top"; + position = "bottom"; + output = [ + "HDMI-A-1" + ]; + modules-left = [ + "hyprland/workspaces" + ]; + modules-right = [ + "clock" + ]; + + "hyprland/workspaces" = { + all-outputs = true; + format-icons = { + active = ""; + default = ""; + }; + format = "{id} {icon}"; + window-rewrite-default = "*"; + }; + }; + }; +} diff --git a/home-manager/compositor/sway.nix b/home-manager/compositor/sway.nix new file mode 100644 index 0000000..16690e9 --- /dev/null +++ b/home-manager/compositor/sway.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + wayland.windowManager.sway = { + enable = true; + + config = { + terminal = "alacritty"; + modifier = "Mod4"; + menu = "${pkgs.tofi}/bin/tofi-run | ${pkgs.findutils}/bin/xargs swaymsg exec --"; + bars = [ + { + command = "${pkgs.waybar}/bin/waybar"; + position = "bottom"; + } + ]; + fonts = { + names = [ "FontAwesome5Free" ]; + }; + }; + }; +} diff --git a/home-manager/config/alacritty.toml b/home-manager/config/alacritty.toml new file mode 100644 index 0000000..0594ea5 --- /dev/null +++ b/home-manager/config/alacritty.toml @@ -0,0 +1,88 @@ +[window] +padding.y = 1 + +[colors] +[colors.bright] +black = "#626880" +blue = "#8CAAEE" +cyan = "#81C8BE" +green = "#A6D189" +magenta = "#F4B8E4" +red = "#E78284" +white = "#A5ADCE" +yellow = "#E5C890" + +[colors.cursor] +cursor = "#F2D5CF" +text = "#303446" + +[colors.dim] +black = "#51576D" +blue = "#8CAAEE" +cyan = "#81C8BE" +green = "#A6D189" +magenta = "#F4B8E4" +red = "#E78284" +white = "#B5BFE2" +yellow = "#E5C890" + +[colors.hints] +[colors.hints.end] +background = "#A5ADCE" +foreground = "#303446" + +[colors.hints.start] +background = "#E5C890" +foreground = "#303446" + +[[colors.indexed_colors]] +color = "#EF9F76" +index = 16 + +[[colors.indexed_colors]] +color = "#F2D5CF" +index = 17 + +[colors.normal] +black = "#51576D" +blue = "#8CAAEE" +cyan = "#81C8BE" +green = "#A6D189" +magenta = "#F4B8E4" +red = "#E78284" +white = "#B5BFE2" +yellow = "#E5C890" + +[colors.primary] +background = "#303446" +bright_foreground = "#C6D0F5" +dim_foreground = "#C6D0F5" +foreground = "#C6D0F5" + +[colors.search] +[colors.search.focused_match] +background = "#A6D189" +foreground = "#303446" + +[colors.search.matches] +background = "#A5ADCE" +foreground = "#303446" + +[colors.selection] +background = "#F2D5CF" +text = "#303446" + +[colors.vi_mode_cursor] +cursor = "#BABBF1" +text = "#303446" + +[env] +TERM = "alacritty-direct" + +[font.normal] +family = "CaskaydiaCove Nerd Font" +style = "Regular" + +[shell] +args = ["-l"] +program = "/nix/store/y770h4wad1b9518vndjw8ap7m1ywjjlq-zsh-5.9/bin/zsh" diff --git a/home-manager/config/i3 b/home-manager/config/i3 new file mode 100644 index 0000000..e824bb1 --- /dev/null +++ b/home-manager/config/i3 @@ -0,0 +1,203 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +bindsym $mod+Return exec i3-sensible-terminal + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id dmenu_run +# A more modern dmenu replacement is rofi: +# bindcode $mod+40 exec "rofi -modi drun,run -show drun" +# There also is i3-dmenu-desktop which only displays applications shipping a +# .desktop file. It is a wrapper around dmenu, so you need that installed. +# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+semicolon split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} + +# Assign stuff to workspaces +# tip: use xprop to get window information, e.g WM_CLASS +assign [class="(?i)slack"] 1 + +bindsym $mod+x move workspace to output next + +## Screenshots +bindsym Print exec --no-startup-id /home/jras/.nix-profile/bin/maim "/home/$USER/Pictures/screenshots/$(date)" +bindsym $mod+Print exec --no-startup-id /home/jras/.nix-profile/bin/maim --window $(xdotool getactivewindow) "/home/$USER/Pictures/screenshots/$(date)" +bindsym Shift+Print exec --no-startup-id /home/jras/.nix-profile/bin/maim --select "/home/$USER/Pictures/screenshots/$(date)" + +## Clipboard Screenshots +bindsym Ctrl+Print exec --no-startup-id /home/jras/.nix-profile/bin/maim | xclip -selection clipboard -t image/png +bindsym Ctrl+$mod+Print exec --no-startup-id /home/jras/.nix-profile/bin/maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png +bindsym Ctrl+Shift+Print exec --no-startup-id /home/jras/.nix-profile/bin/maim --select | xclip -selection clipboard -t image/png + +default_border pixel 3 diff --git a/home-manager/entrypoints/personal.nix b/home-manager/entrypoints/personal.nix new file mode 100644 index 0000000..a1a0675 --- /dev/null +++ b/home-manager/entrypoints/personal.nix @@ -0,0 +1,70 @@ +{ pkgs, ... }: +{ + imports = [ + ../common.nix + ../compositor/hyprland.nix + ]; + home.username = "jras"; + home.homeDirectory = "/home/jras"; + home.stateVersion = "23.11"; + + home.packages = [ + pkgs.google-chrome + pkgs.hugo + pkgs.dart-sass + pkgs.tailwindcss + pkgs.tailwindcss-language-server + pkgs.vscode-langservers-extracted + pkgs.font-awesome + pkgs.pinentry-tty + ]; + + programs.git = { + userName = "Jasper Ras"; + userEmail = "jaspert.ras@gmail.com"; + }; + + programs.alacritty.enable = true; + + programs.helix = { + languages = { + language = [ + { + name = "html"; + language-servers = [ "vscode-html-language-server" "tailwindcss-language-server" ]; + } + { + name = "css"; + language-servers = [ "vscode-css-language-server" "tailwindcss-language-server" ]; + } + ]; + }; + }; + + home.file = { + gamestream-start = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor HDMI-A-1,1920x1080@59.94,auto,1 + ''; + target = "bin/gamestream-start"; + executable = true; + }; + gamestream-end = { + text = '' + #!${pkgs.zsh}/bin/zsh + ${pkgs.hyprland}/bin/hyprctl keyword monitor DP-3,preferred,auto,1 + ''; + target = "bin/gamestream-end"; + executable = true; + }; + }; + + programs.zsh.envExtra = "export PATH=$HOME/bin:$PATH"; + + programs.rbw.enable = true; + programs.rbw.settings = { + email = "jaspert.ras@gmail.com"; + pinentry = pkgs.pinentry-tty; + }; +} diff --git a/home-manager/entrypoints/work.nix b/home-manager/entrypoints/work.nix new file mode 100644 index 0000000..44b2d86 --- /dev/null +++ b/home-manager/entrypoints/work.nix @@ -0,0 +1,150 @@ +{ pkgs, ... }: { + imports = [ + ../common.nix + ../systemd/llama.nix + ../hostnet.nix + ../programming-languages/php.nix + ../systemd/docker.nix + ]; + + home.username = "jras"; + home.homeDirectory = "/home/jras"; + home.stateVersion = "22.11"; + home.sessionPath = [ "$HOME/.local/bin" "$HOME/.plenv/bin" ]; + home.sessionVariables = { + TERMINAL = "alacritty"; + TERM = "alacritty-direct"; + }; + + home.packages = [ + pkgs.git-review + pkgs.hexchat + pkgs.nodejs_20 + pkgs.obsidian + pkgs.apacheHttpd + (pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; }) + pkgs.moonlight-qt + pkgs.brightnessctl + pkgs.xflux + pkgs.hugo + pkgs.docker + pkgs.docker-compose + ]; + + fonts.fontconfig.enable = true; + targets.genericLinux.enable = true; + # https://github.com/nix-community/home-manager/issues/1439#issuecomment-1440763587 + home.activation = { + linkDesktopApplications = { + after = [ "writeBoundary" "createXdgUserDirectories" ]; + before = [ ]; + data = "/usr/bin/update-desktop-database"; + }; + }; + + programs.vscode.enable = true; + + # Requires https://github.com/guibou/nixGL + programs.alacritty = { + enable = true; + package = (pkgs.alacritty.overrideAttrs (oldAttrs: { + postInstall = oldAttrs.postInstall + '' + mv $out/bin/alacritty $out/bin/_alacritty + touch $out/bin/alacritty + chmod +x $out/bin/alacritty + echo -e "#!/usr/bin/env zsh\nnix run github:nix-community/nixGL#nixGLIntel -- $out/bin/_alacritty" > $out/bin/alacritty + ''; + })); + settings = { + font.normal = { + family = "CaskaydiaCove Nerd Font"; + style = "Regular"; + }; + }; + }; + + programs.git = { + userName = "Jasper Ras"; + userEmail = "jras@hostnet.nl"; + extraConfig = { gitreview.username = "jrasper"; }; + ignores = [ + ".direnv" + ".envrc" + ".project" + ".settings/" + ".buildpath" + "tags" + ".hhconfig" + ".DS_Store" + ".idea/" + ".vagrant/" + "*.swp" + "clover.xml" + "yarn-error.log" + "gsuite-auth.json" + "venv/" + "shell.nix" + ]; + }; + + programs.zsh.envExtra = "export PATH=$HOME/.plenv/bin:$PATH"; + programs.zsh.initExtra = '' + eval "$(plenv init -)" + eval "$(dircolors)" + ''; + programs.zsh.shellAliases = { + i3ref = "xdg-open https://i3wm.org/docs/refcard.html"; + ssh = "TERM=xterm-256color ssh"; + }; + + programs.pyenv.enable = true; + programs.pyenv.enableZshIntegration = true; + programs.ssh = { + controlMaster = "auto"; + controlPersist = "12h"; + serverAliveInterval = 11; + matchBlocks = { + "*.g1i.one".user = "jasras"; + "*.os1.openstack.group.one".user = "jasras"; + "*.one.com".user = "jasras"; + "91.184.16.185".port = 12345; + "*.compute.prv.vps1-testpod-cph3.one.com".forwardAgent = true; + "access.*.one.com".forwardAgent = true; + "access.*.g1i.one".forwardAgent = true; + }; + }; + + home.file = { + i3-config = { + source = ../config/i3; + target = ".config/i3/config"; + }; + set-display = { + text = '' + #!/usr/bin/env bash + prev="eDP-1" + displays="$(xrandr -q | rg ' connected' | rg -v eDP-1 | cut -d' ' -f1)" + + if [[ -z "$displays" ]] + then + xrandr --auto + fi + + echo "$displays" | while read -r display + do + xrandr --output "$display" --right-of "$prev" --auto + prev="$display" + done + ''; + target = "bin/set-display"; + executable = true; + }; + }; + + xsession = { + enable = true; + initExtra = '' + export TERMINAL=alacritty + ''; + }; +} diff --git a/home-manager/flake.lock b/home-manager/flake.lock new file mode 100644 index 0000000..aa17cd6 --- /dev/null +++ b/home-manager/flake.lock @@ -0,0 +1,191 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1727974419, + "narHash": "sha256-WD0//20h+2/yPGkO88d2nYbb23WMWYvnRyDQ9Dx4UHg=", + "owner": "ipetkov", + "repo": "crane", + "rev": "37e4f9f0976cb9281cd3f0c70081e5e0ecaee93f", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "helix": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1730313564, + "narHash": "sha256-1RBs/WOH3gp2ETDruEbM2vq2tPiJmqQ3wrjiKREE5NU=", + "owner": "helix-editor", + "repo": "helix", + "rev": "38faf74febf3332fb119302324bfd21229d39e14", + "type": "github" + }, + "original": { + "owner": "helix-editor", + "ref": "master", + "repo": "helix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730016908, + "narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "e83414058edd339148dc142a8437edb9450574c8", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1728018373, + "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1730200266, + "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "helix": "helix", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2", + "zen-browser": "zen-browser" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "helix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1728268235, + "narHash": "sha256-lJMFnMO4maJuNO6PQ5fZesrTmglze3UFTTBuKGwR1Nw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "25685cc2c7054efc31351c172ae77b21814f2d42", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "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" + } + }, + "zen-browser": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1727721329, + "narHash": "sha256-QYlWZwUSwrM7BuO+dXclZIwoPvBIuJr6GpFKv9XKFPI=", + "owner": "MarceColl", + "repo": "zen-browser-flake", + "rev": "e6ab73f405e9a2896cce5956c549a9cc359e5fcc", + "type": "github" + }, + "original": { + "owner": "MarceColl", + "repo": "zen-browser-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home-manager/flake.nix b/home-manager/flake.nix new file mode 100644 index 0000000..2a7e467 --- /dev/null +++ b/home-manager/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Home Manager configuration of jras"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + helix.url = "github:helix-editor/helix/master"; + zen-browser.url = "github:MarceColl/zen-browser-flake"; + }; + + outputs = inputs@{ nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + allowUnfree = { nixpkgs.config.allowUnfree = true; }; + in { + homeConfigurations."jras" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ ./entrypoints/work.nix allowUnfree ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = { inherit inputs; }; + }; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home-manager/home.nix diff --git a/home-manager/hostnet.nix b/home-manager/hostnet.nix new file mode 100644 index 0000000..0c86f1c --- /dev/null +++ b/home-manager/hostnet.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: +let nodePkgs = pkgs.nodePackages; +in { + home.packages = [ + pkgs.pre-commit + nodePkgs.webpack + nodePkgs.webpack-cli + + (pkgs.writeShellScriptBin "use-toolbox" '' + source ${config.home.homeDirectory}/projects/toolbox/var/bootstrap.zsh + '') + ]; + + programs = { + rbenv = { + enable = true; + enableZshIntegration = true; + plugins = [{ + name = "ruby-build"; + src = pkgs.fetchFromGitHub { + owner = "rbenv"; + repo = "ruby-build"; + rev = "v20230717"; + hash = "sha256-kvdANiz9R5pQMTBRHvxC5bfBewIhXc+sgRbe7V2rVU8="; + }; + }]; + }; + }; +} diff --git a/home-manager/neovim/chatgpt.lua b/home-manager/neovim/chatgpt.lua new file mode 100644 index 0000000..c71d690 --- /dev/null +++ b/home-manager/neovim/chatgpt.lua @@ -0,0 +1,5 @@ +local home = vim.fn.expand("$HOME") + +require("chatgpt").setup({ + api_key_cmd = "gpg --decrypt " .. home .. "/.vim-chatgpt.gpg" +}) diff --git a/home-manager/neovim/copilot-vim.lua b/home-manager/neovim/copilot-vim.lua new file mode 100644 index 0000000..6b08971 --- /dev/null +++ b/home-manager/neovim/copilot-vim.lua @@ -0,0 +1,10 @@ +vim.g.copilot_no_tab_map = true +vim.api.nvim_set_keymap("i", "<C-y>", 'copilot#Accept("<CR>")', { silent = true, expr = true }) + +vim.g.copilot_filetypes = { + ['*'] = false, + ['python'] = true, + ['go'] = true, + ['php'] = true, + ['yaml'] = true, +} diff --git a/home-manager/neovim/harpoon.lua b/home-manager/neovim/harpoon.lua new file mode 100644 index 0000000..0e589f2 --- /dev/null +++ b/home-manager/neovim/harpoon.lua @@ -0,0 +1,12 @@ +local mark = require'harpoon.mark' +local ui = require'harpoon.ui' + +vim.keymap.set('n', '<leader>a', function() mark.add_file() end) +vim.keymap.set('n', '<leader>m', function() ui.toggle_quick_menu() end) +vim.keymap.set('n', '<leader>b', function() ui.nav_next() end) +vim.keymap.set('n', '<leader>n', function() ui.nav_prev() end) +vim.keymap.set('n', '<leader>h', function() ui.nav_file(1) end) +vim.keymap.set('n', '<leader>j', function() ui.nav_file(2) end) +vim.keymap.set('n', '<leader>k', function() ui.nav_file(3) end) +vim.keymap.set('n', '<leader>l', function() ui.nav_file(4) end) + diff --git a/home-manager/neovim/init.lua b/home-manager/neovim/init.lua new file mode 100644 index 0000000..24504b9 --- /dev/null +++ b/home-manager/neovim/init.lua @@ -0,0 +1,38 @@ +-- Recommended per nvim-tree-lua +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- Set default theme +vim.o.termguicolors = true +vim.cmd("colorscheme catppuccin-frappe") + +-- System clipboard copy and paste +vim.keymap.set('v', '<leader>y', '"+y') +vim.keymap.set('n', '<leader>Y', '"+yg_') +vim.keymap.set('n', '<leader>y', '"+y') +vim.keymap.set('n', '<leader>yy', '"+yy') +vim.keymap.set('n', '<leader>p', '"+p') +vim.keymap.set('n', '<leader>P', '"+P') +vim.keymap.set('v', '<leader>p', '"+p') +vim.keymap.set('v', '<leader>P', '"+P') + +-- Try to keep our cursor centered +vim.keymap.set('n', 'j', 'jzz') +vim.keymap.set('n', 'k', 'kzz') +vim.keymap.set('n', '<C-d>', '<C-d>zz') +vim.keymap.set('n', '<C-u>', '<C-u>zz') + +-- Splits +vim.keymap.set('n', '<leader>d', ':split<CR>') +vim.keymap.set('n', '<leader>s', ':vsplit<CR>') + +-- :he listchars +vim.opt.listchars = { + trail = '*', + space = 'ˑ', + tab = '▷▷⋮', +} +vim.keymap.set('n', '<leader><TAB><TAB>', ':set invlist<CR>') + +vim.opt.colorcolumn = "120" + diff --git a/home-manager/neovim/lsp-zero-nvim.lua b/home-manager/neovim/lsp-zero-nvim.lua new file mode 100644 index 0000000..2abd191 --- /dev/null +++ b/home-manager/neovim/lsp-zero-nvim.lua @@ -0,0 +1,66 @@ +local lsp = require('lsp-zero').preset({ + manage_nvim_cmp = { + set_sources = 'recommended', + } +}) + +lsp.on_attach(function(client, bufnr) + local opts = {buffer = bufnr} + + lsp.default_keymaps(opts) + + vim.keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<cr>', opts) + vim.keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<cr>', opts) + vim.keymap.set('n', 'gr', '<cmd>Telescope lsp_references<cr>', opts) + vim.keymap.set('n', '<F5>', '<cmd>LspRestart<cr>', opts) +end) + +-- When you don't have mason.nvim installed +-- You'll need to list the servers installed in your system +lsp.setup_servers({'nixd', 'pyright', 'phpactor', 'gopls', 'lua_ls', 'ansiblels'}) + +-- (Optional) Configure lua language server for neovim +local lspconfig = require('lspconfig') +lspconfig.lua_ls.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} + +lsp.setup() + +local cmp = require('cmp') +local cmp_action = require('lsp-zero').cmp_action() + +cmp.setup({ + sources = { + {name = 'nvim_lsp'}, + {name = 'nvim_lua'}, + }, + mapping = { + ['<CR>'] = cmp.mapping.confirm({select = false}), + ['<C-f>'] = cmp_action.luasnip_jump_forward(), + ['<C-b>'] = cmp_action.luasnip_jump_backward(), + ['<Tab>'] = cmp_action.luasnip_supertab(), + ['<S-Tab>'] = cmp_action.luasnip_shift_supertab(), + }, +}) + diff --git a/home-manager/neovim/nvim-tree-lua.lua b/home-manager/neovim/nvim-tree-lua.lua new file mode 100644 index 0000000..9911ba3 --- /dev/null +++ b/home-manager/neovim/nvim-tree-lua.lua @@ -0,0 +1,4 @@ +require('nvim-tree').setup {} + +local api = require'nvim-tree.api' +vim.keymap.set('n', '<Tab>', function () api.tree.open({ find_file = true }) end) diff --git a/home-manager/neovim/nvim-treesitter.lua b/home-manager/neovim/nvim-treesitter.lua new file mode 100644 index 0000000..6bc8fbb --- /dev/null +++ b/home-manager/neovim/nvim-treesitter.lua @@ -0,0 +1,9 @@ +require'nvim-treesitter.configs'.setup { + -- Automatically install missing parsers when entering buffer + -- False because we install them via Nix. + auto_install = false, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, +} diff --git a/home-manager/neovim/nvim-web-devicons.lua b/home-manager/neovim/nvim-web-devicons.lua new file mode 100644 index 0000000..57051fb --- /dev/null +++ b/home-manager/neovim/nvim-web-devicons.lua @@ -0,0 +1 @@ +require'nvim-web-devicons'.setup {} diff --git a/home-manager/neovim/telescope-nvim.lua b/home-manager/neovim/telescope-nvim.lua new file mode 100644 index 0000000..eeaf87e --- /dev/null +++ b/home-manager/neovim/telescope-nvim.lua @@ -0,0 +1,18 @@ +local telescope = require'telescope' +telescope.setup { + extensions = { + file_browser = { + theme = "ivy", + hijack_netrw = true, + }, + }, +} +telescope.load_extension "file_browser" + +local api = require('telescope.builtin') +vim.keymap.set('n', '<leader>f', function() api.find_files{hidden=true} end, {}) +vim.keymap.set('n', '<leader>g', api.live_grep, {}) +vim.keymap.set('n', '<leader>B', api.buffers, {}) +vim.keymap.set('n', '<leader>H', api.help_tags, {}) + +vim.api.nvim_set_keymap("n", "<Tab>", ":Telescope file_browser path=%:p:h select_buffer=true<CR>", { noremap = true }) diff --git a/home-manager/programming-languages/php.nix b/home-manager/programming-languages/php.nix new file mode 100644 index 0000000..589d9bd --- /dev/null +++ b/home-manager/programming-languages/php.nix @@ -0,0 +1,8 @@ +{ config, lib, pkgs, ... }: { + programs.git.ignores = [ + ".phpactor.json" + ".phpcomplete_extended/" + ".phpunit.result.cache" + ".phpcs.xml" + ]; +} diff --git a/home-manager/systemd/docker.nix b/home-manager/systemd/docker.nix new file mode 100644 index 0000000..a0cd2d1 --- /dev/null +++ b/home-manager/systemd/docker.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: { + systemd.user.services.docker = { + Unit.Description = "Docker Application Container Engine (Rootless)"; + Service = { + ExecStart = + "${config.home.profileDirectory}/bin/dockerd-rootless --experimental --storage-driver=overlay2"; + ExecReload = "/bin/kill -s HUP $MAINPID"; + TimeoutSec = "0"; + RestartSec = "2"; + Restart = "always"; + StartLimitBurst = "3"; + StartLimitInterval = "60s"; + LimitNOFILE = "infinity"; + LimitNPROC = "infinity"; + LimitCORE = "infinity"; + TasksMax = "infinity"; + Delegate = "yes"; + Type = "simple"; + }; + Install.WantedBy = [ "default.target" ]; + }; +} diff --git a/home-manager/systemd/llama.nix b/home-manager/systemd/llama.nix new file mode 100644 index 0000000..96c0d62 --- /dev/null +++ b/home-manager/systemd/llama.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: +let + homeDir = "${config.home.homeDirectory}"; + llamaDir = "${homeDir}/.llama"; + apache2Dir = "${homeDir}/.apache2"; + httpd = "${pkgs.apacheHttpd}/bin/httpd"; +in { + systemd.user.services.llama = { + Unit.Description = "Hostnet Apache LLama"; + Service = { + ExecStartPre = "${llamaDir}/se-vhosts.sh"; + ExecStart = "${httpd} -f ${llamaDir}/apache2.conf -DFOREGROUND"; + RestartSec = "2"; + Restart = "always"; + Environment = [ + "APACHE_RUN_DIR=${apache2Dir}" + "APACHE_CONFDIR=${llamaDir}" + "APACHE_RUN_USER=${config.home.username}" + "APACHE_RUN_GROUP=${config.home.username}" + "APACHE_PID_FILE=${homeDir}/.apache2.pid" + "APACHE_RUN_FILE=${apache2Dir}/run" + "APACHE_LOCK_FILE=${apache2Dir}/lock" + "APACHE_LOG_FILE=${apache2Dir}/log" + ]; + }; + Install.WantedBy = [ "default.target" ]; + }; +} |