remove old unused files for now
This commit is contained in:
parent
8dba8e7ce8
commit
8a6bd41baa
15 changed files with 35 additions and 1804 deletions
92
package.nix
92
package.nix
|
|
@ -1,86 +1,60 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
rustHooks,
|
||||
rustPackages,
|
||||
versionCheckHook,
|
||||
}: lib.callWith' rustPackages ({
|
||||
rustPlatform,
|
||||
cargo,
|
||||
stdenvNoCC,
|
||||
callPackage,
|
||||
}: let
|
||||
cargoToml = lib.importTOML ./Cargo.toml;
|
||||
cargoPackage = cargoToml.package;
|
||||
|
||||
stdenv = stdenvNoCC;
|
||||
in stdenv.mkDerivation (self: {
|
||||
pname = cargoPackage.name;
|
||||
version = cargoPackage.version;
|
||||
name = "dynix-modules";
|
||||
|
||||
strictDeps = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
doCheck = true;
|
||||
doInstallCheck = true;
|
||||
outputs = [ "out" "modules" ];
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
root = ./modules/dynamicism;
|
||||
fileset = lib.fileset.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
./modules/dynamicism
|
||||
];
|
||||
};
|
||||
|
||||
cargoDeps = rustPlatform.importCargoLock {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
||||
|
||||
versionCheckProgramArg = "--version";
|
||||
installPhase = lib.dedent ''
|
||||
mkdir -p "$out"
|
||||
cp -r * "$out/"
|
||||
|
||||
nativeBuildInputs = rustHooks.asList ++ [
|
||||
cargo
|
||||
];
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
mkdir -p "$modules/share/nixos/modules/dynix"
|
||||
cp --reflink=auto -r "$out/"* "$modules/share/nixos/modules/dynix/"
|
||||
'';
|
||||
|
||||
passthru.mkDevShell = {
|
||||
path,
|
||||
mkShell,
|
||||
python3Packages,
|
||||
}: let
|
||||
mkShell' = mkShell.override { stdenv = stdenv; };
|
||||
mkShell' = mkShell.override { inherit stdenv; };
|
||||
pyEnv = python3Packages.python.withPackages (p: [
|
||||
p.beartype
|
||||
]);
|
||||
in mkShell' {
|
||||
name = "${self.pname}-devshell-${self.version}";
|
||||
inputsFrom = [ self.finalPackage ];
|
||||
packages = [
|
||||
rustPackages.rustc
|
||||
rustPackages.rustfmt
|
||||
];
|
||||
name = "devshell-for-${self.finalPackage.name}";
|
||||
packages = [ pyEnv ];
|
||||
env.PYTHONPATH = [
|
||||
"${pyEnv}/${pyEnv.sitePackages}"
|
||||
# Cursed.
|
||||
"${path}/nixos/lib/test-driver/src"
|
||||
] |> lib.concatStringsSep ":";
|
||||
};
|
||||
|
||||
passthru.tests.clippy = self.finalPackage.overrideAttrs (prev: {
|
||||
pname = "${self.pname}-clippy";
|
||||
passthru.modulesPath = self.finalPackage.modules + "/share/nixos/modules";
|
||||
|
||||
nativeCheckInputs = prev.nativeCheckInputs or [ ] ++ [
|
||||
rustPackages.clippy
|
||||
];
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
doCheck = true;
|
||||
dontFixup = true;
|
||||
dontInstallCheck = true;
|
||||
|
||||
checkPhase = lib.trim ''
|
||||
echo "cargoClippyPhase()"
|
||||
cargo clippy --all-targets --profile "$cargoCheckType" -- --deny warnings
|
||||
'';
|
||||
|
||||
installPhase = lib.trim ''
|
||||
touch "$out"
|
||||
'';
|
||||
});
|
||||
passthru.tests = lib.fix (callPackage ./tests {
|
||||
dynix = self.finalPackage;
|
||||
}).packages;
|
||||
|
||||
meta = {
|
||||
mainProgram = "dynix";
|
||||
outputsToInstall = [ "modules" ];
|
||||
};
|
||||
}))
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue