normalize whitespace
This commit is contained in:
parent
d76474c524
commit
a91c419858
5 changed files with 208 additions and 206 deletions
252
package.nix
252
package.nix
|
|
@ -1,160 +1,160 @@
|
|||
{
|
||||
lib,
|
||||
clangStdenv,
|
||||
callPackage,
|
||||
linkFarm,
|
||||
rustHooks,
|
||||
rustPackages,
|
||||
versionCheckHook,
|
||||
lib,
|
||||
clangStdenv,
|
||||
callPackage,
|
||||
linkFarm,
|
||||
rustHooks,
|
||||
rustPackages,
|
||||
versionCheckHook,
|
||||
}: lib.callWith' rustPackages ({
|
||||
rustPlatform,
|
||||
cargo,
|
||||
rustPlatform,
|
||||
cargo,
|
||||
}: let
|
||||
stdenv = clangStdenv;
|
||||
cargoToml = lib.importTOML ./Cargo.toml;
|
||||
cargoPackage = cargoToml.package;
|
||||
stdenv = clangStdenv;
|
||||
cargoToml = lib.importTOML ./Cargo.toml;
|
||||
cargoPackage = cargoToml.package;
|
||||
in stdenv.mkDerivation (finalAttrs: let
|
||||
self = finalAttrs.finalPackage;
|
||||
self = finalAttrs.finalPackage;
|
||||
in {
|
||||
pname = cargoPackage.name;
|
||||
version = cargoPackage.version;
|
||||
pname = cargoPackage.name;
|
||||
version = cargoPackage.version;
|
||||
|
||||
strictDeps = true;
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
outputs = [ "out" "modules" ];
|
||||
outputs = [ "out" "modules" ];
|
||||
|
||||
doCheck = true;
|
||||
doInstallCheck = true;
|
||||
doCheck = true;
|
||||
doInstallCheck = true;
|
||||
|
||||
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
||||
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
||||
|
||||
src = linkFarm "dynix-source" {
|
||||
inherit (self) dynixCommand dynixModules;
|
||||
};
|
||||
src = linkFarm "dynix-source" {
|
||||
inherit (self) dynixCommand dynixModules;
|
||||
};
|
||||
|
||||
installPhase = lib.dedent ''
|
||||
runHook preInstall
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out"
|
||||
cp -r --reflink=auto "$dynixCommand/"* "$out/"
|
||||
mkdir -p "$modules"
|
||||
cp -r --reflink=auto "$dynixModules/"* "$modules/"
|
||||
mkdir -p "$out"
|
||||
cp -r --reflink=auto "$dynixCommand/"* "$out/"
|
||||
mkdir -p "$modules"
|
||||
cp -r --reflink=auto "$dynixModules/"* "$modules/"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
#
|
||||
# SUB-DERIVATONS
|
||||
#
|
||||
#
|
||||
# SUB-DERIVATONS
|
||||
#
|
||||
|
||||
dynixCommand = stdenv.mkDerivation (finalAttrs: let
|
||||
commandSelf = finalAttrs.finalPackage;
|
||||
in {
|
||||
pname = "${self.pname}-command";
|
||||
inherit (self) version;
|
||||
inherit (self) strictDeps __structuredAttrs;
|
||||
inherit (self) doCheck doInstallCheck;
|
||||
dynixCommand = stdenv.mkDerivation (finalAttrs: let
|
||||
commandSelf = finalAttrs.finalPackage;
|
||||
in {
|
||||
pname = "${self.pname}-command";
|
||||
inherit (self) version;
|
||||
inherit (self) strictDeps __structuredAttrs;
|
||||
inherit (self) doCheck doInstallCheck;
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = lib.fileset.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = lib.fileset.unions [
|
||||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
./src
|
||||
];
|
||||
};
|
||||
|
||||
cargoDeps = rustPlatform.importCargoLock {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
cargoDeps = rustPlatform.importCargoLock {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
|
||||
nativeBuildInputs = rustHooks.asList ++ [
|
||||
cargo
|
||||
];
|
||||
nativeBuildInputs = rustHooks.asList ++ [
|
||||
cargo
|
||||
];
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
meta = {
|
||||
mainProgram = "dynix";
|
||||
};
|
||||
});
|
||||
meta = {
|
||||
mainProgram = "dynix";
|
||||
};
|
||||
});
|
||||
|
||||
dynixModules = stdenv.mkDerivation (finalAttrs: let
|
||||
modulesSelf = finalAttrs.finalPackage;
|
||||
in {
|
||||
pname = "${self.pname}-modules";
|
||||
inherit (self) version;
|
||||
inherit (self) strictDeps __structuredAttrs;
|
||||
inherit (self) doCheck doInstallCheck;
|
||||
dynixModules = stdenv.mkDerivation (finalAttrs: let
|
||||
modulesSelf = finalAttrs.finalPackage;
|
||||
in {
|
||||
pname = "${self.pname}-modules";
|
||||
inherit (self) version;
|
||||
inherit (self) strictDeps __structuredAttrs;
|
||||
inherit (self) doCheck doInstallCheck;
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
root = ./modules/dynamicism;
|
||||
fileset = lib.fileset.unions [
|
||||
./modules/dynamicism
|
||||
];
|
||||
};
|
||||
src = lib.fileset.toSource {
|
||||
root = ./modules/dynamicism;
|
||||
fileset = lib.fileset.unions [
|
||||
./modules/dynamicism
|
||||
];
|
||||
};
|
||||
|
||||
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
||||
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
||||
|
||||
modulesOut = "${placeholder "out"}/share/nixos/modules/dynix";
|
||||
modulesOut = "${placeholder "out"}/share/nixos/modules/dynix";
|
||||
|
||||
installPhase = lib.dedent ''
|
||||
runHook preInstall
|
||||
installPhase = lib.dedent ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$modulesOut"
|
||||
cp -r "$src/"* "$modulesOut/"
|
||||
mkdir -p "$modulesOut"
|
||||
cp -r "$src/"* "$modulesOut/"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
passthru.mkDevShell = {
|
||||
path,
|
||||
mkShell,
|
||||
python3Packages,
|
||||
fenixToolchain,
|
||||
}: let
|
||||
mkShell' = mkShell.override { inherit stdenv; };
|
||||
pyEnv = python3Packages.python.withPackages (p: [ p.beartype ]);
|
||||
in mkShell' {
|
||||
name = "devshell-for-${self.name}";
|
||||
inputsFrom = [ self ];
|
||||
packages = [
|
||||
pyEnv
|
||||
stdenv.cc
|
||||
fenixToolchain
|
||||
];
|
||||
env.PYTHONPATH = [
|
||||
"${pyEnv}/${pyEnv.sitePackages}"
|
||||
# Cursed.
|
||||
"${path}/nixos/lib/test-driver/src"
|
||||
] |> lib.concatStringsSep ":";
|
||||
};
|
||||
passthru.mkDevShell = {
|
||||
path,
|
||||
mkShell,
|
||||
python3Packages,
|
||||
fenixToolchain,
|
||||
}: let
|
||||
mkShell' = mkShell.override { inherit stdenv; };
|
||||
pyEnv = python3Packages.python.withPackages (p: [ p.beartype ]);
|
||||
in mkShell' {
|
||||
name = "devshell-for-${self.name}";
|
||||
inputsFrom = [ self ];
|
||||
packages = [
|
||||
pyEnv
|
||||
stdenv.cc
|
||||
fenixToolchain
|
||||
];
|
||||
env.PYTHONPATH = [
|
||||
"${pyEnv}/${pyEnv.sitePackages}"
|
||||
# Cursed.
|
||||
"${path}/nixos/lib/test-driver/src"
|
||||
] |> lib.concatStringsSep ":";
|
||||
};
|
||||
|
||||
passthru.modulesPath = self.modules + "/share/nixos/modules";
|
||||
passthru.dynix = self.modulesPath + "/dynix";
|
||||
passthru.modulesPath = self.modules + "/share/nixos/modules";
|
||||
passthru.dynix = self.modulesPath + "/dynix";
|
||||
|
||||
passthru.tests = lib.fix (callPackage ./tests {
|
||||
dynix = self;
|
||||
}).packages;
|
||||
passthru.tests = lib.fix (callPackage ./tests {
|
||||
dynix = self;
|
||||
}).packages;
|
||||
|
||||
passthru.allTests = linkFarm "dynix-all-tests" self.tests;
|
||||
passthru.allTests = linkFarm "dynix-all-tests" self.tests;
|
||||
|
||||
meta = {
|
||||
longDescription = lib.dedent ''
|
||||
Default output contains the Rust binary.
|
||||
The `modules` output contains the modules prefixed under `/share/nixos/modules/dynix`.
|
||||
The `dynix` passthru attr is a shortcut for the modules output *with* the modules prefix,
|
||||
and thus `dynix.dynix` can be passed directly to `imports = [`.
|
||||
'';
|
||||
mainProgram = "dynix";
|
||||
outputsToInstall = [ "out" "modules" ];
|
||||
};
|
||||
meta = {
|
||||
longDescription = lib.dedent ''
|
||||
Default output contains the Rust binary.
|
||||
The `modules` output contains the modules prefixed under `/share/nixos/modules/dynix`.
|
||||
The `dynix` passthru attr is a shortcut for the modules output *with* the modules prefix,
|
||||
and thus `dynix.dynix` can be passed directly to `imports = [`.
|
||||
'';
|
||||
mainProgram = "dynix";
|
||||
outputsToInstall = [ "out" "modules" ];
|
||||
};
|
||||
}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue