57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
{
|
|
description = "A collection of templates for various programming languages";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
treefmt-nix = {
|
|
url = "github:numtide/treefmt-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
crane.url = "github:ipetkov/crane";
|
|
|
|
cadquery = {
|
|
url = "github:vinszent/cq-flake";
|
|
# unfortunately dependencies are out of date so this needs it's own nixpkgs
|
|
# inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
flake-parts,
|
|
...
|
|
} @ inputs:
|
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
|
imports = [
|
|
./cad
|
|
./rust
|
|
|
|
flake-parts.flakeModules.flakeModules
|
|
# define the flake.templates option
|
|
({lib, ...}: {
|
|
options.flake.templates = lib.mkOption {
|
|
type = lib.types.lazyAttrsOf (lib.types.submodule {
|
|
options = {
|
|
path = lib.mkOption {type = lib.types.path;};
|
|
description = lib.mkOption {type = lib.types.str;};
|
|
};
|
|
});
|
|
default = {};
|
|
};
|
|
})
|
|
];
|
|
|
|
flake.flakeModule = {
|
|
imports = builtins.attrValues (builtins.removeAttrs self.flakeModules ["default"]);
|
|
};
|
|
|
|
systems = ["aarch64-linux" "x86_64-linux" "aarch64-darwin"];
|
|
|
|
perSystem = {pkgs, ...}: {formatter = pkgs.alejandra;};
|
|
};
|
|
}
|