krewfile icon indicating copy to clipboard operation
krewfile copied to clipboard

NixOS / Home-manager module

Open stv0g opened this issue 2 years ago • 2 comments

I think it would be pretty neat if the flake could also provide a NixOS module for declaring krew plugins in your NixOS config

stv0g avatar Dec 02 '23 01:12 stv0g

Hi there, I'm not too familiar with writing a homemanager/nixos module but I usually do the following, after adding krewfile to the pkgs overlay for the homemanager:

{
  pkgs,
  lib,
  ...
}: let
  krewfile = pkgs.writeText "krewfile" ''
    modify-secret
    neat
    oidc-login
    pv-migrate
    stern
    explore
    get-all
    node-shell
    krew
  '';
in {
  home.activation.krew = lib.hm.dag.entryAfter ["writeBoundary"] ''
    $DRY_RUN_CMD ${pkgs.krewfile}/bin/krewfile -command ${pkgs.krew}/bin/krew -file ${krewfile}
  '';
}

Does that fit you?

brumhard avatar Dec 04 '23 07:12 brumhard

Yes thats a good starting point for a module :)

stv0g avatar Dec 08 '23 09:12 stv0g

Also thought this would be neat to configure it directly home-manager via module. Therefore, started to add a basic module: #5

RAPSNX avatar Jun 05 '24 17:06 RAPSNX

Released with https://github.com/brumhard/krewfile/releases/tag/v0.5.0

brumhard avatar Jun 10 '24 06:06 brumhard