commit 3f1688319d08bfcc65bcf68416400f11cbfe89d7
parent c8f29e52be96735dc4ef1459350e9d2df855eb52
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 31 Jan 2020 15:34:52 +0100
kubernetes.nix: add a nr option…
Also simplify krew and kind options
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/machines/naruhodo.nix b/machines/naruhodo.nix
@@ -14,6 +14,7 @@ with import ../assets/machines.nix;{
enable = true;
containers = false;
minikube.enable = false;
+ nr = false;
};
profiles.finances.enable = true;
profiles.gpg.pinentry = "/usr/bin/pinentry";
diff --git a/machines/wakasu.nix b/machines/wakasu.nix
@@ -18,8 +18,9 @@
profiles.mails.enable = true;
profiles.containers.kubernetes = {
enable = true;
- krew.enable = true;
- kind.enable = true;
+ krew = true;
+ kind = true;
+ nr = true;
};
programs = {
google-chrome.enable = true;
diff --git a/modules/profiles/kubernetes.nix b/modules/profiles/kubernetes.nix
@@ -13,12 +13,9 @@ in
description = "Enable containers profile alongside";
type = types.bool;
};
- krew = {
- enable = mkEnableOption "Enable krew";
- };
- kind = {
- enable = mkEnableOption "Enable kind";
- };
+ nr = mkEnableOption "Enable nr aliasing";
+ krew = mkEnableOption "Enable krew";
+ kind = mkEnableOption "Enable kind";
minikube = {
enable = mkEnableOption "Enable minikube";
package = mkOption {
@@ -41,14 +38,16 @@ in
kubectx
nur.repos.vdemeester.ko
];
+ }
+ (mkIf cfg.nr {
xdg.configFile."nr/kubernetes" = {
text = builtins.toJSON [
{cmd = "kubectl";} {cmd = "oc"; pkg = "openshift"; }
];
onChange = "${pkgs.nur.repos.vdemeester.nr}/bin/nr -f kubernetes";
};
- }
- (mkIf cfg.krew.enable {
+ })
+ (mkIf cfg.krew {
home.packages = with pkgs; [ nur.repos.vdemeester.krew ];
})
(mkIf config.profiles.zsh.enable {
@@ -60,7 +59,7 @@ in
docker-machine-kvm2
];
})
- (mkIf cfg.kind.enable {
+ (mkIf cfg.kind {
home.packages = with pkgs; [
kind
];