2024-03-06 10:23:25 +00:00
|
|
|
{
|
|
|
|
|
outputs = {
|
|
|
|
|
self,
|
2024-11-24 17:20:35 +01:00
|
|
|
nixpkgs,
|
2024-03-06 10:23:25 +00:00
|
|
|
flake-parts,
|
|
|
|
|
systems,
|
|
|
|
|
...
|
2024-11-24 17:20:35 +01:00
|
|
|
} @ inputs: let
|
|
|
|
|
nixlet-lib = import ./lib {
|
|
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
|
inherit (inputs) kubenix;
|
|
|
|
|
};
|
|
|
|
|
in
|
2024-03-06 10:23:25 +00:00
|
|
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
|
|
|
|
imports = [
|
|
|
|
|
inputs.devenv.flakeModule
|
2024-03-09 15:32:47 +01:00
|
|
|
inputs.nix-gitlab-ci.flakeModule
|
2024-11-24 17:20:35 +01:00
|
|
|
inputs.treefmt-nix.flakeModule
|
2024-03-06 10:23:25 +00:00
|
|
|
];
|
|
|
|
|
systems = import systems;
|
2024-05-08 17:09:17 +00:00
|
|
|
flake = {
|
2024-11-24 17:24:35 +01:00
|
|
|
nixlets = import ./nixlets {inherit nixlet-lib;};
|
2024-03-06 10:23:25 +00:00
|
|
|
};
|
|
|
|
|
perSystem = {
|
2024-05-08 17:09:17 +00:00
|
|
|
lib,
|
2024-03-06 10:23:25 +00:00
|
|
|
pkgs,
|
2024-11-24 17:20:35 +01:00
|
|
|
config,
|
2024-03-06 10:23:25 +00:00
|
|
|
system,
|
|
|
|
|
...
|
|
|
|
|
}: {
|
2024-03-09 15:32:47 +01:00
|
|
|
imports = [
|
|
|
|
|
./ci.nix
|
|
|
|
|
];
|
2024-11-24 17:20:35 +01:00
|
|
|
treefmt = {
|
|
|
|
|
projectRootFile = "flake.nix";
|
|
|
|
|
programs = {
|
|
|
|
|
alejandra.enable = true;
|
|
|
|
|
mdformat.enable = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-03-06 10:23:25 +00:00
|
|
|
devenv.shells.default = {
|
2024-11-24 17:20:35 +01:00
|
|
|
containers = lib.mkForce {};
|
2024-03-06 10:23:25 +00:00
|
|
|
packages = with pkgs; [
|
|
|
|
|
kube-linter
|
|
|
|
|
];
|
|
|
|
|
|
2024-11-24 17:20:35 +01:00
|
|
|
pre-commit.hooks.treefmt = {
|
|
|
|
|
enable = true;
|
|
|
|
|
packageOverrides.treefmt = config.treefmt.build.wrapper;
|
2024-03-06 10:23:25 +00:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# check if every nixlet successfully renders with default values
|
|
|
|
|
checks =
|
|
|
|
|
builtins.mapAttrs (
|
2024-05-08 17:09:17 +00:00
|
|
|
_: nixlet:
|
|
|
|
|
nixlet.render {
|
|
|
|
|
inherit system;
|
2024-03-06 10:23:25 +00:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
self.nixlets;
|
|
|
|
|
|
|
|
|
|
# allow directly building every nixlet with default values
|
|
|
|
|
packages =
|
|
|
|
|
builtins.mapAttrs (
|
2024-05-08 17:09:17 +00:00
|
|
|
_: nixlet:
|
|
|
|
|
nixlet.render {
|
|
|
|
|
inherit system;
|
2024-03-06 10:23:25 +00:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
self.nixlets;
|
2024-05-08 17:09:17 +00:00
|
|
|
|
|
|
|
|
apps.upload = {
|
|
|
|
|
type = "app";
|
|
|
|
|
program = pkgs.callPackage nixlet-lib.uploadNixletsToGitlab {
|
|
|
|
|
projectId = "55602785";
|
|
|
|
|
nixlets = lib.attrValues self.nixlets;
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-03-06 10:23:25 +00:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
|
|
|
|
|
|
# flake & devenv related
|
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
|
systems.url = "github:nix-systems/default-linux";
|
|
|
|
|
devenv = {
|
|
|
|
|
url = "github:cachix/devenv";
|
2024-11-24 17:20:35 +01:00
|
|
|
inputs.git-hooks.follows = "git-hooks";
|
2024-03-06 10:23:25 +00:00
|
|
|
};
|
2024-11-24 17:20:35 +01:00
|
|
|
git-hooks.url = "github:cachix/git-hooks.nix";
|
|
|
|
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
|
|
|
nix-gitlab-ci.url = "gitlab:TECHNOFAB/nix-gitlab-ci?dir=lib";
|
2024-03-06 10:23:25 +00:00
|
|
|
|
|
|
|
|
kubenix = {
|
2024-03-20 15:48:21 +01:00
|
|
|
url = "github:TECHNOFAB11/kubenix";
|
2024-03-06 10:23:25 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
2024-11-24 17:20:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nixConfig = {
|
|
|
|
|
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
|
|
|
|
|
extra-substituters = "https://devenv.cachix.org";
|
2024-03-06 10:23:25 +00:00
|
|
|
};
|
|
|
|
|
}
|