From 0ab9c66cf227e41fb3021426008a8e3b0cc5baaf Mon Sep 17 00:00:00 2001 From: Matthew Ess Date: Tue, 9 Aug 2022 19:56:18 -0400 Subject: [PATCH] Merge conflict --- flake.nix | 30 ++++++++++++++++++++++++++---- home/copyApplications.nix | 1 + home/default.nix | 10 ++-------- pkgs/default.nix | 1 + pkgs/yubiswitch.nix | 22 ++++++++++++++++++++++ 5 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 pkgs/yubiswitch.nix diff --git a/flake.nix b/flake.nix index 3702898..c78ba21 100644 --- a/flake.nix +++ b/flake.nix @@ -127,7 +127,7 @@ matbook = darwinSystem { system = "aarch64-darwin"; modules = nixDarwinCommonModules ++ [ - { + ({ pkgs, ... }: { users.primaryUser = "mat"; networking.computerName = "matbook pro m1"; networking.hostName = "matbook"; @@ -137,19 +137,28 @@ nix.buildCores = 2; nix.maxJobs = 4; + environment.systemPackages = with pkgs; [ + vscodium + ]; games.enable = true; home-manager.sharedModules = [{ programs.git.userEmail = "mat@mat.services"; programs.git.userName = "mat ess"; + programs.ssh.matchBlocks.remarkable = { + hostname = "10.11.99.1"; + user = "root"; + port = 22; + }; + programs.vscode.package = pkgs.vscodium; }]; - } + }) ]; }; yelpbook-m1 = darwinSystem { system = "aarch64-darwin"; modules = nixDarwinCommonModules ++ [ - { + ({ pkgs, ... }: { users.primaryUser = "mess"; networking.knownNetworkServices = [ "Wi-Fi" @@ -158,11 +167,24 @@ nix.maxJobs = 5; games.enable = false; + environment.systemPackages = with pkgs; [ + yubiswitch + vscode + ]; + homebrew.casks = [ "itsycal" ]; home-manager.sharedModules = [{ programs.git.userEmail = "mess@yelp.com"; programs.git.userName = "Matthew Ess"; + programs.ssh.matchBlocks.devbox = { + hostname = "amp1"; + forwardAgent = true; + serverAliveInterval = 120; + }; + programs.fish.functions.devbox.body = '' + ssh -t devbox "agenttmux attach; or agenttmux new -s yelp" + ''; }]; - } + }) ]; }; diff --git a/home/copyApplications.nix b/home/copyApplications.nix index 3f503da..bf0e75f 100644 --- a/home/copyApplications.nix +++ b/home/copyApplications.nix @@ -14,6 +14,7 @@ baseDir="$HOME/Applications/Home Manager Apps" rsyncArgs="--archive --checksum --chmod=-w --copy-unsafe-links --delete" $DRY_RUN_CMD mkdir -p "$baseDir" + $DRY_RUN_CMD sudo rm -rf "$baseDir"/* $DRY_RUN_CMD sudo ${pkgs.rsync}/bin/rsync ''${VERBOSE_ARG:+-v} $rsyncArgs "$appsSrc" "$baseDir" fi ''; diff --git a/home/default.nix b/home/default.nix index a92ca21..ab054a9 100644 --- a/home/default.nix +++ b/home/default.nix @@ -67,19 +67,13 @@ matchBlocks."*".extraOptions = { UseKeychain = "yes"; AddKeysToAgent = "yes"; - # IdentityFile = "~/.ssh/id_ed25519"; + # TODO: gate this behind a check if the cask is present IdentityAgent = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; }; - matchBlocks.remarkable = { - hostname = "10.11.99.1"; - user = "root"; - port = 22; - }; }; # vscode - vscode = with pkgs; { + vscode = { enable = true; - package = vscodium; # extensions = [ pijul-vscode ]; }; }; diff --git a/pkgs/default.nix b/pkgs/default.nix index c3a6f94..72bbd55 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,6 +9,7 @@ let "luar" "smarttab-kak" "kakoune-sudo-write" + "yubiswitch" ]; in genAttrs pkgs buildPkg diff --git a/pkgs/yubiswitch.nix b/pkgs/yubiswitch.nix new file mode 100644 index 0000000..a450575 --- /dev/null +++ b/pkgs/yubiswitch.nix @@ -0,0 +1,22 @@ +{ stdenv, lib, fetchurl, undmg, unzip, version ? "0.12", ... }: + +stdenv.mkDerivation { + inherit version; + pname = "yubiswitch"; + nativeBuildInputs = [ undmg unzip ]; + src = fetchurl { + url = "https://github.com/pallotron/yubiswitch/releases/download/v${version}/yubiswitch_${version}.dmg"; + sha256 = "aR/3AXwAAhFYchfGCmqfNSs8uNnuLOCZ8B0JbXlKAf8="; + }; + + sourceRoot = "."; + + installPhase = '' + runHook preInstall + + mkdir -p $out/Applications + cp -r yubiswitch.app $out/Applications/yubiswitch.app + + runHook postInstall + ''; +}