Skip to content

Commit

Permalink
Add section comments to generated nix to indicate which attributes ar…
Browse files Browse the repository at this point in the history
…e "public".
  • Loading branch information
kolloch committed Apr 21, 2019
1 parent 773b943 commit 1293396
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 0.2.0
# 0.2.0 - 0.2.1

* Added comments to the generated nix build file to indicate which attributes are public and unlikely to change.

# 0.1.0 - 0.2.0

## Bugfixes

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

20 changes: 15 additions & 5 deletions Cargo.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Generated by crate2nix 0.2.0 with the command:
# Generated by crate2nix 0.2.1 with the command:
# "generate" "-n" "<nixos-unstable>" "-o" "Cargo.nix"
# See https://github.com/kolloch/crate2nix for more info.

Expand All @@ -11,10 +11,20 @@
fetchurl? pkgs.fetchurl }:

rec {
root_crate = crates."crate2nix 0.2.0 (path+file:///home/peter/gdrive/projects/crate2nix)";
#
# "public" attributes that we attempt to keep stable with new versions of crate2nix.
#
# Use this attribute to refer to the derivation building your root crate.
root_crate = crates."crate2nix 0.2.1 (path+file:///home/peter/gdrive/projects/crate2nix)";
# Refer your crate build derivation by name here.
workspace_members = {
"crate2nix" = crates."crate2nix 0.2.0 (path+file:///home/peter/gdrive/projects/crate2nix)";
"crate2nix" = crates."crate2nix 0.2.1 (path+file:///home/peter/gdrive/projects/crate2nix)";
};

#
# "private" attributes that may change in every new version of crate2nix.
#

crates = {
"aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)"
= buildRustCrate {
Expand Down Expand Up @@ -353,10 +363,10 @@ rec {
"structopt 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)"
];
};
"crate2nix 0.2.0 (path+file:///home/peter/gdrive/projects/crate2nix)"
"crate2nix 0.2.1 (path+file:///home/peter/gdrive/projects/crate2nix)"
= buildRustCrate {
crateName = "crate2nix";
version = "0.2.0";
version = "0.2.1";
edition = "2018";
src = (builtins.filterSource sourceFilter ./.);
libPath = "src/lib.rs";
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crate2nix"
version = "0.2.0"
version = "0.2.1"
authors = ["Peter Kolloch <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
11 changes: 11 additions & 0 deletions templates/build.nix.tera
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,27 @@
fetchurl? pkgs.fetchurl }:

rec {
#
# "public" attributes that we attempt to keep stable with new versions of crate2nix.
#

{%- if root_package_id %}
# Use this attribute to refer to the derivation building your root crate.
root_crate = crates.{{root_package_id}};
{%- endif -%}
{%- if workspace_members %}
# Refer your crate build derivation by name here.
workspace_members = {
{%- for name, pkg_id in workspace_members %}
{{name}} = crates.{{pkg_id}};
{%- endfor %}
};
{%- endif %}

#
# "private" attributes that may change in every new version of crate2nix.
#

crates = {
{%- for crate in crates %}
{{crate.package_id}}
Expand Down

0 comments on commit 1293396

Please sign in to comment.