Merge pull request #256 from numtide/chore/update-nix-vm-test
Update nix-vm-test
This commit is contained in:
commit
c64d185d2c
3 changed files with 50 additions and 50 deletions
|
|
@ -141,7 +141,7 @@ System Manager is currently only supported on NixOS and Ubuntu. However, it can
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
> \[!WARNING\]
|
> [!WARNING]
|
||||||
> This is unsupported and untested. Use at your own risk.
|
> This is unsupported and untested. Use at your own risk.
|
||||||
|
|
||||||
## Commercial support
|
## Commercial support
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@
|
||||||
);
|
);
|
||||||
nix-vm-test-lib =
|
nix-vm-test-lib =
|
||||||
let
|
let
|
||||||
rev = "f01e096295c8ace5f367985e323e3263eb7f9434";
|
rev = "e34870b8dd2c2d203c05b4f931b8c33eaaf43b81";
|
||||||
sha256 = "sha256:11gqxnhdrpb025wybbb0wmpy2xzjaa6ncs55zbw8i2nzchkzrfvh";
|
sha256 = "sha256:1qp1fq96kv9i1nj20m25057pfcs1b1c9bj4502xy7gnw8caqr30d";
|
||||||
in
|
in
|
||||||
"${
|
"${
|
||||||
builtins.fetchTarball {
|
builtins.fetchTarball {
|
||||||
|
|
|
||||||
94
package.nix
94
package.nix
|
|
@ -14,53 +14,53 @@
|
||||||
let
|
let
|
||||||
cargoManifest = (lib.importTOML ./Cargo.toml).package;
|
cargoManifest = (lib.importTOML ./Cargo.toml).package;
|
||||||
system-manager-unwrapped = rustPlatform.buildRustPackage {
|
system-manager-unwrapped = rustPlatform.buildRustPackage {
|
||||||
pname = "system-manager";
|
pname = "system-manager";
|
||||||
version = cargoManifest.version;
|
version = cargoManifest.version;
|
||||||
src = lib.fileset.toSource {
|
src = lib.fileset.toSource {
|
||||||
root = ./.;
|
root = ./.;
|
||||||
fileset = lib.fileset.unions [
|
fileset = lib.fileset.unions [
|
||||||
./Cargo.toml
|
./Cargo.toml
|
||||||
./Cargo.lock
|
./Cargo.lock
|
||||||
./src
|
./src
|
||||||
./test/rust
|
./test/rust
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
|
||||||
buildInputs = [ dbus ];
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkg-config
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeCheckInputs = [
|
|
||||||
clippy
|
|
||||||
nix
|
|
||||||
];
|
|
||||||
|
|
||||||
preCheck = ''
|
|
||||||
${lib.getExe cargo} clippy
|
|
||||||
|
|
||||||
# Stop the Nix command from trying to create /nix/var/nix/profiles.
|
|
||||||
#
|
|
||||||
# https://nix.dev/manual/nix/2.24/command-ref/new-cli/nix3-profile#profiles
|
|
||||||
export NIX_STATE_DIR=$TMPDIR
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
buildInputs = [ dbus ];
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeCheckInputs = [
|
||||||
|
clippy
|
||||||
|
nix
|
||||||
|
];
|
||||||
|
|
||||||
|
preCheck = ''
|
||||||
|
${lib.getExe cargo} clippy
|
||||||
|
|
||||||
|
# Stop the Nix command from trying to create /nix/var/nix/profiles.
|
||||||
|
#
|
||||||
|
# https://nix.dev/manual/nix/2.24/command-ref/new-cli/nix3-profile#profiles
|
||||||
|
export NIX_STATE_DIR=$TMPDIR
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
runCommand "system-manager"
|
runCommand "system-manager"
|
||||||
{
|
{
|
||||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||||
passthru = {
|
passthru = {
|
||||||
# The unwrapped version takes nix from the PATH, it will fail if nix
|
# The unwrapped version takes nix from the PATH, it will fail if nix
|
||||||
# cannot be found.
|
# cannot be found.
|
||||||
# The wrapped version has a reference to the nix store path, so nix is
|
# The wrapped version has a reference to the nix store path, so nix is
|
||||||
# part of its runtime closure.
|
# part of its runtime closure.
|
||||||
unwrapped = system-manager-unwrapped;
|
unwrapped = system-manager-unwrapped;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
makeWrapper \
|
makeWrapper \
|
||||||
${system-manager-unwrapped}/bin/system-manager \
|
${system-manager-unwrapped}/bin/system-manager \
|
||||||
$out/bin/system-manager \
|
$out/bin/system-manager \
|
||||||
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
||||||
''
|
''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue