Move flake template into a separate file

This commit is contained in:
Eelco Dolstra 2019-04-08 23:39:38 +02:00
parent 47727252ff
commit 507da65900
4 changed files with 20 additions and 18 deletions

2
.gitignore vendored
View file

@ -46,7 +46,7 @@ perl/Makefile.config
/src/libexpr/nix.tbl
# /src/libstore/
/src/libstore/*.gen.hh
*.gen.*
/src/nix/nix

View file

@ -0,0 +1,15 @@
{
name = "hello";
description = "A flake for building Hello World";
epoch = 2019;
requires = [ "nixpkgs" ];
provides = deps: rec {
packages.hello = deps.nixpkgs.provides.packages.hello;
};
}

View file

@ -207,23 +207,8 @@ struct CmdFlakeInit : virtual Args, Command
throw Error("file '%s' already exists", flakePath);
writeFile(flakePath,
R"str(
{
name = "hello";
description = "A flake for building Hello World";
epoch = 2019;
requires = [ "nixpkgs" ];
provides = deps: rec {
packages.hello = deps.nixpkgs.provides.packages.hello;
};
}
)str");
#include "flake-template.nix.gen.hh"
);
}
};

View file

@ -23,3 +23,5 @@ $(foreach name, \
nix-build nix-channel nix-collect-garbage nix-copy-closure nix-daemon nix-env nix-hash nix-instantiate nix-prefetch-url nix-shell nix-store, \
$(eval $(call install-symlink, nix, $(bindir)/$(name))))
$(eval $(call install-symlink, $(bindir)/nix, $(libexecdir)/nix/build-remote))
$(d)/flake.cc: $(d)/flake-template.nix.gen.hh