Skip to content

Commit

Permalink
Add Nix flake along with usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrenierejm authored and hoto committed Aug 17, 2024
1 parent a52501b commit 19e39dd
Show file tree
Hide file tree
Showing 7 changed files with 391 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

[*.go]
Expand All @@ -21,5 +18,5 @@ indent_size = 2
[*.xml]
indent_size = 2

[Makefile]
[{Makefile,.envrc}]
indent_style = tab
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if command -v nix &>/dev/null; then
use flake
PATH_add "$PWD/result/bin"
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
vendor/
bin/
dist/

/result
/.pre-commit-config.yaml
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ All files are located inside Jenkins home directory:

I've tested this on Jenkins 1.625.1 and 2.141

### Run using a binary
## Usage

### Pre-Built Binary

Mac (Intel CPU only):

Expand Down Expand Up @@ -61,7 +63,7 @@ Or if you have the files locally:
-c credentials.xml \
-o json
### Run using docker
### Docker

If you are worried about the binary sending your credentials over the network (it does not do that)
then run a container with disabled network:
Expand Down Expand Up @@ -97,8 +99,15 @@ With files locally:
-s hudson.util.Secret \
-c credentials.xml \
-o json
### Build the binary yourself

### Nix

Assuming you have enabled [Flakes](https://nixos.wiki/wiki/Flakes) in your Nix configuration, you can use the provided [`flake.nix`](./flake.nix) to build and run this project.

- To build and run the binary without installing it: `nix run github:hoto/jenkins-credentials-decryptor -- --help`
- To install in the current profile: `nix profile install github:hoto/jenkins-credentials-decryptor`

### Build Locally

If you are worried about executing a random binary from the internet then:

Expand Down
245 changes: 245 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 19e39dd

Please sign in to comment.