Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
326 changes: 166 additions & 160 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,165 +1,171 @@
{
description = "A collection of flake templates";

outputs = { self }: {

templates = {

trivial = {
path = ./trivial;
description = "A very basic flake";
};

simpleContainer = {
path = ./simple-container;
description = "A NixOS container running apache-httpd";
};

python = {
path = ./python;
description = "Python template, using poetry2nix";
welcomeText = ''
# Getting started
- Run `nix develop`
- Run `poetry run python -m sample_package`
'';
};

rust = {
path = ./rust;
description = "Rust template, using Naersk";
};

bash-hello = {
path = ./bash-hello;
description = "An over-engineered Hello World in bash";
};

c-hello = {
path = ./c-hello;
description = "An over-engineered Hello World in C";
};

ruby = {
path = ./ruby;
description = "Flake for building ruby gems" ;
welcomeText = ''
# Simple Ruby Gem Template
## Intended usage
The intended usage of this flake is to facilitate building ruby gems

## More info
- [Ruby language](https://www.ruby-lang.org/)
- [Ruby in the NixOS manual](https://nixos.org/manual/nixpkgs/stable/#sec-language-ruby)
'';
};

rust-web-server = {
path = ./rust-web-server;
description = "A Rust web server including a NixOS module";
};

compat = {
path = ./compat;
description = "A default.nix and shell.nix for backward compatibility with Nix installations that don't support flakes";
};

haskell-hello = {
path = ./haskell-hello;
description = "A Hello World in Haskell with one dependency";
};

hercules-ci = {
path = ./hercules-ci;
description = "An example for Hercules-CI, containing only the necessary attributes for adding to your project.";
};

full = {
path = ./full;
description = "A template that shows all standard flake outputs";
welcomeText = ''
You just created a template that will show you all standard flake outputs.

Read more about it here:

https://github.com/NixOS/templates/tree/master/full
'';
};

pandoc-xelatex = {
path = ./pandoc-xelatex;
description = "A report built with Pandoc, XeLaTex and a custom font";
};

latexmk = {
path = ./latexmk;
description = "A simple LaTeX template for writing documents with latexmk";
};

go-hello = {
path = ./go-hello;
description = "A simple Go package";
};

empty = {
path = ./empty;
description = "A flake with no outputs";
};

haskell-nix = {
path = ./haskell.nix;
description = "An haskell.nix template using hix";
welcomeText = ''
You just created an haskell.nix template using hix. Read more about it here:
https://input-output-hk.github.io/haskell.nix/tutorials/getting-started-flakes.html
'';
};

haskell-flake = {
path = ./haskell-flake;
description = "A haskell-flake template";
welcomeText = ''
You just created a haskell-flake template.
See the README or https://github.com/srid/haskell-flake.
'';
};

utils-generic = {
path = ./utils-generic;
description = "Simple, all-rounder template with utils enabled and devShell populated";
};

dotnet = {
path = ./dotnet;
description = "A .NET application and test project";
};

typescript-pnpm = {
path = ./typescript/pnpm;
description = "A template combining a node webserver and a dev environment
for frontend typescript development";
welcomeText = ''
# Getting Started
- run `nix develop` to enter the development environment
- run `pnpm install` to install the packaged
- run `pnpm start` to open a live reloading website
'';
};

typescript-p5js = {
path = ./typescript/pnpm-p5js;
description = "A template combining a node webserver and a dev environment
for frontend typescript development";
welcomeText = ''
# Getting Started
- run `nix develop` to enter the development environment
- run `pnpm install` to install the packaged
- run `pnpm start` to open a live reloading website
'';
};
outputs =
{ self }:
{
templates = {
default = self.templates.multi-system;

multi-system = {
path = ./multi-system;
description = "A multi-system flake";
welcomeText = ''
# Getting started
- Run `nix develop` to enter the default development environment
- Run `nix build` to build the `hello` package from Nixpkgs
'';
};

trivial = {
path = ./trivial;
description = "A very basic flake";
};

simpleContainer = {
path = ./simple-container;
description = "A NixOS container running apache-httpd";
};

python = {
path = ./python;
description = "Python template, using poetry2nix";
welcomeText = ''
# Getting started
- Run `nix develop`
- Run `poetry run python -m sample_package`
'';
};

rust = {
path = ./rust;
description = "Rust template, using Naersk";
};

bash-hello = {
path = ./bash-hello;
description = "An over-engineered Hello World in bash";
};

c-hello = {
path = ./c-hello;
description = "An over-engineered Hello World in C";
};

ruby = {
path = ./ruby;
description = "Flake for building ruby gems";
welcomeText = ''
# Simple Ruby Gem Template
## Intended usage
The intended usage of this flake is to facilitate building ruby gems

## More info
- [Ruby language](https://www.ruby-lang.org/)
- [Ruby in the NixOS manual](https://nixos.org/manual/nixpkgs/stable/#sec-language-ruby)
'';
};

rust-web-server = {
path = ./rust-web-server;
description = "A Rust web server including a NixOS module";
};

compat = {
path = ./compat;
description = "A default.nix and shell.nix for backward compatibility with Nix installations that don't support flakes";
};

haskell-hello = {
path = ./haskell-hello;
description = "A Hello World in Haskell with one dependency";
};

hercules-ci = {
path = ./hercules-ci;
description = "An example for Hercules-CI, containing only the necessary attributes for adding to your project.";
};

full = {
path = ./full;
description = "A template that shows all standard flake outputs";
welcomeText = ''
You just created a template that will show you all standard flake outputs.

Read more about it here:

https://github.com/NixOS/templates/tree/master/full
'';
};

pandoc-xelatex = {
path = ./pandoc-xelatex;
description = "A report built with Pandoc, XeLaTex and a custom font";
};

latexmk = {
path = ./latexmk;
description = "A simple LaTeX template for writing documents with latexmk";
};

go-hello = {
path = ./go-hello;
description = "A simple Go package";
};

empty = {
path = ./empty;
description = "A flake with no outputs";
};

haskell-nix = {
path = ./haskell.nix;
description = "An haskell.nix template using hix";
welcomeText = ''
You just created an haskell.nix template using hix. Read more about it here:
https://input-output-hk.github.io/haskell.nix/tutorials/getting-started-flakes.html
'';
};

haskell-flake = {
path = ./haskell-flake;
description = "A haskell-flake template";
welcomeText = ''
You just created a haskell-flake template.
See the README or https://github.com/srid/haskell-flake.
'';
};

utils-generic = self.templates.multi-system;

dotnet = {
path = ./dotnet;
description = "A .NET application and test project";
};

typescript-pnpm = {
path = ./typescript/pnpm;
description = "A template combining a Node.js webserver and a dev environment for frontend TypeScript development";
welcomeText = ''
# Getting Started
- run `nix develop` to enter the development environment
- run `pnpm install` to install the packaged
- run `pnpm start` to open a live reloading website
'';
};

typescript-p5js = {
path = ./typescript/pnpm-p5js;
description = "A template combining a Node.js webserver and a dev environment for frontend TypeScript development";
welcomeText = ''
# Getting Started
- run `nix develop` to enter the development environment
- run `pnpm install` to install the packaged
- run `pnpm start` to open a live reloading website
'';
};
};

defaultTemplate = self.templates.trivial;
};

defaultTemplate = self.templates.trivial;

};
}
50 changes: 50 additions & 0 deletions multi-system/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
description = "A very basic flake";

inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

outputs =
{ self, nixpkgs }:
let
# Systems supported by this flake
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
# A helper function for specifying per-system outputs
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import nixpkgs { inherit system; };
}
);
in
{
# Development environments
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages = with pkgs; [
# Add development environment packages here
];
};
}
);

# Package outputs
packages = forEachSupportedSystem (
{ pkgs }:
{
# Build this by running `nix build`, `nix build .`, or `nix build .#default`
default = pkgs.hello;
# Build this by running `nix build .#hello`
hello = pkgs.hello;
}
);
};
}
Loading