@@ -33,26 +33,89 @@ Key difference from Skaffold: Steiger works directly with OCI image layouts, ski
3333
3434Supports [ Ko] ( https://ko.build/ ) for building Go applications into container images without Dockerfiles.
3535
36+ ### Nix
37+ Integrates with [ Nix] ( https://nixos.org/ ) flake outputs that produce OCI images.
38+
39+ Requirements
40+
41+ - Flakes enabled (` --extra-experimental-features 'nix-command flakes' ` )
42+ - ` pkgs.ociTools.buildImage ` (available via Steiger overlay or [ nixpkgs #390624 ] ( https://github.com/NixOS/nixpkgs/pull/390624 ) )
43+
44+ <details >
45+ <summary >Example flake</summary >
46+
47+ ``` nix
48+ {
49+ inputs = {
50+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
51+ steiger.url = "github:brainhivenl/steiger";
52+ };
53+
54+ outputs = {
55+ nixpkgs,
56+ steiger,
57+ ...
58+ }: let
59+ system = "x86_64-linux";
60+ overlays = [steiger.overlays.ociTools];
61+ pkgs = import nixpkgs { inherit system overlays; };
62+ in {
63+ packages.${system} = {
64+ default = pkgs.ociTools.buildImage {
65+ name = "hello";
66+
67+ copyToRoot = pkgs.buildEnv {
68+ name = "hello-env";
69+ paths = [pkgs.hello];
70+ pathsToLink = ["/bin"];
71+ };
72+
73+ config.Cmd = ["/bin/hello"];
74+ compressor = "none";
75+ };
76+ };
77+
78+ devShells.${system} = {
79+ default = pkgs.mkShell {
80+ packages = [steiger.packages.${system}.default];
81+ };
82+ };
83+ };
84+ }
85+ ```
86+ </details >
87+
3688## Build Caching
3789
3890Steiger delegates caching to the underlying build systems rather than implementing its own cache layer:
3991
4092- ** Docker BuildKit** : Leverages BuildKit's native layer caching and build cache
4193- ** Bazel** : Uses Bazel's extensive caching system (action cache, remote cache, etc.)
4294- ** Ko** : Benefits from Go's build cache and Ko's layer caching
95+ - ** Nix** : Utilizes Nix's content-addressed store and binary cache system for reproducible, cached builds
4396
4497This approach avoids cache invalidation issues and performs comparably to Skaffold in cached scenarios, with better performance in some cases.
4598
4699## Installation
47100
101+ ### Using cargo
102+
48103``` bash
49104cargo install steiger --git https://github.com/brainhivenl/steiger.git
50105```
51106
52- Or build from source:
107+ ### Using nix
108+
109+ Run directly without installation:
110+
111+ ``` bash
112+ nix run github:brainhivenl/steiger -- build
113+ ```
114+
115+ ### Build from source
53116
54117``` bash
55- git clone https://github.com/yourusername /steiger
118+ git clone https://github.com/brainhivenl /steiger
56119cd steiger
57120cargo build --release
58121```
@@ -83,6 +146,13 @@ services:
83146 type : ko
84147 importPath : ./cmd/service
85148
149+ flake :
150+ build :
151+ type : nix
152+ systems : ["x86_64-linux"]
153+ packages :
154+ api : default # attribute path to package e.g. `outputs.packages.<system>.default`
155+
86156profiles :
87157 prod :
88158 env : prod
0 commit comments