1password options
This commit is contained in:
@@ -7,9 +7,10 @@
|
|||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
_1password-shell-plugins.url = "github:1Password/shell-plugins";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, home-manager, ... }:
|
outputs = { nixpkgs, ... }@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
@@ -21,6 +22,10 @@
|
|||||||
./options.nix
|
./options.nix
|
||||||
./home.nix
|
./home.nix
|
||||||
./git.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"
|
"git"
|
||||||
"ssh"
|
"ssh"
|
||||||
"ssh-agent"
|
"ssh-agent"
|
||||||
];
|
] ++ lib.optional config._1password "1password";
|
||||||
};
|
};
|
||||||
shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time";
|
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 {
|
programs.ssh = lib.mkIf config.ssh {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
SetEnv TERM="xterm-256color"
|
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" = {
|
"panoptes" = {
|
||||||
hostname = "192.168.1.107";
|
hostname = "192.168.1.107";
|
||||||
user = "panoptes";
|
user = "panoptes";
|
||||||
@@ -119,6 +124,23 @@
|
|||||||
hostname = "192.168.1.130";
|
hostname = "192.168.1.130";
|
||||||
user = "root";
|
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;
|
default = true;
|
||||||
description = "Whether to enable SSH configuration";
|
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