mirror of
https://github.com/nix-community/disko.git
synced 2026-12-04 06:53: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
@@ -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
|
||||
Reference in new issue
Block a user