Skip to content

Commit

Permalink
add build-push script
Browse files Browse the repository at this point in the history
  • Loading branch information
MayNiklas committed Aug 9, 2023
1 parent c18efb3 commit 0637d12
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@
# allow using them from other flakes that import this one.

packages = flake-utils.lib.flattenTree {
build-push = pkgs.build-push;
build-system = pkgs.build-system;
drone-gen = pkgs.drone-gen;
mtu-check = pkgs.mtu-check;
Expand Down
1 change: 1 addition & 0 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ self: super: {
# needed.

anki-bin = super.pkgs.callPackage ../packages/anki-bin { };
build-push = super.pkgs.callPackage ../packages/build-push { };
build-system = super.pkgs.callPackage ../packages/build-system { };
bukkit-spigot = super.pkgs.callPackage ../packages/bukkit-spigot { };
darknet = super.pkgs.callPackage ../packages/darknet { };
Expand Down
37 changes: 37 additions & 0 deletions packages/build-push/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ stdenv
, writeShellScriptBin
, nixFlakes
, ...
}:
let

# build system script
build-push-skript = writeShellScriptBin "build-push" ''
# build hosts
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.aida.config.system.build.toplevel
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.daisy.config.system.build.toplevel
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.deke.config.system.build.toplevel
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.kora.config.system.build.toplevel
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.simmons.config.system.build.toplevel
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.snowflake.config.system.build.toplevel
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.the-bus.config.system.build.toplevel
${nixFlakes}/bin/nix build ${../../.}#nixosConfigurations.the-hub.config.system.build.toplevel
# add push to binary cache
'';

in
stdenv.mkDerivation
{

pname = "build-push";
version = "0.1.0";

# Needed if no src is used. Alternatively place script in
# separate file and include it as src
dontUnpack = true;

installPhase = ''
cp -r ${build-push-skript} $out
'';
}

0 comments on commit 0637d12

Please sign in to comment.