diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 202e3a7..4c975bc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ *.tfstate *.tfstate.* + +.direnv diff --git a/flake.nix b/flake.nix index 1759e6b..cf12f93 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,12 @@ }; outputs = { self, nixpkgs, unstable, nixos-apple-silicon, home-manager - , plasma-manager, nixvim, sops-nix, terranix, ... }: { + , plasma-manager, nixvim, sops-nix, terranix, ... }: + let + forAllSystems = function: + nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed + (system: function nixpkgs.legacyPackages.${system}); + in { packages.aarch64-linux = let @@ -123,5 +128,16 @@ ]; }; }; + + devShells = forAllSystems (pkgs: { + default = pkgs.mkShell { + packages = with pkgs; [ + age + ssh-to-age + sops + just + ]; + }; + }); }; } diff --git a/host/ark/default.nix b/host/ark/default.nix index bba351f..cd86467 100644 --- a/host/ark/default.nix +++ b/host/ark/default.nix @@ -20,7 +20,13 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "ark"; # Define your hostname. + networking.hostName = "ark"; + networking.nameservers = [ "8.8.8.8" "1.1.1.1" ]; + services.tailscale = { + enable = true; + useRoutingFeatures = "both"; + extraUpFlags = [ "--accept-dns=false" ]; + }; oauth.name = "KoonFamily"; oauth.secrets = import ./oauth-secrets.nix; diff --git a/host/ark/service/wakapi.nix b/host/ark/service/wakapi.nix index 1866df2..8db67bf 100644 --- a/host/ark/service/wakapi.nix +++ b/host/ark/service/wakapi.nix @@ -14,7 +14,7 @@ owner = "k2on"; repo = "wakapi"; rev = "koon-fork"; - hash = "sha256-Gg2YXhPBoIVv+8yV5gz2NTCNFo8V9fNJxqjdkwo6Zf0="; + hash = "sha256-FYGtoJmbqUD02/JKvON1RqpjkrDkAOkfPwMAUZ2MSE4="; }; vendorHash = "sha256-912x6LwitYXdjWpP75Xoc56JXadeLQZuESSyLoaJcU0="; diff --git a/host/common/core/default.nix b/host/common/core/default.nix index 0cd2eee..94ef0fa 100644 --- a/host/common/core/default.nix +++ b/host/common/core/default.nix @@ -1,8 +1,6 @@ { inputs, ... }: { time.timeZone = "America/New_York"; - services.tailscale.enable = true; - # security.sudo.wheelNeedsPassword = false; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/host/max/home/terminal.nix b/host/max/home/terminal.nix index 83b17d5..18aaf98 100644 --- a/host/max/home/terminal.nix +++ b/host/max/home/terminal.nix @@ -38,7 +38,19 @@ dotDir = ".config/zsh"; autocd = true; - # initExtra = builtins.readFile ./zsh-nix-shell.zsh; + initContent = '' + fzf-project() { + selected=$(find ~/dev -mindepth 2 -maxdepth 2 | sed 's|/home/max/dev/||' | fzf --delimiter '/' --nth 2) + if [[ -n $selected ]]; then + cd ~/dev/$selected + zle reset-prompt + fi + zle redisplay + } + + zle -N fzf-project + bindkey '^G' fzf-project + ''; shellAliases = { ll = "ls -la --color"; @@ -46,7 +58,8 @@ vi = "nvim"; vim = "nvim"; - k = "kubectl"; + p = "pnpm"; + g = "pnpm run build && ~/dev/personal/genesis/packages/genesis/dist/bin.js"; tt = "tt --theme one-light -n 10"; @@ -58,11 +71,20 @@ docx-to-pdf = "libreoffice --headless --convert-to pdf"; }; - plugins = [{ - name = "vi-mode"; - src = pkgs.zsh-vi-mode; - file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; - }]; + plugins = [ + { + name = "vi-mode"; + src = pkgs.zsh-vi-mode; + file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; + } + ]; + }; + + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + silent = true; }; programs.starship = { enable = true; }; diff --git a/shell.nix b/shell.nix deleted file mode 100644 index f476c23..0000000 --- a/shell.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs ? import {} }: - -pkgs.mkShell { - packages = [ - pkgs.age - pkgs.ssh-to-age - pkgs.sops - pkgs.just - ]; -}