Move flake template into a separate file
This commit is contained in:
parent
47727252ff
commit
507da65900
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -46,7 +46,7 @@ perl/Makefile.config
|
|||
/src/libexpr/nix.tbl
|
||||
|
||||
# /src/libstore/
|
||||
/src/libstore/*.gen.hh
|
||||
*.gen.*
|
||||
|
||||
/src/nix/nix
|
||||
|
||||
|
|
15
src/nix/flake-template.nix
Normal file
15
src/nix/flake-template.nix
Normal 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;
|
||||
|
||||
};
|
||||
}
|
|
@ -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"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue