aboutsummaryrefslogtreecommitdiffstats
path: root/nix/package.nix
blob: a91906113650dfc1e57f37800a32f8b48979f9fe (plain)
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
# enstate, the program (README.md).
{
  lib,
  runCommand,
  rustPlatform,
  util-linux,
}:

rustPlatform.buildRustPackage {
  pname = "enstate";
  version = "0.0.1";

  # Only what the build reads, each part on its own, never the whole checkout: a
  # filter over the checkout can't tell its files apart below a symbolic link (Nix
  # gives it the resolved paths), and lib.fileset refuses one.
  src = runCommand "enstate-source" { } ''
    mkdir $out
    cp ${../Cargo.toml} $out/Cargo.toml
    cp ${../Cargo.lock} $out/Cargo.lock
    cp -r ${../src} $out/src
    cp -r ${../tests} $out/tests
  '';

  # The tests' fake systemctl looks at the store's lock with flock.
  nativeCheckInputs = [ util-linux ];

  cargoLock = {
    lockFile = ../Cargo.lock;
    outputHashes."config-0.1.0" = "sha256-qtUSpjOQsC9NFwgDXqDIqzvzU1zZqoD90se/ccWSKNs=";
  };

  meta = {
    description = "State next to the Nix store: plan, apply, and make submissions";
    mainProgram = "enstate";
    platforms = lib.platforms.linux;
  };
}