Skip to content

Commit b3de8a3

Browse files
committed
make the template nixago-able
1 parent 7f36dc6 commit b3de8a3

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/std/templates/microservice-aws-github/flake.nix

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
(runnables "operables")
1212
(containers "oci-images" {ci.publish = true;})
1313
(kubectl "deployments" {ci.apply = true;})
14+
# For rendering the Github Action CI/CD
15+
(nixago "action")
1416
];
1517
};
1618

@@ -20,7 +22,11 @@
2022
std.url = "github:divnix/std";
2123
std.inputs.nixpkgs.follows = "nixpkgs";
2224
std.inputs.n2c.follows = "n2c";
25+
std.inputs.nixago.follows = "nixago";
2326
n2c.url = "github:nlewo/nix2container";
24-
n2c.inputs.nixpkgs.follows = "std/nixpkgs";
27+
n2c.inputs.nixpkgs.follows = "nixpkgs";
28+
nixago.url = "github:nix-community/nixago";
29+
nixago.inputs.nixpkgs.follows = "nixpkgs";
30+
nixago.inputs.nixago-exts.follows = "";
2531
};
2632
}

src/std/templates/microservice-aws-github/ops/github/action.nix

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ let
22
inherit (inputs.nixpkgs) lib;
33
inherit (inputs.std.lib) dev;
44

5-
renderFile = (import ./action/template.nix) lib args;
5+
template = (import ./action/template.nix) lib;
66
in {
7+
inherit template;
78
ci = dev.mkNixago {
89
output = ".github/workflows/ci-cd.yaml";
9-
data = renderFile {
10+
format = "yaml";
11+
hook.mode = "copy";
12+
data = template {
1013
default_branch = "main";
1114
platform = "aws"; # gc, azure, digitalocean
1215
# set up with nixbuild.net to speed up builds

src/std/templates/microservice-aws-github/ops/github/action/template.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lib: {
2525
steps =
2626
[]
2727
# account is part of ecr url, thus part of `hits` output and needs to pass so we can't mask it
28-
++ lib.optionals (platform == "aws") [lib.recursiveUpdate aws.credentials {mask-aws-account-id = false;}]
28+
++ lib.optionals (platform == "aws") [(lib.recursiveUpdate aws.credentials {mask-aws-account-id = false;})]
2929
++ lib.optionals (platform == "aws") [aws.ecr]
3030
++ lib.optionals (!withPersistentDiscovery) [installNixAction]
3131
++ lib.optionals withNixbuild [useNixbuildAction]

0 commit comments

Comments
 (0)