Skip to content

Commit

Permalink
make the template nixago-able
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Jun 30, 2023
1 parent 12d2d3c commit 59378e2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/local/flake.lock

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

8 changes: 7 additions & 1 deletion src/std/templates/microservice-aws-github/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
(runnables "operables")
(containers "oci-images" {ci.publish = true;})
(kubectl "deployments" {ci.apply = true;})
# For rendering the Github Action CI/CD
(nixago "action")
];
};

Expand All @@ -20,7 +22,11 @@
std.url = "github:divnix/std";
std.inputs.nixpkgs.follows = "nixpkgs";
std.inputs.n2c.follows = "n2c";
std.inputs.nixago.follows = "nixago";
n2c.url = "github:nlewo/nix2container";
n2c.inputs.nixpkgs.follows = "std/nixpkgs";
n2c.inputs.nixpkgs.follows = "nixpkgs";
nixago.url = "github:nix-community/nixago";
nixago.inputs.nixpkgs.follows = "nixpkgs";
nixago.inputs.nixago-exts.follows = "";
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ let
inherit (inputs.nixpkgs) lib;
inherit (inputs.std.lib) dev;

renderFile = (import ./action/template.nix) lib args;
template = (import ./action/template.nix) lib;
in {
inherit template;
ci = dev.mkNixago {
output = ".github/workflows/ci-cd.yaml";
data = renderFile {
format = "yaml";
hook.mode = "copy";
data = template {
default_branch = "main";
platform = "aws"; # gc, azure, digitalocean
# set up with nixbuild.net to speed up builds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ lib: {
steps =
[]
# account is part of ecr url, thus part of `hits` output and needs to pass so we can't mask it
++ lib.optionals (platform == "aws") [lib.recursiveUpdate aws.credentials {mask-aws-account-id = false;}]
++ lib.optionals (platform == "aws") [(lib.recursiveUpdate aws.credentials {mask-aws-account-id = false;})]
++ lib.optionals (platform == "aws") [aws.ecr]
++ lib.optionals (!withPersistentDiscovery) [installNixAction]
++ lib.optionals withNixbuild [useNixbuildAction]
Expand Down
6 changes: 3 additions & 3 deletions src/tests/flake.lock

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

0 comments on commit 59378e2

Please sign in to comment.