Skip to content

Commit

Permalink
expose flakeModule
Browse files Browse the repository at this point in the history
  • Loading branch information
jashan-lco committed Dec 12, 2023
1 parent 8010434 commit b3a98f2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 45 deletions.
36 changes: 36 additions & 0 deletions flake-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
localFlake:
{ inputs, ... }:
{
imports = [
inputs.devenv.flakeModule
];

perSystem = { inputs', pkgs, ... }: {
packages.kpt = inputs'.kpt.packages.default;
packages.octopilot = inputs'.octopilot.packages.default;

devenv.shells.default = {
name = "devenv-k8s";

imports = [
./skaffold-builder.nix
./cd.nix
];

# https://devenv.sh/packages/
packages = [
pkgs.git
pkgs.kubectl
pkgs.kind
pkgs.skaffold
pkgs.kubeseal
pkgs.kubernetes-helm
pkgs.kustomize
pkgs.jq

inputs'.kpt.packages.default
inputs'.octopilot.packages.default
];
};
};
}
56 changes: 11 additions & 45 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,54 +33,20 @@
};

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

flake-parts.lib.mkFlake { inherit inputs; } ({ withSystem, flake-parts-lib, ...}:
let
inherit (flake-parts-lib) importApply;
flakeModules.default = importApply ./flake-module.nix { inherit withSystem; };
in
{
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];

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

packages.kpt = inputs'.kpt.packages.default;
packages.octopilot = inputs'.octopilot.packages.default;

devenv.shells.default = {
name = "devenv-k8s";

imports = [
./skaffold-builder.nix
./cd.nix
];

# https://devenv.sh/packages/
packages = [
pkgs.git
pkgs.kubectl
pkgs.kind
pkgs.skaffold
pkgs.kubeseal
pkgs.kubernetes-helm
pkgs.kustomize
pkgs.jq

inputs'.kpt.packages.default
inputs'.octopilot.packages.default
];

# See full reference at https://devenv.sh/reference/options/

};
imports = [
flakeModules.default
];

};
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.

inherit flakeModules;
};
};
});
}

0 comments on commit b3a98f2

Please sign in to comment.