Skip to content

Commit

Permalink
move growpart out of nixos into cloud-init package
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Mar 30, 2016
1 parent ef753d2 commit 96be420
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
28 changes: 1 addition & 27 deletions nixos/modules/virtualisation/amazon-grow-partition.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,13 @@

{ config, lib, pkgs, ... }:

with lib;

let

growpart = pkgs.stdenv.mkDerivation {
name = "growpart";
src = pkgs.fetchurl {
url = "https://launchpad.net/cloud-utils/trunk/0.27/+download/cloud-utils-0.27.tar.gz";
sha256 = "16shlmg36lidp614km41y6qk3xccil02f5n3r4wf6d1zr5n4v8vd";
};
patches = [ ./growpart-util-linux-2.26.patch ];
buildPhase = ''
cp bin/growpart $out
sed -i 's|awk|gawk|' $out
sed -i 's|sed|gnused|' $out
'';
dontInstall = true;
dontPatchShebangs = true;
};

in

{

config = mkIf config.ec2.hvm {

boot.initrd.extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.gawk}/bin/gawk
copy_bin_and_libs ${pkgs.gnused}/bin/sed
copy_bin_and_libs ${pkgs.utillinux}/sbin/sfdisk
cp -v ${growpart} $out/bin/growpart
cp -v ${pkgs.cloud-utils}/bin/growpart $out/bin/growpart
ln -s sed $out/bin/gnused
'';

Expand All @@ -44,7 +20,5 @@ in
udevadm settle
fi
'';

};

}
18 changes: 18 additions & 0 deletions pkgs/tools/misc/cloud-utils/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ stdenv, fetchurl }:

stdenv.mkDerivation {
name = "cloud-utils-0.27";
src = fetchurl {
url = "https://launchpad.net/cloud-utils/trunk/0.27/+download/cloud-utils-0.27.tar.gz";
sha256 = "16shlmg36lidp614km41y6qk3xccil02f5n3r4wf6d1zr5n4v8vd";
};
patches = [ ./growpart-util-linux-2.26.patch ];
buildPhase = ''
mkdir -p $out/bin
cp bin/growpart $out/bin/growpart
sed -i 's|awk|gawk|' $out/bin/growpart
sed -i 's|sed|gnused|' $out/bin/growpart
'';
dontInstall = true;
dontPatchShebangs = true;
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,8 @@ in

cloogppl = callPackage ../development/libraries/cloog-ppl { };

cloud-utils = callPackage ../tools/misc/cloud-utils { };

compass = callPackage ../development/tools/compass { };

convmv = callPackage ../tools/misc/convmv { };
Expand Down

0 comments on commit 96be420

Please sign in to comment.