From e0e24a42add6d69d455dde6b6c673c31bc642688 Mon Sep 17 00:00:00 2001 From: Mars Date: Sun, 28 Jul 2024 21:52:06 -0400 Subject: [PATCH] add darwin stuff --- .envrc | 21 +- .gitignore | 1 + flake.in.nix | 8 +- flake.lock | 284 ++---------------- flake.nix | 5 +- modules/home/shell/default.nix | 34 ++- modules/home/shell/git.nix | 7 +- modules/home/shell/nushell/default.nix | 3 +- modules/home/shell/wezterm.nix | 5 +- systems/aarch64-darwin/canis/default.nix | 147 +++++++++ systems/aarch64-darwin/canis/home.nix | 74 +++++ systems/aarch64-darwin/canis/wezterm.lua | 134 +++++++++ systems/x86_64-linux/navis/default.nix | 2 + systems/x86_64-linux/navis/home.nix | 33 +- .../x86_64-linux/navis}/hyprland/default.nix | 0 .../x86_64-linux/navis}/hyprland/rofi.nix | 0 .../x86_64-linux/navis}/hyprland/services.nix | 0 .../x86_64-linux/navis}/hyprland/wall.mp4 | Bin .../x86_64-linux/navis}/hyprland/waybar.nix | 0 .../navis}/screenshot/clipboard.svg | 0 .../navis}/screenshot/default.nix | 0 .../navis}/screenshot/screenshot.rasi | 0 .../x86_64-linux/navis}/wezterm.lua | 0 23 files changed, 455 insertions(+), 303 deletions(-) create mode 100644 systems/aarch64-darwin/canis/default.nix create mode 100644 systems/aarch64-darwin/canis/home.nix create mode 100644 systems/aarch64-darwin/canis/wezterm.lua rename {modules/home => systems/x86_64-linux/navis}/hyprland/default.nix (100%) rename {modules/home => systems/x86_64-linux/navis}/hyprland/rofi.nix (100%) rename {modules/home => systems/x86_64-linux/navis}/hyprland/services.nix (100%) rename {modules/home => systems/x86_64-linux/navis}/hyprland/wall.mp4 (100%) rename {modules/home => systems/x86_64-linux/navis}/hyprland/waybar.nix (100%) rename {modules/home => systems/x86_64-linux/navis}/screenshot/clipboard.svg (100%) rename {modules/home => systems/x86_64-linux/navis}/screenshot/default.nix (100%) rename {modules/home => systems/x86_64-linux/navis}/screenshot/screenshot.rasi (100%) rename {modules/home/shell => systems/x86_64-linux/navis}/wezterm.lua (100%) diff --git a/.envrc b/.envrc index da46543..1e0f965 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,22 @@ watch_file flake.in.nix -cp $(nix eval --raw .#nextFlake) flake.nix + +# Calculate the hash of flake.in.nix +current_hash=$(md5sum flake.in.nix | cut -d ' ' -f 1) +stored_hash_file=".flake_in_nix_hash" + +# Read the stored hash if it exists +if [ -f "$stored_hash_file" ]; then + stored_hash=$(cat "$stored_hash_file") +else + stored_hash="" +fi + +# Compare the hashes and copy if they are different +if [ "$current_hash" != "$stored_hash" ]; then + cp $(nix eval --raw .#nextFlake) flake.nix + # Store the new hash + echo "$current_hash" > "$stored_hash_file" +fi + use_flake + diff --git a/.gitignore b/.gitignore index f126f35..6d85985 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .direnv/ +.flake_in_nix_hash .luarc.json sys.nix diff --git a/flake.in.nix b/flake.in.nix index 16fff03..f979e70 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -30,9 +30,9 @@ nixpkgs = mkInput "NixOS/nixpkgs/nixos-unstable"; nix-super = mkCustomUrl "git+https://git.privatevoid.net/max/nix-super.git"; nixvim = mkInput "pupbrained/nvim-config"; - schizofox = mkInput "schizofox/schizofox"; treefmt-nix = mkInput "numtide/treefmt-nix"; + darwin = mkFollowingNixpkgs "LnL7/nix-darwin/master"; nix-index-database = mkFollowingNixpkgs "nix-community/nix-index-database"; snowfall-flake = mkFollowingNixpkgs "snowfallorg/flake"; snowfall-lib = mkFollowingNixpkgs "snowfallorg/lib/dev"; @@ -65,12 +65,6 @@ ]; outputs-builder = channels: { - overlays = [ - (_final: _prev: { - nixSuper = nix-super.packages.default; - }) - ]; - formatter = treefmt-nix.lib.mkWrapper channels.nixpkgs { projectRootFile = "flake.nix"; diff --git a/flake.lock b/flake.lock index e7e07f6..5c70cce 100644 --- a/flake.lock +++ b/flake.lock @@ -143,28 +143,6 @@ "url": "https://flakehub.com/f/chaotic-cx/nix-empty-flake/%3D0.1.2.tar.gz" } }, - "crane": { - "inputs": { - "nixpkgs": [ - "schizofox", - "searx-randomizer", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1701386725, - "narHash": "sha256-w4aBlMYh9Y8co1V80m5LzEKMijUJ7CBTq209WbqVwUU=", - "owner": "ipetkov", - "repo": "crane", - "rev": "8b9bad9b30bd7a9ed08782e64846b7485f9d0a38", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, "darwin": { "inputs": { "nixpkgs": [ @@ -187,6 +165,27 @@ "type": "github" } }, + "darwin_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722082646, + "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", + "type": "github" + }, + "original": { + "owner": "LnL7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "devshell": { "inputs": { "flake-utils": "flake-utils_4", @@ -257,22 +256,6 @@ } }, "flake-compat_4": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_5": { "flake": false, "locked": { "lastModified": 1696426674, @@ -289,7 +272,7 @@ "type": "github" } }, - "flake-compat_6": { + "flake-compat_5": { "flake": false, "locked": { "lastModified": 1650374568, @@ -305,7 +288,7 @@ "type": "github" } }, - "flake-compat_7": { + "flake-compat_6": { "flake": false, "locked": { "lastModified": 1650374568, @@ -364,45 +347,6 @@ "type": "github" } }, - "flake-parts_3": { - "inputs": { - "nixpkgs-lib": [ - "schizofox", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_4": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib_2" - }, - "locked": { - "lastModified": 1698882062, - "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-schemas": { "locked": { "lastModified": 1693491534, @@ -541,7 +485,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_9" + "systems": "systems_8" }, "locked": { "lastModified": 1694529238, @@ -627,33 +571,6 @@ "type": "github" } }, - "hercules-ci-effects": { - "inputs": { - "flake-parts": [ - "schizofox", - "nixpak", - "flake-parts" - ], - "nixpkgs": [ - "schizofox", - "nixpak", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1713898448, - "narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=", - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "rev": "c0302ec12d569532a6b6bd218f698bc402e93adc", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -718,27 +635,6 @@ "type": "github" } }, - "home-manager_4": { - "inputs": { - "nixpkgs": [ - "schizofox", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1717097707, - "narHash": "sha256-HC5vJ3oYsjwsCaSbkIPv80e4ebJpNvFKQTBOGlHvjLs=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "0eb314b4f0ba337e88123e0b1e57ef58346aafd9", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -1091,32 +987,6 @@ "url": "https://git.privatevoid.net/max/nix-super.git" } }, - "nixpak": { - "inputs": { - "flake-parts": [ - "schizofox", - "flake-parts" - ], - "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": [ - "schizofox", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1717036060, - "narHash": "sha256-Bm1pBy1goxIz9PD0PRJ9ZgQzl7MQOQ6n5IB4wLNdXrA=", - "owner": "nixpak", - "repo": "nixpak", - "rev": "3a68b5453f75b1c8e5d31859a654e061a57dc059", - "type": "github" - }, - "original": { - "owner": "nixpak", - "repo": "nixpak", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1703013332, @@ -1148,24 +1018,6 @@ "type": "github" } }, - "nixpkgs-lib_2": { - "locked": { - "dir": "lib", - "lastModified": 1698611440, - "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-regression": { "locked": { "lastModified": 1643052045, @@ -1183,22 +1035,6 @@ } }, "nixpkgs_10": { - "locked": { - "lastModified": 1718419000, - "narHash": "sha256-v4+aJpRDbJil691DXo5SydqowcB01B6E9+wFH/pNk6k=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "24b048f70e34020c93ed7c11491bc050ff6eb142", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_11": { "locked": { "lastModified": 1720957393, "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", @@ -1425,6 +1261,7 @@ "agenix": "agenix", "catppuccin": "catppuccin", "chaotic": "chaotic", + "darwin": "darwin_2", "flakegen": "flakegen", "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", @@ -1434,62 +1271,14 @@ "nix-super": "nix-super", "nixpkgs": "nixpkgs_5", "nixvim": "nixvim", - "schizofox": "schizofox", "snowfall-flake": "snowfall-flake", "snowfall-lib": "snowfall-lib_2", "treefmt-nix": "treefmt-nix_3" } }, - "schizofox": { - "inputs": { - "flake-compat": "flake-compat_4", - "flake-parts": "flake-parts_3", - "home-manager": "home-manager_4", - "nixpak": "nixpak", - "nixpkgs": "nixpkgs_10", - "searx-randomizer": "searx-randomizer", - "systems": "systems_8" - }, - "locked": { - "lastModified": 1719058240, - "narHash": "sha256-pprpeDB/mvINS5m5FIOq/1I0xpBvO8l7FyWNmmO0Ir0=", - "owner": "schizofox", - "repo": "schizofox", - "rev": "becff9b92a28c3cd6e6a215da7f5f56883d3a304", - "type": "github" - }, - "original": { - "owner": "schizofox", - "repo": "schizofox", - "type": "github" - } - }, - "searx-randomizer": { - "inputs": { - "crane": "crane", - "flake-parts": "flake-parts_4", - "nixpkgs": [ - "schizofox", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1704412376, - "narHash": "sha256-Ap/AudJxCYBDWYy0lyqP0/FZYJCibL7jKkoj6hp1WS0=", - "owner": "schizofox", - "repo": "searx-randomizer", - "rev": "c36a473732ba6b4f6024ac1c181631cf4d542b17", - "type": "github" - }, - "original": { - "owner": "schizofox", - "repo": "searx-randomizer", - "type": "github" - } - }, "snowfall-flake": { "inputs": { - "flake-compat": "flake-compat_5", + "flake-compat": "flake-compat_4", "nixpkgs": [ "nixpkgs" ], @@ -1511,7 +1300,7 @@ }, "snowfall-lib": { "inputs": { - "flake-compat": "flake-compat_6", + "flake-compat": "flake-compat_5", "flake-utils-plus": "flake-utils-plus", "nixpkgs": [ "snowfall-flake", @@ -1535,7 +1324,7 @@ }, "snowfall-lib_2": { "inputs": { - "flake-compat": "flake-compat_7", + "flake-compat": "flake-compat_6", "flake-utils-plus": "flake-utils-plus_2", "nixpkgs": [ "nixpkgs" @@ -1662,21 +1451,6 @@ } }, "systems_8": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_9": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1733,7 +1507,7 @@ }, "treefmt-nix_3": { "inputs": { - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1721769617, diff --git a/flake.nix b/flake.nix index 23c6cb3..0c9713e 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,10 @@ agenix.url = "github:ryantm/agenix"; catppuccin.url = "github:catppuccin/nix"; chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + darwin = { + inputs.nixpkgs.follows = "nixpkgs"; + url = "github:LnL7/nix-darwin/master"; + }; flakegen.url = "github:jorsn/flakegen"; hyprland = { submodules = true; @@ -24,7 +28,6 @@ nix-super.url = "git+https://git.privatevoid.net/max/nix-super.git"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixvim.url = "github:pupbrained/nvim-config"; - schizofox.url = "github:schizofox/schizofox"; snowfall-flake = { inputs.nixpkgs.follows = "nixpkgs"; url = "github:snowfallorg/flake"; diff --git a/modules/home/shell/default.nix b/modules/home/shell/default.nix index 28c8075..9f5cd39 100644 --- a/modules/home/shell/default.nix +++ b/modules/home/shell/default.nix @@ -1,4 +1,4 @@ -{...}: { +{lib, ...}: { imports = [ ./fish.nix ./git.nix @@ -8,6 +8,13 @@ ]; programs = { + fd.enable = true; + git-cliff.enable = true; + jq.enable = true; + nix-index-database.comma.enable = true; + nix-index.enable = true; + ripgrep.enable = true; + atuin = { enable = true; settings = { @@ -22,6 +29,31 @@ catppuccin.enable = true; }; + btop = { + enable = true; + catppuccin.enable = true; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + eza = { + enable = true; + git = true; + icons = true; + }; + + fzf = { + enable = true; + catppuccin.enable = true; + colors = with lib; { + bg = mkForce "-1"; + "bg+" = mkForce "-1"; + }; + }; + zoxide = { enable = true; options = ["--cmd" "cd"]; diff --git a/modules/home/shell/git.nix b/modules/home/shell/git.nix index 00e695f..cf87360 100644 --- a/modules/home/shell/git.nix +++ b/modules/home/shell/git.nix @@ -8,16 +8,11 @@ with pkgs; { userEmail = "mars@pupbrained.xyz"; aliases.pushall = "!git remote | xargs -L1 git push"; delta.enable = true; + signing.signByDefault = true; extraConfig = { init.defaultBranch = "main"; push.autoSetupRemote = true; - credential.helper = "libsecret"; - }; - - signing = { - signByDefault = true; - key = "0FF5B8826803F895"; }; }; diff --git a/modules/home/shell/nushell/default.nix b/modules/home/shell/nushell/default.nix index f3d7363..bd52b61 100644 --- a/modules/home/shell/nushell/default.nix +++ b/modules/home/shell/nushell/default.nix @@ -1,5 +1,4 @@ -{pkgs, ...}: -with pkgs; { +{...}: { programs = { carapace.enable = true; diff --git a/modules/home/shell/wezterm.nix b/modules/home/shell/wezterm.nix index 7e8ed97..9eebd77 100644 --- a/modules/home/shell/wezterm.nix +++ b/modules/home/shell/wezterm.nix @@ -1,6 +1,3 @@ {...}: { - programs.wezterm = { - enable = true; - extraConfig = builtins.readFile ./wezterm.lua; - }; + programs.wezterm.enable = true; } diff --git a/systems/aarch64-darwin/canis/default.nix b/systems/aarch64-darwin/canis/default.nix new file mode 100644 index 0000000..6e94744 --- /dev/null +++ b/systems/aarch64-darwin/canis/default.nix @@ -0,0 +1,147 @@ +{ + pkgs, + inputs, + lib, + ... +}: { + environment.variables.FLAKE = "/Users/marshall/nix-config"; + + fonts.packages = with pkgs; [ + font-awesome + inter + maple-mono + nerdfonts + ]; + + networking = { + computerName = "MacBook Air"; + hostName = "canis"; + }; + + nix = { + gc = { + automatic = true; + interval.Day = 7; + }; + + daemonIOLowPriority = true; + daemonProcessType = "Adaptive"; + distributedBuilds = true; + nixPath = ["nixpkgs=${inputs.nixpkgs}"]; + registry = lib.mapAttrs (_: v: {flake = v;}) inputs; + + settings = { + auto-optimise-store = true; + builders-use-substitutes = true; + extra-experimental-features = "nix-command flakes"; + flake-registry = "/etc/nix/registry.json"; + keep-derivations = true; + keep-outputs = true; + max-jobs = "auto"; + warn-dirty = false; + extra-sandbox-paths = ["/nix/var/cache/ccache"]; + + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + ]; + + trusted-substituters = [ + "cache.nixos.org" + "nix-community.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" + ]; + + trusted-users = ["marshall"]; + }; + }; + + nixpkgs.config.allowUnfree = true; + + programs = { + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; + + security.pam.enableSudoTouchIdAuth = true; + + services = { + nix-daemon.enable = true; + skhd = { + enable = true; + package = pkgs.skhd; + + skhdConfig = '' + alt - return : wezterm + alt - w : open -na "Arc" + + cmd - space : yabai -m window --toggle float + + shift + cmd - q : yabai -m window --close + + alt - h : yabai -m window --focus west + alt - j : yabai -m window --focus south + alt - k : yabai -m window --focus north + alt - l : yabai -m window --focus east + + shift + cmd - h : yabai -m window --swap west + shift + cmd - j : yabai -m window --swap south + shift + cmd - k : yabai -m window --swap north + shift + cmd - l : yabai -m window --swap east + + shift + cmd - 1 : yabai -m window --space 1 + shift + cmd - 2 : yabai -m window --space 2 + shift + cmd - 3 : yabai -m window --space 3 + shift + cmd - 4 : yabai -m window --space 4 + shift + cmd - 5 : yabai -m window --space 5 + shift + cmd - 6 : yabai -m window --space 6 + shift + cmd - 7 : yabai -m window --space 7 + shift + cmd - 8 : yabai -m window --space 8 + shift + cmd - 9 : yabai -m window --space 9 + ''; + }; + }; + + snowfallorg.users.marshall = { + create = true; + + home = { + enable = true; + + config = import ./home.nix {inherit lib pkgs inputs;}; + }; + }; + + users.users.marshall = { + name = "marshall"; + home = "/Users/marshall"; + }; + + system = { + keyboard.enableKeyMapping = true; + + defaults = { + NSGlobalDomain = { + KeyRepeat = 1; + NSAutomaticCapitalizationEnabled = false; + NSAutomaticSpellingCorrectionEnabled = false; + }; + + dock = { + autohide = true; + autohide-delay = 1000.0; + expose-animation-duration = 0.0; + orientation = "bottom"; + showhidden = true; + tilesize = 48; + }; + }; + }; +} diff --git a/systems/aarch64-darwin/canis/home.nix b/systems/aarch64-darwin/canis/home.nix new file mode 100644 index 0000000..d812a30 --- /dev/null +++ b/systems/aarch64-darwin/canis/home.nix @@ -0,0 +1,74 @@ +{ + pkgs, + inputs, + ... +}: { + imports = with inputs; [ + nix-index-database.hmModules.nix-index + catppuccin.homeManagerModules.catppuccin + chaotic.homeManagerModules.default + nix-colors.homeManagerModules.default + ]; + + home = { + packages = with pkgs; + [ + alejandra + bit + cargo-edit + cargo-udeps + cmake + duf + eternal-terminal + grc + huniq + hurl + igrep + keybase + keychain + monolith + nix-output-monitor + nix-prefetch-scripts + nixd + nodePackages_latest.nodejs + nurl + pinentry_mac + pkg-config + pnpm + rm-improved + rnr + slack + stylua + tailspin + tokei + typst + typst-live + typstfmt + unrar + unzip + upx + vgrep + wget + xcp + xh + ] + ++ (with inputs; [nixvim.packages.${pkgs.system}.default]); + + stateVersion = "24.05"; + }; + + programs = { + bacon.enable = true; + btop.enable = true; + bun.enable = true; + gpg.enable = true; + skim.enable = false; + tealdeer.enable = false; + wezterm.extraConfig = builtins.readFile ./wezterm.lua; + + git = { + extraConfig.credential.helper = "osxkeychain"; + signing.key = "874E22DF2F9DFCB5"; + }; + }; +} diff --git a/systems/aarch64-darwin/canis/wezterm.lua b/systems/aarch64-darwin/canis/wezterm.lua new file mode 100644 index 0000000..bd989f4 --- /dev/null +++ b/systems/aarch64-darwin/canis/wezterm.lua @@ -0,0 +1,134 @@ +local c = wezterm.config_builder() + +wezterm.on('user-var-changed', function(window, pane, name, value) + local overrides = window:get_config_overrides() or {} + if name == 'ZEN_MODE' then + local incremental = value:find('+') + local number_value = tonumber(value) + if incremental ~= nil then + while number_value > 0 do + window:perform_action(wezterm.action.IncreaseFontSize, pane) + number_value = number_value - 1 + end + overrides.enable_tab_bar = false + elseif number_value < 0 then + window:perform_action(wezterm.action.ResetFontSize, pane) + overrides.font_size = nil + overrides.enable_tab_bar = true + else + overrides.font_size = number_value + overrides.enable_tab_bar = false + end + end + window:set_config_overrides(overrides) +end) +wezterm.on('format-window-title', function(tab, pane, tabs, panes, config) + local zoomed = '' + + if tab.active_pane.is_zoomed then + zoomed = '[Z] ' + end + + local index = '' + + if #tabs > 1 then + index = string.format('[%d/%d] ', tab.tab_index + 1, #tabs) + end + + return 'WezTerm - ' .. zoomed .. index .. tab.active_pane.title +end) + +wezterm.plugin.require('https://github.com/nekowinston/wezterm-bar').apply_to_config(c, { + position = 'bottom', + max_width = 32, + dividers = 'slant_right', + indicator = { + leader = { + enabled = true, + off = ' ', + on = ' ', + }, + mode = { + enabled = true, + names = { + resize_mode = 'RESIZE', + copy_mode = 'VISUAL', + search_mode = 'SEARCH', + }, + }, + }, + tabs = { + numerals = 'arabic', + pane_count = 'subscript', + brackets = { + active = { '', ':' }, + inactive = { '', ':' }, + }, + }, + clock = { + enabled = true, + format = '%l:%M %p', + }, +}) + +local act = wezterm.action + +local keybinds = { + { + key = 'Enter', + mods = 'CTRL|SHIFT', + action = act.SplitHorizontal({ domain = 'CurrentPaneDomain' }), + }, + { + key = 'h', + mods = 'CTRL|SHIFT', + action = act.ActivatePaneDirection('Left'), + }, + { + key = 'l', + mods = 'CTRL|SHIFT', + action = act.ActivatePaneDirection('Right'), + }, + { + key = 'k', + mods = 'CTRL|SHIFT', + action = act.ActivatePaneDirection('Up'), + }, + { + key = 'j', + mods = 'CTRL|SHIFT', + action = act.ActivatePaneDirection('Down'), + }, + { + key = 't', + mods = 'CTRL|SHIFT', + action = act.SpawnCommandInNewTab({ cwd = wezterm.home_dir }), + }, +} + +local config = { + adjust_window_size_when_changing_font_size = false, + color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()), + cursor_blink_ease_in = 'Constant', + cursor_blink_ease_out = 'Constant', + cursor_blink_rate = 500, + default_cursor_style = 'BlinkingBar', + enable_scroll_bar = false, + font = wezterm.font('Maple Mono NF'), + font_size = 16, + front_end = 'WebGpu', + hide_tab_bar_if_only_one_tab = true, + keys = keybinds, + macos_window_background_blur = 32, + use_fancy_tab_bar = false, + webgpu_power_preference = 'HighPerformance', + window_background_opacity = 0.85, + window_decorations = 'RESIZE', + window_padding = { left = 0, right = 0, top = 0, bottom = 0 }, +} + +for k, v in pairs(config) do + c[k] = v +end + +return c diff --git a/systems/x86_64-linux/navis/default.nix b/systems/x86_64-linux/navis/default.nix index 9e6f3ce..4330291 100644 --- a/systems/x86_64-linux/navis/default.nix +++ b/systems/x86_64-linux/navis/default.nix @@ -177,6 +177,8 @@ with lib // pkgs // inputs; { (mapAttrs (_: flake: {inherit flake;})) (x: x // {nixpkgs.flake = nixpkgs;}) ]; + + nixSuper = inputs.nix-super.packages.${pkgs.system}.default; in { package = mkForce nixSuper; registry = mappedRegistry // optionalAttrs (config.nix.package == nixSuper) {default = mappedRegistry.nixpkgs;}; diff --git a/systems/x86_64-linux/navis/home.nix b/systems/x86_64-linux/navis/home.nix index c0bf933..bbb769c 100644 --- a/systems/x86_64-linux/navis/home.nix +++ b/systems/x86_64-linux/navis/home.nix @@ -13,6 +13,9 @@ nix-colors.homeManagerModules.default nix-index-database.hmModules.nix-index schizofox.homeManagerModules.default + + ./hyprland + ./screenshot ]; home = { @@ -131,33 +134,11 @@ }; programs = { - nix-index-database.comma.enable = true; - nix-index.enable = true; - ripgrep.enable = true; + wezterm.extraConfig = builtins.readFile ./wezterm.lua; - fzf = { - enable = true; - catppuccin.enable = true; - colors = with lib; { - bg = mkForce "-1"; - "bg+" = mkForce "-1"; - }; - }; - - eza = { - enable = true; - git = true; - icons = true; - }; - - btop = { - enable = true; - catppuccin.enable = true; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; + git = { + extraConfig.credential.helper = "libsecret"; + signing.key = "0FF5B8826803F895"; }; }; diff --git a/modules/home/hyprland/default.nix b/systems/x86_64-linux/navis/hyprland/default.nix similarity index 100% rename from modules/home/hyprland/default.nix rename to systems/x86_64-linux/navis/hyprland/default.nix diff --git a/modules/home/hyprland/rofi.nix b/systems/x86_64-linux/navis/hyprland/rofi.nix similarity index 100% rename from modules/home/hyprland/rofi.nix rename to systems/x86_64-linux/navis/hyprland/rofi.nix diff --git a/modules/home/hyprland/services.nix b/systems/x86_64-linux/navis/hyprland/services.nix similarity index 100% rename from modules/home/hyprland/services.nix rename to systems/x86_64-linux/navis/hyprland/services.nix diff --git a/modules/home/hyprland/wall.mp4 b/systems/x86_64-linux/navis/hyprland/wall.mp4 similarity index 100% rename from modules/home/hyprland/wall.mp4 rename to systems/x86_64-linux/navis/hyprland/wall.mp4 diff --git a/modules/home/hyprland/waybar.nix b/systems/x86_64-linux/navis/hyprland/waybar.nix similarity index 100% rename from modules/home/hyprland/waybar.nix rename to systems/x86_64-linux/navis/hyprland/waybar.nix diff --git a/modules/home/screenshot/clipboard.svg b/systems/x86_64-linux/navis/screenshot/clipboard.svg similarity index 100% rename from modules/home/screenshot/clipboard.svg rename to systems/x86_64-linux/navis/screenshot/clipboard.svg diff --git a/modules/home/screenshot/default.nix b/systems/x86_64-linux/navis/screenshot/default.nix similarity index 100% rename from modules/home/screenshot/default.nix rename to systems/x86_64-linux/navis/screenshot/default.nix diff --git a/modules/home/screenshot/screenshot.rasi b/systems/x86_64-linux/navis/screenshot/screenshot.rasi similarity index 100% rename from modules/home/screenshot/screenshot.rasi rename to systems/x86_64-linux/navis/screenshot/screenshot.rasi diff --git a/modules/home/shell/wezterm.lua b/systems/x86_64-linux/navis/wezterm.lua similarity index 100% rename from modules/home/shell/wezterm.lua rename to systems/x86_64-linux/navis/wezterm.lua