Skip to content

Commit

Permalink
Fix flake packages
Browse files Browse the repository at this point in the history
`nix flake show` should now work.
  • Loading branch information
DanNixon committed Oct 2, 2023
1 parent 2ec1a0f commit 49a5ff5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ jobs:
- uses: cachix/install-nix-action@v20

- name: Build
run: nix build -L .#${{ matrix.package }}.package
run: nix build -L .#${{ matrix.package }}

- name: Build and push container image
if: ${{ github.ref_name == 'main' || github.ref_type == 'tag' }}
run: |
set -x
local_cr="docker-archive://$(nix build .#${{ matrix.package }}.container-image --no-link --print-out-paths)"
local_cr="docker-archive://$(nix build .#${{ matrix.package }}-container-image --no-link --print-out-paths)"
remote_cr="docker://ghcr.io/dannixon/${{ matrix.package }}"
skopeo copy --dest-creds="dannixon:${{ github.token }}" "$local_cr" "$remote_cr:${{ github.ref_name }}"
Expand Down
6 changes: 3 additions & 3 deletions agent/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
buildInputs,
nativeBuildInputs,
} : rec {
package = naersk'.buildPackage {
satori-agent = naersk'.buildPackage {
name = "satori-agent";
version = version;

Expand All @@ -25,13 +25,13 @@
};
};

container-image = let
satori-agent-container-image = let
entrypoint = pkgs.writeShellApplication {
name = "entrypoint";
text = ''
#!${pkgs.runtimeShell}
mkdir -m 1777 /tmp
${package}/bin/satori-agent "$@"
${satori-agent}/bin/satori-agent "$@"
'';
};
in
Expand Down
6 changes: 3 additions & 3 deletions archiver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
buildInputs,
nativeBuildInputs,
} : rec {
package = naersk'.buildPackage {
satori-archiver = naersk'.buildPackage {
name = "satori-archiver";
version = version;

Expand All @@ -21,7 +21,7 @@
};
};

container-image = pkgs.dockerTools.buildImage {
satori-archiver-container-image = pkgs.dockerTools.buildImage {
name = "satori-archiver";
tag = "latest";
created = "now";
Expand All @@ -33,7 +33,7 @@
};

config = {
Entrypoint = [ "${pkgs.tini}/bin/tini" "--" "${package}/bin/satori-archiver" ];
Entrypoint = [ "${pkgs.tini}/bin/tini" "--" "${satori-archiver}/bin/satori-archiver" ];
ExposedPorts = {
"9090/tcp" = {};
};
Expand Down
6 changes: 3 additions & 3 deletions ctl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
buildInputs,
nativeBuildInputs,
} : rec {
package = naersk'.buildPackage {
satorictl = naersk'.buildPackage {
name = "satorictl";
version = version;

Expand All @@ -21,7 +21,7 @@
};
};

container-image = pkgs.dockerTools.buildImage {
satorictl-container-image = pkgs.dockerTools.buildImage {
name = "satorictl";
tag = "latest";
created = "now";
Expand All @@ -33,7 +33,7 @@
};

config = {
Entrypoint = [ "${pkgs.tini}/bin/tini" "--" "${package}/bin/satorictl" ];
Entrypoint = [ "${pkgs.tini}/bin/tini" "--" "${satorictl}/bin/satorictl" ];
Env = [
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
Expand Down
6 changes: 3 additions & 3 deletions event-processor/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
buildInputs,
nativeBuildInputs,
} : rec {
package = naersk'.buildPackage {
satori-event-processor = naersk'.buildPackage {
name = "satori-event-processor";
version = version;

Expand All @@ -21,7 +21,7 @@
};
};

container-image = pkgs.dockerTools.buildImage {
satori-event-processor-container-image = pkgs.dockerTools.buildImage {
name = "satori-event-processor";
tag = "latest";
created = "now";
Expand All @@ -33,7 +33,7 @@
};

config = {
Entrypoint = [ "${pkgs.tini}/bin/tini" "--" "${package}/bin/satori-event-processor" ];
Entrypoint = [ "${pkgs.tini}/bin/tini" "--" "${satori-event-processor}/bin/satori-event-processor" ];
ExposedPorts = {
"9090/tcp" = {};
};
Expand Down
11 changes: 5 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@
};

packages = {
satori-agent = import ./agent { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
satori-archiver = import ./archiver { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
satorictl = import ./ctl { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
satori-event-processor = import ./event-processor { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };

fmt = naersk'.buildPackage {
src = ./.;
nativeBuildInputs = nativeBuildInputs;
Expand All @@ -78,7 +73,11 @@
AWS_ACCESS_KEY_ID = "minioadmin";
AWS_SECRET_ACCESS_KEY = "minioadmin";
};
};
} //
import ./agent { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; } //
import ./archiver { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; } //
import ./ctl { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; } //
import ./event-processor { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
}
);
}

0 comments on commit 49a5ff5

Please sign in to comment.