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.
|
||||
|
||||
## Commercial support
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
);
|
||||
nix-vm-test-lib =
|
||||
let
|
||||
rev = "f01e096295c8ace5f367985e323e3263eb7f9434";
|
||||
sha256 = "sha256:11gqxnhdrpb025wybbb0wmpy2xzjaa6ncs55zbw8i2nzchkzrfvh";
|
||||
rev = "e34870b8dd2c2d203c05b4f931b8c33eaaf43b81";
|
||||
sha256 = "sha256:1qp1fq96kv9i1nj20m25057pfcs1b1c9bj4502xy7gnw8caqr30d";
|
||||
in
|
||||
"${
|
||||
builtins.fetchTarball {
|
||||
|
|
|
|||
94
package.nix
94
package.nix
|
|
@ -14,53 +14,53 @@
|
|||
let
|
||||
cargoManifest = (lib.importTOML ./Cargo.toml).package;
|
||||
system-manager-unwrapped = rustPlatform.buildRustPackage {
|
||||
pname = "system-manager";
|
||||
version = cargoManifest.version;
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = lib.fileset.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
./test/rust
|
||||
];
|
||||
};
|
||||
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
buildInputs = [ dbus ];
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
pname = "system-manager";
|
||||
version = cargoManifest.version;
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = lib.fileset.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
./test/rust
|
||||
];
|
||||
|
||||
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
|
||||
runCommand "system-manager"
|
||||
{
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
passthru = {
|
||||
# The unwrapped version takes nix from the PATH, it will fail if nix
|
||||
# cannot be found.
|
||||
# The wrapped version has a reference to the nix store path, so nix is
|
||||
# part of its runtime closure.
|
||||
unwrapped = system-manager-unwrapped;
|
||||
};
|
||||
}
|
||||
''
|
||||
makeWrapper \
|
||||
${system-manager-unwrapped}/bin/system-manager \
|
||||
$out/bin/system-manager \
|
||||
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
||||
''
|
||||
runCommand "system-manager"
|
||||
{
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
passthru = {
|
||||
# The unwrapped version takes nix from the PATH, it will fail if nix
|
||||
# cannot be found.
|
||||
# The wrapped version has a reference to the nix store path, so nix is
|
||||
# part of its runtime closure.
|
||||
unwrapped = system-manager-unwrapped;
|
||||
};
|
||||
}
|
||||
''
|
||||
makeWrapper \
|
||||
${system-manager-unwrapped}/bin/system-manager \
|
||||
$out/bin/system-manager \
|
||||
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue