-
Notifications
You must be signed in to change notification settings - Fork 93
Update docs and flake #289
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4b022f7
refactor: change docs file structure, add toc
deemp b65290b
refactor: use lib.fileset in docs derivation
deemp 80146ba
refactor: benchmark readme
deemp f181557
refactor: use flake-utils, add scripts
deemp 4e0d92b
chore: format nix files
deemp c965db1
refactor: rm old script
deemp 69486a2
fix: print general commands in brackets
deemp 72388c1
refactor: readme
deemp 4713c86
upd: theme
deemp bd708b4
fix: point the nixpkgs input to nixpkgs-unstable
deemp b0cd1dd
fix: suggested command to update flake inputs
deemp 8743a09
fix: text and TOC centering
deemp 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,48 +1,76 @@ | ||
| { | ||
| description = "devshell"; | ||
| # To update all inputs: | ||
| # $ nix flake update --recreate-lock-file | ||
| inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
| inputs.systems.url = "github:nix-systems/default"; | ||
|
|
||
| outputs = { self, nixpkgs, systems }: | ||
| let | ||
| eachSystem = nixpkgs.lib.genAttrs (import systems); | ||
| in | ||
| { | ||
| legacyPackages = eachSystem (system: | ||
| import self { | ||
| inherit system; | ||
| inputs = null; | ||
| nixpkgs = nixpkgs.legacyPackages.${system}; | ||
| } | ||
| ); | ||
|
|
||
| templates = rec { | ||
| toml = { | ||
| path = ./templates/toml; | ||
| description = "nix flake new my-project -t github:numtide/devshell"; | ||
| }; | ||
| flake-parts = { | ||
| path = ./templates/flake-parts; | ||
| description = "nix flake new my-project -t github:numtide/devshell#flake-parts"; | ||
| # nix flake update --recreate-lock-file | ||
| inputs.nixpkgs.url = "github:NixOS/nixpkgs/efc960b6d6a6498c23868f4ba59fcb8bb51c9861"; | ||
| inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
|
||
| outputs = inputs: inputs.flake-utils.lib.eachDefaultSystem | ||
| (system: | ||
| let | ||
| pkgs = inputs.nixpkgs.legacyPackages.${system}; | ||
| devshell = import ./. { nixpkgs = pkgs; }; | ||
| in | ||
| rec { | ||
| packages = { | ||
| docs = pkgs.writeShellApplication { | ||
| name = "docs"; | ||
| meta.description = ''Run mdBook server at http://localhost:3000''; | ||
| runtimeInputs = [ pkgs.mdbook ]; | ||
| text = '' | ||
| cd docs | ||
| cp ${devshell.modules-docs.markdown} src/modules_schema.md | ||
| mdbook serve | ||
| ''; | ||
| }; | ||
| bench = pkgs.writeShellApplication { | ||
| name = "benchmark"; | ||
| meta.description = ''Run benchmark''; | ||
| runtimeInputs = [ pkgs.hyperfine ]; | ||
| text = '' | ||
| cd benchmark | ||
| hyperfine -w 3 \ | ||
| 'nix-instantiate ../shell.nix' \ | ||
| 'nix-instantiate ./devshell-nix.nix' \ | ||
| 'nix-instantiate ./devshell-toml.nix' \ | ||
| 'nix-instantiate ./nixpkgs-mkshell.nix' | ||
| ''; | ||
| }; | ||
| }; | ||
| default = toml; | ||
| }; | ||
|
|
||
| devShells = eachSystem (system: { | ||
| default = self.legacyPackages.${system}.fromTOML ./devshell.toml; | ||
| }); | ||
| devShells.default = devshell.fromTOML ./devshell.toml; | ||
|
|
||
| apps.default = devShells.default.flakeApp; | ||
|
|
||
| apps = eachSystem (system: { | ||
| default = self.devShells.${system}.default.flakeApp; | ||
| }); | ||
| checks = | ||
| with pkgs.lib; | ||
| pipe (import ./tests { inherit pkgs; }) [ | ||
| (collect isDerivation) | ||
| (map (x: { name = x.name or x.pname; value = x; })) | ||
| listToAttrs | ||
| ]; | ||
|
|
||
| # Import this overlay into your instance of nixpkgs | ||
| overlays.default = import ./overlay.nix; | ||
| lib = { | ||
| importTOML = import ./nix/importTOML.nix; | ||
| formatter = pkgs.nixpkgs-fmt; | ||
| } | ||
| ) // { | ||
| # Import this overlay into your instance of nixpkgs | ||
| overlays.default = import ./overlay.nix; | ||
|
|
||
| templates = rec { | ||
| toml = { | ||
| path = ./templates/toml; | ||
| description = "nix flake new my-project -t github:numtide/devshell"; | ||
| }; | ||
| flake-parts = { | ||
| path = ./templates/flake-parts; | ||
| description = "nix flake new my-project -t github:numtide/devshell#flake-parts"; | ||
| }; | ||
| flakeModule = ./flake-module.nix; | ||
| default = toml; | ||
| }; | ||
|
|
||
| lib.importTOML = import ./nix/importTOML.nix; | ||
|
|
||
| flakeModule = ./flake-module.nix; | ||
| } | ||
| ; | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you point to a channel instead, to make it easier to bump nixpkgs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in bd708b4