-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathflake-module.nix
40 lines (36 loc) · 1.07 KB
/
flake-module.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ inputs, ... }: {
perSystem = { self', inputs', pkgs, system, ... }:
let
nix-manual = "${inputs.nix-master}/doc/manual/source/language/derivations.md";
# pkgs = import inputs.nixpkgs-master { inherit system; };
nix = inputs'.nix-master.packages.nix-cli;
sourceInfo' = {
inherit (inputs.nix-master.sourceInfo) rev lastModified;
};
metaFile = builtins.toFile "meta.json" (builtins.toJSON sourceInfo');
nix-meta = pkgs.stdenv.mkDerivation {
name = "salt-meta";
src = ./.;
buildPhase = ''
cat ${metaFile} > $out
'';
};
# https://github.com/NixOS/nix/blob/master/doc/manual/src/language/derivations.md
salt = pkgs.stdenv.mkDerivation {
pname = "salt-data";
version = "0.1.0";
src = ./src;
installPhase = ''
mkdir $out
cp -rf . $out
cp ${nix-manual} $out
${nix}/bin/nix __dump-language > $out/language.json
'';
};
in
{
packages = {
inherit salt nix-meta;
};
};
}