diff --git a/_sources/generated.json b/_sources/generated.json new file mode 100644 index 0000000..b15e1ff --- /dev/null +++ b/_sources/generated.json @@ -0,0 +1,112 @@ +{ + "catppuccin-bat": { + "cargoLocks": null, + "date": "2022-11-10", + "extract": null, + "name": "catppuccin-bat", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "rev": "ba4d16880d63e656acced2b7d4e034e4a93f74b1", + "sha256": "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=", + "type": "git", + "url": "https://github.com/catppuccin/bat" + }, + "version": "ba4d16880d63e656acced2b7d4e034e4a93f74b1" + }, + "catppuccin-wezterm": { + "cargoLocks": null, + "date": "2023-04-12", + "extract": null, + "name": "catppuccin-wezterm", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "rev": "b1a81bae74d66eaae16457f2d8f151b5bd4fe5da", + "sha256": "sha256-McSWoZaJeK+oqdK/0vjiRxZGuLBpEB10Zg4+7p5dIGY=", + "type": "git", + "url": "https://github.com/catppuccin/wezterm" + }, + "version": "b1a81bae74d66eaae16457f2d8f151b5bd4fe5da" + }, + "catppuccin-zsh-fsh": { + "cargoLocks": null, + "date": "2023-07-11", + "extract": null, + "name": "catppuccin-zsh-fsh", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "rev": "7cdab58bddafe0565f84f6eaf2d7dd109bd6fc18", + "sha256": "sha256-31lh+LpXGe7BMZBhRWvvbOTkwjOM77FPNaGy6d26hIA=", + "type": "git", + "url": "https://github.com/catppuccin/zsh-fsh" + }, + "version": "7cdab58bddafe0565f84f6eaf2d7dd109bd6fc18" + }, + "nekowinston-wezterm-bar": { + "cargoLocks": null, + "date": "2023-05-10", + "extract": null, + "name": "nekowinston-wezterm-bar", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "rev": "e96b81460b3ad11a7461934dcb7889ce5079f97f", + "sha256": "sha256-3acxqJ9HMA5hASWq/sVL9QQjfEw5Xrh2fT9nFuGjzHM=", + "type": "git", + "url": "https://github.com/nekowinston/wezterm-bar" + }, + "version": "e96b81460b3ad11a7461934dcb7889ce5079f97f" + }, + "yabai": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "yabai", + "passthru": null, + "pinned": false, + "src": { + "name": null, + "sha256": "sha256-0YJN7XRpseXZnVXDcsv/8w8pen0sE52qQmS+xFni6V0=", + "type": "url", + "url": "https://github.com/koekeishiya/yabai/releases/download/v6.0.12/yabai-v6.0.12.tar.gz" + }, + "version": "v6.0.12" + }, + "zsh-fast-syntax-highlighting": { + "cargoLocks": null, + "date": "2023-07-05", + "extract": null, + "name": "zsh-fast-syntax-highlighting", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "rev": "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9", + "sha256": "sha256-RVX9ZSzjBW3LpFs2W86lKI6vtcvDWP6EPxzeTcRZua4=", + "type": "git", + "url": "https://github.com/zdharma-continuum/fast-syntax-highlighting" + }, + "version": "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9" + } +} \ No newline at end of file diff --git a/_sources/generated.nix b/_sources/generated.nix new file mode 100644 index 0000000..80ded8b --- /dev/null +++ b/_sources/generated.nix @@ -0,0 +1,77 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: +{ + catppuccin-bat = { + pname = "catppuccin-bat"; + version = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; + src = fetchgit { + url = "https://github.com/catppuccin/bat"; + rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; + }; + date = "2022-11-10"; + }; + catppuccin-wezterm = { + pname = "catppuccin-wezterm"; + version = "b1a81bae74d66eaae16457f2d8f151b5bd4fe5da"; + src = fetchgit { + url = "https://github.com/catppuccin/wezterm"; + rev = "b1a81bae74d66eaae16457f2d8f151b5bd4fe5da"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sha256 = "sha256-McSWoZaJeK+oqdK/0vjiRxZGuLBpEB10Zg4+7p5dIGY="; + }; + date = "2023-04-12"; + }; + catppuccin-zsh-fsh = { + pname = "catppuccin-zsh-fsh"; + version = "7cdab58bddafe0565f84f6eaf2d7dd109bd6fc18"; + src = fetchgit { + url = "https://github.com/catppuccin/zsh-fsh"; + rev = "7cdab58bddafe0565f84f6eaf2d7dd109bd6fc18"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sha256 = "sha256-31lh+LpXGe7BMZBhRWvvbOTkwjOM77FPNaGy6d26hIA="; + }; + date = "2023-07-11"; + }; + nekowinston-wezterm-bar = { + pname = "nekowinston-wezterm-bar"; + version = "e96b81460b3ad11a7461934dcb7889ce5079f97f"; + src = fetchgit { + url = "https://github.com/nekowinston/wezterm-bar"; + rev = "e96b81460b3ad11a7461934dcb7889ce5079f97f"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sha256 = "sha256-3acxqJ9HMA5hASWq/sVL9QQjfEw5Xrh2fT9nFuGjzHM="; + }; + date = "2023-05-10"; + }; + yabai = { + pname = "yabai"; + version = "v6.0.12"; + src = fetchurl { + url = "https://github.com/koekeishiya/yabai/releases/download/v6.0.12/yabai-v6.0.12.tar.gz"; + sha256 = "sha256-0YJN7XRpseXZnVXDcsv/8w8pen0sE52qQmS+xFni6V0="; + }; + }; + zsh-fast-syntax-highlighting = { + pname = "zsh-fast-syntax-highlighting"; + version = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; + src = fetchgit { + url = "https://github.com/zdharma-continuum/fast-syntax-highlighting"; + rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sha256 = "sha256-RVX9ZSzjBW3LpFs2W86lKI6vtcvDWP6EPxzeTcRZua4="; + }; + date = "2023-07-05"; + }; +} diff --git a/flake.lock b/flake.lock index 3422f45..eb282c7 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1703433843, - "narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=", + "lastModified": 1707830867, + "narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=", "owner": "ryantm", "repo": "agenix", - "rev": "417caa847f9383e111d1397039c9d4337d024bf0", + "rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6", "type": "github" }, "original": { @@ -30,11 +30,11 @@ ] }, "locked": { - "lastModified": 1707333512, - "narHash": "sha256-Y6u9vz5dXTZ8IErO9n2NRpEGaUrfBgysOOa52smqtpI=", + "lastModified": 1707747706, + "narHash": "sha256-rUT4kar5oCgkvwzuADjSmewNG+Hfps14BbN+kgx4c60=", "owner": "caarlos0", "repo": "nur", - "rev": "3b0e759446f567d243d5a62320af50cc7c7754e0", + "rev": "8d7d6496e98f49edb5097ceebe55c99506a6876c", "type": "github" }, "original": { @@ -92,11 +92,11 @@ ] }, "locked": { - "lastModified": 1706833576, - "narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=", + "lastModified": 1707707289, + "narHash": "sha256-YuDt/eSTXMEHv8jS8BEZJgqCcG8Tr3cyqaZjJFXZHsw=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7", + "rev": "44f50a5ecaab72a61d5fd8e5c5717bc4bf9c25dd", "type": "github" }, "original": { @@ -208,11 +208,11 @@ ] }, "locked": { - "lastModified": 1707607386, - "narHash": "sha256-hj/RgQMTvCWQVInkZwiMMieumkfOjHXhtWhfuXHop/8=", + "lastModified": 1707919853, + "narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=", "owner": "nix-community", "repo": "home-manager", - "rev": "bfd0ae29a86eff4603098683b516c67e22184511", + "rev": "043ba285c6dc20f36441d48525402bcb9743c498", "type": "github" }, "original": { @@ -228,11 +228,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1707635259, - "narHash": "sha256-wuH3gg0BiZ9KZYckzaQLzticDK6gYK8jD377HYfuz6c=", + "lastModified": 1707894220, + "narHash": "sha256-jHIV2jjNIG+w3pAnjoOEFxHCHZ2vP2c1YZLtXstLqQQ=", "owner": "nekowinston", "repo": "nur", - "rev": "1966ad5b29b74b3a1c6761b31b83ffdc272cfd51", + "rev": "0d91a010e4ee989765ec849e8a3df74554d887a6", "type": "github" }, "original": { @@ -272,11 +272,11 @@ ] }, "locked": { - "lastModified": 1707614384, - "narHash": "sha256-qa/Hu7ZV1MTFV70k714t5l3cCZh1X7lvzaO7cuEVw0c=", + "lastModified": 1707959659, + "narHash": "sha256-bZmLqeoa6M9Dhx5WKpBYExhoy4mrW4FSDWBTxBnVaBg=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "b17d5d4f4cda5231ea5ffb12c61c3468c3e6d095", + "rev": "f7483e526e4fc42b979d652d8e43bfd6204924c0", "type": "github" }, "original": { @@ -321,11 +321,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1707546158, - "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=", + "lastModified": 1707863367, + "narHash": "sha256-LdBbCSSP7VHaHA4KXcPGKqkvsowT2+7W4jlEHJj6rPg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0", + "rev": "35ff7e87ee05199a8003f438ec11a174bcbd98ea", "type": "github" }, "original": { @@ -337,11 +337,11 @@ }, "nur": { "locked": { - "lastModified": 1707659083, - "narHash": "sha256-AACVGpkK3iPTKu2cPGD7Vdyx7UxwDZM+Ik//czpOuPk=", + "lastModified": 1707995185, + "narHash": "sha256-EZEloWq14yCTy3X6uBOTDxgC4bIKUcxzVfdKnfQau/0=", "owner": "nix-community", "repo": "nur", - "rev": "5ec9be8abec9ab008486961c1c49f05774b8458c", + "rev": "b49255739b185560e4025ed905b76e12bd73ba40", "type": "github" }, "original": { @@ -430,11 +430,11 @@ ] }, "locked": { - "lastModified": 1704454987, - "narHash": "sha256-vGc23vf8C1WIdaUgEs3XqvCU1ag5soQKZnytUsCRpEw=", + "lastModified": 1707986911, + "narHash": "sha256-kRWXQnUkMm5HjlDX9rBq8lowygvbK9+ScAOhiySR3KY=", "owner": "willpower3309", "repo": "swayfx", - "rev": "f0ecffe593574593ec99c104fa12e4bfd593b0f2", + "rev": "2bd366f3372d6f94f6633e62b7f7b06fcf316943", "type": "github" }, "original": { @@ -499,11 +499,11 @@ ] }, "locked": { - "lastModified": 1707476384, - "narHash": "sha256-9YortZTCO9r7wFHX92t+npUDmD5VcKrkVmwaPCvEiXI=", + "lastModified": 1707761607, + "narHash": "sha256-OKNdTgnyhZpmqdgba8s78/QvowyTIMJDp0iLxv570bU=", "owner": "nix-community", "repo": "nixos-wsl", - "rev": "76ca59d8d4423b27c0238bc31401692ebc571365", + "rev": "c8ddba82ca6b791be1acaae4b336ff8e857ec70b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9156de0..d54327a 100644 --- a/flake.nix +++ b/flake.nix @@ -49,6 +49,7 @@ pre-commit = { check.enable = true; + settings.excludes = ["_sources/"]; settings.hooks = { alejandra.enable = true; commitizen.enable = true; diff --git a/home/apps/colorscheme-sync.nix b/home/apps/colorscheme-sync.nix index 991f346..13dfc6a 100644 --- a/home/apps/colorscheme-sync.nix +++ b/home/apps/colorscheme-sync.nix @@ -4,9 +4,6 @@ pkgs, ... }: let - # TODO: de-duplicate across modules - lat = 48.210033; - lng = 16.363449; inherit (pkgs.stdenv) isDarwin isLinux; in { config = lib.mkIf config.isGraphical { @@ -33,29 +30,24 @@ in { }) ]; - services.darkman = let - starship = "${config.programs.starship.package}/bin/starship"; - zsh = "${config.programs.zsh.package}/bin/zsh"; - in { + services.darkman = { enable = isLinux; settings = { - inherit lat lng; + lat = config.location.latitude; + lon = config.location.longitude; useGeoclue = false; }; - darkModeScripts = { - toggle-shell = '' - ${starship} config palette catppuccin_mocha - ${zsh} -ic "fast-theme XDG:catppuccin-mocha" - ''; - }; - lightModeScripts = { - toggle-shell = '' - ${starship} config palette catppuccin_latte - ${zsh} -ic "fast-theme XDG:catppuccin-latte" - ''; - }; }; - programs.zsh.shellAliases.cat = "bat --theme=$(dark-mode-ternary 'Catppuccin-mocha' 'Catppuccin-latte')"; + programs.zsh = { + shellAliases.cat = "bat --theme=$(dark-mode-ternary 'Catppuccin-frappe' 'Catppuccin-latte')"; + initExtra = '' + zadm_sync() { + export STARSHIP_CONFIG__PALETTE="catppuccin_$(dark-mode-ternary frappe latte)" + fast-theme "XDG:catppuccin-$(dark-mode-ternary frappe latte)" >/dev/null + } + add-zsh-hook precmd zadm_sync + ''; + }; }; } diff --git a/home/apps/default.nix b/home/apps/default.nix index 8abb8b6..27c231c 100644 --- a/home/apps/default.nix +++ b/home/apps/default.nix @@ -1,8 +1,4 @@ { - lib, - osConfig, - ... -}: { imports = [ ./browsers.nix ./colorscheme-sync.nix @@ -22,10 +18,4 @@ ./wezterm.nix ./zsh.nix ]; - - options.isGraphical = lib.mkOption { - default = osConfig.isGraphical; - description = "Whether the system is a graphical target"; - type = lib.types.bool; - }; } diff --git a/home/apps/kubernetes.nix b/home/apps/kubernetes.nix index 6a32563..eac1d52 100644 --- a/home/apps/kubernetes.nix +++ b/home/apps/kubernetes.nix @@ -34,26 +34,6 @@ kubectl = "kubecolor"; }; - # programs.zsh = { - # initExtra = '' - # # kubecolor - # compdef kubecolor=kubectl - # # konf - # source <(konf-go shellwrapper zsh) - # source <(konf completion zsh) - # # ignore if konf store hasn't been initialized - # konf --silent set - - # ''; - # }; - - # sops.secrets = let - # konfStore = "${config.home.homeDirectory}/.kube/konfs/store"; - # in { - # "konf-ctp".path = "${konfStore}/ctp_ctp.yaml"; - # "konf-work-prod".path = "${konfStore}/work-prod_work-prod.yaml"; - # "konf-work-staging".path = "${konfStore}/work-staging_work-staging.yaml"; - # }; - home.sessionVariables = { KREW_ROOT = "${config.xdg.dataHome}/krew"; KUBECACHEDIR = "${config.xdg.cacheHome}/kube"; diff --git a/home/apps/sway.nix b/home/apps/sway.nix index 76e8914..64da09c 100644 --- a/home/apps/sway.nix +++ b/home/apps/sway.nix @@ -18,8 +18,6 @@ red = "#f38ba8"; mauve = "#cba6f7"; }; - lat = 48.210033; - lng = 16.363449; in { config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "sway")) { fonts.fontconfig.enable = true; @@ -45,8 +43,8 @@ in { }; wlsunset = { enable = true; - latitude = toString lat; - longitude = toString lng; + latitude = toString config.location.latitude; + longitude = toString config.location.longitude; }; udiskie.enable = true; }; diff --git a/home/apps/vscode.nix b/home/apps/vscode.nix index 674c8a1..2dfe258 100644 --- a/home/apps/vscode.nix +++ b/home/apps/vscode.nix @@ -16,6 +16,8 @@ in { extensions = (with pkgs.vscode-extensions; [ # patches + ms-python.python + ms-python.vscode-pylance ms-vscode-remote.remote-ssh sumneko.lua # needs a pinned release @@ -83,6 +85,7 @@ in { dhall.vscode-dhall-lsp-server editorconfig.editorconfig esbenp.prettier-vscode + geequlim.godot-tools github.copilot github.vscode-github-actions gitlab.gitlab-workflow @@ -90,6 +93,7 @@ in { graphql.vscode-graphql-syntax gruntfuggly.todo-tree jock.svg + leonardssh.vscord lunuan.kubernetes-templates mikestead.dotenv mkhl.direnv @@ -106,6 +110,7 @@ in { unifiedjs.vscode-mdx usernamehw.errorlens vscodevim.vim + wakatime.vscode-wakatime ]); mutableExtensionsDir = true; }; diff --git a/home/apps/wezterm.nix b/home/apps/wezterm.nix index 71f6645..3a2bb5b 100644 --- a/home/apps/wezterm.nix +++ b/home/apps/wezterm.nix @@ -6,6 +6,7 @@ ... }: let mkSymlink = path: config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/wezterm/${path}"; + srcs = pkgs.callPackage ../../_sources/generated.nix {}; inherit (pkgs.stdenv) isDarwin; in { # use the GUI version & config when we have a gui, else just get terminfo @@ -26,26 +27,9 @@ in { source = mkSymlink "config"; recursive = true; }; - "wezterm/bar".source = pkgs.fetchFromGitHub { - owner = "nekowinston"; - repo = "wezterm-bar"; - sha256 = "sha256-3acxqJ9HMA5hASWq/sVL9QQjfEw5Xrh2fT9nFuGjzHM="; - rev = "e96b81460b3ad11a7461934dcb7889ce5079f97f"; - }; - "wezterm/catppuccin".source = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "wezterm"; - sha256 = "sha256-McSWoZaJeK+oqdK/0vjiRxZGuLBpEB10Zg4+7p5dIGY="; - rev = "b1a81bae74d66eaae16457f2d8f151b5bd4fe5da"; - }; + "wezterm/bar".source = srcs.nekowinston-wezterm-bar.src; + "wezterm/catppuccin".source = srcs.catppuccin-wezterm.src; }; - - programs.zsh.initExtra = '' - if [[ "$TERM_PROGRAM" == "WezTerm" ]]; then - TERM=wezterm - source ${config.programs.wezterm.package}/etc/profile.d/wezterm.sh - fi - ''; }) ]; } diff --git a/home/apps/wezterm/wezterm.lua b/home/apps/wezterm/wezterm.lua index e41cec3..98bf5ec 100644 --- a/home/apps/wezterm/wezterm.lua +++ b/home/apps/wezterm/wezterm.lua @@ -23,6 +23,7 @@ c.adjust_window_size_when_changing_font_size = false c.audible_bell = "Disabled" c.default_cursor_style = "BlinkingBar" c.inactive_pane_hsb = { brightness = 0.90 } +-- c.window_background_opacity = 0.95 -- some annoying bug is causing crashes on sway if utils.is_darwin() then @@ -30,8 +31,8 @@ if utils.is_darwin() then end require("catppuccin.plugin").apply_to_config(c, { - sync = false, - flavor = "frappe", + sync = true, + sync_flavors = { dark = "frappe" }, }) return c diff --git a/home/apps/zsh.nix b/home/apps/zsh.nix index fad0522..ca38892 100644 --- a/home/apps/zsh.nix +++ b/home/apps/zsh.nix @@ -1,34 +1,15 @@ { config, - flakePath, lib, pkgs, ... }: let - symlink = fileName: {recursive ? false}: { - source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/${fileName}"; - recursive = recursive; - }; + srcs = pkgs.callPackage ../../_sources/generated.nix {}; zshPlugins = plugins: (map (plugin: rec { name = src.name; inherit (plugin) file src; }) plugins); - catppuccin-zsh-fsh = pkgs.stdenvNoCC.mkDerivation { - name = "catppuccin-zsh-fsh"; - src = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "zsh-fsh"; - rev = "7cdab58bddafe0565f84f6eaf2d7dd109bd6fc18"; - sha256 = "sha256-31lh+LpXGe7BMZBhRWvvbOTkwjOM77FPNaGy6d26hIA="; - }; - phases = ["buildPhase"]; - buildPhase = '' - mkdir -p $out/share/zsh/site-functions/themes - ls $src/themes - cp $src/themes/* $out/share/zsh/site-functions/themes/ - ''; - }; in { programs = { atuin = { @@ -41,23 +22,16 @@ in { sync_frequency = "5m"; }; }; - bat = let - src = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "bat"; - rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; - sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; - }; - in { + bat = { enable = true; themes = { - "catppuccin-latte" = { - inherit src; + "Catppuccin-latte" = { + src = srcs.catppuccin-bat.src; file = "Catppuccin-latte.tmTheme"; }; - "catppuccin-mocha" = { - inherit src; - file = "Catppuccin-mocha.tmTheme"; + "Catppuccin-frappe" = { + src = srcs.catppuccin-bat.src; + file = "Catppuccin-frappe.tmTheme"; }; }; }; @@ -123,7 +97,10 @@ in { nix-index.enable = true; - starship.enable = true; + starship = { + enable = true; + settings = builtins.fromTOML (builtins.readFile ./starship/config.toml); + }; tealdeer = { enable = true; @@ -155,10 +132,8 @@ in { ZVM_VI_HIGHLIGHT_FOREGROUND=white } ''; - initExtra = let - functionsDir = "${config.home.homeDirectory}/${config.programs.zsh.dotDir}/functions"; - in '' - for script in "${functionsDir}"/**/*; do source "$script"; done + initExtra = '' + for script in "${./zsh/functions}"/**/*; do source "$script"; done ''; envExtra = '' export LESSHISTFILE="-" @@ -168,52 +143,31 @@ in { oh-my-zsh = { enable = true; plugins = - [ - "colored-man-pages" - "colorize" - "docker" - "docker-compose" - "git" - "kubectl" - ] - ++ lib.optionals pkgs.stdenv.isDarwin [ - "dash" - "macos" - ]; + ["colored-man-pages" "colorize" "git"] + ++ lib.optionals pkgs.stdenv.isDarwin ["dash" "macos"]; }; - plugins = with pkgs; (zshPlugins [ + plugins = zshPlugins [ { - src = zsh-vi-mode.overrideAttrs (old: { - src = fetchFromGitHub { - inherit (old.src) repo owner; - rev = "a3d717831c1864de8eabf20b946d66afc67e6695"; - hash = "sha256-peoyY+krpK/7dA3TW6PEpauDwZLe+riVWfwpFYnRn1Q="; - }; - }); + src = pkgs.zsh-vi-mode; file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; } { - src = zsh-nix-shell; + src = pkgs.zsh-nix-shell; file = "share/zsh-nix-shell/nix-shell.plugin.zsh"; } { - src = zsh-fast-syntax-highlighting.overrideAttrs (old: { - src = fetchFromGitHub { - inherit (old.src) repo owner; - rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; - hash = "sha256-RVX9ZSzjBW3LpFs2W86lKI6vtcvDWP6EPxzeTcRZua4="; - }; + src = pkgs.zsh-fast-syntax-highlighting.overrideAttrs (_: { + src = srcs.zsh-fast-syntax-highlighting.src; }); file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh"; } - ]); + ]; shellAliases = { cp = "cp -i"; mv = "mv -i"; rm = "rm -i"; # switch between yubikeys for the same GPG key switch_yubikeys = ''gpg-connect-agent "scd serialno" "learn --force" "/bye"''; - tree = "lsd --tree"; # podman docker = "podman"; docker-compose = "podman-compose"; @@ -222,9 +176,5 @@ in { }; }; - xdg.configFile = { - "fsh".source = "${catppuccin-zsh-fsh}/share/zsh/site-functions/themes"; - "starship.toml" = symlink "home/apps/starship/config.toml" {}; - "zsh/functions" = symlink "home/apps/zsh/functions" {recursive = true;}; - }; + xdg.configFile."fsh".source = "${srcs.catppuccin-zsh-fsh.src}/themes"; } diff --git a/home/lib.nix b/home/lib.nix index 91ed76f..47caf1d 100644 --- a/home/lib.nix +++ b/home/lib.nix @@ -27,13 +27,40 @@ xdg.mime.enable = isLinux; }; - modules = with inputs; - [ + modules = + (with inputs; [ agenix.homeManagerModules.age caarlos0-nur.homeManagerModules.default nekowinston-nur.homeManagerModules.default nix-index-database.hmModules.nix-index - ./. + ]) + ++ [ + ({ + osConfig, + lib, + ... + }: let + inherit (lib) mkOption types; + in { + options = { + isGraphical = mkOption { + default = osConfig.isGraphical; + description = "Whether the system is a graphical target"; + type = types.bool; + }; + location = { + latitude = mkOption { + default = osConfig.location.latitude; + type = types.nullOr types.float; + }; + longitude = mkOption { + default = osConfig.location.longitude; + type = types.nullOr types.float; + }; + }; + }; + }) ] - ++ pkgs.lib.optionals (!isNixOS) [hmStandaloneConfig]; + ++ pkgs.lib.optionals (!isNixOS) [hmStandaloneConfig] + ++ [./.]; } diff --git a/machines/futomaki/default.nix b/machines/futomaki/default.nix index c0a1830..f379717 100644 --- a/machines/futomaki/default.nix +++ b/machines/futomaki/default.nix @@ -10,8 +10,12 @@ firewall.enable = true; }; - time.timeZone = "Europe/Vienna"; i18n.defaultLocale = "en_US.UTF-8"; + location = { + latitude = 48.210033; + longitude = 16.363449; + }; + time.timeZone = "Europe/Vienna"; services = { flatpak.enable = true; diff --git a/machines/lib.nix b/machines/lib.nix index b3c921f..3bc3112 100644 --- a/machines/lib.nix +++ b/machines/lib.nix @@ -41,42 +41,47 @@ hostPlatform = ldTernary "linux" "darwin"; pkgs = inputs.nixpkgs.legacyPackages.${system}; + inherit (pkgs.lib) mkOption types; in { ${target}."${host}" = builder { inherit system; modules = with inputs; [ { - options = let - inherit (pkgs) lib; - in { + options = { dotfiles = { - username = lib.mkOption { - type = lib.types.str; + username = mkOption { + type = types.str; default = username; description = "The username of the user"; }; - desktop = lib.mkOption { - type = lib.types.enum ["gnome" "sway"]; + desktop = mkOption { + type = types.enum ["gnome" "sway"]; default = "sway"; description = "The desktop environment to use"; }; }; - isGraphical = lib.mkOption { - type = lib.types.bool; + isGraphical = mkOption { + type = types.bool; default = isGraphical; description = "Whether the system is a graphical target"; }; }; - config = { - networking.hostName = host; - }; + config.networking.hostName = host; } ./common/shared ./common/${hostPlatform} ./${host} home-manager.${module}.home-manager ] + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ + { + options.location = { + latitude = mkOption {type = types.nullOr types.float;}; + longitude = mkOption {type = types.nullOr types.float;}; + }; + } + ] ++ [(hmCommonConfig {inherit username;})] ++ extraModules; specialArgs = {inherit inputs;}; diff --git a/machines/sashimi/default.nix b/machines/sashimi/default.nix index 357e981..9ebcb68 100644 --- a/machines/sashimi/default.nix +++ b/machines/sashimi/default.nix @@ -5,4 +5,9 @@ "aarch64-darwin" "x86_64-darwin" ]; + + location = { + latitude = 48.210033; + longitude = 16.363449; + }; } diff --git a/machines/yuba/default.nix b/machines/yuba/default.nix index cdcb310..2b69737 100644 --- a/machines/yuba/default.nix +++ b/machines/yuba/default.nix @@ -1,5 +1,13 @@ { imports = [../common/wsl]; + + i18n.defaultLocale = "en_US.UTF-8"; + location = { + latitude = 48.210033; + longitude = 16.363449; + }; + time.timeZone = "Europe/Vienna"; + wsl = { defaultUser = "winston"; enable = true; diff --git a/nvfetcher.toml b/nvfetcher.toml new file mode 100644 index 0000000..a3510b9 --- /dev/null +++ b/nvfetcher.toml @@ -0,0 +1,23 @@ +[catppuccin-bat] +src.git = "https://github.com/catppuccin/bat" +fetch.git = "https://github.com/catppuccin/bat" + +[catppuccin-wezterm] +src.git = "https://github.com/catppuccin/wezterm" +fetch.git = "https://github.com/catppuccin/wezterm" + +[catppuccin-zsh-fsh] +src.git = "https://github.com/catppuccin/zsh-fsh" +fetch.git = "https://github.com/catppuccin/zsh-fsh" + +[nekowinston-wezterm-bar] +src.git = "https://github.com/nekowinston/wezterm-bar" +fetch.git = "https://github.com/nekowinston/wezterm-bar" + +[yabai] +src.github = "koekeishiya/yabai" +fetch.url = "https://github.com/koekeishiya/yabai/releases/download/$ver/yabai-$ver.tar.gz" + +[zsh-fast-syntax-highlighting] +src.git = "https://github.com/zdharma-continuum/fast-syntax-highlighting" +fetch.git = "https://github.com/zdharma-continuum/fast-syntax-highlighting" diff --git a/pkgs/overlays.nix b/pkgs/overlays.nix index 5ab45cf..1537ada 100644 --- a/pkgs/overlays.nix +++ b/pkgs/overlays.nix @@ -1,14 +1,20 @@ {inputs}: [ inputs.nix-vscode-extensions.overlays.default inputs.catppuccin-vsc.overlays.default - (final: prev: { + (final: prev: let + srcs = prev.callPackages ../_sources/generated.nix {}; + in { + starship = prev.starship.overrideAttrs (old: { + patches = [ + (prev.fetchpatch { + url = "https://github.com/starship/starship/pull/4439.patch"; + sha256 = "sha256-BKH3elz96Oa424Oz5UIKA2/BOpkym1LTestvccFinnc="; + }) + ]; + }); sway-unwrapped = inputs.swayfx.packages.${prev.system}.default; - yabai = prev.yabai.overrideAttrs (old: rec { - version = "6.0.6"; - src = prev.fetchzip { - url = "https://github.com/koekeishiya/yabai/releases/download/v${version}/yabai-v${version}.tar.gz"; - hash = "sha256-G4BbYU4mgV8Jap8a872/YtoXU/hwUhFyLXdcuT1jldI="; - }; + yabai = prev.yabai.overrideAttrs (_: { + inherit (srcs.yabai) version src; }); nur = import inputs.nur { nurpkgs = prev;