From 8af6904499991bbdfd55d1cfb0003addedd553a7 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Sun, 8 Sep 2024 18:20:14 -0500 Subject: [PATCH] add krewfile to manage krew and its plugins --- flake.lock | 62 ++++++++++++++++++++++++++++++++-- flake.nix | 9 ++++- nixos/home/jahanson/global.nix | 14 +++++++- 3 files changed, 80 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 6107f58..b29764a 100644 --- a/flake.lock +++ b/flake.lock @@ -153,6 +153,24 @@ "inputs": { "systems": "systems_4" }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_5" + }, "locked": { "lastModified": 1681202837, "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", @@ -238,6 +256,28 @@ "type": "github" } }, + "krewfile": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1725822077, + "narHash": "sha256-N+1mHVZoFwiuDUBqhWVWSINmAGpKTdH9jYPIkXNcqj4=", + "owner": "ajgon", + "repo": "krewfile", + "rev": "d4db6ad2cc1c23513d691f63ac4aae6d8c9b1b8b", + "type": "github" + }, + "original": { + "owner": "ajgon", + "ref": "feat/fix-deps", + "repo": "krewfile", + "type": "github" + } + }, "lix": { "flake": false, "locked": { @@ -254,7 +294,7 @@ }, "lix-module": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "flakey-profile": "flakey-profile", "lix": "lix", "nixpkgs": [ @@ -361,7 +401,7 @@ "nix-vscode-extensions": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixpkgs" ] @@ -645,6 +685,7 @@ "ghostty": "ghostty", "home-manager": "home-manager", "impermanence": "impermanence", + "krewfile": "krewfile", "lix-module": "lix-module", "nix-index-database": "nix-index-database", "nix-inspect": "nix-inspect", @@ -780,6 +821,21 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "talhelper": { "inputs": { "flake-parts": "flake-parts", @@ -825,7 +881,7 @@ }, "vscode-server": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_2" }, "locked": { diff --git a/flake.nix b/flake.nix index a6b1177..d31f0c4 100644 --- a/flake.nix +++ b/flake.nix @@ -85,10 +85,17 @@ }; vscode-server.url = "github:nix-community/nixos-vscode-server"; + + # krewfile - Declarative krew plugin management + krewfile = { + url = "github:ajgon/krewfile?ref=feat/fix-deps"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; outputs = - { self, nixpkgs, sops-nix, home-manager, nix-vscode-extensions, impermanence, disko, talhelper, lix-module, ghostty, vscode-server, ... } @ inputs: + { self, nixpkgs, sops-nix, home-manager, nix-vscode-extensions, impermanence, disko, talhelper, lix-module, ghostty, vscode-server, krewfile, ... } @ inputs: let forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" diff --git a/nixos/home/jahanson/global.nix b/nixos/home/jahanson/global.nix index 9df60dd..030a9ed 100644 --- a/nixos/home/jahanson/global.nix +++ b/nixos/home/jahanson/global.nix @@ -1,8 +1,9 @@ -{ pkgs, config, ... }: +{ pkgs, config, inputs, ... }: with config; { imports = [ ../modules + inputs.krewfile.homeManagerModules.krewfile ]; config = { @@ -20,7 +21,17 @@ with config; EDITOR = "vim"; }; + programs.krewfile = { + enable = true; + krewPackage = pkgs.krew; + plugins = [ + "resource-capacity" + "rook-ceph" + ]; + }; + home = { + # Install these packages for my user packages = with pkgs; [ # misc @@ -92,6 +103,7 @@ with config; # nix tools nvd + # charmbracelet tools gum ];