Skip to content

Commit

Permalink
chore(templates): added flake and flake-with-direnv templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bddvlpr committed Aug 25, 2024
1 parent 1c6ede2 commit a2e0173
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
./overlays/module.nix
./pkgs/module.nix
./systems/module.nix
./templates/module.nix
];

perSystem = {
Expand Down
15 changes: 15 additions & 0 deletions templates/module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
flake.templates = rec {
parts = {
path = ./parts;
description = "Flake-parts based flake with support for darwin and linux";
};

parts-with-direnv = {
path = ./parts-with-direnv;
description = "Flake-parts based flake with support for darwin and linux with direnv config";
};

default = parts;
};
}
1 change: 1 addition & 0 deletions templates/parts-with-direnv/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
24 changes: 24 additions & 0 deletions templates/parts-with-direnv/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = {flake-parts} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];

perSystem = {pkgs, ...}: {
formatter = pkgs.alejandra;

devShells.default =
pkgs.mkShell {
};
};
};
}
20 changes: 20 additions & 0 deletions templates/parts/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = {flake-parts} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];

perSystem = {pkgs, ...}: {
formatter = pkgs.alejandra;
};
};
}

0 comments on commit a2e0173

Please sign in to comment.