Skip to content

Commit

Permalink
add templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jashan-lco committed Dec 21, 2023
1 parent b03af3f commit c81e884
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
32 changes: 32 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,37 @@
};

};

flake = {
templates = {

app-repo = {
path = ./templates/app-repo;
description = "Application source repo";
welcomeText = ''
Add the following to `.gitignore`:
```sh
echo .devenv >> .gitignore
echo .pre-commit-hook.yaml >> .gitignore
```
'';
};

deploy-repo = {
path = ./templates/deploy-repo;
description = "GitOps deploy repo";
welcomeText = ''
Add the following to `.gitignore`:
```sh
echo .devenv >> .gitignore
echo .pre-commit-hook.yaml >> .gitignore
echo '**/secret*.yaml' >> .gitignore
```
'';
};
};
};
});
}
45 changes: 45 additions & 0 deletions templates/app-repo/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
description = "Description for the project";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv-k8s.url = "github:LCOGT/devenv-k8s";
};

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devenv-k8s.flakeModules.default
];

systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];

perSystem = { config, self', inputs', pkgs, system, ... }: {
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.

# https://devenv.sh/basics/
# Enter using `nix develop --impure`
devenv.shells.default = {
# https://devenv.sh/packages/
packages = [

];

# https://devenv.sh/reference/options/#entershell
enterShell = ''
echo Hello
'';
};
};

flake = {
# The usual flake attributes can be defined here, including system-
# agnostic ones like nixosModule and system-enumerating ones, although
# those are more easily expressed in perSystem.

};
};
}
27 changes: 27 additions & 0 deletions templates/deploy-repo/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
description = "GitOps deploy repo";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv-k8s.url = "github:LCOGT/devenv-k8s";
};

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devenv-k8s.flakeModules.default
];

systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];

perSystem = { lib, config, ... }: {

# Enable these as you see fit
config.devenv.shells.default = {
pre-commit.hooks.kustomize-build-staging.enable = lib.mkForce false;
pre-commit.hooks.kustomize-build-prod.enable = lib.mkForce false;
};
};
};
}

0 comments on commit c81e884

Please sign in to comment.