mirror of
https://github.com/nix-community/disko.git
synced 2026-12-03 06:23:28 +01:00
move disko-install into disko package
This commit is contained in:
1 parent
a2009bc2b4
commit
72818e54ec
4 files changed
+19
-14
No files matched your search
@@ -28,7 +28,10 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
disko = pkgs.callPackage ./package.nix { };
|
disko = pkgs.callPackage ./package.nix { };
|
||||||
disko-install = pkgs.callPackage ./disko-install.nix { };
|
# alias to make `nix run` more convenient
|
||||||
|
disko-install = self.packages.${system}.disko.overrideAttrs (old: {
|
||||||
|
name = "disko-install";
|
||||||
|
});
|
||||||
default = self.packages.${system}.disko;
|
default = self.packages.${system}.disko;
|
||||||
} // pkgs.lib.optionalAttrs (!pkgs.buildPlatform.isRiscV64) {
|
} // pkgs.lib.optionalAttrs (!pkgs.buildPlatform.isRiscV64) {
|
||||||
disko-doc = pkgs.callPackage ./doc.nix { };
|
disko-doc = pkgs.callPackage ./doc.nix { };
|
||||||
|
|||||||
+1
-1
@@ -240,7 +240,7 @@ let
|
|||||||
machine.succeed("echo -n 'additionalSecret' > /tmp/additionalSecret.key")
|
machine.succeed("echo -n 'additionalSecret' > /tmp/additionalSecret.key")
|
||||||
machine.succeed("echo -n 'secretsecret' > /tmp/secret.key")
|
machine.succeed("echo -n 'secretsecret' > /tmp/secret.key")
|
||||||
${lib.optionalString (testMode == "direct") ''
|
${lib.optionalString (testMode == "direct") ''
|
||||||
# running direct mode
|
# running direct mode
|
||||||
machine.succeed("${tsp-format}")
|
machine.succeed("${tsp-format}")
|
||||||
machine.succeed("${tsp-mount}")
|
machine.succeed("${tsp-mount}")
|
||||||
machine.succeed("${tsp-mount}") # verify that the command is idempotent
|
machine.succeed("${tsp-mount}") # verify that the command is idempotent
|
||||||
|
|||||||
+13
-10
@@ -1,6 +1,6 @@
|
|||||||
{ stdenvNoCC, makeWrapper, lib, path }:
|
{ stdenvNoCC, makeWrapper, lib, path, nix, coreutils }:
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation rec {
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||||
name = "disko";
|
name = "disko";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@@ -8,13 +8,15 @@ stdenvNoCC.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin $out/share/disko
|
mkdir -p $out/bin $out/share/disko
|
||||||
cp -r cli.nix default.nix disk-deactivate lib $out/share/disko
|
cp -r install-cli.nix cli.nix default.nix disk-deactivate lib $out/share/disko
|
||||||
sed \
|
|
||||||
-e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" \
|
for i in disko disko-install; do
|
||||||
-e "s|#!/usr/bin/env.*|#!/usr/bin/env bash|" \
|
sed -e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" "$i" > "$out/bin/$i"
|
||||||
disko > $out/bin/disko
|
chmod 755 "$out/bin/$i"
|
||||||
chmod 755 $out/bin/disko
|
wrapProgram "$out/bin/$i" \
|
||||||
wrapProgram $out/bin/disko --prefix NIX_PATH : "nixpkgs=${path}"
|
--prefix PATH : ${lib.makeBinPath [ nix coreutils ]} \
|
||||||
|
--prefix NIX_PATH : "nixpkgs=${path}"
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Format disks with nix-config";
|
description = "Format disks with nix-config";
|
||||||
@@ -22,5 +24,6 @@ stdenvNoCC.mkDerivation rec {
|
|||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = with maintainers; [ lassulus ];
|
maintainers = with maintainers; [ lassulus ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
mainProgram = finalAttrs.name;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
{ pkgs ? import <nixpkgs> { }, self }:
|
{ pkgs ? import <nixpkgs> { }, self }:
|
||||||
let
|
let
|
||||||
disko-install = pkgs.callPackage ../../disko-install.nix { };
|
disko-install = pkgs.callPackage ../../disko-install.nix { };
|
||||||
toplevel = self.nixosConfigurations.testmachine.config.system.build.toplevel;
|
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
pkgs.stdenv.drvPath
|
pkgs.stdenv.drvPath
|
||||||
toplevel
|
self.nixosConfigurations.testmachine.config.system.build.toplevel
|
||||||
self.nixosConfigurations.testmachine.config.system.build.diskoScript
|
self.nixosConfigurations.testmachine.config.system.build.diskoScript
|
||||||
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
|
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user