-
-
Notifications
You must be signed in to change notification settings - Fork 96
Make the trivial flake multi system #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lucperkins
wants to merge
3
commits into
NixOS:master
Choose a base branch
from
lucperkins:multi-system-trivial-template
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
|
|
||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; }; | ||
| } | ||
| ); | ||
lucperkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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; | ||
| } | ||
| ); | ||
| }; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.