mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
disko2: Create package
This requires a lot of restructuring. The .nix files have to be bundled together with the python files, so they need to follow python's module system structure. I ran `nix-fast-build --no-link -j 2 --eval-workers 3 --flake .#checks` and it succeeded, so I'm reasonably confident I changed everything as required.
This commit is contained in:
1 parent
5da578139e
commit
389235b63f
88 files changed
+374
-282
No files matched your search
+3
-40
@@ -1,45 +1,8 @@
|
||||
{ lib ? import <nixpkgs/lib>
|
||||
, rootMountPoint ? "/mnt"
|
||||
, checked ? false
|
||||
, diskoLib ? import ./lib { inherit lib rootMountPoint; }
|
||||
, diskoLib ? import ./src/disko_lib { inherit lib rootMountPoint; }
|
||||
}:
|
||||
let
|
||||
eval = cfg: lib.evalModules {
|
||||
modules = lib.singleton {
|
||||
# _file = toString input;
|
||||
imports = lib.singleton { disko.devices = cfg.disko.devices; };
|
||||
options = {
|
||||
disko.devices = lib.mkOption {
|
||||
type = diskoLib.toplevel;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit eval;
|
||||
lib = lib.warn "the .lib.lib output is deprecated" diskoLib;
|
||||
|
||||
# legacy alias
|
||||
create = cfg: builtins.trace "the create output is deprecated, use format instead" (eval cfg).config.disko.devices._create;
|
||||
createScript = cfg: pkgs: builtins.trace "the create output is deprecated, use format instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
||||
createScriptNoDeps = cfg: pkgs: builtins.trace "the create output is deprecated, use format instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
||||
|
||||
format = cfg: (eval cfg).config.disko.devices._create;
|
||||
formatScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
||||
formatScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
||||
|
||||
mount = cfg: (eval cfg).config.disko.devices._mount;
|
||||
mountScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScript;
|
||||
mountScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScriptNoDeps;
|
||||
|
||||
disko = cfg: (eval cfg).config.disko.devices._disko;
|
||||
diskoScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScript;
|
||||
diskoScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
||||
|
||||
# we keep this old output for backwards compatibility
|
||||
diskoNoDeps = cfg: pkgs: builtins.trace "the diskoNoDeps output is deprecated, please use disko instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
||||
|
||||
config = cfg: (eval cfg).config.disko.devices._config;
|
||||
packages = cfg: (eval cfg).config.disko.devices._packages;
|
||||
diskoLib.outputs {
|
||||
inherit lib checked rootMountPoint;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ else
|
||||
fi
|
||||
|
||||
# The "--impure" is still pure, as the path is within the nix store.
|
||||
script=$(nixBuild "${libexec_dir}"/cli.nix \
|
||||
script=$(nixBuild "${libexec_dir}"/src/cli.nix \
|
||||
--no-out-link \
|
||||
--impure \
|
||||
--argstr mode "$mode" \
|
||||
|
||||
+1
-1
@@ -197,7 +197,7 @@ main() {
|
||||
# shellcheck disable=SC2064
|
||||
trap "cleanupMountPoint ${escapeMountPoint}" EXIT
|
||||
|
||||
outputs=$(nixBuild "${libexec_dir}"/install-cli.nix \
|
||||
outputs=$(nixBuild "${libexec_dir}"/src/install-cli.nix \
|
||||
"${nix_args[@]}" \
|
||||
--no-out-link \
|
||||
--impure \
|
||||
|
||||
@@ -1,157 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env bash
|
||||
# This script only exists so you can run `./disko2` directly
|
||||
# It should not be be installed as part of the package!
|
||||
# Check src/disko/cli.py for the actual entrypoint
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Literal, assert_never
|
||||
|
||||
from lib.ansi import disko_dev_ansi
|
||||
from lib.eval_config import eval_disko_file, eval_flake
|
||||
from lib.logging import LOGGER, debug, info
|
||||
from lib.result import DiskoError, DiskoSuccess, DiskoResult, exit_on_error
|
||||
from lib.types.disk import generate_config
|
||||
from lib.types.device import disko_dev_lsblk
|
||||
|
||||
Mode = Literal[
|
||||
"destroy",
|
||||
"format",
|
||||
"mount",
|
||||
"destroy,format,mount",
|
||||
"format,mount",
|
||||
"generate",
|
||||
"dev",
|
||||
]
|
||||
|
||||
|
||||
# Modes to apply an existing configuration
|
||||
APPLY_MODES: list[Mode] = [
|
||||
"destroy",
|
||||
"format",
|
||||
"mount",
|
||||
"destroy,format,mount",
|
||||
"format,mount",
|
||||
]
|
||||
ALL_MODES: list[Mode] = APPLY_MODES + ["generate", "dev"]
|
||||
|
||||
MODE_DESCRIPTION: dict[Mode, str] = {
|
||||
"destroy": "Destroy the partition tables on the specified disks",
|
||||
"format": "Change formatting and filesystems on the specified disks",
|
||||
"mount": "Mount the specified disks",
|
||||
"destroy,format,mount": "Run destroy, format and mount in sequence",
|
||||
"format,mount": "Run format and mount in sequence",
|
||||
"generate": "Generate a disko configuration file from the system's current state",
|
||||
"dev": "Print information useful for developers",
|
||||
}
|
||||
|
||||
|
||||
def run_apply(
|
||||
*, mode: str, disko_file: str | None, flake: str | None, **_kwargs: dict[str, Any]
|
||||
) -> DiskoResult[dict[str, Any]]:
|
||||
# match would be nicer, but mypy doesn't understand type narrowing in tuples
|
||||
if not disko_file and not flake:
|
||||
return DiskoError.single_message("ERR_MISSING_ARGUMENTS", {}, "validate args")
|
||||
if not disko_file and flake:
|
||||
return eval_flake(flake)
|
||||
if disko_file and not flake:
|
||||
return eval_disko_file(Path(disko_file))
|
||||
|
||||
return DiskoError.single_message("ERR_TOO_MANY_ARGUMENTS", {}, "validate args")
|
||||
|
||||
|
||||
def run_generate() -> DiskoResult[dict[str, Any]]:
|
||||
return generate_config()
|
||||
|
||||
|
||||
def run_dev(args: argparse.Namespace) -> DiskoResult[None]:
|
||||
match args.dev_command:
|
||||
case "lsblk":
|
||||
return disko_dev_lsblk()
|
||||
case "ansi":
|
||||
return DiskoSuccess(None, disko_dev_ansi())
|
||||
case _:
|
||||
assert_never(args.dev_command)
|
||||
|
||||
|
||||
def run(
|
||||
args: argparse.Namespace,
|
||||
) -> DiskoResult[None | dict[str, Any]]:
|
||||
if args.verbose:
|
||||
LOGGER.setLevel("DEBUG")
|
||||
debug("Enabled debug logging.")
|
||||
|
||||
match args.mode:
|
||||
case None:
|
||||
return DiskoError.single_message(
|
||||
"ERR_MISSING_MODE", {"valid_modes": ALL_MODES}, "select mode"
|
||||
)
|
||||
case "generate":
|
||||
return run_generate()
|
||||
case "dev":
|
||||
return run_dev(args)
|
||||
case _:
|
||||
return run_apply(**vars(args))
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
root_parser = argparse.ArgumentParser(
|
||||
prog="disko2",
|
||||
description="Automated disk partitioning and formatting tool for NixOS",
|
||||
)
|
||||
|
||||
root_parser.add_argument(
|
||||
"--verbose",
|
||||
"-v",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Print more detailed output, helpful for debugging",
|
||||
)
|
||||
|
||||
mode_parsers = root_parser.add_subparsers(dest="mode")
|
||||
|
||||
def create_apply_parser(mode: Mode) -> argparse.ArgumentParser:
|
||||
parser = mode_parsers.add_parser(
|
||||
mode,
|
||||
help=MODE_DESCRIPTION[mode],
|
||||
)
|
||||
parser.add_argument(
|
||||
"disko_file",
|
||||
nargs="?",
|
||||
default=None,
|
||||
help="Path to the disko configuration file",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--flake",
|
||||
"-f",
|
||||
help="Flake to fetch the disko configuration from",
|
||||
)
|
||||
return parser
|
||||
|
||||
# Commands to apply an existing configuration
|
||||
apply_parsers = [create_apply_parser(mode) for mode in APPLY_MODES]
|
||||
|
||||
# Other commands
|
||||
generate_parser = mode_parsers.add_parser(
|
||||
"generate",
|
||||
help=MODE_DESCRIPTION["generate"],
|
||||
)
|
||||
|
||||
# Commands for developers
|
||||
dev_parsers = mode_parsers.add_parser(
|
||||
"dev",
|
||||
help=MODE_DESCRIPTION["dev"],
|
||||
).add_subparsers(dest="dev_command")
|
||||
dev_parsers.add_parser("lsblk", help="List block devices the way disko sees them")
|
||||
dev_parsers.add_parser("ansi", help="Print defined ansi color codes")
|
||||
return root_parser.parse_args()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = parse_args()
|
||||
result = run(args)
|
||||
output = exit_on_error(result)
|
||||
if output:
|
||||
info("Output:\n" + json.dumps(output, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
set -euo pipefail
|
||||
(
|
||||
cd "$(dirname "$(realpath "$0")")"/src
|
||||
python3 -m disko "$@"
|
||||
)
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, nixosOptionsDoc, runCommand, fetchurl, pandoc }:
|
||||
|
||||
let
|
||||
diskoLib = import ./lib {
|
||||
diskoLib = import ./src/disko_lib {
|
||||
inherit lib;
|
||||
rootMountPoint = "/mnt";
|
||||
};
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
We are currently having issues being able to generate proper module option
|
||||
documentation for our recursive disko types. However you can read the available
|
||||
options [here](https://github.com/nix-community/disko/tree/master/lib/types).
|
||||
options [here](https://github.com/nix-community/disko/tree/master/src/disko_lib/types).
|
||||
Combined with the
|
||||
[examples](https://github.com/nix-community/disko/tree/master/example) this
|
||||
hopefully gives you an overview.
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ the example is working in [the tests directory](../tests/). They utilize the
|
||||
|
||||
We use a wrapper around this called `makeDiskoTest`. There is currently (as of
|
||||
2024-10-16) no documentation for all its arguments, but you can have a look at
|
||||
[its current code](https://github.com/nix-community/disko/blob/master/lib/tests.nix#L44C5-L58C10),
|
||||
[its current code](https://github.com/nix-community/disko/blob/master/src/disko_lib/tests.nix#L44C5-L58C10),
|
||||
that should already be helpful.
|
||||
|
||||
However, you don't need to know about all of the inner workings to interact with
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
{
|
||||
nixosModules.default = self.nixosModules.disko; # convention
|
||||
nixosModules.disko.imports = [ ./module.nix ];
|
||||
lib = import ./lib {
|
||||
lib = import ./src/disko_lib {
|
||||
inherit (nixpkgs) lib;
|
||||
};
|
||||
packages = forAllSystems (system:
|
||||
@@ -32,6 +32,7 @@
|
||||
in
|
||||
{
|
||||
disko = pkgs.callPackage ./package.nix { diskoVersion = version; };
|
||||
disko2 = pkgs.callPackage ./package-disko2.nix { diskoVersion = version; };
|
||||
# alias to make `nix run` more convenient
|
||||
disko-install = self.packages.${system}.disko.overrideAttrs (_old: {
|
||||
name = "disko-install";
|
||||
@@ -61,7 +62,7 @@
|
||||
|
||||
shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } ''
|
||||
cd ${./.}
|
||||
shellcheck disk-deactivate/disk-deactivate disko
|
||||
shellcheck src/disk-deactivate/disk-deactivate disko disko2
|
||||
touch $out
|
||||
'';
|
||||
in
|
||||
|
||||
+3
-3
@@ -4,13 +4,13 @@ let
|
||||
|
||||
vmVariantWithDisko = extendModules {
|
||||
modules = [
|
||||
./lib/interactive-vm.nix
|
||||
./src/disko_lib/interactive-vm.nix
|
||||
config.disko.tests.extraConfig
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ ./lib/make-disk-image.nix ];
|
||||
imports = [ ./src/disko_lib/make-disk-image.nix ];
|
||||
|
||||
options.disko = {
|
||||
imageBuilder = {
|
||||
@@ -205,7 +205,7 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
_module.args.diskoLib = import ./lib {
|
||||
_module.args.diskoLib = import ./src/disko_lib {
|
||||
inherit lib;
|
||||
rootMountPoint = config.disko.rootMountPoint;
|
||||
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
{ python3Packages, lib, lix, coreutils, nixos-install-tools, binlore, diskoVersion }:
|
||||
|
||||
let
|
||||
self = python3Packages.buildPythonApplication {
|
||||
pname = "disko2";
|
||||
version = diskoVersion;
|
||||
src = ./.;
|
||||
pyproject = true;
|
||||
|
||||
build-system = [ python3Packages.setuptools ];
|
||||
dependencies = [
|
||||
lix # lix instead of nix because it produces way better eval errors
|
||||
coreutils
|
||||
nixos-install-tools
|
||||
];
|
||||
|
||||
# Otherwise resholve thinks that disko and disko-install might be able to execute their arguments
|
||||
passthru.binlore.out = binlore.synthesize self ''
|
||||
execer cannot bin/.disko2-wrapped
|
||||
'';
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/disko/
|
||||
cp example/simple-efi.nix $out/share/disko/
|
||||
'';
|
||||
|
||||
makeWrapperArgs = [ "--set DISKO_VERSION ${diskoVersion}" ];
|
||||
|
||||
doCheck = true;
|
||||
# installCheckPhase = ''
|
||||
# $out/bin/disko2 mount $out/share/disko/simple-efi.nix
|
||||
# '';
|
||||
meta = with lib; {
|
||||
description = "Format disks with nix-config";
|
||||
homepage = "https://github.com/nix-community/disko";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ lassulus ];
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "disko2";
|
||||
};
|
||||
};
|
||||
in
|
||||
self
|
||||
+1
-1
@@ -9,7 +9,7 @@ let
|
||||
];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/share/disko
|
||||
cp -r install-cli.nix cli.nix default.nix disk-deactivate lib $out/share/disko
|
||||
cp -r default.nix src $out/share/disko
|
||||
|
||||
for i in disko disko-install; do
|
||||
sed -e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" "$i" > "$out/bin/$i"
|
||||
|
||||
+18
-1
@@ -1,6 +1,23 @@
|
||||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "disko2"
|
||||
version = "2.0.0-preview"
|
||||
|
||||
[project.scripts]
|
||||
disko2 = "disko:main"
|
||||
|
||||
[tool.setuptools]
|
||||
package-dir = { "" = "src" }
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
"*" = ["*.nix"]
|
||||
|
||||
[tool.mypy]
|
||||
strict = true
|
||||
|
||||
[tool.autoflake]
|
||||
remove_all_unused_imports = true
|
||||
in_place = true
|
||||
in_place = true
|
||||
@@ -9,7 +9,7 @@
|
||||
, ...
|
||||
}@args:
|
||||
let
|
||||
disko = import ./. {
|
||||
disko = import ../. {
|
||||
inherit rootMountPoint;
|
||||
inherit lib;
|
||||
};
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,5 @@
|
||||
from . import cli
|
||||
|
||||
|
||||
def main() -> None:
|
||||
cli.main()
|
||||
@@ -0,0 +1,4 @@
|
||||
from . import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,157 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Literal, assert_never
|
||||
|
||||
from disko_lib.ansi import disko_dev_ansi
|
||||
from disko_lib.eval_config import eval_disko_file, eval_flake
|
||||
from disko_lib.logging import LOGGER, debug, info
|
||||
from disko_lib.result import DiskoError, DiskoSuccess, DiskoResult, exit_on_error
|
||||
from disko_lib.types.disk import generate_config
|
||||
from disko_lib.types.device import disko_dev_lsblk
|
||||
|
||||
Mode = Literal[
|
||||
"destroy",
|
||||
"format",
|
||||
"mount",
|
||||
"destroy,format,mount",
|
||||
"format,mount",
|
||||
"generate",
|
||||
"dev",
|
||||
]
|
||||
|
||||
|
||||
# Modes to apply an existing configuration
|
||||
APPLY_MODES: list[Mode] = [
|
||||
"destroy",
|
||||
"format",
|
||||
"mount",
|
||||
"destroy,format,mount",
|
||||
"format,mount",
|
||||
]
|
||||
ALL_MODES: list[Mode] = APPLY_MODES + ["generate", "dev"]
|
||||
|
||||
MODE_DESCRIPTION: dict[Mode, str] = {
|
||||
"destroy": "Destroy the partition tables on the specified disks",
|
||||
"format": "Change formatting and filesystems on the specified disks",
|
||||
"mount": "Mount the specified disks",
|
||||
"destroy,format,mount": "Run destroy, format and mount in sequence",
|
||||
"format,mount": "Run format and mount in sequence",
|
||||
"generate": "Generate a disko configuration file from the system's current state",
|
||||
"dev": "Print information useful for developers",
|
||||
}
|
||||
|
||||
|
||||
def run_apply(
|
||||
*, mode: str, disko_file: str | None, flake: str | None, **_kwargs: dict[str, Any]
|
||||
) -> DiskoResult[dict[str, Any]]:
|
||||
# match would be nicer, but mypy doesn't understand type narrowing in tuples
|
||||
if not disko_file and not flake:
|
||||
return DiskoError.single_message("ERR_MISSING_ARGUMENTS", {}, "validate args")
|
||||
if not disko_file and flake:
|
||||
return eval_flake(flake)
|
||||
if disko_file and not flake:
|
||||
return eval_disko_file(Path(disko_file))
|
||||
|
||||
return DiskoError.single_message("ERR_TOO_MANY_ARGUMENTS", {}, "validate args")
|
||||
|
||||
|
||||
def run_generate() -> DiskoResult[dict[str, Any]]:
|
||||
return generate_config()
|
||||
|
||||
|
||||
def run_dev(args: argparse.Namespace) -> DiskoResult[None]:
|
||||
match args.dev_command:
|
||||
case "lsblk":
|
||||
return disko_dev_lsblk()
|
||||
case "ansi":
|
||||
return DiskoSuccess(None, disko_dev_ansi())
|
||||
case _:
|
||||
assert_never(args.dev_command)
|
||||
|
||||
|
||||
def run(
|
||||
args: argparse.Namespace,
|
||||
) -> DiskoResult[None | dict[str, Any]]:
|
||||
if args.verbose:
|
||||
LOGGER.setLevel("DEBUG")
|
||||
debug("Enabled debug logging.")
|
||||
|
||||
match args.mode:
|
||||
case None:
|
||||
return DiskoError.single_message(
|
||||
"ERR_MISSING_MODE", {"valid_modes": ALL_MODES}, "select mode"
|
||||
)
|
||||
case "generate":
|
||||
return run_generate()
|
||||
case "dev":
|
||||
return run_dev(args)
|
||||
case _:
|
||||
return run_apply(**vars(args))
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
root_parser = argparse.ArgumentParser(
|
||||
prog="disko2",
|
||||
description="Automated disk partitioning and formatting tool for NixOS",
|
||||
)
|
||||
|
||||
root_parser.add_argument(
|
||||
"--verbose",
|
||||
"-v",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Print more detailed output, helpful for debugging",
|
||||
)
|
||||
|
||||
mode_parsers = root_parser.add_subparsers(dest="mode")
|
||||
|
||||
def create_apply_parser(mode: Mode) -> argparse.ArgumentParser:
|
||||
parser = mode_parsers.add_parser(
|
||||
mode,
|
||||
help=MODE_DESCRIPTION[mode],
|
||||
)
|
||||
parser.add_argument(
|
||||
"disko_file",
|
||||
nargs="?",
|
||||
default=None,
|
||||
help="Path to the disko configuration file",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--flake",
|
||||
"-f",
|
||||
help="Flake to fetch the disko configuration from",
|
||||
)
|
||||
return parser
|
||||
|
||||
# Commands to apply an existing configuration
|
||||
apply_parsers = [create_apply_parser(mode) for mode in APPLY_MODES]
|
||||
|
||||
# Other commands
|
||||
generate_parser = mode_parsers.add_parser(
|
||||
"generate",
|
||||
help=MODE_DESCRIPTION["generate"],
|
||||
)
|
||||
|
||||
# Commands for developers
|
||||
dev_parsers = mode_parsers.add_parser(
|
||||
"dev",
|
||||
help=MODE_DESCRIPTION["dev"],
|
||||
).add_subparsers(dest="dev_command")
|
||||
dev_parsers.add_parser("lsblk", help="List block devices the way disko sees them")
|
||||
dev_parsers.add_parser("ansi", help="Print defined ansi color codes")
|
||||
return root_parser.parse_args()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = parse_args()
|
||||
result = run(args)
|
||||
output = exit_on_error(result)
|
||||
if output:
|
||||
info("Output:\n" + json.dumps(output, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
File renamed without changes.
@@ -4,9 +4,6 @@
|
||||
# See https://gist.github.com/rene-d/9e584a7dd2935d0f461904b9f2950007
|
||||
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
class Colors:
|
||||
"""
|
||||
ANSI escape sequences
|
||||
@@ -180,7 +177,6 @@ class Colors:
|
||||
|
||||
def disko_dev_ansi() -> str:
|
||||
import inspect
|
||||
from lib.result import DiskoSuccess # Import here to avoid circular dependency
|
||||
|
||||
for name, value in inspect.getmembers(Colors):
|
||||
if value != "_" and not name.startswith("_") and name != "RESET":
|
||||
@@ -4,7 +4,6 @@
|
||||
, eval-config ? import <nixpkgs/nixos/lib/eval-config.nix>
|
||||
}:
|
||||
let
|
||||
outputs = import ../default.nix { inherit lib diskoLib; };
|
||||
diskoLib = {
|
||||
testLib = import ./tests.nix { inherit lib makeTest eval-config; };
|
||||
# like lib.types.oneOf but instead of a list takes an attrset
|
||||
@@ -79,7 +78,7 @@ let
|
||||
then "${dev}p${toString index}" # /dev/mapper/vg-lv1 style
|
||||
else
|
||||
abort ''
|
||||
${dev} seems not to be a supported disk format. Please add this to disko in https://github.com/nix-community/disko/blob/master/lib/default.nix
|
||||
${dev} seems not to be a supported disk format. Please add this to disko in https://github.com/nix-community/disko/blob/master/src/disko_lib/default.nix
|
||||
'';
|
||||
|
||||
/* Escape a string as required to be used in udev symlinks
|
||||
@@ -213,11 +212,11 @@ let
|
||||
isAttrsOfSubmodule = o: o.type.name == "attrsOf" && o.type.nestedTypes.elemType.name == "submodule";
|
||||
isSerializable = n: o: !(
|
||||
lib.hasPrefix "_" n
|
||||
|| lib.hasSuffix "Hook" n
|
||||
|| isAttrsOfSubmodule o
|
||||
# TODO don't hardcode diskoLib.subType options.
|
||||
|| n == "content" || n == "partitions" || n == "datasets" || n == "swap"
|
||||
|| n == "mode"
|
||||
|| lib.hasSuffix "Hook" n
|
||||
|| isAttrsOfSubmodule o
|
||||
# TODO don't hardcode diskoLib.subType options.
|
||||
|| n == "content" || n == "partitions" || n == "datasets" || n == "swap"
|
||||
|| n == "mode"
|
||||
);
|
||||
in
|
||||
lib.toShellVars
|
||||
@@ -297,6 +296,23 @@ let
|
||||
};
|
||||
|
||||
|
||||
/* Evaluate a disko configuration
|
||||
|
||||
eval :: lib.types.devices -> AttrSet
|
||||
*/
|
||||
eval-disko = cfg: lib.evalModules {
|
||||
modules = lib.singleton {
|
||||
# _file = toString input;
|
||||
imports = lib.singleton { disko.devices = cfg.disko.devices; };
|
||||
options = {
|
||||
disko.devices = lib.mkOption {
|
||||
type = diskoLib.toplevel;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/* Takes a disko device specification, returns an attrset with metadata
|
||||
|
||||
meta :: lib.types.devices -> AttrSet
|
||||
@@ -638,6 +654,44 @@ let
|
||||
(lib.attrNames (builtins.readDir ./types))
|
||||
);
|
||||
|
||||
} // outputs;
|
||||
|
||||
};
|
||||
outputs =
|
||||
{ lib ? import <nixpkgs/lib>
|
||||
, rootMountPoint ? "/mnt"
|
||||
, checked ? false
|
||||
, diskoLib ? import ./. { inherit lib rootMountPoint; }
|
||||
}:
|
||||
let
|
||||
eval = diskoLib.eval-disko;
|
||||
in
|
||||
{
|
||||
# legacy alias
|
||||
create = cfg: builtins.trace "the create output is deprecated, use format instead" (eval cfg).config.disko.devices._create;
|
||||
createScript = cfg: pkgs: builtins.trace "the create output is deprecated, use format instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
||||
createScriptNoDeps = cfg: pkgs: builtins.trace "the create output is deprecated, use format instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
||||
|
||||
format = cfg: (eval cfg).config.disko.devices._create;
|
||||
formatScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
||||
formatScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
||||
|
||||
mount = cfg: (eval cfg).config.disko.devices._mount;
|
||||
mountScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScript;
|
||||
mountScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScriptNoDeps;
|
||||
|
||||
disko = cfg: (eval cfg).config.disko.devices._disko;
|
||||
diskoScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScript;
|
||||
diskoScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
||||
|
||||
# we keep this old output for backwards compatibility
|
||||
diskoNoDeps = cfg: pkgs: builtins.trace "the diskoNoDeps output is deprecated, please use disko instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
||||
|
||||
config = cfg: (eval cfg).config.disko.devices._config;
|
||||
packages = cfg: (eval cfg).config.disko.devices._packages;
|
||||
};
|
||||
in
|
||||
diskoLib
|
||||
// (outputs {
|
||||
inherit lib rootMountPoint;
|
||||
}) # Compatibility alias
|
||||
// { inherit outputs; }
|
||||
@@ -36,7 +36,7 @@ let
|
||||
|
||||
evaluatedConfig =
|
||||
if hasDiskoFile || hasFlakeDiskoConfig then
|
||||
disko.eval diskFormat
|
||||
disko.eval-disko diskFormat
|
||||
else if (lib.traceValSeq hasFlakeDiskoModule) then
|
||||
flake'.nixosConfigurations.${flakeAttr}
|
||||
else
|
||||
@@ -3,8 +3,8 @@ from pathlib import Path
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
from lib.run_cmd import run
|
||||
from lib.result import DiskoError, DiskoResult, DiskoSuccess
|
||||
from .run_cmd import run
|
||||
from .result import DiskoError, DiskoResult, DiskoSuccess
|
||||
|
||||
NIX_BASE_CMD = [
|
||||
"nix",
|
||||
File renamed without changes.
@@ -5,7 +5,7 @@ import logging
|
||||
import re
|
||||
from typing import Any, Literal, assert_never
|
||||
|
||||
from lib.ansi import Colors
|
||||
from .ansi import Colors
|
||||
|
||||
logging.basicConfig(format="%(message)s", level=logging.INFO)
|
||||
LOGGER = logging.getLogger("disko_logger")
|
||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Generic, Literal, TypeVar
|
||||
|
||||
from lib.logging import DiskoMessage, debug, print_msg, MessageCode
|
||||
from .logging import DiskoMessage, debug, print_msg, MessageCode
|
||||
|
||||
T = TypeVar("T", covariant=True)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import subprocess
|
||||
|
||||
from lib.logging import debug
|
||||
from lib.result import DiskoError, DiskoResult, DiskoSuccess
|
||||
from .logging import debug
|
||||
from .result import DiskoError, DiskoResult, DiskoSuccess
|
||||
|
||||
|
||||
def run(args: list[str]) -> DiskoResult[str]:
|
||||
@@ -79,7 +79,7 @@ let
|
||||
# so /dev/vdb becomes /dev/vda etc.
|
||||
testConfigBooted = testLib.prepareDiskoConfig diskoConfigWithArgs testLib.devices;
|
||||
|
||||
tsp-generator = pkgs.callPackage ../. { checked = true; };
|
||||
tsp-generator = pkgs.callPackage ../../. { checked = true; };
|
||||
tsp-format = (tsp-generator.formatScript testConfigInstall) pkgs;
|
||||
tsp-mount = (tsp-generator.mountScript testConfigInstall) pkgs;
|
||||
tsp-disko = (tsp-generator.diskoScript testConfigInstall) pkgs;
|
||||
@@ -92,7 +92,7 @@ let
|
||||
(lib.optionalAttrs (testMode == "module") {
|
||||
disko.enableConfig = true;
|
||||
imports = [
|
||||
../module.nix
|
||||
../../module.nix
|
||||
testConfigBooted
|
||||
];
|
||||
})
|
||||
@@ -168,7 +168,7 @@ let
|
||||
imports = [
|
||||
(lib.optionalAttrs (testMode == "module") {
|
||||
imports = [
|
||||
../module.nix
|
||||
../../module.nix
|
||||
];
|
||||
disko = {
|
||||
enableConfig = false;
|
||||
File renamed without changes.
File renamed without changes.
@@ -3,8 +3,8 @@ import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from lib.result import DiskoError, DiskoResult, DiskoSuccess
|
||||
from lib.run_cmd import run
|
||||
from ..result import DiskoError, DiskoResult, DiskoSuccess
|
||||
from ..run_cmd import run
|
||||
|
||||
# To see what other fields are available in the lsblk output and what
|
||||
# sort of values you can expect from them, run:
|
||||
File renamed without changes.
@@ -1,9 +1,9 @@
|
||||
from typing import Any
|
||||
|
||||
from lib.logging import DiskoMessage, debug
|
||||
from lib.result import DiskoError, DiskoResult, DiskoSuccess
|
||||
from lib.types.device import BlockDevice, list_block_devices
|
||||
import lib.types.gpt as gpt
|
||||
from ..logging import DiskoMessage, debug
|
||||
from ..result import DiskoError, DiskoResult, DiskoSuccess
|
||||
from ..types.device import BlockDevice, list_block_devices
|
||||
from . import gpt
|
||||
|
||||
|
||||
def _generate_content(device: BlockDevice) -> DiskoResult[dict[str, Any]]:
|
||||
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
from typing import Any
|
||||
from lib.types.device import BlockDevice
|
||||
from lib.result import DiskoResult, DiskoSuccess
|
||||
from .device import BlockDevice
|
||||
from ..result import DiskoResult, DiskoSuccess
|
||||
|
||||
|
||||
def generate_config(device: BlockDevice) -> DiskoResult[dict[str, Any]]:
|
||||
File renamed without changes.
@@ -1,8 +1,8 @@
|
||||
from typing import Any
|
||||
from lib.logging import debug
|
||||
from lib.types import filesystem
|
||||
from lib.types.device import BlockDevice
|
||||
from lib.result import DiskoError, DiskoResult, DiskoSuccess
|
||||
from ..logging import debug
|
||||
from . import filesystem
|
||||
from .device import BlockDevice
|
||||
from ..result import DiskoError, DiskoResult, DiskoSuccess
|
||||
|
||||
|
||||
def _add_type_if_required(
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
}:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
diskoLib = import ../lib { inherit lib makeTest eval-config; };
|
||||
diskoLib = import ../src/disko_lib { inherit lib makeTest eval-config; };
|
||||
|
||||
allTestFilenames =
|
||||
builtins.map (lib.removeSuffix ".nix") (
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
diskoLib ? pkgs.callPackage ../lib { },
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
,
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# this is a regression test for https://github.com/nix-community/disko/issues/52
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# this is a regression test for https://github.com/nix-community/disko/issues/52
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
, diskoLib ? pkgs.callPackage ../src/disko_lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
|
||||
Reference in new issue
Block a user