decouple 1Password

This commit is contained in:
Sridhar Ratnakumar 2024-03-26 08:25:23 -04:00
parent ada0cc1e7c
commit 414ad642b2
5 changed files with 26 additions and 14 deletions

23
home/_1password.nix Normal file
View file

@ -0,0 +1,23 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; [
_1password
gh
];
programs.zsh.envExtra = ''
# For 1Password CLI. This requires `pkgs.gh` to be installed.
source $HOME/.config/op/plugins.sh
'';
programs.ssh = {
enable = true;
matchBlocks = {
# Configure 1Password agent only on macOS; whilst using agent forwarding
# to make it available to Linux machines.
"*".extraOptions = lib.mkIf pkgs.stdenv.isDarwin {
identityAgent = ''"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"'';
};
};
};
}

View file

@ -7,6 +7,7 @@
imports = [
inputs.nixvim.homeManagerModules.nixvim
inputs.nix-index-database.hmModules.nix-index
./_1password.nix
./tmux.nix
./neovim.nix
# ./helix.nix

View file

@ -1,18 +1,10 @@
{ pkgs, lib, ... }:
let
inherit (pkgs) stdenv;
in
{
programs.ssh = {
enable = true;
matchBlocks = {
# Configure 1Password agent only on macOS; whilst using agent forwarding
# to make it available to Linux machines.
"*".extraOptions = lib.mkIf stdenv.isDarwin {
identityAgent = ''"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"'';
};
vanjaram = {
hostname = "100.94.107.36";
hostname = "100.83.79.127";
user = "srid";
forwardAgent = true;
};

View file

@ -19,8 +19,7 @@
# But also see: 'doom env', which is what works.
envExtra = ''
export PATH=/etc/profiles/per-user/$USER/bin:/run/current-system/sw/bin/:/usr/local/bin:$PATH
# For 1Password CLI. This requires `pkgs.gh` to be installed.
source $HOME/.config/op/plugins.sh
# Because, adding it in .ssh/config is not enough.
# cf. https://developer.1password.com/docs/ssh/get-started#step-4-configure-your-ssh-or-git-client
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock

View file

@ -10,9 +10,6 @@
# onlyoffice-bin
obsidian
_1password
_1password-gui
simplescreenrecorder
obs-studio