diff options
Diffstat (limited to 'nix/package.nix')
| -rw-r--r-- | nix/package.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 0000000..a919061 --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,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; + }; +} |
