1password options
This commit is contained in:
@@ -7,9 +7,10 @@
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
_1password-shell-plugins.url = "github:1Password/shell-plugins";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, home-manager, ... }:
|
||||
outputs = { nixpkgs, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
@@ -21,6 +22,10 @@
|
||||
./options.nix
|
||||
./home.nix
|
||||
./git.nix
|
||||
inputs._1password-shell-plugins.hmModules.default
|
||||
];
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"1password-cli"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
26
home.nix
26
home.nix
@@ -100,17 +100,22 @@
|
||||
"git"
|
||||
"ssh"
|
||||
"ssh-agent"
|
||||
];
|
||||
] ++ lib.optional config._1password "1password";
|
||||
};
|
||||
shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time";
|
||||
# initContent = lib.mkIf config._1password ''
|
||||
# source ${config.home.homeDirectory}/.config/op/plugins.sh
|
||||
# '';
|
||||
};
|
||||
|
||||
programs.ssh = lib.mkIf config.ssh {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
SetEnv TERM="xterm-256color"
|
||||
${lib.optionalString config._1password "IdentityAgent ~/.1password/agent.sock"}
|
||||
'';
|
||||
matchBlocks = lib.mkIf (config.profile == "personal") {
|
||||
matchBlocks = lib.mkMerge [
|
||||
(lib.mkIf (config.profile == "personal") {
|
||||
"panoptes" = {
|
||||
hostname = "192.168.1.107";
|
||||
user = "panoptes";
|
||||
@@ -119,6 +124,23 @@
|
||||
hostname = "192.168.1.130";
|
||||
user = "root";
|
||||
};
|
||||
})
|
||||
(lib.mkIf (config.profile == "work") {
|
||||
"ubuntu-nvidia" = {
|
||||
hostname = "10.118.46.120";
|
||||
user = "john";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
# https://developer.1password.com/docs/cli/shell-plugins/nix/
|
||||
programs._1password-shell-plugins = lib.mkIf config._1password {
|
||||
# enable 1Password shell plugins for bash, zsh, and fish shell
|
||||
enable = true;
|
||||
# the specified packages as well as 1Password CLI will be
|
||||
# automatically installed and configured to use shell plugins
|
||||
# https://developer.1password.com/docs/cli/shell-plugins
|
||||
plugins = with pkgs; [ gh ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,4 +23,10 @@
|
||||
default = true;
|
||||
description = "Whether to enable SSH configuration";
|
||||
};
|
||||
|
||||
options._1password = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable 1 password stuff";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user