Skip to content

Commit

Permalink
✨ (flake) Update root flake files
Browse files Browse the repository at this point in the history
  • Loading branch information
Comamoca committed Nov 23, 2024
1 parent ea71b7d commit 645dd21
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 68 deletions.
69 changes: 58 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 38 additions & 44 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,61 +1,55 @@
{
description = "A very basic flake";
description = "A basic flake to with flake-parts";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
treefmt-nix.url = "github:numtide/treefmt-nix";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
};

outputs =
{
inputs@{
self,
systems,
nixpkgs,
treefmt-nix,
flake-parts,
}:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
stdenv = pkgs.stdenv;
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
# Run treefmt. See `./treefmt.nix`.
formatter.x86_64-linux = treefmtEval.config.build.wrapper;
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ treefmt-nix.flakeModule ];
systems = import inputs.systems;

templates = {
flake = {
templates = import ./template.nix;
};

flake-basic = {
path = ./flake-basic;
description = "Nix flake basic template.";
};
perSystem =
{
config,
pkgs,
system,
...
}:
let
stdenv = pkgs.stdenv;
in
{
treefmt = {
projectRootFile = "flake.nix";
programs = {
deno.enable = true;
nixfmt.enable = true;
};

c-cli = {
path = ./c-cli;
description = "Basic C project template.";
};
c-raylib-cmake = {
path = ./c-raylib-cmake;
description = "Raylib project build with cmake.";
};
deno-hono = {
path = ./deno-hono;
description = "Hono project with Deno.";
};
haxe-basic-cpp = {
path = ./haxe-basic-cpp;
description = "Haxe project with cpp target.";
};
honox-minimal = {
path = ./honox-minimal;
description = "Minimal HonoX project.";
};
odin-hello = {
path = ./odin-hello;
description = "Minimal Odin project.";
};
cl-nix = {
path = ./cl-nix;
description = "Common Lisp with Nix";
settings.formatter = { };
};

devShells.default = pkgs.mkShell {
packages = with pkgs; [
nil
];
};
};
};
};
}
36 changes: 36 additions & 0 deletions template.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{

flake-basic = {
path = ./flake-basic;
description = "Nix flake basic template.";
};

c-cli = {
path = ./c-cli;
description = "Basic C project template.";
};
c-raylib-cmake = {
path = ./c-raylib-cmake;
description = "Raylib project build with cmake.";
};
deno-hono = {
path = ./deno-hono;
description = "Hono project with Deno.";
};
haxe-basic-cpp = {
path = ./haxe-basic-cpp;
description = "Haxe project with cpp target.";
};
honox-minimal = {
path = ./honox-minimal;
description = "Minimal HonoX project.";
};
odin-hello = {
path = ./odin-hello;
description = "Minimal Odin project.";
};
cl-nix = {
path = ./cl-nix;
description = "Common Lisp with Nix";
};
}
13 changes: 0 additions & 13 deletions treefmt.nix

This file was deleted.

0 comments on commit 645dd21

Please sign in to comment.