Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
f2c2be56b7 |
4 changed files with 13 additions and 44 deletions
|
@ -11,10 +11,10 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
|
|
|
@ -10,11 +10,9 @@ jobs:
|
|||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: apt-get update && apt-get install -y sudo
|
||||
- run: mkdir /var/empty && chown root:root /var/empty && chmod 555 /var/empty
|
||||
- uses: cachix/install-nix-action@v25
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v22
|
||||
with:
|
||||
github_access_token: ${{ secrets.GH_TOKEN }}
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: nix build
|
||||
- run: nix flake check
|
||||
|
|
42
flake.nix
42
flake.nix
|
@ -9,8 +9,9 @@
|
|||
};
|
||||
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} ({withSystem, ...}: {
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
imports = [
|
||||
inputs.flake-parts.flakeModules.easyOverlay
|
||||
inputs.treefmt-nix.flakeModule
|
||||
];
|
||||
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
||||
|
@ -33,7 +34,7 @@
|
|||
|
||||
packages.default = pkgs.buildGoApplication {
|
||||
pname = "sealme";
|
||||
version = "0.2.0";
|
||||
version = "0.1";
|
||||
pwd = ./.;
|
||||
src = ./.;
|
||||
modules = ./gomod2nix.toml;
|
||||
|
@ -41,30 +42,6 @@
|
|||
|
||||
packages.sealme = config.packages.default;
|
||||
|
||||
packages.ksecret = let
|
||||
build-inputs = with pkgs; [kubectl yq-go];
|
||||
script = (pkgs.writeScriptBin "ksecret" (builtins.readFile ./scripts/ksecret.sh)).overrideAttrs (old: {
|
||||
buildComamnd = "${old.buildCommand}\n patchShebangs $out";
|
||||
});
|
||||
completion-zsh =
|
||||
pkgs.writeTextDir "share/zsh/site-functions/_ksecret"
|
||||
''
|
||||
compdef _ksecret ksecret
|
||||
_ksecret() {
|
||||
service=kubectl
|
||||
CURRENT+=2
|
||||
words="kubectl get secrets ''${words[@]:1}"
|
||||
_kubectl
|
||||
}
|
||||
'';
|
||||
in
|
||||
pkgs.symlinkJoin {
|
||||
name = "ksecret";
|
||||
paths = [script completion-zsh];
|
||||
buildInputs = [pkgs.makeWrapper];
|
||||
postBuild = "wrapProgram $out/bin/ksecret --prefix PATH : ${pkgs.lib.makeBinPath build-inputs}";
|
||||
};
|
||||
|
||||
treefmt = {
|
||||
projectRootFile = ".git/config";
|
||||
programs = {
|
||||
|
@ -81,16 +58,13 @@
|
|||
gomod2nix
|
||||
];
|
||||
};
|
||||
|
||||
overlayAttrs = {
|
||||
inherit (config.packages) sealme;
|
||||
};
|
||||
};
|
||||
|
||||
flake = {
|
||||
overlays.default = final: prev:
|
||||
withSystem prev.stdenv.hostPlatform.system (
|
||||
{config, ...}: {
|
||||
sealme = config.packages.sealme;
|
||||
ksecret = config.packages.ksecret;
|
||||
}
|
||||
);
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
kubectl get secrets $@ -o yaml | yq '.stringData = .data | del(.data) | .stringData.* |= @base64d'
|
Loading…
Add table
Reference in a new issue