From 479a2283a26c4e46930adbdef484e34109be8cc2 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 5 Oct 2023 13:43:28 -0500 Subject: [PATCH] Modularized --- flake.nix | 164 +-- home/default.nix | 1177 ----------------- home/linux.nix | 1140 ---------------- home/work.nix | 6 - lib/colors.nix | 102 ++ modules/home-manager/bat.nix | 26 + modules/home-manager/broot.nix | 112 ++ modules/home-manager/common.nix | 82 ++ modules/home-manager/default.nix | 18 + modules/home-manager/desktop.nix | 27 + modules/home-manager/eww.nix | 79 ++ modules/home-manager/firefox.nix | 55 + modules/home-manager/fish.nix | 86 ++ .../fish/interactiveShellInit.fish | 0 .../home-manager}/fish/shellInit.fish | 0 modules/home-manager/git.nix | 81 ++ modules/home-manager/helix.nix | 485 +++++++ modules/home-manager/hyprland.nix | 230 ++++ modules/home-manager/iex.nix | 35 + modules/home-manager/kitty.nix | 176 +++ modules/home-manager/linux.nix | 23 + modules/home-manager/macos.nix | 1 + modules/home-manager/mako.nix | 26 + .../home-manager}/scripts/common/bin/? | 0 .../home-manager}/scripts/common/bin/N | 0 .../home-manager}/scripts/common/bin/archive | 0 .../scripts/common/bin/archupdate | 0 .../home-manager}/scripts/common/bin/at | 0 .../home-manager}/scripts/common/bin/bp | 0 .../common/bin/check-domain-availability | 0 .../scripts/common/bin/check-port | 0 .../home-manager}/scripts/common/bin/clip | 0 .../home-manager}/scripts/common/bin/clipshot | 0 .../scripts/common/bin/copy-git-forge-url | 0 .../scripts/common/bin/countdown | 0 .../home-manager}/scripts/common/bin/dns | 0 .../scripts/common/bin/dns-cleaner | 0 .../scripts/common/bin/dns-deleter | 0 .../scripts/common/bin/dns-deleter-matching | 0 .../scripts/common/bin/editscrot | 0 .../scripts/common/bin/email-via-mailgun-smtp | 0 .../home-manager}/scripts/common/bin/emoji | 0 .../home-manager}/scripts/common/bin/ezln | 0 .../home-manager}/scripts/common/bin/field | 0 .../home-manager}/scripts/common/bin/getip | 0 .../scripts/common/bin/git-authors | 0 .../scripts/common/bin/gitforge-url.ts | 0 .../scripts/common/bin/glancepath | 0 .../scripts/common/bin/good-morning | 0 .../scripts/common/bin/has_command | 0 .../scripts/common/bin/is_wayland | 0 .../scripts/common/bin/k8s-yaml-diff | 0 .../scripts/common/bin/k8s-yaml-sort | 0 .../scripts/common/bin/keyrepeat | 0 .../home-manager}/scripts/common/bin/kubeline | 0 .../home-manager}/scripts/common/bin/kubfc | 0 .../home-manager}/scripts/common/bin/kubfn | 0 .../home-manager}/scripts/common/bin/launch | 0 .../home-manager}/scripts/common/bin/linewise | 0 .../scripts/common/bin/maybe_source_env_file | 0 .../home-manager}/scripts/common/bin/nd | 0 .../home-manager}/scripts/common/bin/nf | 0 .../home-manager}/scripts/common/bin/note | 0 .../home-manager}/scripts/common/bin/nsync | 0 .../home-manager}/scripts/common/bin/nvimdiff | 0 .../scripts/common/bin/open-in-git-forge | 0 .../scripts/common/bin/optimize-photo-for-web | 0 .../common/bin/pass-migrate-to-pass-otp | 0 .../home-manager}/scripts/common/bin/pipeline | 0 .../home-manager}/scripts/common/bin/poll | 0 .../scripts/common/bin/pr-for-commit | 0 .../scripts/common/bin/readme.md | 0 .../home-manager}/scripts/common/bin/remote | 0 .../scripts/common/bin/resource-usage | 0 .../home-manager}/scripts/common/bin/s | 0 .../home-manager}/scripts/common/bin/scn | 0 .../scripts/common/bin/screenshot | 0 .../home-manager}/scripts/common/bin/scrup | 0 .../home-manager}/scripts/common/bin/scwd | 0 .../home-manager}/scripts/common/bin/setbg | 0 .../scripts/common/bin/source_if_exists | 0 .../home-manager}/scripts/common/bin/sw | 0 .../home-manager}/scripts/common/bin/tdf | 0 .../common/bin/terminal-rendering-test | 0 .../home-manager}/scripts/common/bin/termrec | 0 .../home-manager}/scripts/common/bin/tls | 0 .../scripts/common/bin/tmux-edit-buffer | 0 .../scripts/common/bin/tmux-lyte-session | 0 .../scripts/common/bin/tmux-save-buffer | 0 .../scripts/common/bin/tmux-session-dir | 0 .../scripts/common/bin/tmux-session-preview | 0 .../scripts/common/bin/tmuxswitcher | 0 .../scripts/common/bin/unarchive | 0 .../home-manager}/scripts/common/bin/weather | 0 .../scripts/common/bin/work-journal-entry | 0 .../home-manager}/scripts/common/bin/yamldiff | 0 .../scripts/linux/bin/restartbar | 0 .../home-manager}/scripts/linux/bin/startbar | 0 modules/home-manager/sway.nix | 360 +++++ modules/home-manager/swaylock.nix | 35 + modules/home-manager/waybar.nix | 353 +++++ modules/home-manager/wezterm.nix | 131 ++ modules/home-manager/zellij.nix | 15 + readme.md | 2 +- 104 files changed, 2575 insertions(+), 2452 deletions(-) delete mode 100644 home/default.nix delete mode 100644 home/linux.nix delete mode 100644 home/work.nix create mode 100644 lib/colors.nix create mode 100644 modules/home-manager/bat.nix create mode 100644 modules/home-manager/broot.nix create mode 100644 modules/home-manager/common.nix create mode 100644 modules/home-manager/desktop.nix create mode 100644 modules/home-manager/eww.nix create mode 100644 modules/home-manager/firefox.nix create mode 100644 modules/home-manager/fish.nix rename {home => modules/home-manager}/fish/interactiveShellInit.fish (100%) rename {home => modules/home-manager}/fish/shellInit.fish (100%) create mode 100644 modules/home-manager/git.nix create mode 100644 modules/home-manager/helix.nix create mode 100644 modules/home-manager/hyprland.nix create mode 100644 modules/home-manager/iex.nix create mode 100644 modules/home-manager/kitty.nix create mode 100644 modules/home-manager/linux.nix create mode 100644 modules/home-manager/macos.nix create mode 100644 modules/home-manager/mako.nix rename {home => modules/home-manager}/scripts/common/bin/? (100%) rename {home => modules/home-manager}/scripts/common/bin/N (100%) rename {home => modules/home-manager}/scripts/common/bin/archive (100%) rename {home => modules/home-manager}/scripts/common/bin/archupdate (100%) rename {home => modules/home-manager}/scripts/common/bin/at (100%) rename {home => modules/home-manager}/scripts/common/bin/bp (100%) rename {home => modules/home-manager}/scripts/common/bin/check-domain-availability (100%) rename {home => modules/home-manager}/scripts/common/bin/check-port (100%) rename {home => modules/home-manager}/scripts/common/bin/clip (100%) rename {home => modules/home-manager}/scripts/common/bin/clipshot (100%) rename {home => modules/home-manager}/scripts/common/bin/copy-git-forge-url (100%) rename {home => modules/home-manager}/scripts/common/bin/countdown (100%) rename {home => modules/home-manager}/scripts/common/bin/dns (100%) rename {home => modules/home-manager}/scripts/common/bin/dns-cleaner (100%) rename {home => modules/home-manager}/scripts/common/bin/dns-deleter (100%) rename {home => modules/home-manager}/scripts/common/bin/dns-deleter-matching (100%) rename {home => modules/home-manager}/scripts/common/bin/editscrot (100%) rename {home => modules/home-manager}/scripts/common/bin/email-via-mailgun-smtp (100%) rename {home => modules/home-manager}/scripts/common/bin/emoji (100%) rename {home => modules/home-manager}/scripts/common/bin/ezln (100%) rename {home => modules/home-manager}/scripts/common/bin/field (100%) rename {home => modules/home-manager}/scripts/common/bin/getip (100%) rename {home => modules/home-manager}/scripts/common/bin/git-authors (100%) rename {home => modules/home-manager}/scripts/common/bin/gitforge-url.ts (100%) rename {home => modules/home-manager}/scripts/common/bin/glancepath (100%) rename {home => modules/home-manager}/scripts/common/bin/good-morning (100%) rename {home => modules/home-manager}/scripts/common/bin/has_command (100%) rename {home => modules/home-manager}/scripts/common/bin/is_wayland (100%) rename {home => modules/home-manager}/scripts/common/bin/k8s-yaml-diff (100%) rename {home => modules/home-manager}/scripts/common/bin/k8s-yaml-sort (100%) rename {home => modules/home-manager}/scripts/common/bin/keyrepeat (100%) rename {home => modules/home-manager}/scripts/common/bin/kubeline (100%) rename {home => modules/home-manager}/scripts/common/bin/kubfc (100%) rename {home => modules/home-manager}/scripts/common/bin/kubfn (100%) rename {home => modules/home-manager}/scripts/common/bin/launch (100%) rename {home => modules/home-manager}/scripts/common/bin/linewise (100%) rename {home => modules/home-manager}/scripts/common/bin/maybe_source_env_file (100%) rename {home => modules/home-manager}/scripts/common/bin/nd (100%) rename {home => modules/home-manager}/scripts/common/bin/nf (100%) rename {home => modules/home-manager}/scripts/common/bin/note (100%) rename {home => modules/home-manager}/scripts/common/bin/nsync (100%) rename {home => modules/home-manager}/scripts/common/bin/nvimdiff (100%) rename {home => modules/home-manager}/scripts/common/bin/open-in-git-forge (100%) rename {home => modules/home-manager}/scripts/common/bin/optimize-photo-for-web (100%) rename {home => modules/home-manager}/scripts/common/bin/pass-migrate-to-pass-otp (100%) rename {home => modules/home-manager}/scripts/common/bin/pipeline (100%) rename {home => modules/home-manager}/scripts/common/bin/poll (100%) rename {home => modules/home-manager}/scripts/common/bin/pr-for-commit (100%) rename {home => modules/home-manager}/scripts/common/bin/readme.md (100%) rename {home => modules/home-manager}/scripts/common/bin/remote (100%) rename {home => modules/home-manager}/scripts/common/bin/resource-usage (100%) rename {home => modules/home-manager}/scripts/common/bin/s (100%) rename {home => modules/home-manager}/scripts/common/bin/scn (100%) rename {home => modules/home-manager}/scripts/common/bin/screenshot (100%) rename {home => modules/home-manager}/scripts/common/bin/scrup (100%) rename {home => modules/home-manager}/scripts/common/bin/scwd (100%) rename {home => modules/home-manager}/scripts/common/bin/setbg (100%) rename {home => modules/home-manager}/scripts/common/bin/source_if_exists (100%) rename {home => modules/home-manager}/scripts/common/bin/sw (100%) rename {home => modules/home-manager}/scripts/common/bin/tdf (100%) rename {home => modules/home-manager}/scripts/common/bin/terminal-rendering-test (100%) rename {home => modules/home-manager}/scripts/common/bin/termrec (100%) rename {home => modules/home-manager}/scripts/common/bin/tls (100%) rename {home => modules/home-manager}/scripts/common/bin/tmux-edit-buffer (100%) rename {home => modules/home-manager}/scripts/common/bin/tmux-lyte-session (100%) rename {home => modules/home-manager}/scripts/common/bin/tmux-save-buffer (100%) rename {home => modules/home-manager}/scripts/common/bin/tmux-session-dir (100%) rename {home => modules/home-manager}/scripts/common/bin/tmux-session-preview (100%) rename {home => modules/home-manager}/scripts/common/bin/tmuxswitcher (100%) rename {home => modules/home-manager}/scripts/common/bin/unarchive (100%) rename {home => modules/home-manager}/scripts/common/bin/weather (100%) rename {home => modules/home-manager}/scripts/common/bin/work-journal-entry (100%) rename {home => modules/home-manager}/scripts/common/bin/yamldiff (100%) rename {home => modules/home-manager}/scripts/linux/bin/restartbar (100%) rename {home => modules/home-manager}/scripts/linux/bin/startbar (100%) create mode 100644 modules/home-manager/sway.nix create mode 100644 modules/home-manager/swaylock.nix create mode 100644 modules/home-manager/waybar.nix create mode 100644 modules/home-manager/wezterm.nix create mode 100644 modules/home-manager/zellij.nix diff --git a/flake.nix b/flake.nix index 6039f63..fda83e4 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ } @ inputs: let inherit (self) outputs; - systems = [ + forAllSystems = nixpkgs-stable.lib.genAttrs [ "aarch64-linux" # "i686-linux" "x86_64-linux" @@ -36,121 +36,18 @@ "x86_64-darwin" ]; - color-schemes = let - mkColorScheme = scheme @ { - scheme-name, - bg, - bg2, - bg3, - bg4, - bg5, - fg, - fg2, - fg3, - fgdim, - # pink, - purple, - red, - orange, - yellow, - green, - # teal, - blue, - }: let - base = - { - # aliases? - text = fg; - primary = blue; - urgent = red; - - # blacks - "0" = bg4; - "8" = bg5; - - "1" = red; - "9" = red; - "2" = green; - "10" = green; - "3" = orange; - "11" = orange; - "4" = blue; - "12" = blue; - "5" = purple; - "13" = purple; - "6" = yellow; - "14" = yellow; - - # whites - "7" = fg2; - "15" = fg3; - } - // scheme; - in - { - withHashPrefix = inputs.nixpkgs-unstable.lib.mapAttrs (_: value: "#${value}") base; - } - // base; - in { - donokai = mkColorScheme { - scheme-name = "donokai"; - bg = "111111"; - bg2 = "181818"; - bg3 = "222222"; - bg4 = "292929"; - bg5 = "333333"; - - fg = "f8f8f8"; - fg2 = "d8d8d8"; - fg3 = "c8c8c8"; - fgdim = "666666"; - - red = "f92672"; - green = "a6e22e"; - yellow = "f4bf75"; - blue = "66d9ef"; - purple = "ae81ff"; - # teal = "a1efe4"; - orange = "fab387"; - }; - catppuccin-mocha-sapphire = mkColorScheme { - scheme-name = "catppuccin-mocha-sapphire"; - bg = "1e1e2e"; - bg2 = "181825"; - bg3 = "313244"; - bg4 = "45475a"; - bg5 = "585b70"; - - fg = "cdd6f4"; - fg2 = "bac2de"; - fg3 = "a6adc8"; - fgdim = "6c7086"; - - # pink = "f5e0dc"; - purple = "cba6f7"; - red = "f38ba8"; - orange = "fab387"; - yellow = "f9e2af"; - green = "a6e3a1"; - # teal = "94e2d5"; - blue = "74c7ec"; - }; - }; - + color-schemes = (import ./lib/colors.nix inputs).schemes; colors = color-schemes.catppuccin-mocha-sapphire; + # colors = (import ./lib/colors.nix inputs).color-schemes.donokai; font = { name = "IosevkaLyteTerm"; size = 12; }; - - linuxHomeManagerModules = [./home ./home/linux.nix]; - - forAllSystems = nixpkgs-stable.lib.genAttrs systems; in { # TODO: nix-color integration? # Your custom packages # Acessible through 'nix build', 'nix shell', etc - packages = forAllSystems (system: import ./pkgs nixpkgs-stable.legacyPackages.${system}); + packages = forAllSystems (system: import ./pkgs nixpkgs-unstable.legacyPackages.${system}); # Formatter for your nix files, available through 'nix fmt' # Other options beside 'alejandra' include 'nixpkgs-fmt' @@ -170,7 +67,7 @@ # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' nixosConfigurations = let - mkNixosSystem = cb: system: modules: + mkNixosSystem = cb: system: modules: homeManagerModules: cb { system = system; specialArgs = { @@ -189,7 +86,7 @@ home-manager = { extraSpecialArgs = {inherit inputs outputs system colors font;}; users.daniel = { - imports = linuxHomeManagerModules; + imports = homeManagerModules; }; }; } @@ -198,31 +95,42 @@ # mkNixosStableSystem = mkNixosSystem nixpkgs-stable.lib.nixosSystem; mkNixosUnstableSystem = mkNixosSystem nixpkgs-unstable.lib.nixosSystem; in { - dragon = mkNixosUnstableSystem "x86_64-linux" [./nixos/dragon]; - thinker = mkNixosUnstableSystem "x86_64-linux" [./nixos/thinker]; - beefcake = mkNixosUnstableSystem "x86_64-linux" [ - inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev - ./nixos/beefcake - ]; - rascal = mkNixosUnstableSystem "x86_64-linux" [./nixos/rascal]; - musicbox = mkNixosUnstableSystem "x86_64-linux" [./nixos/musicbox]; + dragon = mkNixosUnstableSystem "x86_64-linux" [./nixos/dragon] (with outputs.homeManagerModules; [ + sway + ]); + thinker = mkNixosUnstableSystem "x86_64-linux" [./nixos/thinker] (with outputs.homeManagerModules; [ + sway + ]); + beefcake = + mkNixosUnstableSystem "x86_64-linux" [ + inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev + ./nixos/beefcake + ] (with outputs.homeManagerModules; [ + linux + ]); + rascal = mkNixosUnstableSystem "x86_64-linux" [./nixos/rascal] (with outputs.homeManagerModules; [ + linux + ]); + musicbox = mkNixosUnstableSystem "x86_64-linux" [./nixos/musicbox] (with outputs.homeManagerModules; [ + sway + ]); }; # Standalone home-manager configuration entrypoint # Available through 'home-manager --flake .#your-username@your-hostname' - homeConfigurations = let - mkHome = system: modules: - home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs-unstable.legacyPackages.${system}; - extraSpecialArgs = {inherit inputs outputs system colors font;}; - modules = modules; - }; - in { - "daniel" = mkHome "x86_64-linux" linuxHomeManagerModules; - "daniel.flanagan" = mkHome "aarch64-darwin" [./home]; + homeConfigurations = { + /* + daniel = home-manager.lib.homeManagerConfiguration rec { + system = "x86_64-linux"; + pkgs = nixpkgs-unstable.legacyPackages.${system}; + extraSpecialArgs = {inherit inputs outputs system colors font;}; + modules = with outputs.homeManagerModules; [linux]; + }; + */ }; - # TODO: darwin for work? + # TODO: nix-on-droid for phone terminal usage? + # TODO: nix-darwin for work? # TODO: nixos ISO? # Disk partition schemes and functions diff --git a/home/default.nix b/home/default.nix deleted file mode 100644 index d4c8c18..0000000 --- a/home/default.nix +++ /dev/null @@ -1,1177 +0,0 @@ -{ - font, - pkgs, - lib, - system, - inputs, - colors, - ... -}: let - email = "daniel@lyte.dev"; - name = "Daniel Flanagan"; -in { - # TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module) - # TODO: wallpaper? - - imports = [ - # nix-colors.homeManagerModules.default - ]; - - home = { - username = lib.mkDefault "daniel"; - homeDirectory = lib.mkDefault "/home/daniel/.home"; - stateVersion = "23.11"; - - packages = [ - # I use gawk for my fish prompt - pkgs.gawk - - # text editor - inputs.helix.packages.${system}.helix - - # tools I use when editing nix code - pkgs.nil - pkgs.alejandra - - (pkgs.buildEnv { - name = "my-scripts-common"; - paths = [./scripts/common]; - }) - ]; - }; - - home.file.".iex.exs" = { - enable = true; - text = '' - Application.put_env(:elixir, :ansi_enabled, true) - - # PROTIP: to break, `#iex:break` - - IEx.configure( - colors: [enabled: true], - inspect: [ - pretty: true, - printable_limit: :infinity, - limit: :infinity - ], - default_prompt: - [ - # ANSI CHA, move cursor to column 1 - "\e[G", - :magenta, - # IEx prompt variable - "%prefix", - "#", - # IEx prompt variable - "%counter", - # plain string - ">", - :reset - ] - |> IO.ANSI.format() - |> IO.chardata_to_string() - ) - ''; - }; - - programs.password-store = { - enable = true; - package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); - }; - - programs.git = { - enable = true; - - userEmail = email; - userName = name; - - delta = { - enable = true; - options = {}; - }; - - lfs = { - enable = true; - }; - - signing = { - signByDefault = true; - key = "daniel@lyte.dev"; - }; - - aliases = { - a = "add -A"; - ac = "commit -a"; - b = "rev-parse --symbolic-full-name HEAD"; - c = "commit"; - cm = "commit -m"; - cnv = "commit --no-verify"; - co = "checkout"; - d = "diff"; - ds = "diff --staged"; - dt = "difftool"; - f = "fetch"; - l = "log --graph --abbrev-commit --decorate --oneline --all"; - plainlog = " log --pretty=format:'%h %ad%x09%an%x09%s' --date=short --decorate"; - ls = "ls-files"; - mm = "merge master"; - p = "push"; - pf = "push --force-with-lease"; - pl = "pull"; - rim = "rebase -i master"; - s = "status"; - }; - - extraConfig = { - push = { - autoSetupRemote = true; - }; - - branch = { - autoSetupMerge = true; - }; - - sendemail = { - smtpserver = "smtp.mailgun.org"; - smtpuser = "daniel@lyte.dev"; - smtrpencryption = "tls"; - smtpserverport = 587; - }; - - url = { - # TODO: how to have per-machine not-in-git configuration? - "git@git.hq.bill.com:" = { - insteadOf = "https://git.hq.bill.com"; - }; - }; - }; - }; - - programs.gitui = { - enable = true; - }; - - programs.helix = { - enable = true; - package = inputs.helix.packages.${system}.helix; - languages = { - language-server = { - lexical = { - command = "lexical"; - args = ["start"]; - }; - - next-ls = { - command = "next-ls"; - args = ["--stdout"]; - }; - - deno = { - command = "deno"; - args = ["lsp"]; - config = { - enable = true; - lint = true; - unstable = true; - }; - }; - }; - - language = [ - { - name = "elixir"; - language-servers = ["elixir-ls"]; # "lexical" "next-ls" - auto-format = true; - } - { - name = "html"; - auto-format = false; - } - { - name = "nix"; - auto-format = true; - formatter = { - command = "alejandra"; - args = ["-"]; - }; - } - { - name = "fish"; - auto-format = true; - indent = { - tab-width = 2; - unit = "\t"; - }; - } - - { - name = "javascript"; - language-id = "javascript"; - grammar = "javascript"; - scope = "source.js"; - injection-regex = "^(js|javascript)$"; - file-types = ["js" "mjs"]; - shebangs = ["deno"]; - language-servers = ["deno"]; - roots = ["deno.jsonc" "deno.json"]; - formatter = { - command = "deno"; - args = ["fmt"]; - }; - auto-format = true; - comment-token = "//"; - indent = { - tab-width = 2; - unit = "\t"; - }; - } - - { - name = "typescript"; - language-id = "typescript"; - grammar = "typescript"; - scope = "source.ts"; - injection-regex = "^(ts|typescript)$"; - file-types = ["ts"]; - shebangs = ["deno"]; - language-servers = ["deno"]; - roots = ["deno.jsonc" "deno.json"]; - formatter = { - command = "deno"; - args = ["fmt"]; - }; - auto-format = true; - comment-token = "//"; - indent = { - tab-width = 2; - unit = "\t"; - }; - } - - { - name = "jsonc"; - language-id = "json"; - grammar = "jsonc"; - scope = "source.jsonc"; - injection-regex = "^(jsonc)$"; - roots = ["deno.jsonc" "deno.json"]; - file-types = ["jsonc"]; - language-servers = ["deno"]; - indent = { - tab-width = 2; - unit = " "; - }; - auto-format = true; - } - - /* - [[language]] - name = "jsx" - scope = "source.jsx" - injection-regex = "jsx" - file-types = ["jsx"] - shebangs = ["deno", "node"] - roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"] - comment-token = "//" - config = { enable = true, lint = true, unstable = true } - language-server = { command = "deno", args = ["lsp"], language-id = "javascriptreact" } - indent = { tab-width = 2, unit = " " } - grammar = "javascript" - auto-format = true - - [[language]] - name = "tsx" - scope = "source.tsx" - injection-regex = "^(tsx)$" # |typescript - file-types = ["tsx"] - shebangs = ["deno", "node"] - roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"] - config = { enable = true, lint = true, unstable = true } - language-server = { command = "deno", args = ["lsp"], language-id = "typescriptreact" } - indent = { tab-width = 2, unit = " " } - auto-format = true - - [[language]] - name = "jsonc" - scope = "source.jsonc" - injection-regex = "^(jsonc)$" - file-types = ["jsonc"] - shebangs = ["deno", "node"] - roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"] - config = { enable = true, lint = true, unstable = true } - language-server = { command = "deno", args = ["lsp"], language-id = "jsonc" } - indent = { tab-width = 2, unit = " " } - auto-format = true - */ - ]; - }; - - settings = { - theme = "custom"; - - editor = { - soft-wrap.enable = true; - auto-pairs = false; - auto-save = false; - completion-trigger-len = 1; - color-modes = false; - bufferline = "multiple"; - scrolloff = 8; - rulers = [80 120]; - cursorline = true; - - cursor-shape = { - normal = "block"; - insert = "bar"; - select = "underline"; - }; - - file-picker.hidden = false; - indent-guides = { - render = true; - character = "▏"; - }; - - lsp = { - display-messages = true; - display-inlay-hints = true; - }; - statusline = { - left = ["mode" "spinner" "selections" "primary-selection-length" "position" "position-percentage" "diagnostics" "workspace-diagnostics"]; - center = ["file-name"]; - right = ["version-control" "total-line-numbers" "file-encoding"]; - }; - }; - keys = { - insert = { - j = { - k = "normal_mode"; - j = "normal_mode"; - K = "normal_mode"; - J = "normal_mode"; - }; - }; - - normal = { - D = "kill_to_line_end"; - "^" = "goto_line_start"; - "C-k" = "jump_view_up"; - "C-j" = "jump_view_down"; - "C-h" = "jump_view_left"; - "C-l" = "jump_view_right"; - "C-q" = ":quit-all!"; - "L" = "repeat_last_motion"; - space = { - q = ":reflow 80"; - Q = ":reflow 120"; - v = ":run-shell-command fish -c 'env > /tmp/env'"; - C = ":bc!"; - h = ":toggle lsp.display-inlay-hints"; - # O = ["select_textobject_inner WORD", ":pipe-to xargs xdg-open"]; - }; - }; - - select = { - space = { - q = ":reflow 80"; - Q = ":reflow 120"; - }; - "L" = "repeat_last_motion"; - }; - }; - }; - - themes = with colors.withHashPrefix; { - custom = { - "type" = orange; - - "constructor" = blue; - - "constant" = orange; - "constant.builtin" = orange; - "constant.character" = yellow; - "constant.character.escape" = orange; - - "string" = green; - "string.regexp" = orange; - "string.special" = blue; - - "comment" = { - fg = fgdim; - modifiers = ["italic"]; - }; - - "variable" = text; - "variable.parameter" = { - fg = red; - modifiers = ["italic"]; - }; - "variable.builtin" = red; - "variable.other.member" = text; - - "label" = blue; - - "punctuation" = fgdim; - "punctuation.special" = blue; - - "keyword" = purple; - "keyword.storage.modifier.ref" = yellow; - "keyword.control.conditional" = { - fg = purple; - modifiers = ["italic"]; - }; - - "operator" = blue; - - "function" = blue; - "function.macro" = purple; - - "tag" = purple; - "attribute" = blue; - - "namespace" = { - fg = blue; - modifiers = ["italic"]; - }; - - "special" = blue; - - "markup.heading.marker" = { - fg = orange; - modifiers = ["bold"]; - }; - "markup.heading.1" = blue; - "markup.heading.2" = yellow; - "markup.heading.3" = green; - "markup.heading.4" = orange; - "markup.heading.5" = red; - "markup.heading.6" = fg3; - "markup.list" = purple; - "markup.bold" = {modifiers = ["bold"];}; - "markup.italic" = {modifiers = ["italic"];}; - "markup.strikethrough" = {modifiers = ["crossed_out"];}; - "markup.link.url" = { - fg = red; - modifiers = ["underlined"]; - }; - "markup.link.text" = blue; - "markup.raw" = red; - - "diff.plus" = green; - "diff.minus" = red; - "diff.delta" = blue; - - "ui.linenr" = {fg = fgdim;}; - "ui.linenr.selected" = {fg = fg2;}; - - "ui.statusline" = { - fg = fgdim; - bg = bg2; - }; - "ui.statusline.inactive" = { - fg = fg3; - bg = bg; - }; - "ui.statusline.normal" = { - fg = bg; - bg = purple; - modifiers = ["bold"]; - }; - "ui.statusline.insert" = { - fg = bg; - bg = green; - modifiers = ["bold"]; - }; - "ui.statusline.select" = { - fg = bg; - bg = red; - modifiers = ["bold"]; - }; - - "ui.popup" = { - fg = text; - bg = bg2; - }; - "ui.window" = {fg = fgdim;}; - "ui.help" = { - fg = fg2; - bg = bg2; - }; - - "ui.bufferline" = { - fg = fgdim; - bg = bg2; - }; - "ui.bufferline.background" = {bg = bg2;}; - - "ui.text" = text; - "ui.text.focus" = { - fg = text; - bg = bg3; - modifiers = ["bold"]; - }; - "ui.text.inactive" = {fg = fg2;}; - - "ui.virtual" = fg2; - "ui.virtual.ruler" = {bg = bg3;}; - "ui.virtual.indent-guide" = bg3; - "ui.virtual.inlay-hint" = { - fg = bg3; - bg = bg; - }; - - "ui.selection" = {bg = bg5;}; - - "ui.cursor" = { - fg = bg; - bg = text; - }; - "ui.cursor.primary" = { - fg = bg; - bg = red; - }; - "ui.cursor.match" = { - fg = orange; - modifiers = ["bold"]; - }; - - "ui.cursor.primary.normal" = { - fg = bg; - bg = text; - }; - "ui.cursor.primary.insert" = { - fg = bg; - bg = text; - }; - "ui.cursor.primary.select" = { - fg = bg; - bg = text; - }; - - "ui.cursor.normal" = { - fg = bg; - bg = fg; - }; - "ui.cursor.insert" = { - fg = bg; - bg = fg; - }; - "ui.cursor.select" = { - fg = bg; - bg = fg; - }; - - "ui.cursorline.primary" = {bg = bg3;}; - - "ui.highlight" = { - bg = primary; - fg = bg; - modifiers = ["bold"]; - }; - - "ui.menu" = { - fg = fg3; - bg = bg2; - }; - "ui.menu.selected" = { - fg = text; - bg = bg3; - modifiers = ["bold"]; - }; - - "diagnostic.error" = { - underline = { - color = red; - style = "curl"; - }; - }; - "diagnostic.warning" = { - underline = { - color = orange; - style = "curl"; - }; - }; - "diagnostic.info" = { - underline = { - color = blue; - style = "curl"; - }; - }; - "diagnostic.hint" = { - underline = { - color = blue; - style = "curl"; - }; - }; - - error = red; - warning = orange; - info = blue; - hint = yellow; - "ui.background" = { - bg = bg; - fg = fgdim; - }; - - # "ui.cursorline.primary" = { bg = "default" } - # "ui.cursorline.secondary" = { bg = "default" } - "ui.cursorcolumn.primary" = {bg = bg3;}; - "ui.cursorcolumn.secondary" = {bg = bg3;}; - - "ui.bufferline.active" = { - fg = primary; - bg = bg3; - underline = { - color = primary; - style = ""; - }; - }; - }; - }; - }; - - programs.bat = { - enable = true; - config = { - theme = "Catppuccin-mocha"; - }; - themes = { - "Catppuccin-mocha" = builtins.readFile (pkgs.fetchFromGitHub - { - owner = "catppuccin"; - repo = "bat"; - rev = "477622171ec0529505b0ca3cada68fc9433648c6"; - sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; - } - + "/Catppuccin-mocha.tmTheme"); - }; - }; - - programs.wezterm = { - enable = true; - extraConfig = '' - local wezterm = require'wezterm' - - local config = {} - - -- TODO: integrate nix colors - - if wezterm.config_builder then - config = wezterm.config_builder() - end - - local hostname = io.popen("/bin/hostname"):read("*a"):gsub("%s", "") - local font_spec = { family = '${font.name}', weight = 'Medium', italic = false } - local font_size = ${toString font.size}.0 - - if hostname == "laptop" then - font_size = 13 - end - - local font = wezterm.font_with_fallback{ - font_spec, - { family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false }, - 'Noto Color Emoji', - } - - if hostname == "laptop" then - config.font_rules = { - -- no italics - { - font = font - }, - } - end - - config.default_cursor_style = 'BlinkingBar' - - config.font = font - config.font_size = font_size - - config.hide_tab_bar_if_only_one_tab = true - config.use_fancy_tab_bar = false - config.tab_bar_at_bottom = false - config.window_background_opacity = 1.0 - - config.color_scheme = "Catppuccin Mocha" - - config.window_frame.font = config.font - config.window_frame.font_size = font_size - - config.inactive_pane_hsb = { - saturation = 0.8, - brightness = 0.7, - } - - config.keys = { - { - key = 'j', - mods = 'CTRL', - action = wezterm.action.ActivatePaneDirection'Down' - }, - { - key = 'Insert', - mods = 'SHIFT', - action = wezterm.action.PasteFrom'Clipboard' - }, - { - key = 'v', - mods = 'CTRL|SHIFT', - action = wezterm.action.PasteFrom'PrimarySelection' - }, - { - key = 'h', - mods = 'CTRL', - action = wezterm.action.ActivatePaneDirection'Left' - }, - { - key = 'l', - mods = 'CTRL', - action = wezterm.action.ActivatePaneDirection'Right' - }, - { - key = 'k', - mods = 'CTRL', - action = wezterm.action.ActivatePaneDirection'Up' - }, - { - key = 'j', - mods = 'CTRL|SHIFT', - action = wezterm.action.SplitVertical{domain='CurrentPaneDomain'} - }, - { - key = 'l', - mods = 'CTRL|SHIFT', - action = wezterm.action.SplitHorizontal{domain='CurrentPaneDomain'} - }, - { - key = 'l', - mods = 'CTRL|SHIFT|ALT', - action = wezterm.action.ShowDebugOverlay - }, - { - key = 'r', - mods = 'CTRL|SHIFT|ALT', - action = wezterm.action.RotatePanes'Clockwise' - }, - } - - config.unix_domains = { - { - name = 'unix', - local_echo_threshold_ms = 10, - }, - } - - -- config.default_gui_startup_args = { 'connect', 'unix' } - -- config.default_domain = 'unix' - - config.window_padding = { - top = '0.5cell', - bottom = '0.5cell', - left = '1cell', - right = '1cell', - } - - return config - ''; - }; - - programs.kitty = { - enable = true; - darwinLaunchOptions = ["--single-instance"]; - shellIntegration = { - enableFishIntegration = true; - }; - settings = with colors.withHashPrefix; { - "font_family" = font.name; - "bold_font" = "${font.name} Heavy"; - "italic_font" = "${font.name} Italic"; - "bold_italic_font" = "${font.name} Heavy Italic"; - "font_size" = toString font.size; - "inactive_text_alpha" = "0.5"; - "copy_on_select" = true; - - "scrollback_lines" = 500000; - - "symbol_map" = "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono"; - - # use `kitty + list-fonts --psnames` to get the font's PostScript name - - "allow_remote_control" = true; - "listen_on" = "unix:/tmp/kitty"; - "repaint_delay" = 3; - "input_delay" = 3; - "sync_to_monitor" = true; - - "adjust_line_height" = 0; - "window_padding_width" = "10.0"; - "window_margin_width" = "0.0"; - - "confirm_os_window_close" = 0; - - "enabled_layouts" = "splits:split_axis=vertical,stack"; - - "shell_integration" = "disabled"; - - "enable_audio_bell" = true; - "visual_bell_duration" = "0.25"; - "visual_bell_color" = yellow; - - "url_style" = "single"; - - "strip_trailing_spaces" = "smart"; - - # open_url_modifiers ctrl - - "tab_bar_align" = "left"; - "tab_bar_style" = "separator"; - "tab_separator" = ''""''; - "tab_bar_edge" = "top"; - "tab_title_template" = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "''; - "active_tab_font_style" = "normal"; - - ## name: Catppuccin Kitty Mocha - ## author: Catppuccin Org - ## license: MIT - ## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf - ## blurb: Soothing pastel theme for the high-spirited! - - # The basic colors - "foreground" = text; - "background" = bg; - "selection_foreground" = bg; - "selection_background" = text; - - # Cursor colors - "cursor" = text; - "cursor_text_color" = bg; - - # URL underline color when hovering with mouse - "url_color" = primary; - - # Kitty window border colors - "active_border_color" = primary; - "inactive_border_color" = bg3; - "bell_border_color" = urgent; - - # OS Window titlebar colors - "wayland_titlebar_color" = "system"; - "macos_titlebar_color" = "system"; - - # Tab bar colors - "active_tab_foreground" = bg; - "active_tab_background" = primary; - "inactive_tab_foreground" = fgdim; - "inactive_tab_background" = bg2; - "tab_bar_background" = bg; - - # Colors for marks (marked text in the terminal) - "mark1_foreground" = bg; - "mark1_background" = blue; - "mark2_foreground" = bg; - "mark2_background" = purple; - "mark3_foreground" = bg; - "mark3_background" = blue; - - # The 16 terminal colors - - # black - "color0" = colors.withHashPrefix."0"; - "color8" = colors.withHashPrefix."8"; - - # red - "color1" = colors.withHashPrefix."1"; - "color9" = colors.withHashPrefix."9"; - - # green - "color2" = colors.withHashPrefix."2"; - "color10" = colors.withHashPrefix."10"; - - # yellow - "color3" = colors.withHashPrefix."3"; - "color11" = colors.withHashPrefix."11"; - - # blue - "color4" = colors.withHashPrefix."4"; - "color12" = colors.withHashPrefix."12"; - - # magenta - "color5" = colors.withHashPrefix."5"; - "color13" = colors.withHashPrefix."13"; - - # cyan - "color6" = colors.withHashPrefix."6"; - "color14" = colors.withHashPrefix."14"; - - # white - "color7" = colors.withHashPrefix."7"; - "color15" = colors.withHashPrefix."15"; - }; - keybindings = { - "ctrl+shift+1" = "change_font_size all 12.5"; - "ctrl+shift+2" = "change_font_size all 18.5"; - "ctrl+shift+3" = "change_font_size all 26"; - "ctrl+shift+4" = "change_font_size all 32"; - "ctrl+shift+5" = "change_font_size all 48"; - "ctrl+shift+o" = "launch --type=tab --stdin-source=@screen_scrollback $EDITOR"; - - "ctrl+shift+equal" = "change_font_size all +0.5"; - "ctrl+shift+minus" = "change_font_size all -0.5"; - - "shift+insert" = "paste_from_clipboard"; - "ctrl+shift+v" = "paste_from_selection"; - "ctrl+shift+c" = "copy_to_clipboard"; - - # kill pane - "ctrl+shift+q" = "close_window"; - - # kill tab - "ctrl+alt+shift+q" = "close_tab"; - - "ctrl+shift+j" = "launch --location=hsplit --cwd=current"; - "ctrl+shift+l" = "launch --location=vsplit --cwd=current"; - - "ctrl+alt+shift+k" = "move_window up"; - "ctrl+alt+shift+h" = "move_window left"; - "ctrl+alt+shift+l" = "move_window right"; - "ctrl+alt+shift+j" = "move_window down"; - - "ctrl+h" = "neighboring_window left"; - "ctrl+l" = "neighboring_window right"; - "ctrl+k" = "neighboring_window up"; - "ctrl+j" = "neighboring_window down"; - "ctrl+shift+n" = "nth_window -1"; - "ctrl+shift+space>u" = "kitten hints --type=url --program @"; - - "ctrl+shift+z" = "toggle_layout stack"; - }; - }; - - programs.zellij = { - # TODO: enable after port config - enable = false; - enableFishIntegration = true; - settings = { - pane_frames = false; - # TODO: port config - }; - }; - - programs.broot = { - enable = true; - enableFishIntegration = true; - settings = { - modal = true; - skin = { - # this is a crappy copy of broot's catppuccin mocha theme - input = "rgb(205, 214, 244) none"; - selected_line = "none rgb(88, 91, 112)"; - default = "rgb(205, 214, 244) none"; - tree = "rgb(108, 112, 134) none"; - parent = "rgb(116, 199, 236) none"; - file = "none none"; - - perm__ = "rgb(186, 194, 222) none"; - perm_r = "rgb(250, 179, 135) none"; - perm_w = "rgb(235, 160, 172) none"; - perm_x = "rgb(166, 227, 161) none"; - owner = "rgb(148, 226, 213) none"; - group = "rgb(137, 220, 235) none"; - - dates = "rgb(186, 194, 222) none"; - - directory = "rgb(180, 190, 254) none Bold"; - exe = "rgb(166, 227, 161) none"; - link = "rgb(249, 226, 175) none"; - pruning = "rgb(166, 173, 200) none Italic"; - - preview_title = "rgb(205, 214, 244) rgb(24, 24, 37)"; - preview = "rgb(205, 214, 244) rgb(24, 24, 37)"; - preview_line_number = "rgb(108, 112, 134) none"; - - char_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; - content_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; - preview_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; - - count = "rgb(249, 226, 175) none"; - sparse = "rgb(243, 139, 168) none"; - content_extract = "rgb(243, 139, 168) none Italic"; - - git_branch = "rgb(250, 179, 135) none"; - git_insertions = "rgb(250, 179, 135) none"; - git_deletions = "rgb(250, 179, 135) none"; - git_status_current = "rgb(250, 179, 135) none"; - git_status_modified = "rgb(250, 179, 135) none"; - git_status_new = "rgb(250, 179, 135) none Bold"; - git_status_ignored = "rgb(250, 179, 135) none"; - git_status_conflicted = "rgb(250, 179, 135) none"; - git_status_other = "rgb(250, 179, 135) none"; - staging_area_title = "rgb(250, 179, 135) none"; - - flag_label = "rgb(243, 139, 168) none"; - flag_value = "rgb(243, 139, 168) none Bold"; - - status_normal = "none rgb(24, 24, 37)"; - status_italic = "rgb(243, 139, 168) rgb(24, 24, 37) Italic"; - status_bold = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; - status_ellipsis = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; - status_error = "rgb(205, 214, 244) rgb(243, 139, 168)"; - status_job = "rgb(235, 160, 172) rgb(40, 38, 37)"; - status_code = "rgb(235, 160, 172) rgb(24, 24, 37) Italic"; - mode_command_mark = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; - - help_paragraph = "rgb(205, 214, 244) none"; - help_headers = "rgb(243, 139, 168) none Bold"; - help_bold = "rgb(250, 179, 135) none Bold"; - help_italic = "rgb(249, 226, 175) none Italic"; - help_code = "rgb(166, 227, 161) rgb(49, 50, 68)"; - help_table_border = "rgb(108, 112, 134) none"; - - hex_null = "rgb(205, 214, 244) none"; - hex_ascii_graphic = "rgb(250, 179, 135) none"; - hex_ascii_whitespace = "rgb(166, 227, 161) none"; - hex_ascii_other = "rgb(148, 226, 213) none"; - hex_non_ascii = "rgb(243, 139, 168) none"; - - file_error = "rgb(251, 73, 52) none"; - - purpose_normal = "none none"; - purpose_italic = "rgb(177, 98, 134) none Italic"; - purpose_bold = "rgb(177, 98, 134) none Bold"; - purpose_ellipsis = "none none"; - - scrollbar_track = "rgb(49, 50, 68) none"; - scrollbar_thumb = "rgb(88, 91, 112) none"; - - good_to_bad_0 = "rgb(166, 227, 161) none"; - good_to_bad_1 = "rgb(148, 226, 213) none"; - good_to_bad_2 = "rgb(137, 220, 235) none"; - good_to_bad_3 = "rgb(116, 199, 236) none"; - good_to_bad_4 = "rgb(137, 180, 250) none"; - good_to_bad_5 = "rgb(180, 190, 254) none"; - good_to_bad_6 = "rgb(203, 166, 247) none"; - good_to_bad_7 = "rgb(250, 179, 135) none"; - good_to_bad_8 = "rgb(235, 160, 172) none"; - good_to_bad_9 = "rgb(243, 139, 168) none"; - }; - - verbs = [ - { - invocation = "edit"; - shortcut = "e"; - execution = "$EDITOR {file}"; - } - ]; - }; - }; - - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - - programs.fish = { - enable = true; - # I load long scripts from files for a better editing experience - shellInit = builtins.readFile ./fish/shellInit.fish; - interactiveShellInit = builtins.readFile ./fish/interactiveShellInit.fish; - loginShellInit = ""; - functions = { - # TODO: I think these should be loaded from fish files too for better editor experience? - d = '' - # --wraps=cd --description "Quickly jump to NICE_HOME (or given relative or absolute path) and list files." - if count $argv > /dev/null - cd $argv - else - cd $NICE_HOME - end - la - ''; - - c = '' - if count $argv > /dev/null - cd $NICE_HOME && d $argv - else - d $NICE_HOME - end - ''; - - g = '' - if test (count $argv) -gt 0 - git $argv - else - git status - end - ''; - - ltl = '' - set d $argv[1] . - set -l l "" - for f in $d[1]/* - if test -z $l; set l $f; continue; end - if command test $f -nt $l; and test ! -d $f - set l $f - end - end - echo $l - ''; - - has_command = "command --quiet --search $argv[1]"; - }; - shellAbbrs = {}; - shellAliases = { - l = "br"; - ls = "eza --group-directories-first --classify"; - la = "eza -la --group-directories-first --classify"; - lA = "eza -la --all --group-directories-first --classify"; - tree = "eza --tree --level=3"; - lt = "eza -l --sort=modified"; - lat = "eza -la --sort=modified"; - lc = "lt --sort=accessed"; - lT = "lt --reverse"; - lC = "lc --reverse"; - lD = "la --only-dirs"; - "cd.." = "d .."; - "cdc" = "d $XDG_CONFIG_HOME"; - "cdn" = "d $NOTES_PATH"; - "cdl" = "d $XDG_DOWNLOAD_DIR"; - "cdg" = "d $XDG_GAMES_DIR"; - ".." = "d .."; - "..." = "d ../.."; - "...." = "d ../../.."; - "....." = "d ../../../.."; - "......" = "d ../../../../.."; - "......." = "d ../../../../../.."; - "........" = "d ../../../../../../.."; - "........." = "d ../../../../../../../.."; - cat = "bat"; - p = "ping"; - dc = "docker compose"; - pc = "podman-compose"; - k = "kubectl"; - kg = "kubectl get"; - v = "$EDITOR"; - sv = "sudo $EDITOR"; - kssh = "kitty +kitten ssh"; - }; - }; - - programs.eza = { - enable = true; - package = inputs.nixpkgs-unstable.legacyPackages.${system}.eza; - }; - - programs.skim = { - enable = true; - enableFishIntegration = true; - }; - - programs.nix-index = { - enable = true; - enableFishIntegration = true; - }; - - # maybe we can share somehow so things for nix-y systems and non-nix-y systems alike - # am I going to _have_ non-nix systems anymore? -} diff --git a/home/linux.nix b/home/linux.nix deleted file mode 100644 index 41743d6..0000000 --- a/home/linux.nix +++ /dev/null @@ -1,1140 +0,0 @@ -{ - config, - pkgs, - lib, - colors, - font, - ... -}: { - home.pointerCursor = { - name = "Bibata-Modern-Classic"; - package = pkgs.bibata-cursors; - size = 64; # TODO: this doesn't seem to work -- at least in Sway - # some icons are also missing (hand2?) - }; - - programs.foot = { - enable = true; - }; - - # programs.eww = { - # enable = true; - # }; - - /* - home.file.".config/eww/eww.yuck" = { - enable = true; - text = '' - (defwidget bar [] - (centerbox :orientation "h" - (sidestuff) - (box) - (music))) - - (defwindow bar - :monitor 0 - :stacking "fg" - :exclusive true - :geometry - (geometry - :x "0%" - :y "0%" - :width "100%" - :height "31px" - :anchor "bottom center") - (bar)) - - (defwidget sidestuff [] - (box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :spacing 20 - time - ; TODO: idle inhibitor? - ; TODO: get these to align properly? - (box :class "mic" ( - box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "} - ) {micVolume + "%"} - ) - (box :class "vol" ( - box :class {muted == "false" ? "live" : "muted"} {muted == "false" ? "󰕾 " : "󰖁 "} - ) {volume + "%"} - ) - {" " + round(EWW_CPU["avg"], 0) + "%"} - {" " + round(EWW_RAM["used_mem_perc"], 0) + "%"} - {isDesktop == "true" ? "" : " " + brightness + "%"} - {isDesktop == "true" ? "" : "󱊣 " + EWW_BATTERY["BAT0"]["capacity"] + "%/" + EWW_BATTERY["BAT1"]["capacity"] + "%"} - )) - - (defwidget music [] - (box :class "music" - :orientation "h" - :halign "end" - :space-evenly false - {music != "" ? "''${music}" : ""})) - - (deflisten music :initial "" - "playerctl --follow metadata --format '{{ title }} by {{ artist }}' || true") - - (deflisten volume :initial "0" - "pamixer --get-volume; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-volume; done") - - (deflisten muted :initial "false" - "pamixer --get-mute; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-mute; done") - - (deflisten micVolume :initial "0" - "pamixer --default-source --get-volume; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-volume; done") - - (deflisten micMuted :initial "false" - "pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done") - - (defpoll time :interval "1s" - "date '+%a %b %d %H:%M:%S'") - - (defpoll isDesktop :interval "24h" - "if [ -d \"$HOME/.config/lytedev-env/host-desktop\" ]; then echo true; else echo false; fi") - - (defpoll brightness :interval "10s" - "echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))") - ''; - }; - */ - - programs.fish = { - shellAliases = { - sctl = "sudo systemctl"; - sctlu = "systemctl --user"; - }; - }; - - services.mako = with colors.withHashPrefix; { - enable = true; - borderSize = 1; - maxVisible = 5; - defaultTimeout = 15000; - font = "Symbols Nerd Font ${toString font.size},${font.name} ${toString font.size}"; - # TODO: config - - backgroundColor = bg; - textColor = text; - borderColor = primary; - progressColor = primary; - - extraConfig = '' - [urgency=high] - border-color=${urgent} - [urgency=high] - background-color=${urgent} - ''; - }; - - # this doesn't work due to weird quoting bugs AFAICT - /* - services.swayidle = let - bins = rec { - swaylock = builtins.trace "${pkgs.swaylock}/bin/swaylock" "${pkgs.swaylock}/bin/swaylock"; - swaymsg = "${pkgs.sway}/bin/swaymsg"; - notify-send = "${swaymsg} exec -- ${pkgs.libnotify}/bin/notify-send"; - }; - in (with bins; { - enable = true; - - events = [ - { - event = "before-sleep"; - command = swaylock; - } - ]; - - timeouts = [ - { - timeout = 5; - command = "${notify-send} \\\"Idling in 300 seconds\\\""; - resumeCommand = "${notify-send} \\\"Idling cancelled.\\\""; - } - { - # timeout = 540; - timeout = 6; - command = "${notify-send} 'Idling in 90 seconds'"; - } - { - # timeout = 570; - timeout = 7; - command = "${notify-send} 'Idling in 60 seconds'"; - } - { - # timeout = 600; - timeout = 8; - command = "${notify-send} 'Idling in 30 seconds...'"; - } - { - # timeout = 630; - timeout = 9; - command = "${swaylock} -f"; - } - { - # timeout = 660; - timeout = 10; - command = "${swaymsg} 'output * dpms off'"; - resumeCommand = "${swaymsg} 'output * dpms on' & ${swaymsg} exec -- maybe-good-morning &"; - } - ]; - }); - */ - - wayland.windowManager.hyprland = { - enable = true; - extraConfig = '' - # See https://wiki.hyprland.org/Configuring/Monitors/ - monitor=,preferred,auto,auto - monitor=desc:LG Display 0x0521,preferred,auto,1 - - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - - # Execute your favorite apps at launch - exec-once = firefox & kitty --single-instance & hyprpaper & mako & /usr/lib/polkit-kde-authentication-agent-1 - exec-once = swayidle -w timeout 600 'notify-send "Locking in 30 seconds..."' timeout 630 'swaylock -f' timeout 660 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on && maybe-good-morning' before-sleep 'swaylock -f' - exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP - - env = XCURSOR_SIZE,24 - - input { - kb_layout = us - kb_options = ctrl:nocaps - touchpad { - natural_scroll = yes - } - # kb_variant = - # kb_model = - # kb_rules = - - follow_mouse = 2 - - repeat_delay = 200 - repeat_rate = 60 - - touchpad { - natural_scroll = yes - tap-to-click = true - middle_button_emulation = true - } - - force_no_accel = true - sensitivity = 1 # -1.0 - 1.0, 0 means no modification. - } - - misc { - disable_hyprland_logo = true - disable_splash_rendering = true - } - - binds { - allow_workspace_cycles = true - } - - general { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - gaps_in = 3 - gaps_out = 6 - border_size = 1 - no_cursor_warps = true - resize_on_border = true - - col.active_border = rgba(74c7ecff) 45deg - col.inactive_border = rgba(59595988) - - layout = dwindle - } - - decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 3 - # blur = yes - # blur_size = 3 - # blur_passes = 1 - # blur_new_optimizations = on - - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) - - dim_inactive = 0.5 - } - - animations { - enabled = yes - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - bezier=overshot,0.05,0.9,0.1,1.1 - - animation = windows, 1, 2, default - animation = windowsOut, 1, 2, default, popin 80% - animation = border, 1, 2, default - animation = borderangle, 1, 2, default - animation = fade, 1, 2, default - animation = workspaces, 1, 2, default - } - - dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - pseudotile = yes - preserve_split = 1 - no_gaps_when_only = true - } - - master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_is_master = true - } - - gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = on - } - - # Example per-device config - # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more - # device:epic-mouse-v1 { - # sensitivity = -0.5 - # } - - # Example windowrule v1 - # windowrule = float, ^(kitty)$ - # Example windowrule v2 - # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ - # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - $mainMod = SUPER - - # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more - bind = $mainMod, return, exec, kitty --single-instance - bind = $mainMod SHIFT, return, exec, kitty - bind = $mainMod, U, exec, firefox - bind = $mainMod, space, exec, wofi --show drun - bind = $mainMod, C, killactive, - bind = $mainMod, M, exit, - bind = $mainMod, E, exec, dolphin - bind = $mainMod, F, togglefloating, - bind = $mainMod SHIFT, F, fullscreen, - bind = $mainMod, R, exec, anyrun - bind = $mainMod, S, pseudo, # dwindle - bind = $mainMod, P, togglesplit, # dwindle - - # Move focus with mainMod + arrow keys - bind = $mainMod, left, movefocus, l - bind = $mainMod, right, movefocus, r - bind = $mainMod, up, movefocus, u - bind = $mainMod, down, movefocus, d - bind = $mainMod, h, movefocus, l - bind = $mainMod, l, movefocus, r - bind = $mainMod, k, movefocus, u - bind = $mainMod, j, movefocus, d - - bind = $mainMod SHIFT, H, swapwindow, l - bind = $mainMod SHIFT, L, swapwindow, r - bind = $mainMod SHIFT, K, swapwindow, u - bind = $mainMod SHIFT, J, swapwindow, d - - bind = $mainMod SHIFT, V, exec, pamixer --default-source --toggle-mute - bind = , XF86AudioMicMute, exec, pamixer --default-source --toggle-mute - bind = , XF86AudioMute, exec, pamixer --toggle-mute - bind = , XF86AudioRaiseVolume, exec, pamixer --increase 5 - bind = , XF86AudioLowerVolume, exec, pamixer --decrease 5 - bind = CTRL, XF86AudioRaiseVolume, exec, pamixer --increase 1 - bind = CTRL, XF86AudioLowerVolume, exec, pamixer --decrease 1 - - bind = , XF86AudioPlay, exec, playerctl play-pause - bind = , XF86AudioNext, exec, playerctl next - bind = , XF86AudioPrev, exec, playerctl previous - - bind = $mainMod, tab, workspace, previous - - # Switch workspaces with mainMod + [0-9] - bind = $mainMod, 1, workspace, 1 - bind = $mainMod, 2, workspace, 2 - bind = $mainMod, 3, workspace, 3 - bind = $mainMod, 4, workspace, 4 - bind = $mainMod, 5, workspace, 5 - bind = $mainMod, 6, workspace, 6 - bind = $mainMod, 7, workspace, 7 - bind = $mainMod, 8, workspace, 8 - bind = $mainMod, 9, workspace, 9 - bind = $mainMod, 0, workspace, 10 - - # Move active window to a workspace with mainMod + SHIFT + [0-9] - bind = $mainMod SHIFT, 1, movetoworkspace, 1 - bind = $mainMod SHIFT, 2, movetoworkspace, 2 - bind = $mainMod SHIFT, 3, movetoworkspace, 3 - bind = $mainMod SHIFT, 4, movetoworkspace, 4 - bind = $mainMod SHIFT, 5, movetoworkspace, 5 - bind = $mainMod SHIFT, 6, movetoworkspace, 6 - bind = $mainMod SHIFT, 7, movetoworkspace, 7 - bind = $mainMod SHIFT, 8, movetoworkspace, 8 - bind = $mainMod SHIFT, 9, movetoworkspace, 9 - bind = $mainMod SHIFT, 0, movetoworkspace, 10 - - bind = , XF86MonBrightnessDown, exec, brightnessctl set 10%- - bind = , XF86MonBrightnessUp, exec, brightnessctl set +10% - bind = SHIFT, XF86MonBrightnessDown, exec, brightnessctl set 1% - bind = SHIFT, XF86MonBrightnessUp, exec, brightnessctl set 100% - bind = CTRL, XF86MonBrightnessDown, exec, brightnessctl set 1%- - bind = CTRL, XF86MonBrightnessUp, exec, brightnessctl set +1% - - bind = $mainMod SHIFT, S, exec, clipshot - - # Scroll through existing workspaces with mainMod + scroll - bind = $mainMod, mouse_down, workspace, e+1 - bind = $mainMod, mouse_up, workspace, e-1 - - bind = CTRL SHIFT $mainMod, L, exec, swaylock - - # Move/resize windows with mainMod + LMB/RMB and dragging - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - - bind = $mainMod CTRL, space, exec, makoctl dismiss - bind = $mainMod SHIFT CTRL, space, exec, makoctl restore - bind = $mainMod SHIFT, space, exec, makoctl invoke - - bind = $mainMod, E, exec, thunar - ''; - }; - - wayland.windowManager.sway = { - /* - TODO: - + Super+r should rotate the selected group of windows. - + Super+Control+{1-9} should control the size of the preselect space. - + Super+Shift+b should balance the size of all selected nodes. - set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)" - for_window [title=".*"] floating enable - for_window [app_id=$tilers] floating disable - - # for_window [title=".*"] opacity $opacity - - # TODO: I forget why I needed this - could google it I expect? - exec /usr/lib/polkit-kde-authentication-agent-1 - - # prevent all windows from stealing focus - no_focus [class=".*"] - */ - - enable = true; - - systemd = { - enable = true; - }; - - config = { - output = { - "*" = { - background = "$HOME/.wallpaper fill"; - }; - - "Dell Inc. DELL U2720Q D3TM623" = { - # desktop left vertical monitor - transform = "90"; - scale = "1.5"; - }; - }; - - # TODO: popup_during_fullscreen smart - focus = { - wrapping = "no"; - followMouse = "no"; - mouseWarping = false; - }; - - modifier = "Mod4"; - - gaps = { - smartBorders = "on"; - }; - - window = { - border = 2; - titlebar = false; - }; - - floating = { - modifier = config.wayland.windowManager.sway.config.modifier; - titlebar = false; - }; - - startup = [ - { - command = "systemctl --user restart waybar"; - always = true; - } - { - command = lib.concatStringsSep " " [ - "swayidle -w" - "timeout 300 'notify-send \"Idling in 300 seconds\"'" - "resume 'notify-send \"Idling cancelled.\"'" - "timeout 480 'notify-send \"Idling in 120 seconds\"'" - "timeout 510 'notify-send \"Idling in 90 seconds\"'" - "timeout 540 'notify-send \"Idling in 60 seconds!\"'" - "timeout 570 'notify-send \"Idling in 30 seconds!\"'" - "timeout 590 'notify-send \"Idling in 10 seconds!\"'" - "timeout 591 'notify-send \"Idling in 9 seconds!\"'" - "timeout 592 'notify-send \"Idling in 8 seconds!\"'" - "timeout 593 'notify-send \"Idling in 7 seconds!\"'" - "timeout 594 'notify-send \"Idling in 6 seconds!\"'" - "timeout 595 'notify-send \"Idling in 5 seconds!\"'" - "timeout 596 'notify-send \"Idling in 4 seconds!\"'" - "timeout 597 'notify-send \"Idling in 3 seconds!\"'" - "timeout 598 'notify-send \"Idling in 2 seconds!\"'" - "timeout 599 'notify-send \"Idling in 1 second!\"'" - "timeout 600 'swaylock -f'" - "timeout 600 'swaymsg \"output * dpms off\"'" - "resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'" - "before-sleep 'swaylock'" - ]; - } - {command = "firefox";} - {command = "kitty --single-instance";} - ]; - - modes = { - resize = { - "h" = "resize shrink width 10 px or 10 ppt"; - "j" = "resize grow height 10 px or 10 ppt"; - "k" = "resize shrink height 10 px or 10 ppt"; - "l" = "resize grow width 10 px or 10 ppt"; - - "left" = "resize shrink width 10 px or 10 ppt"; - "down" = "resize grow height 10 px or 10 ppt"; - "up" = "resize shrink height 10 px or 10 ppt"; - "right" = "resize grow width 10 px or 10 ppt"; - - "return" = ''mode "default"''; - "escape" = ''mode "default"''; - }; - }; - - input = { - "type:keyboard" = { - xkb_options = "ctrl:nocaps"; - repeat_delay = "200"; - repeat_rate = "60"; - }; - - "type:pointer" = { - accel_profile = "flat"; - pointer_accel = "0"; - }; - - "type:touchpad" = { - dwt = "disabled"; - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - # pointer_accel - }; - }; - keybindings = let - mod = config.wayland.windowManager.sway.config.modifier; - in { - # bindsym $mod+shift+space exec wofi --show drun - "${mod}+control+space" = "exec makoctl dismiss"; - "${mod}+shift+space" = "exec makoctl invoke"; - "${mod}+return" = "exec kitty --single-instance"; - "${mod}+shift+return" = "exec floating-term"; - "${mod}+shift+alt+return" = "exec kitty"; - "${mod}+c" = "kill"; - "${mod}+shift+c" = "kill # TODO: kill -9?"; - "${mod}+space" = "exec wofi --show drun"; - "${mod}+shift+s" = "exec clipshot"; - "${mod}+e" = "exec thunar"; - "${mod}+shift+r" = "reload"; - "${mod}+control+Escape" = "exit"; - "${mod}+shift+e" = "exit"; - "${mod}+shift+p" = "exec pass-chooser"; - "${mod}+control+j" = "split v"; - "${mod}+control+l" = "split h"; - "${mod}+control+f" = "focus mode_toggle"; - - "${mod}+h" = "focus left"; - "${mod}+j" = "focus down"; - "${mod}+k" = "focus up"; - "${mod}+l" = "focus right"; - - "${mod}+left" = "focus left"; - "${mod}+down" = "focus down"; - "${mod}+up" = "focus up"; - "${mod}+right" = "focus right"; - - "${mod}+shift+h" = "move left"; - "${mod}+shift+j" = "move down"; - "${mod}+shift+k" = "move up"; - "${mod}+shift+l" = "move right"; - - "${mod}+shift+left" = "move left"; - "${mod}+shift+down" = "move down"; - "${mod}+shift+up" = "move up"; - "${mod}+shift+right" = "move right"; - - "${mod}+1" = "workspace 1"; - "${mod}+2" = "workspace 2"; - "${mod}+3" = "workspace 3"; - "${mod}+4" = "workspace 4"; - "${mod}+5" = "workspace 5"; - "${mod}+6" = "workspace 6"; - "${mod}+7" = "workspace 7"; - "${mod}+8" = "workspace 8"; - "${mod}+9" = "workspace 9"; - "${mod}+0" = "workspace 10"; - - "${mod}+shift+1" = "move container to workspace 1"; - "${mod}+shift+2" = "move container to workspace 2"; - "${mod}+shift+3" = "move container to workspace 3"; - "${mod}+shift+4" = "move container to workspace 4"; - "${mod}+shift+5" = "move container to workspace 5"; - "${mod}+shift+6" = "move container to workspace 6"; - "${mod}+shift+7" = "move container to workspace 7"; - "${mod}+shift+8" = "move container to workspace 8"; - "${mod}+shift+9" = "move container to workspace 9"; - "${mod}+shift+0" = "move container to workspace 10"; - - "${mod}+b" = "splith"; - "${mod}+v" = "splitv"; - - "${mod}+shift+f" = "fullscreen toggle"; - "${mod}+f" = "floating toggle"; - "${mod}+s" = "floating disable"; - "${mod}+alt+f" = "focus mode_toggle"; - "${mod}+p" = "focus parent"; - "${mod}+period" = "focus child"; - "${mod}+comma" = "focus child"; - "${mod}+tab" = "workspace back_and_forth"; - - "${mod}+minus" = "gaps inner current minus 5"; - "${mod}+plus" = "gaps inner current plus 5"; - "${mod}+control+alt+h" = "gaps horizontal current minus 5"; - "${mod}+control+alt+l" = "gaps horizontal current plus 5"; - "${mod}+control+alt+j" = "gaps vertical current minus 5"; - "${mod}+control+alt+k" = "gaps vertical current plus 5"; - - # TODO: this should also reset the horizontal and vertical gaps? - "${mod}+control+equal" = "gaps inner current set 0"; - - "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; - "control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; - "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86MonBrightnessDown" = "exec brightnessctl set 10%-"; - "XF86MonBrightnessUp" = "exec brightnessctl set +10%"; - "shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%"; - "shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%"; - "control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-"; - "control+XF86MonBrightnessUp" = "exec brightnessctl set +1%"; - "XF86AudioPlay" = "exec playerctl play-pause"; - "XF86AudioNext" = "exec playerctl next"; - "XF86AudioPrev" = "exec playerctl previous"; - "${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - - "${mod}+control+shift+l" = "exec swaylock"; - - "${mod}+shift+alt+f" = "for_window [class=$tilers] floating toggle"; - }; - assigns = {}; - bars = []; - colors = with colors; { - background = bg; - focused = { - background = bg; - border = primary; - childBorder = primary; - indicator = primary; - text = bg; - }; - focusedInactive = { - background = bg; - border = primary; - childBorder = primary; - indicator = primary; - text = bg; - }; - placeholder = { - background = bg; - border = primary; - childBorder = primary; - indicator = primary; - text = text; - }; - unfocused = { - background = bg; - border = bg; - childBorder = bg; - indicator = bg; - text = text; - }; - urgent = { - background = urgent; - border = urgent; - childBorder = urgent; - indicator = urgent; - text = bg; - }; - }; - }; - }; - - gtk = { - enable = true; - theme = { - name = "Catppuccin-Mocha-Compact-Sapphire-dark"; - package = pkgs.catppuccin-gtk.override { - accents = ["sapphire"]; - size = "compact"; - tweaks = ["rimless" "black"]; - variant = "mocha"; - }; - }; - }; - - home.packages = [ - (pkgs.buildEnv { - name = "my-linux-scripts"; - paths = [./scripts/linux]; - }) - ]; - - programs.waybar = { - enable = true; - settings = { - mainBar = { - "layer" = "top"; - "position" = "bottom"; - "output" = ["eDP-1" "DP-3"]; - "height" = 32; - "modules-left" = ["clock" "sway/window"]; - "modules-center" = ["sway/workspaces"]; - "modules-right" = [ - "mpris" - "idle_inhibitor" - "bluetooth" - # "wireplumber", - "pulseaudio" - # "network", - "cpu" - "memory" - # "temperature", - "backlight" - "battery" - "tray" - ]; - "bluetooth" = { - "format" = ""; - "format-connected" = ""; - "format-connected-battery" = ""; - # "format-device-preference" = [ "device1", "device2" ], # preference list deciding the displayed devic; - "tooltip-format" = "{controller_alias}@{controller_address} ({num_connections} connected)"; - "tooltip-format-connected" = "{controller_alias}@{controller_address} ({num_connections} connected)\n{device_enumerate}"; - "tooltip-format-enumerate-connected" = "{device_alias}@{device_address}"; - "tooltip-format-enumerate-connected-battery" = "{device_alias}@{device_address} (󰁹 {device_battery_percentage}%)"; - }; - # "wireplumber" = ; - # "format" = "{volume}% {icon}"; - # "format-muted" = ""; - # "on-click" = "helvum; - # }, - "sway/workspaces" = { - "disable-scroll" = false; - "persistent_workspaces" = { - }; - "all-outputs" = true; - "format" = "{name}"; - }; - "idle_inhibitor" = { - "format" = "{icon}"; - "format-icons" = { - "activated" = "󰈈"; - "deactivated" = "󰈉"; - }; - }; - "tray" = { - "icon-size" = 24; - "spacing" = 4; - }; - "clock" = { - "interval" = 1; - "format" = "{:%a %b %d %H:%M:%S}"; - }; - "cpu" = { - "format" = "{usage} "; - "tooltip" = true; - "interval" = 3; - }; - "memory" = { - "format" = "{} 󰍛"; - }; - "temperature" = { - # "thermal-zone" = 2; - # "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input"; - "critical-threshold" = 80; - # "format-critical" = "{temperatureC}°C {icon}"; - "format" = "{temperatureC}°C {icon}"; - "format-icons" = ["" "" ""]; - }; - "backlight" = { - # "device" = "acpi_video1"; - "format" = "{percent}% {icon}"; - "format-icons" = ["" ""]; - }; - "battery" = { - "states" = { - # "good" = 95; - "warning" = 30; - "critical" = 1; - }; - "format" = "{capacity}% {icon}"; - "format-charging" = "{capacity}% 󱐋"; - "format-plugged" = "{capacity}% 󰚥"; - "format-alt" = "{time} {icon}"; - "format-good" = ""; # An empty format will hide the modul; - "format-full" = "󰁹"; - "format-icons" = ["󰂎" "󰁻" "󰁽" "󰁿" "󰂂"]; - }; - "network" = { - "format-wifi" = "{essid} ({signalStrength}%) "; - "format-ethernet" = "{ifname}: {ipaddr}/{cidr} "; - "format-linked" = "{ifname} (No IP) "; - "format-disconnected" = "Disconnected ⚠"; - "format-alt" = "{ifname}: {ipaddr}/{cidr}"; - }; - "mpris" = { - "format" = "{title} by {artist}"; - }; - "pulseaudio" = { - # "scroll-step" = 1, # %, can be a floa; - "format" = "{volume} {icon} {format_source}"; - #"format" = "{volume}% {icon} {format_source}"; - #"format-bluetooth" = "{volume}% {icon} {format_source}"; - #"format-bluetooth-muted" = " {icon} {format_source}"; - #"format-muted" = " {format_source}"; - "format-muted" = "󰝟 {format_source}"; - "format-source" = ""; - "format-source-muted" = ""; - "format-icons" = { - "headphones" = ""; - "handsfree" = "󱥋"; - "headset" = "󰋎"; - "phone" = ""; - "portable" = ""; - "car" = ""; - "default" = ["" "" ""]; - }; - # TODO: toggle mute? - "on-click" = "pavucontrol"; - }; - }; - }; - style = let - border-width = "0px"; - in - with colors.withHashPrefix; '' - * { - border-radius: 0; - font-family: "${font.name}", "Symbols Nerd Font Mono", sans-serif; - font-size: 16px; - } - - window#waybar { - min-height: 32px; - background-color: ${bg}; - color: ${text}; - border-top: solid ${blue} ${border-width}; - transition: none; - } - - window#waybar.hidden { - /* opacity: 0.2; */ - } - - window#waybar.empty { - /* opacity: 0.2; */ - } - - #workspaces button { - padding: 0 0.75em; - background-color: transparent; - border-top: solid ${primary} ${border-width}; - transition: none; - color: ${fgdim}; - background-color: ${bg}; - } - - #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - } - - #workspaces button.active { - color: ${text}; - background-color: ${bg}; - } - - #workspaces button.visible { - color: ${fgdim}; - background-color: ${bg}; - } - - /* A workspace that is persistent but has windows in it */ - #workspaces button.persistent { - color: ${fgdim}; - } - - #workspaces button.focused { - color: ${bg}; - background-color: ${primary}; - } - - #workspaces button.urgent { - background-color: ${urgent}; - color: ${bg}; - border-top: solid ${urgent} ${border-width}; - } - - #mode { - background-color: transparent; - } - - #clock, - #battery, - #cpu, - #memory, - #temperature, - #backlight, - #network, - #pulseaudio, - #custom-media, - #tray, - #mode, - #idle_inhibitor, - #mpris, - #window, - #mpd { - margin-top: 1px; - padding: 0 0.75em; - background-color: inherit; - color: ${text}; - } - - #clock {} - - #battery { - /* background-color: #ffffff; */ - /* color: #000000; */ - } - - #battery.charging { - /* color: #ffffff; */ - /* background-color: #26A65B; */ - } - - @keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } - } - - #battery.critical:not(.charging) { - background-color: ${red}; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - #bluetooth, - #bluetooth.connected-battery, - #bluetooth.connected.battery, - #bluetooth.connected { - color: ${text}; - } - - label:focus { - /* background-color: #000000; */ - } - - #cpu { - /* background-color: #2ecc71; */ - /* color: #000000; */ - } - - #memory { - /* background-color: #9b59b6; */ - } - - #backlight { - /* background-color: #90b1b1; */ - } - - #network { - /* background-color: #2980b9; */ - } - - #network.disconnected { - /* background-color: #f53c3c; */ - } - - #pulseaudio { - color: ${red}; - /* background-color: #f1c40f; */ - /* color: #000000; */ - } - - #pulseaudio.source-muted { - /* background-color: #90b1b1; */ - color: ${text}; - } - - #custom-media { - /* background-color: #66cc99; */ - /* color: #2a5c45; */ - /* min-width: 100px; */ - } - - #custom-media.custom-spotify { - /* background-color: #66cc99; */ - } - - #custom-media.custom-vlc { - /* background-color: #ffa000; */ - } - - #temperature { - /* background-color: #f0932b; */ - } - - #temperature.critical { - /* background-color: #eb4d4b; */ - } - - #tray { - /* background-color: #2980b9; */ - } - - #idle_inhibitor { - /* background-color: #2d3436; */ - } - - #idle_inhibitor.activated { - /* background-color: #ecf0f1; */ - /* color: #2d3436; */ - } - - #mpd { - /* background-color: #66cc99; */ - /* color: #2a5c45; */ - } - - #mpd.disconnected { - /* background-color: #f53c3c; */ - } - - #mpd.stopped { - /* background-color: #90b1b1; */ - } - - #mpd.paused { - /* background-color: #51a37a; */ - } - ''; - systemd = { - enable = true; - }; - }; - - programs.firefox = { - # TODO: this should be able to work on macos, no? - # TODO: enable dark theme by default - enable = true; - - # TODO: uses nixpkgs.pass so pass otp doesn't work - package = pkgs.firefox.override {extraNativeMessagingHosts = [pkgs.passff-host];}; - - # extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - # ublock-origin - # ]; # TODO: would be nice to have _all_ my firefox stuff managed here instead of Firefox Sync maybe? - - profiles = { - daniel = { - id = 0; - settings = { - "general.smoothScroll" = true; - }; - - extraConfig = '' - user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); - // user_pref("full-screen-api.ignore-widgets", true); - user_pref("media.ffmpeg.vaapi.enabled", true); - user_pref("media.rdd-vpx.enabled", true); - ''; - - userChrome = '' - #TabsToolbar { - visibility: collapse; - } - - #webrtcIndicator { - display: none; - } - - #main-window[tabsintitlebar=" - true "]:not([extradragspace=" - true "]) #TabsToolbar>.toolbar-items { - opacity: 0; - pointer-events: none; - } - - #main-window:not([tabsintitlebar=" - true "]) #TabsToolbar { - visibility: collapse !important; - } - ''; - - # userContent = '' - # ''; - }; - }; - }; - - programs.swaylock = { - enable = true; - settings = { - color = "ffffffff"; - image = "~/.wallpaper"; - font = font.name; - show-failed-attempts = true; - ignore-empty-password = true; - - indicator-radius = "150"; - indicator-thickness = "30"; - - inside-color = "11111100"; - inside-clear-color = "11111100"; - inside-ver-color = "11111100"; - inside-wrong-color = "11111100"; - - key-hl-color = "a1efe4"; - separator-color = "11111100"; - - line-color = "111111cc"; - line-uses-ring = true; - - ring-color = "111111cc"; - ring-clear-color = "f4bf75"; - ring-ver-color = "66d9ef"; - ring-wrong-color = "f92672"; - }; - }; -} diff --git a/home/work.nix b/home/work.nix deleted file mode 100644 index 231e7c3..0000000 --- a/home/work.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: let - username = "daniel.flanagan@hq.bill.com"; -in { - home.username = username; - home.homeDirectory = "/Users/${username}"; -} diff --git a/lib/colors.nix b/lib/colors.nix new file mode 100644 index 0000000..da72f1b --- /dev/null +++ b/lib/colors.nix @@ -0,0 +1,102 @@ +{nixpkgs-unstable, ...}: { + schemes = let + mkColorScheme = scheme @ { + scheme-name, + bg, + bg2, + bg3, + bg4, + bg5, + fg, + fg2, + fg3, + fgdim, + # pink, + purple, + red, + orange, + yellow, + green, + # teal, + blue, + }: let + base = + { + # aliases? + text = fg; + primary = blue; + urgent = red; + + # blacks + "0" = bg4; + "8" = bg5; + + "1" = red; + "9" = red; + "2" = green; + "10" = green; + "3" = orange; + "11" = orange; + "4" = blue; + "12" = blue; + "5" = purple; + "13" = purple; + "6" = yellow; + "14" = yellow; + + # whites + "7" = fg2; + "15" = fg3; + } + // scheme; + in + { + withHashPrefix = nixpkgs-unstable.lib.mapAttrs (_: value: "#${value}") base; + } + // base; + in { + donokai = mkColorScheme { + scheme-name = "donokai"; + bg = "111111"; + bg2 = "181818"; + bg3 = "222222"; + bg4 = "292929"; + bg5 = "333333"; + + fg = "f8f8f8"; + fg2 = "d8d8d8"; + fg3 = "c8c8c8"; + fgdim = "666666"; + + red = "f92672"; + green = "a6e22e"; + yellow = "f4bf75"; + blue = "66d9ef"; + purple = "ae81ff"; + # teal = "a1efe4"; + orange = "fab387"; + }; + catppuccin-mocha-sapphire = mkColorScheme { + scheme-name = "catppuccin-mocha-sapphire"; + bg = "1e1e2e"; + bg2 = "181825"; + bg3 = "313244"; + bg4 = "45475a"; + bg5 = "585b70"; + + fg = "cdd6f4"; + fg2 = "bac2de"; + fg3 = "a6adc8"; + fgdim = "6c7086"; + + # pink = "f5e0dc"; + purple = "cba6f7"; + red = "f38ba8"; + orange = "fab387"; + yellow = "f9e2af"; + green = "a6e3a1"; + # teal = "94e2d5"; + blue = "74c7ec"; + }; + }; +} diff --git a/modules/home-manager/bat.nix b/modules/home-manager/bat.nix new file mode 100644 index 0000000..81f2da5 --- /dev/null +++ b/modules/home-manager/bat.nix @@ -0,0 +1,26 @@ +{ + pkgs, + # colors, + ... +}: { + programs.bat = { + enable = true; + config = { + theme = "Catppuccin-mocha"; + }; + themes = { + "Catppuccin-mocha" = builtins.readFile (pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "bat"; + rev = "477622171ec0529505b0ca3cada68fc9433648c6"; + sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; + } + + "/Catppuccin-mocha.tmTheme"); + }; + }; + + home.shellAliases = { + cat = "bat"; + }; +} diff --git a/modules/home-manager/broot.nix b/modules/home-manager/broot.nix new file mode 100644 index 0000000..45f50f3 --- /dev/null +++ b/modules/home-manager/broot.nix @@ -0,0 +1,112 @@ +{ + # colors, + ... +}: { + programs.broot = { + enable = true; + enableFishIntegration = true; + settings = { + modal = true; + skin = { + # this is a crappy copy of broot's catppuccin mocha theme + input = "rgb(205, 214, 244) none"; + selected_line = "none rgb(88, 91, 112)"; + default = "rgb(205, 214, 244) none"; + tree = "rgb(108, 112, 134) none"; + parent = "rgb(116, 199, 236) none"; + file = "none none"; + + perm__ = "rgb(186, 194, 222) none"; + perm_r = "rgb(250, 179, 135) none"; + perm_w = "rgb(235, 160, 172) none"; + perm_x = "rgb(166, 227, 161) none"; + owner = "rgb(148, 226, 213) none"; + group = "rgb(137, 220, 235) none"; + + dates = "rgb(186, 194, 222) none"; + + directory = "rgb(180, 190, 254) none Bold"; + exe = "rgb(166, 227, 161) none"; + link = "rgb(249, 226, 175) none"; + pruning = "rgb(166, 173, 200) none Italic"; + + preview_title = "rgb(205, 214, 244) rgb(24, 24, 37)"; + preview = "rgb(205, 214, 244) rgb(24, 24, 37)"; + preview_line_number = "rgb(108, 112, 134) none"; + + char_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; + content_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; + preview_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic"; + + count = "rgb(249, 226, 175) none"; + sparse = "rgb(243, 139, 168) none"; + content_extract = "rgb(243, 139, 168) none Italic"; + + git_branch = "rgb(250, 179, 135) none"; + git_insertions = "rgb(250, 179, 135) none"; + git_deletions = "rgb(250, 179, 135) none"; + git_status_current = "rgb(250, 179, 135) none"; + git_status_modified = "rgb(250, 179, 135) none"; + git_status_new = "rgb(250, 179, 135) none Bold"; + git_status_ignored = "rgb(250, 179, 135) none"; + git_status_conflicted = "rgb(250, 179, 135) none"; + git_status_other = "rgb(250, 179, 135) none"; + staging_area_title = "rgb(250, 179, 135) none"; + + flag_label = "rgb(243, 139, 168) none"; + flag_value = "rgb(243, 139, 168) none Bold"; + + status_normal = "none rgb(24, 24, 37)"; + status_italic = "rgb(243, 139, 168) rgb(24, 24, 37) Italic"; + status_bold = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; + status_ellipsis = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; + status_error = "rgb(205, 214, 244) rgb(243, 139, 168)"; + status_job = "rgb(235, 160, 172) rgb(40, 38, 37)"; + status_code = "rgb(235, 160, 172) rgb(24, 24, 37) Italic"; + mode_command_mark = "rgb(235, 160, 172) rgb(24, 24, 37) Bold"; + + help_paragraph = "rgb(205, 214, 244) none"; + help_headers = "rgb(243, 139, 168) none Bold"; + help_bold = "rgb(250, 179, 135) none Bold"; + help_italic = "rgb(249, 226, 175) none Italic"; + help_code = "rgb(166, 227, 161) rgb(49, 50, 68)"; + help_table_border = "rgb(108, 112, 134) none"; + + hex_null = "rgb(205, 214, 244) none"; + hex_ascii_graphic = "rgb(250, 179, 135) none"; + hex_ascii_whitespace = "rgb(166, 227, 161) none"; + hex_ascii_other = "rgb(148, 226, 213) none"; + hex_non_ascii = "rgb(243, 139, 168) none"; + + file_error = "rgb(251, 73, 52) none"; + + purpose_normal = "none none"; + purpose_italic = "rgb(177, 98, 134) none Italic"; + purpose_bold = "rgb(177, 98, 134) none Bold"; + purpose_ellipsis = "none none"; + + scrollbar_track = "rgb(49, 50, 68) none"; + scrollbar_thumb = "rgb(88, 91, 112) none"; + + good_to_bad_0 = "rgb(166, 227, 161) none"; + good_to_bad_1 = "rgb(148, 226, 213) none"; + good_to_bad_2 = "rgb(137, 220, 235) none"; + good_to_bad_3 = "rgb(116, 199, 236) none"; + good_to_bad_4 = "rgb(137, 180, 250) none"; + good_to_bad_5 = "rgb(180, 190, 254) none"; + good_to_bad_6 = "rgb(203, 166, 247) none"; + good_to_bad_7 = "rgb(250, 179, 135) none"; + good_to_bad_8 = "rgb(235, 160, 172) none"; + good_to_bad_9 = "rgb(243, 139, 168) none"; + }; + + verbs = [ + { + invocation = "edit"; + shortcut = "e"; + execution = "$EDITOR {file}"; + } + ]; + }; + }; +} diff --git a/modules/home-manager/common.nix b/modules/home-manager/common.nix new file mode 100644 index 0000000..6632240 --- /dev/null +++ b/modules/home-manager/common.nix @@ -0,0 +1,82 @@ +{ + pkgs, + lib, + system, + inputs, + outputs, + ... +}: { + # TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module) + # TODO: wallpaper? + + imports = [ + # nix-colors.homeManagerModules.default + outputs.homeManagerModules.fish + outputs.homeManagerModules.helix + outputs.homeManagerModules.git + outputs.homeManagerModules.iex + ]; + + # TODO: specify an email? + # accounts.email.accounts = { + # primary = { + # address = "daniel@lyte.dev"; + # }; + # }; + + home = { + username = lib.mkDefault "daniel"; + homeDirectory = lib.mkDefault "/home/daniel/.home"; + stateVersion = lib.mkDefault "23.11"; + + packages = [ + # I use gawk for my fish prompt + pkgs.gawk + + # text editor + inputs.helix.packages.${system}.helix + + # tools I use when editing nix code + pkgs.nil + pkgs.alejandra + + (pkgs.buildEnv { + name = "my-scripts-common"; + paths = [./scripts/common]; + }) + ]; + }; + + programs.password-store = { + enable = true; + package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); + }; + + programs.gitui = { + enable = true; + }; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.eza = { + enable = true; + package = inputs.nixpkgs-unstable.legacyPackages.${system}.eza; + }; + + programs.skim = { + enable = true; + enableFishIntegration = true; + defaultOptions = ["--color=16"]; + }; + + programs.nix-index = { + enable = true; + enableFishIntegration = true; + }; + + # maybe we can share somehow so things for nix-y systems and non-nix-y systems alike + # am I going to _have_ non-nix systems anymore? +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 45aae31..89fda1b 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -3,4 +3,22 @@ { # List your module files here # my-module = import ./my-module.nix; + common = import ./common.nix; + linux = import ./linux.nix; + macos = import ./macos.nix; + iex = import ./iex.nix; + mako = import ./mako.nix; + git = import ./git.nix; + helix = import ./helix.nix; + bat = import ./bat.nix; + fish = import ./fish.nix; + kitty = import ./kitty.nix; + wezterm = import ./wezterm.nix; + zellij = import ./zellij.nix; + firefox = import ./firefox.nix; + broot = import ./broot.nix; + waybar = import ./waybar.nix; + swaylock = import ./swaylock.nix; + desktop = import ./desktop.nix; + sway = import ./sway.nix; } diff --git a/modules/home-manager/desktop.nix b/modules/home-manager/desktop.nix new file mode 100644 index 0000000..337baf1 --- /dev/null +++ b/modules/home-manager/desktop.nix @@ -0,0 +1,27 @@ +{ + outputs, + pkgs, + ... +}: { + imports = with outputs.homeManagerModules; [ + kitty + firefox + ]; + + programs.foot = { + enable = true; + }; + + gtk = { + enable = true; + theme = { + name = "Catppuccin-Mocha-Compact-Sapphire-dark"; + package = pkgs.catppuccin-gtk.override { + accents = ["sapphire"]; + size = "compact"; + tweaks = ["rimless" "black"]; + variant = "mocha"; + }; + }; + }; +} diff --git a/modules/home-manager/eww.nix b/modules/home-manager/eww.nix new file mode 100644 index 0000000..9f30e41 --- /dev/null +++ b/modules/home-manager/eww.nix @@ -0,0 +1,79 @@ +{ + programs.eww = { + enable = true; + }; + + home.file.".config/eww/eww.yuck" = { + enable = true; + text = '' + (defwidget bar [] + (centerbox :orientation "h" + (sidestuff) + (box) + (music))) + + (defwindow bar + :monitor 0 + :stacking "fg" + :exclusive true + :geometry + (geometry + :x "0%" + :y "0%" + :width "100%" + :height "31px" + :anchor "bottom center") + (bar)) + + (defwidget sidestuff [] + (box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :spacing 20 + time + ; TODO: idle inhibitor? + ; TODO: get these to align properly? + (box :class "mic" ( + box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "} + ) {micVolume + "%"} + ) + (box :class "vol" ( + box :class {muted == "false" ? "live" : "muted"} {muted == "false" ? "󰕾 " : "󰖁 "} + ) {volume + "%"} + ) + {" " + round(EWW_CPU["avg"], 0) + "%"} + {" " + round(EWW_RAM["used_mem_perc"], 0) + "%"} + {isDesktop == "true" ? "" : " " + brightness + "%"} + {isDesktop == "true" ? "" : "󱊣 " + EWW_BATTERY["BAT0"]["capacity"] + "%/" + EWW_BATTERY["BAT1"]["capacity"] + "%"} + )) + + (defwidget music [] + (box :class "music" + :orientation "h" + :halign "end" + :space-evenly false + {music != "" ? "''${music}" : ""})) + + (deflisten music :initial "" + "playerctl --follow metadata --format '{{ title }} by {{ artist }}' || true") + + (deflisten volume :initial "0" + "pamixer --get-volume; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-volume; done") + + (deflisten muted :initial "false" + "pamixer --get-mute; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-mute; done") + + (deflisten micVolume :initial "0" + "pamixer --default-source --get-volume; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-volume; done") + + (deflisten micMuted :initial "false" + "pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done") + + (defpoll time :interval "1s" + "date '+%a %b %d %H:%M:%S'") + + (defpoll isDesktop :interval "24h" + "if [ -d \"$HOME/.config/lytedev-env/host-desktop\" ]; then echo true; else echo false; fi") + + (defpoll brightness :interval "10s" + "echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))") + ''; + }; +} diff --git a/modules/home-manager/firefox.nix b/modules/home-manager/firefox.nix new file mode 100644 index 0000000..933562b --- /dev/null +++ b/modules/home-manager/firefox.nix @@ -0,0 +1,55 @@ +{pkgs, ...}: { + programs.firefox = { + # TODO: this should be able to work on macos, no? + # TODO: enable dark theme by default + enable = true; + + # TODO: uses nixpkgs.pass so pass otp doesn't work + package = pkgs.firefox.override {extraNativeMessagingHosts = [pkgs.passff-host];}; + + # extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + # ublock-origin + # ]; # TODO: would be nice to have _all_ my firefox stuff managed here instead of Firefox Sync maybe? + + profiles = { + daniel = { + id = 0; + settings = { + "general.smoothScroll" = true; + }; + + extraConfig = '' + user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); + // user_pref("full-screen-api.ignore-widgets", true); + user_pref("media.ffmpeg.vaapi.enabled", true); + user_pref("media.rdd-vpx.enabled", true); + ''; + + userChrome = '' + #TabsToolbar { + visibility: collapse; + } + + #webrtcIndicator { + display: none; + } + + #main-window[tabsintitlebar=" + true "]:not([extradragspace=" + true "]) #TabsToolbar>.toolbar-items { + opacity: 0; + pointer-events: none; + } + + #main-window:not([tabsintitlebar=" + true "]) #TabsToolbar { + visibility: collapse !important; + } + ''; + + # userContent = '' + # ''; + }; + }; + }; +} diff --git a/modules/home-manager/fish.nix b/modules/home-manager/fish.nix new file mode 100644 index 0000000..27c26a6 --- /dev/null +++ b/modules/home-manager/fish.nix @@ -0,0 +1,86 @@ +{ + programs.fish = { + enable = true; + # I load long scripts from files for a better editing experience + shellInit = builtins.readFile ./fish/shellInit.fish; + interactiveShellInit = builtins.readFile ./fish/interactiveShellInit.fish; + loginShellInit = ""; + functions = { + # TODO: I think these should be loaded from fish files too for better editor experience? + d = '' + # --wraps=cd --description "Quickly jump to NICE_HOME (or given relative or absolute path) and list files." + if count $argv > /dev/null + cd $argv + else + cd $NICE_HOME + end + la + ''; + + c = '' + if count $argv > /dev/null + cd $NICE_HOME && d $argv + else + d $NICE_HOME + end + ''; + + g = '' + if test (count $argv) -gt 0 + git $argv + else + git status + end + ''; + + ltl = '' + set d $argv[1] . + set -l l "" + for f in $d[1]/* + if test -z $l; set l $f; continue; end + if command test $f -nt $l; and test ! -d $f + set l $f + end + end + echo $l + ''; + + has_command = "command --quiet --search $argv[1]"; + }; + shellAbbrs = {}; + shellAliases = { + l = "br"; + ls = "eza --group-directories-first --classify"; + la = "eza -la --group-directories-first --classify"; + lA = "eza -la --all --group-directories-first --classify"; + tree = "eza --tree --level=3"; + lt = "eza -l --sort=modified"; + lat = "eza -la --sort=modified"; + lc = "lt --sort=accessed"; + lT = "lt --reverse"; + lC = "lc --reverse"; + lD = "la --only-dirs"; + "cd.." = "d .."; + "cdc" = "d $XDG_CONFIG_HOME"; + "cdn" = "d $NOTES_PATH"; + "cdl" = "d $XDG_DOWNLOAD_DIR"; + "cdg" = "d $XDG_GAMES_DIR"; + ".." = "d .."; + "..." = "d ../.."; + "...." = "d ../../.."; + "....." = "d ../../../.."; + "......" = "d ../../../../.."; + "......." = "d ../../../../../.."; + "........" = "d ../../../../../../.."; + "........." = "d ../../../../../../../.."; + p = "ping"; + dc = "docker compose"; + pc = "podman-compose"; + k = "kubectl"; + kg = "kubectl get"; + v = "$EDITOR"; + sv = "sudo $EDITOR"; + kssh = "kitty +kitten ssh"; + }; + }; +} diff --git a/home/fish/interactiveShellInit.fish b/modules/home-manager/fish/interactiveShellInit.fish similarity index 100% rename from home/fish/interactiveShellInit.fish rename to modules/home-manager/fish/interactiveShellInit.fish diff --git a/home/fish/shellInit.fish b/modules/home-manager/fish/shellInit.fish similarity index 100% rename from home/fish/shellInit.fish rename to modules/home-manager/fish/shellInit.fish diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix new file mode 100644 index 0000000..11712ee --- /dev/null +++ b/modules/home-manager/git.nix @@ -0,0 +1,81 @@ +{lib, ...}: let + email = lib.mkDefault "daniel@lyte.dev"; +in { + programs.git = { + enable = true; + + userEmail = email; + userName = lib.mkDefault "Daniel Flanagan"; + + delta = { + enable = true; + options = {}; + }; + + lfs = { + enable = true; + }; + + signing = { + signByDefault = true; + key = email; + }; + + aliases = { + a = "add -A"; + ac = "commit -a"; + b = "rev-parse --symbolic-full-name HEAD"; + c = "commit"; + cm = "commit -m"; + cnv = "commit --no-verify"; + co = "checkout"; + d = "diff"; + ds = "diff --staged"; + dt = "difftool"; + f = "fetch"; + l = "log --graph --abbrev-commit --decorate --oneline --all"; + plainlog = " log --pretty=format:'%h %ad%x09%an%x09%s' --date=short --decorate"; + ls = "ls-files"; + mm = "merge master"; + p = "push"; + pf = "push --force-with-lease"; + pl = "pull"; + rim = "rebase -i master"; + s = "status"; + }; + + extraConfig = { + push = { + autoSetupRemote = true; + }; + + branch = { + autoSetupMerge = true; + }; + + sendemail = { + smtpserver = "smtp.mailgun.org"; + smtpuser = email; + smtrpencryption = "tls"; + smtpserverport = 587; + }; + + url = { + # TODO: how to have per-machine not-in-git configuration? + "git@git.hq.bill.com:" = { + insteadOf = "https://git.hq.bill.com"; + }; + }; + }; + }; + + programs.fish.functions = { + g = '' + if test (count $argv) -gt 0 + git $argv + else + git status + end + ''; + }; +} diff --git a/modules/home-manager/helix.nix b/modules/home-manager/helix.nix new file mode 100644 index 0000000..3a69201 --- /dev/null +++ b/modules/home-manager/helix.nix @@ -0,0 +1,485 @@ +{ + inputs, + colors, + system, + ... +}: { + programs.helix = { + enable = true; + package = inputs.helix.packages.${system}.helix; + languages = { + language-server = { + lexical = { + command = "lexical"; + args = ["start"]; + }; + + next-ls = { + command = "next-ls"; + args = ["--stdout"]; + }; + + deno = { + command = "deno"; + args = ["lsp"]; + config = { + enable = true; + lint = true; + unstable = true; + }; + }; + }; + + language = [ + { + name = "elixir"; + language-servers = ["elixir-ls"]; # "lexical" "next-ls" + auto-format = true; + } + { + name = "html"; + auto-format = false; + } + { + name = "nix"; + auto-format = true; + formatter = { + command = "alejandra"; + args = ["-"]; + }; + } + { + name = "fish"; + auto-format = true; + indent = { + tab-width = 2; + unit = "\t"; + }; + } + + { + name = "javascript"; + language-id = "javascript"; + grammar = "javascript"; + scope = "source.js"; + injection-regex = "^(js|javascript)$"; + file-types = ["js" "mjs"]; + shebangs = ["deno"]; + language-servers = ["deno"]; + roots = ["deno.jsonc" "deno.json"]; + formatter = { + command = "deno"; + args = ["fmt"]; + }; + auto-format = true; + comment-token = "//"; + indent = { + tab-width = 2; + unit = "\t"; + }; + } + + { + name = "typescript"; + language-id = "typescript"; + grammar = "typescript"; + scope = "source.ts"; + injection-regex = "^(ts|typescript)$"; + file-types = ["ts"]; + shebangs = ["deno"]; + language-servers = ["deno"]; + roots = ["deno.jsonc" "deno.json"]; + formatter = { + command = "deno"; + args = ["fmt"]; + }; + auto-format = true; + comment-token = "//"; + indent = { + tab-width = 2; + unit = "\t"; + }; + } + + { + name = "jsonc"; + language-id = "json"; + grammar = "jsonc"; + scope = "source.jsonc"; + injection-regex = "^(jsonc)$"; + roots = ["deno.jsonc" "deno.json"]; + file-types = ["jsonc"]; + language-servers = ["deno"]; + indent = { + tab-width = 2; + unit = " "; + }; + auto-format = true; + } + + /* + [[language]] + name = "jsx" + scope = "source.jsx" + injection-regex = "jsx" + file-types = ["jsx"] + shebangs = ["deno", "node"] + roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"] + comment-token = "//" + config = { enable = true, lint = true, unstable = true } + language-server = { command = "deno", args = ["lsp"], language-id = "javascriptreact" } + indent = { tab-width = 2, unit = " " } + grammar = "javascript" + auto-format = true + + [[language]] + name = "tsx" + scope = "source.tsx" + injection-regex = "^(tsx)$" # |typescript + file-types = ["tsx"] + shebangs = ["deno", "node"] + roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"] + config = { enable = true, lint = true, unstable = true } + language-server = { command = "deno", args = ["lsp"], language-id = "typescriptreact" } + indent = { tab-width = 2, unit = " " } + auto-format = true + + [[language]] + name = "jsonc" + scope = "source.jsonc" + injection-regex = "^(jsonc)$" + file-types = ["jsonc"] + shebangs = ["deno", "node"] + roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"] + config = { enable = true, lint = true, unstable = true } + language-server = { command = "deno", args = ["lsp"], language-id = "jsonc" } + indent = { tab-width = 2, unit = " " } + auto-format = true + */ + ]; + }; + + settings = { + theme = "custom"; + + editor = { + soft-wrap.enable = true; + auto-pairs = false; + auto-save = false; + completion-trigger-len = 1; + color-modes = false; + bufferline = "multiple"; + scrolloff = 8; + rulers = [80 120]; + cursorline = true; + + cursor-shape = { + normal = "block"; + insert = "bar"; + select = "underline"; + }; + + file-picker.hidden = false; + indent-guides = { + render = true; + character = "▏"; + }; + + lsp = { + display-messages = true; + display-inlay-hints = true; + }; + statusline = { + left = ["mode" "spinner" "selections" "primary-selection-length" "position" "position-percentage" "diagnostics" "workspace-diagnostics"]; + center = ["file-name"]; + right = ["version-control" "total-line-numbers" "file-encoding"]; + }; + }; + keys = { + insert = { + j = { + k = "normal_mode"; + j = "normal_mode"; + K = "normal_mode"; + J = "normal_mode"; + }; + }; + + normal = { + D = "kill_to_line_end"; + "^" = "goto_line_start"; + "C-k" = "jump_view_up"; + "C-j" = "jump_view_down"; + "C-h" = "jump_view_left"; + "C-l" = "jump_view_right"; + "C-q" = ":quit-all!"; + "L" = "repeat_last_motion"; + space = { + q = ":reflow 80"; + Q = ":reflow 120"; + v = ":run-shell-command fish -c 'env > /tmp/env'"; + C = ":bc!"; + h = ":toggle lsp.display-inlay-hints"; + # O = ["select_textobject_inner WORD", ":pipe-to xargs xdg-open"]; + }; + }; + + select = { + space = { + q = ":reflow 80"; + Q = ":reflow 120"; + }; + "L" = "repeat_last_motion"; + }; + }; + }; + + themes = with colors.withHashPrefix; { + custom = { + "type" = orange; + + "constructor" = blue; + + "constant" = orange; + "constant.builtin" = orange; + "constant.character" = yellow; + "constant.character.escape" = orange; + + "string" = green; + "string.regexp" = orange; + "string.special" = blue; + + "comment" = { + fg = fgdim; + modifiers = ["italic"]; + }; + + "variable" = text; + "variable.parameter" = { + fg = red; + modifiers = ["italic"]; + }; + "variable.builtin" = red; + "variable.other.member" = text; + + "label" = blue; + + "punctuation" = fgdim; + "punctuation.special" = blue; + + "keyword" = purple; + "keyword.storage.modifier.ref" = yellow; + "keyword.control.conditional" = { + fg = purple; + modifiers = ["italic"]; + }; + + "operator" = blue; + + "function" = blue; + "function.macro" = purple; + + "tag" = purple; + "attribute" = blue; + + "namespace" = { + fg = blue; + modifiers = ["italic"]; + }; + + "special" = blue; + + "markup.heading.marker" = { + fg = orange; + modifiers = ["bold"]; + }; + "markup.heading.1" = blue; + "markup.heading.2" = yellow; + "markup.heading.3" = green; + "markup.heading.4" = orange; + "markup.heading.5" = red; + "markup.heading.6" = fg3; + "markup.list" = purple; + "markup.bold" = {modifiers = ["bold"];}; + "markup.italic" = {modifiers = ["italic"];}; + "markup.strikethrough" = {modifiers = ["crossed_out"];}; + "markup.link.url" = { + fg = red; + modifiers = ["underlined"]; + }; + "markup.link.text" = blue; + "markup.raw" = red; + + "diff.plus" = green; + "diff.minus" = red; + "diff.delta" = blue; + + "ui.linenr" = {fg = fgdim;}; + "ui.linenr.selected" = {fg = fg2;}; + + "ui.statusline" = { + fg = fgdim; + bg = bg2; + }; + "ui.statusline.inactive" = { + fg = fg3; + bg = bg; + }; + "ui.statusline.normal" = { + fg = bg; + bg = purple; + modifiers = ["bold"]; + }; + "ui.statusline.insert" = { + fg = bg; + bg = green; + modifiers = ["bold"]; + }; + "ui.statusline.select" = { + fg = bg; + bg = red; + modifiers = ["bold"]; + }; + + "ui.popup" = { + fg = text; + bg = bg2; + }; + "ui.window" = {fg = fgdim;}; + "ui.help" = { + fg = fg2; + bg = bg2; + }; + + "ui.bufferline" = { + fg = fgdim; + bg = bg2; + }; + "ui.bufferline.background" = {bg = bg2;}; + + "ui.text" = text; + "ui.text.focus" = { + fg = text; + bg = bg3; + modifiers = ["bold"]; + }; + "ui.text.inactive" = {fg = fg2;}; + + "ui.virtual" = fg2; + "ui.virtual.ruler" = {bg = bg3;}; + "ui.virtual.indent-guide" = bg3; + "ui.virtual.inlay-hint" = { + fg = bg3; + bg = bg; + }; + + "ui.selection" = {bg = bg5;}; + + "ui.cursor" = { + fg = bg; + bg = text; + }; + "ui.cursor.primary" = { + fg = bg; + bg = red; + }; + "ui.cursor.match" = { + fg = orange; + modifiers = ["bold"]; + }; + + "ui.cursor.primary.normal" = { + fg = bg; + bg = text; + }; + "ui.cursor.primary.insert" = { + fg = bg; + bg = text; + }; + "ui.cursor.primary.select" = { + fg = bg; + bg = text; + }; + + "ui.cursor.normal" = { + fg = bg; + bg = fg; + }; + "ui.cursor.insert" = { + fg = bg; + bg = fg; + }; + "ui.cursor.select" = { + fg = bg; + bg = fg; + }; + + "ui.cursorline.primary" = {bg = bg3;}; + + "ui.highlight" = { + bg = primary; + fg = bg; + modifiers = ["bold"]; + }; + + "ui.menu" = { + fg = fg3; + bg = bg2; + }; + "ui.menu.selected" = { + fg = text; + bg = bg3; + modifiers = ["bold"]; + }; + + "diagnostic.error" = { + underline = { + color = red; + style = "curl"; + }; + }; + "diagnostic.warning" = { + underline = { + color = orange; + style = "curl"; + }; + }; + "diagnostic.info" = { + underline = { + color = blue; + style = "curl"; + }; + }; + "diagnostic.hint" = { + underline = { + color = blue; + style = "curl"; + }; + }; + + error = red; + warning = orange; + info = blue; + hint = yellow; + "ui.background" = { + bg = bg; + fg = fgdim; + }; + + # "ui.cursorline.primary" = { bg = "default" } + # "ui.cursorline.secondary" = { bg = "default" } + "ui.cursorcolumn.primary" = {bg = bg3;}; + "ui.cursorcolumn.secondary" = {bg = bg3;}; + + "ui.bufferline.active" = { + fg = primary; + bg = bg3; + underline = { + color = primary; + style = ""; + }; + }; + }; + }; + }; +} diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix new file mode 100644 index 0000000..4f9928d --- /dev/null +++ b/modules/home-manager/hyprland.nix @@ -0,0 +1,230 @@ +{ + # colors, + # font, + ... +}: { + wayland.windowManager.hyprland = { + enable = true; + extraConfig = '' + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor=,preferred,auto,auto + monitor=desc:LG Display 0x0521,preferred,auto,1 + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + + # Execute your favorite apps at launch + exec-once = firefox & kitty --single-instance & hyprpaper & mako & /usr/lib/polkit-kde-authentication-agent-1 + exec-once = swayidle -w timeout 600 'notify-send "Locking in 30 seconds..."' timeout 630 'swaylock -f' timeout 660 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on && maybe-good-morning' before-sleep 'swaylock -f' + exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + + env = XCURSOR_SIZE,24 + + input { + kb_layout = us + kb_options = ctrl:nocaps + touchpad { + natural_scroll = yes + } + # kb_variant = + # kb_model = + # kb_rules = + + follow_mouse = 2 + + repeat_delay = 200 + repeat_rate = 60 + + touchpad { + natural_scroll = yes + tap-to-click = true + middle_button_emulation = true + } + + force_no_accel = true + sensitivity = 1 # -1.0 - 1.0, 0 means no modification. + } + + misc { + disable_hyprland_logo = true + disable_splash_rendering = true + } + + binds { + allow_workspace_cycles = true + } + + general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 3 + gaps_out = 6 + border_size = 1 + no_cursor_warps = true + resize_on_border = true + + col.active_border = rgba(74c7ecff) 45deg + col.inactive_border = rgba(59595988) + + layout = dwindle + } + + decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 3 + # blur = yes + # blur_size = 3 + # blur_passes = 1 + # blur_new_optimizations = on + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) + + dim_inactive = 0.5 + } + + animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + bezier=overshot,0.05,0.9,0.1,1.1 + + animation = windows, 1, 2, default + animation = windowsOut, 1, 2, default, popin 80% + animation = border, 1, 2, default + animation = borderangle, 1, 2, default + animation = fade, 1, 2, default + animation = workspaces, 1, 2, default + } + + dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + pseudotile = yes + preserve_split = 1 + no_gaps_when_only = true + } + + master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true + } + + gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on + } + + # Example per-device config + # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more + # device:epic-mouse-v1 { + # sensitivity = -0.5 + # } + + # Example windowrule v1 + # windowrule = float, ^(kitty)$ + # Example windowrule v2 + # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ + # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + $mainMod = SUPER + + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + bind = $mainMod, return, exec, kitty --single-instance + bind = $mainMod SHIFT, return, exec, kitty + bind = $mainMod, U, exec, firefox + bind = $mainMod, space, exec, wofi --show drun + bind = $mainMod, C, killactive, + bind = $mainMod, M, exit, + bind = $mainMod, E, exec, dolphin + bind = $mainMod, F, togglefloating, + bind = $mainMod SHIFT, F, fullscreen, + bind = $mainMod, R, exec, anyrun + bind = $mainMod, S, pseudo, # dwindle + bind = $mainMod, P, togglesplit, # dwindle + + # Move focus with mainMod + arrow keys + bind = $mainMod, left, movefocus, l + bind = $mainMod, right, movefocus, r + bind = $mainMod, up, movefocus, u + bind = $mainMod, down, movefocus, d + bind = $mainMod, h, movefocus, l + bind = $mainMod, l, movefocus, r + bind = $mainMod, k, movefocus, u + bind = $mainMod, j, movefocus, d + + bind = $mainMod SHIFT, H, swapwindow, l + bind = $mainMod SHIFT, L, swapwindow, r + bind = $mainMod SHIFT, K, swapwindow, u + bind = $mainMod SHIFT, J, swapwindow, d + + bind = $mainMod SHIFT, V, exec, pamixer --default-source --toggle-mute + bind = , XF86AudioMicMute, exec, pamixer --default-source --toggle-mute + bind = , XF86AudioMute, exec, pamixer --toggle-mute + bind = , XF86AudioRaiseVolume, exec, pamixer --increase 5 + bind = , XF86AudioLowerVolume, exec, pamixer --decrease 5 + bind = CTRL, XF86AudioRaiseVolume, exec, pamixer --increase 1 + bind = CTRL, XF86AudioLowerVolume, exec, pamixer --decrease 1 + + bind = , XF86AudioPlay, exec, playerctl play-pause + bind = , XF86AudioNext, exec, playerctl next + bind = , XF86AudioPrev, exec, playerctl previous + + bind = $mainMod, tab, workspace, previous + + # Switch workspaces with mainMod + [0-9] + bind = $mainMod, 1, workspace, 1 + bind = $mainMod, 2, workspace, 2 + bind = $mainMod, 3, workspace, 3 + bind = $mainMod, 4, workspace, 4 + bind = $mainMod, 5, workspace, 5 + bind = $mainMod, 6, workspace, 6 + bind = $mainMod, 7, workspace, 7 + bind = $mainMod, 8, workspace, 8 + bind = $mainMod, 9, workspace, 9 + bind = $mainMod, 0, workspace, 10 + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + bind = $mainMod SHIFT, 1, movetoworkspace, 1 + bind = $mainMod SHIFT, 2, movetoworkspace, 2 + bind = $mainMod SHIFT, 3, movetoworkspace, 3 + bind = $mainMod SHIFT, 4, movetoworkspace, 4 + bind = $mainMod SHIFT, 5, movetoworkspace, 5 + bind = $mainMod SHIFT, 6, movetoworkspace, 6 + bind = $mainMod SHIFT, 7, movetoworkspace, 7 + bind = $mainMod SHIFT, 8, movetoworkspace, 8 + bind = $mainMod SHIFT, 9, movetoworkspace, 9 + bind = $mainMod SHIFT, 0, movetoworkspace, 10 + + bind = , XF86MonBrightnessDown, exec, brightnessctl set 10%- + bind = , XF86MonBrightnessUp, exec, brightnessctl set +10% + bind = SHIFT, XF86MonBrightnessDown, exec, brightnessctl set 1% + bind = SHIFT, XF86MonBrightnessUp, exec, brightnessctl set 100% + bind = CTRL, XF86MonBrightnessDown, exec, brightnessctl set 1%- + bind = CTRL, XF86MonBrightnessUp, exec, brightnessctl set +1% + + bind = $mainMod SHIFT, S, exec, clipshot + + # Scroll through existing workspaces with mainMod + scroll + bind = $mainMod, mouse_down, workspace, e+1 + bind = $mainMod, mouse_up, workspace, e-1 + + bind = CTRL SHIFT $mainMod, L, exec, swaylock + + # Move/resize windows with mainMod + LMB/RMB and dragging + bindm = $mainMod, mouse:272, movewindow + bindm = $mainMod, mouse:273, resizewindow + + bind = $mainMod CTRL, space, exec, makoctl dismiss + bind = $mainMod SHIFT CTRL, space, exec, makoctl restore + bind = $mainMod SHIFT, space, exec, makoctl invoke + + bind = $mainMod, E, exec, thunar + ''; + }; +} diff --git a/modules/home-manager/iex.nix b/modules/home-manager/iex.nix new file mode 100644 index 0000000..a94a8ff --- /dev/null +++ b/modules/home-manager/iex.nix @@ -0,0 +1,35 @@ +{ + home.file.".iex.exs" = { + enable = true; + text = '' + Application.put_env(:elixir, :ansi_enabled, true) + + # PROTIP: to break, `#iex:break` + + IEx.configure( + colors: [enabled: true], + inspect: [ + pretty: true, + printable_limit: :infinity, + limit: :infinity + ], + default_prompt: + [ + # ANSI CHA, move cursor to column 1 + "\e[G", + :magenta, + # IEx prompt variable + "%prefix", + "#", + # IEx prompt variable + "%counter", + # plain string + ">", + :reset + ] + |> IO.ANSI.format() + |> IO.chardata_to_string() + ) + ''; + }; +} diff --git a/modules/home-manager/kitty.nix b/modules/home-manager/kitty.nix new file mode 100644 index 0000000..ded6f67 --- /dev/null +++ b/modules/home-manager/kitty.nix @@ -0,0 +1,176 @@ +{ + colors, + font, + ... +}: { + programs.kitty = { + enable = true; + darwinLaunchOptions = ["--single-instance"]; + shellIntegration = { + enableFishIntegration = true; + }; + settings = with colors.withHashPrefix; { + "font_family" = font.name; + "bold_font" = "${font.name} Heavy"; + "italic_font" = "${font.name} Italic"; + "bold_italic_font" = "${font.name} Heavy Italic"; + "font_size" = toString font.size; + "inactive_text_alpha" = "0.5"; + "copy_on_select" = true; + + "scrollback_lines" = 500000; + + "symbol_map" = "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono"; + + # use `kitty + list-fonts --psnames` to get the font's PostScript name + + "allow_remote_control" = true; + "listen_on" = "unix:/tmp/kitty"; + "repaint_delay" = 3; + "input_delay" = 3; + "sync_to_monitor" = true; + + "adjust_line_height" = 0; + "window_padding_width" = "10.0"; + "window_margin_width" = "0.0"; + + "confirm_os_window_close" = 0; + + "enabled_layouts" = "splits:split_axis=vertical,stack"; + + "shell_integration" = "disabled"; + + "enable_audio_bell" = true; + "visual_bell_duration" = "0.25"; + "visual_bell_color" = yellow; + + "url_style" = "single"; + + "strip_trailing_spaces" = "smart"; + + # open_url_modifiers ctrl + + "tab_bar_align" = "left"; + "tab_bar_style" = "separator"; + "tab_separator" = ''""''; + "tab_bar_edge" = "top"; + "tab_title_template" = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "''; + "active_tab_font_style" = "normal"; + + ## name: Catppuccin Kitty Mocha + ## author: Catppuccin Org + ## license: MIT + ## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf + ## blurb: Soothing pastel theme for the high-spirited! + + # The basic colors + "foreground" = text; + "background" = bg; + "selection_foreground" = bg; + "selection_background" = text; + + # Cursor colors + "cursor" = text; + "cursor_text_color" = bg; + + # URL underline color when hovering with mouse + "url_color" = primary; + + # Kitty window border colors + "active_border_color" = primary; + "inactive_border_color" = bg3; + "bell_border_color" = urgent; + + # OS Window titlebar colors + "wayland_titlebar_color" = "system"; + "macos_titlebar_color" = "system"; + + # Tab bar colors + "active_tab_foreground" = bg; + "active_tab_background" = primary; + "inactive_tab_foreground" = fgdim; + "inactive_tab_background" = bg2; + "tab_bar_background" = bg; + + # Colors for marks (marked text in the terminal) + "mark1_foreground" = bg; + "mark1_background" = blue; + "mark2_foreground" = bg; + "mark2_background" = purple; + "mark3_foreground" = bg; + "mark3_background" = blue; + + # The 16 terminal colors + + # black + "color0" = colors.withHashPrefix."0"; + "color8" = colors.withHashPrefix."8"; + + # red + "color1" = colors.withHashPrefix."1"; + "color9" = colors.withHashPrefix."9"; + + # green + "color2" = colors.withHashPrefix."2"; + "color10" = colors.withHashPrefix."10"; + + # yellow + "color3" = colors.withHashPrefix."3"; + "color11" = colors.withHashPrefix."11"; + + # blue + "color4" = colors.withHashPrefix."4"; + "color12" = colors.withHashPrefix."12"; + + # magenta + "color5" = colors.withHashPrefix."5"; + "color13" = colors.withHashPrefix."13"; + + # cyan + "color6" = colors.withHashPrefix."6"; + "color14" = colors.withHashPrefix."14"; + + # white + "color7" = colors.withHashPrefix."7"; + "color15" = colors.withHashPrefix."15"; + }; + keybindings = { + "ctrl+shift+1" = "change_font_size all 12.5"; + "ctrl+shift+2" = "change_font_size all 18.5"; + "ctrl+shift+3" = "change_font_size all 26"; + "ctrl+shift+4" = "change_font_size all 32"; + "ctrl+shift+5" = "change_font_size all 48"; + "ctrl+shift+o" = "launch --type=tab --stdin-source=@screen_scrollback $EDITOR"; + + "ctrl+shift+equal" = "change_font_size all +0.5"; + "ctrl+shift+minus" = "change_font_size all -0.5"; + + "shift+insert" = "paste_from_clipboard"; + "ctrl+shift+v" = "paste_from_selection"; + "ctrl+shift+c" = "copy_to_clipboard"; + + # kill pane + "ctrl+shift+q" = "close_window"; + + # kill tab + "ctrl+alt+shift+q" = "close_tab"; + + "ctrl+shift+j" = "launch --location=hsplit --cwd=current"; + "ctrl+shift+l" = "launch --location=vsplit --cwd=current"; + + "ctrl+alt+shift+k" = "move_window up"; + "ctrl+alt+shift+h" = "move_window left"; + "ctrl+alt+shift+l" = "move_window right"; + "ctrl+alt+shift+j" = "move_window down"; + + "ctrl+h" = "neighboring_window left"; + "ctrl+l" = "neighboring_window right"; + "ctrl+k" = "neighboring_window up"; + "ctrl+j" = "neighboring_window down"; + "ctrl+shift+n" = "nth_window -1"; + "ctrl+shift+space>u" = "kitten hints --type=url --program @"; + + "ctrl+shift+z" = "toggle_layout stack"; + }; + }; +} diff --git a/modules/home-manager/linux.nix b/modules/home-manager/linux.nix new file mode 100644 index 0000000..0d96329 --- /dev/null +++ b/modules/home-manager/linux.nix @@ -0,0 +1,23 @@ +{ + outputs, + pkgs, + ... +}: { + imports = with outputs.homeManagerModules; [ + common + ]; + + programs.fish = { + shellAliases = { + sctl = "sudo systemctl"; + sctlu = "systemctl --user"; + }; + }; + + home.packages = [ + (pkgs.buildEnv { + name = "my-linux-scripts"; + paths = [./scripts/linux]; + }) + ]; +} diff --git a/modules/home-manager/macos.nix b/modules/home-manager/macos.nix new file mode 100644 index 0000000..6462967 --- /dev/null +++ b/modules/home-manager/macos.nix @@ -0,0 +1 @@ +{...}: {} diff --git a/modules/home-manager/mako.nix b/modules/home-manager/mako.nix new file mode 100644 index 0000000..6d00fa1 --- /dev/null +++ b/modules/home-manager/mako.nix @@ -0,0 +1,26 @@ +{ + colors, + font, + ... +}: { + services.mako = with colors.withHashPrefix; { + enable = true; + borderSize = 1; + maxVisible = 5; + defaultTimeout = 15000; + font = "Symbols Nerd Font ${toString font.size},${font.name} ${toString font.size}"; + # TODO: config + + backgroundColor = bg; + textColor = text; + borderColor = primary; + progressColor = primary; + + extraConfig = '' + [urgency=high] + border-color=${urgent} + [urgency=high] + background-color=${urgent} + ''; + }; +} diff --git a/home/scripts/common/bin/? b/modules/home-manager/scripts/common/bin/? similarity index 100% rename from home/scripts/common/bin/? rename to modules/home-manager/scripts/common/bin/? diff --git a/home/scripts/common/bin/N b/modules/home-manager/scripts/common/bin/N similarity index 100% rename from home/scripts/common/bin/N rename to modules/home-manager/scripts/common/bin/N diff --git a/home/scripts/common/bin/archive b/modules/home-manager/scripts/common/bin/archive similarity index 100% rename from home/scripts/common/bin/archive rename to modules/home-manager/scripts/common/bin/archive diff --git a/home/scripts/common/bin/archupdate b/modules/home-manager/scripts/common/bin/archupdate similarity index 100% rename from home/scripts/common/bin/archupdate rename to modules/home-manager/scripts/common/bin/archupdate diff --git a/home/scripts/common/bin/at b/modules/home-manager/scripts/common/bin/at similarity index 100% rename from home/scripts/common/bin/at rename to modules/home-manager/scripts/common/bin/at diff --git a/home/scripts/common/bin/bp b/modules/home-manager/scripts/common/bin/bp similarity index 100% rename from home/scripts/common/bin/bp rename to modules/home-manager/scripts/common/bin/bp diff --git a/home/scripts/common/bin/check-domain-availability b/modules/home-manager/scripts/common/bin/check-domain-availability similarity index 100% rename from home/scripts/common/bin/check-domain-availability rename to modules/home-manager/scripts/common/bin/check-domain-availability diff --git a/home/scripts/common/bin/check-port b/modules/home-manager/scripts/common/bin/check-port similarity index 100% rename from home/scripts/common/bin/check-port rename to modules/home-manager/scripts/common/bin/check-port diff --git a/home/scripts/common/bin/clip b/modules/home-manager/scripts/common/bin/clip similarity index 100% rename from home/scripts/common/bin/clip rename to modules/home-manager/scripts/common/bin/clip diff --git a/home/scripts/common/bin/clipshot b/modules/home-manager/scripts/common/bin/clipshot similarity index 100% rename from home/scripts/common/bin/clipshot rename to modules/home-manager/scripts/common/bin/clipshot diff --git a/home/scripts/common/bin/copy-git-forge-url b/modules/home-manager/scripts/common/bin/copy-git-forge-url similarity index 100% rename from home/scripts/common/bin/copy-git-forge-url rename to modules/home-manager/scripts/common/bin/copy-git-forge-url diff --git a/home/scripts/common/bin/countdown b/modules/home-manager/scripts/common/bin/countdown similarity index 100% rename from home/scripts/common/bin/countdown rename to modules/home-manager/scripts/common/bin/countdown diff --git a/home/scripts/common/bin/dns b/modules/home-manager/scripts/common/bin/dns similarity index 100% rename from home/scripts/common/bin/dns rename to modules/home-manager/scripts/common/bin/dns diff --git a/home/scripts/common/bin/dns-cleaner b/modules/home-manager/scripts/common/bin/dns-cleaner similarity index 100% rename from home/scripts/common/bin/dns-cleaner rename to modules/home-manager/scripts/common/bin/dns-cleaner diff --git a/home/scripts/common/bin/dns-deleter b/modules/home-manager/scripts/common/bin/dns-deleter similarity index 100% rename from home/scripts/common/bin/dns-deleter rename to modules/home-manager/scripts/common/bin/dns-deleter diff --git a/home/scripts/common/bin/dns-deleter-matching b/modules/home-manager/scripts/common/bin/dns-deleter-matching similarity index 100% rename from home/scripts/common/bin/dns-deleter-matching rename to modules/home-manager/scripts/common/bin/dns-deleter-matching diff --git a/home/scripts/common/bin/editscrot b/modules/home-manager/scripts/common/bin/editscrot similarity index 100% rename from home/scripts/common/bin/editscrot rename to modules/home-manager/scripts/common/bin/editscrot diff --git a/home/scripts/common/bin/email-via-mailgun-smtp b/modules/home-manager/scripts/common/bin/email-via-mailgun-smtp similarity index 100% rename from home/scripts/common/bin/email-via-mailgun-smtp rename to modules/home-manager/scripts/common/bin/email-via-mailgun-smtp diff --git a/home/scripts/common/bin/emoji b/modules/home-manager/scripts/common/bin/emoji similarity index 100% rename from home/scripts/common/bin/emoji rename to modules/home-manager/scripts/common/bin/emoji diff --git a/home/scripts/common/bin/ezln b/modules/home-manager/scripts/common/bin/ezln similarity index 100% rename from home/scripts/common/bin/ezln rename to modules/home-manager/scripts/common/bin/ezln diff --git a/home/scripts/common/bin/field b/modules/home-manager/scripts/common/bin/field similarity index 100% rename from home/scripts/common/bin/field rename to modules/home-manager/scripts/common/bin/field diff --git a/home/scripts/common/bin/getip b/modules/home-manager/scripts/common/bin/getip similarity index 100% rename from home/scripts/common/bin/getip rename to modules/home-manager/scripts/common/bin/getip diff --git a/home/scripts/common/bin/git-authors b/modules/home-manager/scripts/common/bin/git-authors similarity index 100% rename from home/scripts/common/bin/git-authors rename to modules/home-manager/scripts/common/bin/git-authors diff --git a/home/scripts/common/bin/gitforge-url.ts b/modules/home-manager/scripts/common/bin/gitforge-url.ts similarity index 100% rename from home/scripts/common/bin/gitforge-url.ts rename to modules/home-manager/scripts/common/bin/gitforge-url.ts diff --git a/home/scripts/common/bin/glancepath b/modules/home-manager/scripts/common/bin/glancepath similarity index 100% rename from home/scripts/common/bin/glancepath rename to modules/home-manager/scripts/common/bin/glancepath diff --git a/home/scripts/common/bin/good-morning b/modules/home-manager/scripts/common/bin/good-morning similarity index 100% rename from home/scripts/common/bin/good-morning rename to modules/home-manager/scripts/common/bin/good-morning diff --git a/home/scripts/common/bin/has_command b/modules/home-manager/scripts/common/bin/has_command similarity index 100% rename from home/scripts/common/bin/has_command rename to modules/home-manager/scripts/common/bin/has_command diff --git a/home/scripts/common/bin/is_wayland b/modules/home-manager/scripts/common/bin/is_wayland similarity index 100% rename from home/scripts/common/bin/is_wayland rename to modules/home-manager/scripts/common/bin/is_wayland diff --git a/home/scripts/common/bin/k8s-yaml-diff b/modules/home-manager/scripts/common/bin/k8s-yaml-diff similarity index 100% rename from home/scripts/common/bin/k8s-yaml-diff rename to modules/home-manager/scripts/common/bin/k8s-yaml-diff diff --git a/home/scripts/common/bin/k8s-yaml-sort b/modules/home-manager/scripts/common/bin/k8s-yaml-sort similarity index 100% rename from home/scripts/common/bin/k8s-yaml-sort rename to modules/home-manager/scripts/common/bin/k8s-yaml-sort diff --git a/home/scripts/common/bin/keyrepeat b/modules/home-manager/scripts/common/bin/keyrepeat similarity index 100% rename from home/scripts/common/bin/keyrepeat rename to modules/home-manager/scripts/common/bin/keyrepeat diff --git a/home/scripts/common/bin/kubeline b/modules/home-manager/scripts/common/bin/kubeline similarity index 100% rename from home/scripts/common/bin/kubeline rename to modules/home-manager/scripts/common/bin/kubeline diff --git a/home/scripts/common/bin/kubfc b/modules/home-manager/scripts/common/bin/kubfc similarity index 100% rename from home/scripts/common/bin/kubfc rename to modules/home-manager/scripts/common/bin/kubfc diff --git a/home/scripts/common/bin/kubfn b/modules/home-manager/scripts/common/bin/kubfn similarity index 100% rename from home/scripts/common/bin/kubfn rename to modules/home-manager/scripts/common/bin/kubfn diff --git a/home/scripts/common/bin/launch b/modules/home-manager/scripts/common/bin/launch similarity index 100% rename from home/scripts/common/bin/launch rename to modules/home-manager/scripts/common/bin/launch diff --git a/home/scripts/common/bin/linewise b/modules/home-manager/scripts/common/bin/linewise similarity index 100% rename from home/scripts/common/bin/linewise rename to modules/home-manager/scripts/common/bin/linewise diff --git a/home/scripts/common/bin/maybe_source_env_file b/modules/home-manager/scripts/common/bin/maybe_source_env_file similarity index 100% rename from home/scripts/common/bin/maybe_source_env_file rename to modules/home-manager/scripts/common/bin/maybe_source_env_file diff --git a/home/scripts/common/bin/nd b/modules/home-manager/scripts/common/bin/nd similarity index 100% rename from home/scripts/common/bin/nd rename to modules/home-manager/scripts/common/bin/nd diff --git a/home/scripts/common/bin/nf b/modules/home-manager/scripts/common/bin/nf similarity index 100% rename from home/scripts/common/bin/nf rename to modules/home-manager/scripts/common/bin/nf diff --git a/home/scripts/common/bin/note b/modules/home-manager/scripts/common/bin/note similarity index 100% rename from home/scripts/common/bin/note rename to modules/home-manager/scripts/common/bin/note diff --git a/home/scripts/common/bin/nsync b/modules/home-manager/scripts/common/bin/nsync similarity index 100% rename from home/scripts/common/bin/nsync rename to modules/home-manager/scripts/common/bin/nsync diff --git a/home/scripts/common/bin/nvimdiff b/modules/home-manager/scripts/common/bin/nvimdiff similarity index 100% rename from home/scripts/common/bin/nvimdiff rename to modules/home-manager/scripts/common/bin/nvimdiff diff --git a/home/scripts/common/bin/open-in-git-forge b/modules/home-manager/scripts/common/bin/open-in-git-forge similarity index 100% rename from home/scripts/common/bin/open-in-git-forge rename to modules/home-manager/scripts/common/bin/open-in-git-forge diff --git a/home/scripts/common/bin/optimize-photo-for-web b/modules/home-manager/scripts/common/bin/optimize-photo-for-web similarity index 100% rename from home/scripts/common/bin/optimize-photo-for-web rename to modules/home-manager/scripts/common/bin/optimize-photo-for-web diff --git a/home/scripts/common/bin/pass-migrate-to-pass-otp b/modules/home-manager/scripts/common/bin/pass-migrate-to-pass-otp similarity index 100% rename from home/scripts/common/bin/pass-migrate-to-pass-otp rename to modules/home-manager/scripts/common/bin/pass-migrate-to-pass-otp diff --git a/home/scripts/common/bin/pipeline b/modules/home-manager/scripts/common/bin/pipeline similarity index 100% rename from home/scripts/common/bin/pipeline rename to modules/home-manager/scripts/common/bin/pipeline diff --git a/home/scripts/common/bin/poll b/modules/home-manager/scripts/common/bin/poll similarity index 100% rename from home/scripts/common/bin/poll rename to modules/home-manager/scripts/common/bin/poll diff --git a/home/scripts/common/bin/pr-for-commit b/modules/home-manager/scripts/common/bin/pr-for-commit similarity index 100% rename from home/scripts/common/bin/pr-for-commit rename to modules/home-manager/scripts/common/bin/pr-for-commit diff --git a/home/scripts/common/bin/readme.md b/modules/home-manager/scripts/common/bin/readme.md similarity index 100% rename from home/scripts/common/bin/readme.md rename to modules/home-manager/scripts/common/bin/readme.md diff --git a/home/scripts/common/bin/remote b/modules/home-manager/scripts/common/bin/remote similarity index 100% rename from home/scripts/common/bin/remote rename to modules/home-manager/scripts/common/bin/remote diff --git a/home/scripts/common/bin/resource-usage b/modules/home-manager/scripts/common/bin/resource-usage similarity index 100% rename from home/scripts/common/bin/resource-usage rename to modules/home-manager/scripts/common/bin/resource-usage diff --git a/home/scripts/common/bin/s b/modules/home-manager/scripts/common/bin/s similarity index 100% rename from home/scripts/common/bin/s rename to modules/home-manager/scripts/common/bin/s diff --git a/home/scripts/common/bin/scn b/modules/home-manager/scripts/common/bin/scn similarity index 100% rename from home/scripts/common/bin/scn rename to modules/home-manager/scripts/common/bin/scn diff --git a/home/scripts/common/bin/screenshot b/modules/home-manager/scripts/common/bin/screenshot similarity index 100% rename from home/scripts/common/bin/screenshot rename to modules/home-manager/scripts/common/bin/screenshot diff --git a/home/scripts/common/bin/scrup b/modules/home-manager/scripts/common/bin/scrup similarity index 100% rename from home/scripts/common/bin/scrup rename to modules/home-manager/scripts/common/bin/scrup diff --git a/home/scripts/common/bin/scwd b/modules/home-manager/scripts/common/bin/scwd similarity index 100% rename from home/scripts/common/bin/scwd rename to modules/home-manager/scripts/common/bin/scwd diff --git a/home/scripts/common/bin/setbg b/modules/home-manager/scripts/common/bin/setbg similarity index 100% rename from home/scripts/common/bin/setbg rename to modules/home-manager/scripts/common/bin/setbg diff --git a/home/scripts/common/bin/source_if_exists b/modules/home-manager/scripts/common/bin/source_if_exists similarity index 100% rename from home/scripts/common/bin/source_if_exists rename to modules/home-manager/scripts/common/bin/source_if_exists diff --git a/home/scripts/common/bin/sw b/modules/home-manager/scripts/common/bin/sw similarity index 100% rename from home/scripts/common/bin/sw rename to modules/home-manager/scripts/common/bin/sw diff --git a/home/scripts/common/bin/tdf b/modules/home-manager/scripts/common/bin/tdf similarity index 100% rename from home/scripts/common/bin/tdf rename to modules/home-manager/scripts/common/bin/tdf diff --git a/home/scripts/common/bin/terminal-rendering-test b/modules/home-manager/scripts/common/bin/terminal-rendering-test similarity index 100% rename from home/scripts/common/bin/terminal-rendering-test rename to modules/home-manager/scripts/common/bin/terminal-rendering-test diff --git a/home/scripts/common/bin/termrec b/modules/home-manager/scripts/common/bin/termrec similarity index 100% rename from home/scripts/common/bin/termrec rename to modules/home-manager/scripts/common/bin/termrec diff --git a/home/scripts/common/bin/tls b/modules/home-manager/scripts/common/bin/tls similarity index 100% rename from home/scripts/common/bin/tls rename to modules/home-manager/scripts/common/bin/tls diff --git a/home/scripts/common/bin/tmux-edit-buffer b/modules/home-manager/scripts/common/bin/tmux-edit-buffer similarity index 100% rename from home/scripts/common/bin/tmux-edit-buffer rename to modules/home-manager/scripts/common/bin/tmux-edit-buffer diff --git a/home/scripts/common/bin/tmux-lyte-session b/modules/home-manager/scripts/common/bin/tmux-lyte-session similarity index 100% rename from home/scripts/common/bin/tmux-lyte-session rename to modules/home-manager/scripts/common/bin/tmux-lyte-session diff --git a/home/scripts/common/bin/tmux-save-buffer b/modules/home-manager/scripts/common/bin/tmux-save-buffer similarity index 100% rename from home/scripts/common/bin/tmux-save-buffer rename to modules/home-manager/scripts/common/bin/tmux-save-buffer diff --git a/home/scripts/common/bin/tmux-session-dir b/modules/home-manager/scripts/common/bin/tmux-session-dir similarity index 100% rename from home/scripts/common/bin/tmux-session-dir rename to modules/home-manager/scripts/common/bin/tmux-session-dir diff --git a/home/scripts/common/bin/tmux-session-preview b/modules/home-manager/scripts/common/bin/tmux-session-preview similarity index 100% rename from home/scripts/common/bin/tmux-session-preview rename to modules/home-manager/scripts/common/bin/tmux-session-preview diff --git a/home/scripts/common/bin/tmuxswitcher b/modules/home-manager/scripts/common/bin/tmuxswitcher similarity index 100% rename from home/scripts/common/bin/tmuxswitcher rename to modules/home-manager/scripts/common/bin/tmuxswitcher diff --git a/home/scripts/common/bin/unarchive b/modules/home-manager/scripts/common/bin/unarchive similarity index 100% rename from home/scripts/common/bin/unarchive rename to modules/home-manager/scripts/common/bin/unarchive diff --git a/home/scripts/common/bin/weather b/modules/home-manager/scripts/common/bin/weather similarity index 100% rename from home/scripts/common/bin/weather rename to modules/home-manager/scripts/common/bin/weather diff --git a/home/scripts/common/bin/work-journal-entry b/modules/home-manager/scripts/common/bin/work-journal-entry similarity index 100% rename from home/scripts/common/bin/work-journal-entry rename to modules/home-manager/scripts/common/bin/work-journal-entry diff --git a/home/scripts/common/bin/yamldiff b/modules/home-manager/scripts/common/bin/yamldiff similarity index 100% rename from home/scripts/common/bin/yamldiff rename to modules/home-manager/scripts/common/bin/yamldiff diff --git a/home/scripts/linux/bin/restartbar b/modules/home-manager/scripts/linux/bin/restartbar similarity index 100% rename from home/scripts/linux/bin/restartbar rename to modules/home-manager/scripts/linux/bin/restartbar diff --git a/home/scripts/linux/bin/startbar b/modules/home-manager/scripts/linux/bin/startbar similarity index 100% rename from home/scripts/linux/bin/startbar rename to modules/home-manager/scripts/linux/bin/startbar diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix new file mode 100644 index 0000000..a255e90 --- /dev/null +++ b/modules/home-manager/sway.nix @@ -0,0 +1,360 @@ +{ + pkgs, + colors, + outputs, + lib, + config, + # font, + ... +}: { + imports = with outputs.homeManagerModules; [ + linux + waybar + mako + swaylock + desktop + ]; + + home.pointerCursor = { + name = "Bibata-Modern-Classic"; + package = pkgs.bibata-cursors; + size = 64; # TODO: this doesn't seem to work -- at least in Sway + # some icons are also missing (hand2?) + }; + + wayland.windowManager.sway = { + /* + TODO: + + Super+r should rotate the selected group of windows. + + Super+Control+{1-9} should control the size of the preselect space. + + Super+Shift+b should balance the size of all selected nodes. + set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)" + for_window [title=".*"] floating enable + for_window [app_id=$tilers] floating disable + + # for_window [title=".*"] opacity $opacity + + # TODO: I forget why I needed this - could google it I expect? + exec /usr/lib/polkit-kde-authentication-agent-1 + + # prevent all windows from stealing focus + no_focus [class=".*"] + */ + + enable = true; + + systemd = { + enable = true; + }; + + config = { + output = { + "*" = { + background = "$HOME/.wallpaper fill"; + }; + + "Dell Inc. DELL U2720Q D3TM623" = { + # desktop left vertical monitor + transform = "90"; + scale = "1.5"; + }; + }; + + # TODO: popup_during_fullscreen smart + focus = { + wrapping = "no"; + followMouse = "no"; + mouseWarping = false; + }; + + modifier = "Mod4"; + + gaps = { + smartBorders = "on"; + }; + + window = { + border = 2; + titlebar = false; + }; + + floating = { + modifier = config.wayland.windowManager.sway.config.modifier; + titlebar = false; + }; + + startup = [ + { + command = "systemctl --user restart waybar"; + always = true; + } + { + command = lib.concatStringsSep " " [ + "swayidle -w" + "timeout 300 'notify-send \"Idling in 300 seconds\"'" + "resume 'notify-send \"Idling cancelled.\"'" + "timeout 480 'notify-send \"Idling in 120 seconds\"'" + "timeout 510 'notify-send \"Idling in 90 seconds\"'" + "timeout 540 'notify-send \"Idling in 60 seconds!\"'" + "timeout 570 'notify-send \"Idling in 30 seconds!\"'" + "timeout 590 'notify-send \"Idling in 10 seconds!\"'" + "timeout 591 'notify-send \"Idling in 9 seconds!\"'" + "timeout 592 'notify-send \"Idling in 8 seconds!\"'" + "timeout 593 'notify-send \"Idling in 7 seconds!\"'" + "timeout 594 'notify-send \"Idling in 6 seconds!\"'" + "timeout 595 'notify-send \"Idling in 5 seconds!\"'" + "timeout 596 'notify-send \"Idling in 4 seconds!\"'" + "timeout 597 'notify-send \"Idling in 3 seconds!\"'" + "timeout 598 'notify-send \"Idling in 2 seconds!\"'" + "timeout 599 'notify-send \"Idling in 1 second!\"'" + "timeout 600 'swaylock -f'" + "timeout 600 'swaymsg \"output * dpms off\"'" + "resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'" + "before-sleep 'swaylock'" + ]; + } + {command = "firefox";} + {command = "kitty --single-instance";} + ]; + + modes = { + resize = { + "h" = "resize shrink width 10 px or 10 ppt"; + "j" = "resize grow height 10 px or 10 ppt"; + "k" = "resize shrink height 10 px or 10 ppt"; + "l" = "resize grow width 10 px or 10 ppt"; + + "left" = "resize shrink width 10 px or 10 ppt"; + "down" = "resize grow height 10 px or 10 ppt"; + "up" = "resize shrink height 10 px or 10 ppt"; + "right" = "resize grow width 10 px or 10 ppt"; + + "return" = ''mode "default"''; + "escape" = ''mode "default"''; + }; + }; + + input = { + "type:keyboard" = { + xkb_options = "ctrl:nocaps"; + repeat_delay = "200"; + repeat_rate = "60"; + }; + + "type:pointer" = { + accel_profile = "flat"; + pointer_accel = "0"; + }; + + "type:touchpad" = { + dwt = "disabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + # pointer_accel + }; + }; + keybindings = let + mod = config.wayland.windowManager.sway.config.modifier; + in { + # bindsym $mod+shift+space exec wofi --show drun + "${mod}+control+space" = "exec makoctl dismiss"; + "${mod}+shift+space" = "exec makoctl invoke"; + "${mod}+return" = "exec kitty --single-instance"; + "${mod}+shift+return" = "exec floating-term"; + "${mod}+shift+alt+return" = "exec kitty"; + "${mod}+c" = "kill"; + "${mod}+shift+c" = "kill # TODO: kill -9?"; + "${mod}+space" = "exec wofi --show drun"; + "${mod}+shift+s" = "exec clipshot"; + "${mod}+e" = "exec thunar"; + "${mod}+shift+r" = "reload"; + "${mod}+control+Escape" = "exit"; + "${mod}+shift+e" = "exit"; + "${mod}+shift+p" = "exec pass-chooser"; + "${mod}+control+j" = "split v"; + "${mod}+control+l" = "split h"; + "${mod}+control+f" = "focus mode_toggle"; + + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; + + "${mod}+left" = "focus left"; + "${mod}+down" = "focus down"; + "${mod}+up" = "focus up"; + "${mod}+right" = "focus right"; + + "${mod}+shift+h" = "move left"; + "${mod}+shift+j" = "move down"; + "${mod}+shift+k" = "move up"; + "${mod}+shift+l" = "move right"; + + "${mod}+shift+left" = "move left"; + "${mod}+shift+down" = "move down"; + "${mod}+shift+up" = "move up"; + "${mod}+shift+right" = "move right"; + + "${mod}+1" = "workspace 1"; + "${mod}+2" = "workspace 2"; + "${mod}+3" = "workspace 3"; + "${mod}+4" = "workspace 4"; + "${mod}+5" = "workspace 5"; + "${mod}+6" = "workspace 6"; + "${mod}+7" = "workspace 7"; + "${mod}+8" = "workspace 8"; + "${mod}+9" = "workspace 9"; + "${mod}+0" = "workspace 10"; + + "${mod}+shift+1" = "move container to workspace 1"; + "${mod}+shift+2" = "move container to workspace 2"; + "${mod}+shift+3" = "move container to workspace 3"; + "${mod}+shift+4" = "move container to workspace 4"; + "${mod}+shift+5" = "move container to workspace 5"; + "${mod}+shift+6" = "move container to workspace 6"; + "${mod}+shift+7" = "move container to workspace 7"; + "${mod}+shift+8" = "move container to workspace 8"; + "${mod}+shift+9" = "move container to workspace 9"; + "${mod}+shift+0" = "move container to workspace 10"; + + "${mod}+b" = "splith"; + "${mod}+v" = "splitv"; + + "${mod}+shift+f" = "fullscreen toggle"; + "${mod}+f" = "floating toggle"; + "${mod}+s" = "floating disable"; + "${mod}+alt+f" = "focus mode_toggle"; + "${mod}+p" = "focus parent"; + "${mod}+period" = "focus child"; + "${mod}+comma" = "focus child"; + "${mod}+tab" = "workspace back_and_forth"; + + "${mod}+minus" = "gaps inner current minus 5"; + "${mod}+plus" = "gaps inner current plus 5"; + "${mod}+control+alt+h" = "gaps horizontal current minus 5"; + "${mod}+control+alt+l" = "gaps horizontal current plus 5"; + "${mod}+control+alt+j" = "gaps vertical current minus 5"; + "${mod}+control+alt+k" = "gaps vertical current plus 5"; + + # TODO: this should also reset the horizontal and vertical gaps? + "${mod}+control+equal" = "gaps inner current set 0"; + + "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; + "control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; + "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + "XF86MonBrightnessDown" = "exec brightnessctl set 10%-"; + "XF86MonBrightnessUp" = "exec brightnessctl set +10%"; + "shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%"; + "shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%"; + "control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-"; + "control+XF86MonBrightnessUp" = "exec brightnessctl set +1%"; + "XF86AudioPlay" = "exec playerctl play-pause"; + "XF86AudioNext" = "exec playerctl next"; + "XF86AudioPrev" = "exec playerctl previous"; + "${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + + "${mod}+control+shift+l" = "exec swaylock"; + + "${mod}+shift+alt+f" = "for_window [class=$tilers] floating toggle"; + }; + assigns = {}; + bars = []; + colors = with colors; { + background = bg; + focused = { + background = bg; + border = primary; + childBorder = primary; + indicator = primary; + text = bg; + }; + focusedInactive = { + background = bg; + border = primary; + childBorder = primary; + indicator = primary; + text = bg; + }; + placeholder = { + background = bg; + border = primary; + childBorder = primary; + indicator = primary; + text = text; + }; + unfocused = { + background = bg; + border = bg; + childBorder = bg; + indicator = bg; + text = text; + }; + urgent = { + background = urgent; + border = urgent; + childBorder = urgent; + indicator = urgent; + text = bg; + }; + }; + }; + }; + + # this doesn't work due to weird quoting bugs AFAICT + /* + services.swayidle = let + bins = rec { + swaylock = builtins.trace "${pkgs.swaylock}/bin/swaylock" "${pkgs.swaylock}/bin/swaylock"; + swaymsg = "${pkgs.sway}/bin/swaymsg"; + notify-send = "${swaymsg} exec -- ${pkgs.libnotify}/bin/notify-send"; + }; + in (with bins; { + enable = true; + + events = [ + { + event = "before-sleep"; + command = swaylock; + } + ]; + + timeouts = [ + { + timeout = 5; + command = "${notify-send} \\\"Idling in 300 seconds\\\""; + resumeCommand = "${notify-send} \\\"Idling cancelled.\\\""; + } + { + # timeout = 540; + timeout = 6; + command = "${notify-send} 'Idling in 90 seconds'"; + } + { + # timeout = 570; + timeout = 7; + command = "${notify-send} 'Idling in 60 seconds'"; + } + { + # timeout = 600; + timeout = 8; + command = "${notify-send} 'Idling in 30 seconds...'"; + } + { + # timeout = 630; + timeout = 9; + command = "${swaylock} -f"; + } + { + # timeout = 660; + timeout = 10; + command = "${swaymsg} 'output * dpms off'"; + resumeCommand = "${swaymsg} 'output * dpms on' & ${swaymsg} exec -- maybe-good-morning &"; + } + ]; + }); + */ +} diff --git a/modules/home-manager/swaylock.nix b/modules/home-manager/swaylock.nix new file mode 100644 index 0000000..de988da --- /dev/null +++ b/modules/home-manager/swaylock.nix @@ -0,0 +1,35 @@ +{ + font, + # colors, + ... +}: { + programs.swaylock = { + enable = true; + settings = { + color = "ffffffff"; + image = "~/.wallpaper"; + font = font.name; + show-failed-attempts = true; + ignore-empty-password = true; + + indicator-radius = "150"; + indicator-thickness = "30"; + + inside-color = "11111100"; + inside-clear-color = "11111100"; + inside-ver-color = "11111100"; + inside-wrong-color = "11111100"; + + key-hl-color = "a1efe4"; + separator-color = "11111100"; + + line-color = "111111cc"; + line-uses-ring = true; + + ring-color = "111111cc"; + ring-clear-color = "f4bf75"; + ring-ver-color = "66d9ef"; + ring-wrong-color = "f92672"; + }; + }; +} diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix new file mode 100644 index 0000000..b4d4974 --- /dev/null +++ b/modules/home-manager/waybar.nix @@ -0,0 +1,353 @@ +{ + colors, + font, + ... +}: { + programs.waybar = { + enable = true; + settings = { + mainBar = { + "layer" = "top"; + "position" = "bottom"; + "output" = ["eDP-1" "DP-3"]; + "height" = 32; + "modules-left" = ["clock" "sway/window"]; + "modules-center" = ["sway/workspaces"]; + "modules-right" = [ + "mpris" + "idle_inhibitor" + "bluetooth" + # "wireplumber", + "pulseaudio" + # "network", + "cpu" + "memory" + # "temperature", + "backlight" + "battery" + "tray" + ]; + "bluetooth" = { + "format" = ""; + "format-connected" = ""; + "format-connected-battery" = ""; + # "format-device-preference" = [ "device1", "device2" ], # preference list deciding the displayed devic; + "tooltip-format" = "{controller_alias}@{controller_address} ({num_connections} connected)"; + "tooltip-format-connected" = "{controller_alias}@{controller_address} ({num_connections} connected)\n{device_enumerate}"; + "tooltip-format-enumerate-connected" = "{device_alias}@{device_address}"; + "tooltip-format-enumerate-connected-battery" = "{device_alias}@{device_address} (󰁹 {device_battery_percentage}%)"; + }; + # "wireplumber" = ; + # "format" = "{volume}% {icon}"; + # "format-muted" = ""; + # "on-click" = "helvum; + # }, + "sway/workspaces" = { + "disable-scroll" = false; + "persistent_workspaces" = { + }; + "all-outputs" = true; + "format" = "{name}"; + }; + "idle_inhibitor" = { + "format" = "{icon}"; + "format-icons" = { + "activated" = "󰈈"; + "deactivated" = "󰈉"; + }; + }; + "tray" = { + "icon-size" = 24; + "spacing" = 4; + }; + "clock" = { + "interval" = 1; + "format" = "{:%a %b %d %H:%M:%S}"; + }; + "cpu" = { + "format" = "{usage} "; + "tooltip" = true; + "interval" = 3; + }; + "memory" = { + "format" = "{} 󰍛"; + }; + "temperature" = { + # "thermal-zone" = 2; + # "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input"; + "critical-threshold" = 80; + # "format-critical" = "{temperatureC}°C {icon}"; + "format" = "{temperatureC}°C {icon}"; + "format-icons" = ["" "" ""]; + }; + "backlight" = { + # "device" = "acpi_video1"; + "format" = "{percent}% {icon}"; + "format-icons" = ["" ""]; + }; + "battery" = { + "states" = { + # "good" = 95; + "warning" = 30; + "critical" = 1; + }; + "format" = "{capacity}% {icon}"; + "format-charging" = "{capacity}% 󱐋"; + "format-plugged" = "{capacity}% 󰚥"; + "format-alt" = "{time} {icon}"; + "format-good" = ""; # An empty format will hide the modul; + "format-full" = "󰁹"; + "format-icons" = ["󰂎" "󰁻" "󰁽" "󰁿" "󰂂"]; + }; + "network" = { + "format-wifi" = "{essid} ({signalStrength}%) "; + "format-ethernet" = "{ifname}: {ipaddr}/{cidr} "; + "format-linked" = "{ifname} (No IP) "; + "format-disconnected" = "Disconnected ⚠"; + "format-alt" = "{ifname}: {ipaddr}/{cidr}"; + }; + "mpris" = { + "format" = "{title} by {artist}"; + }; + "pulseaudio" = { + # "scroll-step" = 1, # %, can be a floa; + "format" = "{volume} {icon} {format_source}"; + #"format" = "{volume}% {icon} {format_source}"; + #"format-bluetooth" = "{volume}% {icon} {format_source}"; + #"format-bluetooth-muted" = " {icon} {format_source}"; + #"format-muted" = " {format_source}"; + "format-muted" = "󰝟 {format_source}"; + "format-source" = ""; + "format-source-muted" = ""; + "format-icons" = { + "headphones" = ""; + "handsfree" = "󱥋"; + "headset" = "󰋎"; + "phone" = ""; + "portable" = ""; + "car" = ""; + "default" = ["" "" ""]; + }; + # TODO: toggle mute? + "on-click" = "pavucontrol"; + }; + }; + }; + style = let + border-width = "0px"; + in + with colors.withHashPrefix; '' + * { + border-radius: 0; + font-family: "${font.name}", "Symbols Nerd Font Mono", sans-serif; + font-size: 16px; + } + + window#waybar { + min-height: 32px; + background-color: ${bg}; + color: ${text}; + border-top: solid ${blue} ${border-width}; + transition: none; + } + + window#waybar.hidden { + /* opacity: 0.2; */ + } + + window#waybar.empty { + /* opacity: 0.2; */ + } + + #workspaces button { + padding: 0 0.75em; + background-color: transparent; + border-top: solid ${primary} ${border-width}; + transition: none; + color: ${fgdim}; + background-color: ${bg}; + } + + #workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + } + + #workspaces button.active { + color: ${text}; + background-color: ${bg}; + } + + #workspaces button.visible { + color: ${fgdim}; + background-color: ${bg}; + } + + /* A workspace that is persistent but has windows in it */ + #workspaces button.persistent { + color: ${fgdim}; + } + + #workspaces button.focused { + color: ${bg}; + background-color: ${primary}; + } + + #workspaces button.urgent { + background-color: ${urgent}; + color: ${bg}; + border-top: solid ${urgent} ${border-width}; + } + + #mode { + background-color: transparent; + } + + #clock, + #battery, + #cpu, + #memory, + #temperature, + #backlight, + #network, + #pulseaudio, + #custom-media, + #tray, + #mode, + #idle_inhibitor, + #mpris, + #window, + #mpd { + margin-top: 1px; + padding: 0 0.75em; + background-color: inherit; + color: ${text}; + } + + #clock {} + + #battery { + /* background-color: #ffffff; */ + /* color: #000000; */ + } + + #battery.charging { + /* color: #ffffff; */ + /* background-color: #26A65B; */ + } + + @keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } + } + + #battery.critical:not(.charging) { + background-color: ${red}; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + #bluetooth, + #bluetooth.connected-battery, + #bluetooth.connected.battery, + #bluetooth.connected { + color: ${text}; + } + + label:focus { + /* background-color: #000000; */ + } + + #cpu { + /* background-color: #2ecc71; */ + /* color: #000000; */ + } + + #memory { + /* background-color: #9b59b6; */ + } + + #backlight { + /* background-color: #90b1b1; */ + } + + #network { + /* background-color: #2980b9; */ + } + + #network.disconnected { + /* background-color: #f53c3c; */ + } + + #pulseaudio { + color: ${red}; + /* background-color: #f1c40f; */ + /* color: #000000; */ + } + + #pulseaudio.source-muted { + /* background-color: #90b1b1; */ + color: ${text}; + } + + #custom-media { + /* background-color: #66cc99; */ + /* color: #2a5c45; */ + /* min-width: 100px; */ + } + + #custom-media.custom-spotify { + /* background-color: #66cc99; */ + } + + #custom-media.custom-vlc { + /* background-color: #ffa000; */ + } + + #temperature { + /* background-color: #f0932b; */ + } + + #temperature.critical { + /* background-color: #eb4d4b; */ + } + + #tray { + /* background-color: #2980b9; */ + } + + #idle_inhibitor { + /* background-color: #2d3436; */ + } + + #idle_inhibitor.activated { + /* background-color: #ecf0f1; */ + /* color: #2d3436; */ + } + + #mpd { + /* background-color: #66cc99; */ + /* color: #2a5c45; */ + } + + #mpd.disconnected { + /* background-color: #f53c3c; */ + } + + #mpd.stopped { + /* background-color: #90b1b1; */ + } + + #mpd.paused { + /* background-color: #51a37a; */ + } + ''; + systemd = { + enable = true; + }; + }; +} diff --git a/modules/home-manager/wezterm.nix b/modules/home-manager/wezterm.nix new file mode 100644 index 0000000..aa63cb6 --- /dev/null +++ b/modules/home-manager/wezterm.nix @@ -0,0 +1,131 @@ +{font, ...}: { + programs.wezterm = { + enable = true; + extraConfig = '' + local wezterm = require'wezterm' + + local config = {} + + -- TODO: integrate nix colors + + if wezterm.config_builder then + config = wezterm.config_builder() + end + + local hostname = io.popen("/bin/hostname"):read("*a"):gsub("%s", "") + local font_spec = { family = '${font.name}', weight = 'Medium', italic = false } + local font_size = ${toString font.size}.0 + + if hostname == "laptop" then + font_size = 13 + end + + local font = wezterm.font_with_fallback{ + font_spec, + { family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false }, + 'Noto Color Emoji', + } + + if hostname == "laptop" then + config.font_rules = { + -- no italics + { + font = font + }, + } + end + + config.default_cursor_style = 'BlinkingBar' + + config.font = font + config.font_size = font_size + + config.hide_tab_bar_if_only_one_tab = true + config.use_fancy_tab_bar = false + config.tab_bar_at_bottom = false + config.window_background_opacity = 1.0 + + config.color_scheme = "Catppuccin Mocha" + + config.window_frame.font = config.font + config.window_frame.font_size = font_size + + config.inactive_pane_hsb = { + saturation = 0.8, + brightness = 0.7, + } + + config.keys = { + { + key = 'j', + mods = 'CTRL', + action = wezterm.action.ActivatePaneDirection'Down' + }, + { + key = 'Insert', + mods = 'SHIFT', + action = wezterm.action.PasteFrom'Clipboard' + }, + { + key = 'v', + mods = 'CTRL|SHIFT', + action = wezterm.action.PasteFrom'PrimarySelection' + }, + { + key = 'h', + mods = 'CTRL', + action = wezterm.action.ActivatePaneDirection'Left' + }, + { + key = 'l', + mods = 'CTRL', + action = wezterm.action.ActivatePaneDirection'Right' + }, + { + key = 'k', + mods = 'CTRL', + action = wezterm.action.ActivatePaneDirection'Up' + }, + { + key = 'j', + mods = 'CTRL|SHIFT', + action = wezterm.action.SplitVertical{domain='CurrentPaneDomain'} + }, + { + key = 'l', + mods = 'CTRL|SHIFT', + action = wezterm.action.SplitHorizontal{domain='CurrentPaneDomain'} + }, + { + key = 'l', + mods = 'CTRL|SHIFT|ALT', + action = wezterm.action.ShowDebugOverlay + }, + { + key = 'r', + mods = 'CTRL|SHIFT|ALT', + action = wezterm.action.RotatePanes'Clockwise' + }, + } + + config.unix_domains = { + { + name = 'unix', + local_echo_threshold_ms = 10, + }, + } + + -- config.default_gui_startup_args = { 'connect', 'unix' } + -- config.default_domain = 'unix' + + config.window_padding = { + top = '0.5cell', + bottom = '0.5cell', + left = '1cell', + right = '1cell', + } + + return config + ''; + }; +} diff --git a/modules/home-manager/zellij.nix b/modules/home-manager/zellij.nix new file mode 100644 index 0000000..6412765 --- /dev/null +++ b/modules/home-manager/zellij.nix @@ -0,0 +1,15 @@ +{ + programs.zellij = { + # TODO: enable after port config + enable = false; + enableFishIntegration = true; + settings = { + pane_frames = false; + # TODO: port config + }; + }; + + home.shellAliases = { + z = "zellij"; + }; +} diff --git a/readme.md b/readme.md index b7d3b3b..f47fb6d 100644 --- a/readme.md +++ b/readme.md @@ -121,7 +121,7 @@ nix-shell --packages git \ ## Short Term -- Fix Helix UI (picker borders gone) +- Modularize the home manager stuff into modules - Remove all work-specific config and stick that in its own flake that uses my main flake as input - Fonts installed by home manager instead of nixos module - Zellij config