templates: add flake template for new clans
All checks were successful
build / test (push) Successful in 7s

This commit is contained in:
DavHau 2023-07-21 15:13:26 +02:00
parent d17ae02a43
commit 95b2a0dd5f
7 changed files with 60 additions and 0 deletions

View File

@ -22,6 +22,7 @@
imports = [
./flake-parts/packages.nix
./flake-parts/formatting.nix
./templates/flake-module.nix
./templates/python-project/flake-module.nix
./pkgs/clan-cli/flake-module.nix
];

View File

@ -0,0 +1,12 @@
{ ... }: {
flake.templates = {
new-clan = {
description = "Initialize a new clan flake";
path = ./new-clan;
};
python-project = {
description = "Initialize a new internal python project";
path = ./python-project;
};
};
}

View File

@ -0,0 +1,16 @@
# This file provides backward compatibility to nix < 2.4 clients
let
flake =
import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; };
in
flake.defaultNix

View File

@ -0,0 +1,25 @@
{
description = "";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = inputs @ { flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = builtins.fromJSON (builtins.readFile ./systems.json);
imports =
let
relPaths = builtins.fromJSON (builtins.readFile ./imports.json);
paths = map (path: ./. + path) relPaths;
in
paths;
};
}

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,2 @@
(import ./default.nix).devShells.${builtins.currentSystem}.default
or (throw "dev-shell not defined. Cannot find flake attribute devShell.${builtins.currentSystem}.default")

View File

@ -0,0 +1,3 @@
[
"x86_64-linux"
]