disko: fix packaging missing nix files

This commit is contained in:
Jörg Thalheim 2023-02-02 13:51:49 +01:00
parent b3875afc1f
commit 50adcfe303

View File

@ -1,27 +1,15 @@
{ stdenvNoCC, lib }: { stdenvNoCC, lib }:
let
inclFiles = {src, name}: files: lib.cleanSourceWith {
inherit src name;
filter = _path: _type: _type == "regular" && lib.any (file: builtins.baseNameOf _path == file) files;
};
in
stdenvNoCC.mkDerivation rec { stdenvNoCC.mkDerivation rec {
name = "disko"; name = "disko";
src = inclFiles { inherit name; src = ./.; } [ src = ./.;
"disko"
"cli.nix"
"default.nix"
"types.nix"
"options.nix"
];
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/share/disko mkdir -p $out/bin $out/share/disko
cp -r $src/* $out/share/disko cp -r cli.nix default.nix types.nix disk-deactivate types $out/share/disko
sed \ sed \
-e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" \ -e "s|libexec_dir=\".*\"|libexec_dir=\"$out/share/disko\"|" \
-e "s|#!/usr/bin/env.*|#!/usr/bin/env bash|" \ -e "s|#!/usr/bin/env.*|#!/usr/bin/env bash|" \
$src/disko > $out/bin/disko disko > $out/bin/disko
chmod 755 $out/bin/disko chmod 755 $out/bin/disko
''; '';
meta = with lib; { meta = with lib; {