From 4dc9cdac9177966dd5346192da6c6558eb57a6c7 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 30 Aug 2024 17:52:57 +0200 Subject: [PATCH] flake.nix: move websites from packages.* to apps.* this should not change their behaviour with "nix run", which was the reason for putting them there in the first place (however, it does remove the ability to build them with "nix build", but afaik this has never been used by anyone). This means the packages.* output is now left unused, so we can use it instead for things that actually are programs which want to expose (see the next commit after this one for an example). --- flake.nix | 9 +++++++-- websites/docs.hacc.space/default.nix | 4 ++-- websites/hacc.earth/default.nix | 4 ++-- websites/help.studentsforfuture.info/default.nix | 4 ++-- websites/infra4future.de/default.nix | 4 ++-- websites/muc.hacc.earth/default.nix | 4 ++-- websites/mumble.infra4future.de/default.nix | 4 ++-- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index d93d44b..89e87c2 100644 --- a/flake.nix +++ b/flake.nix @@ -73,9 +73,14 @@ (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; - packages.x86_64-linux = + apps.x86_64-linux = let - websites = self.nixosConfigurations.parsons.config.hacc.websites.builders; + mkApp = pkg: { + type = "app"; + program = pkgs.lib.getExe pkg; + }; + websites = pkgs.lib.mapAttrs (name: mkApp) + self.nixosConfigurations.parsons.config.hacc.websites.builders; in { docs = websites."docs.hacc.space"; } // websites; }; diff --git a/websites/docs.hacc.space/default.nix b/websites/docs.hacc.space/default.nix index cab23a7..d7211e0 100644 --- a/websites/docs.hacc.space/default.nix +++ b/websites/docs.hacc.space/default.nix @@ -1,4 +1,4 @@ -{ copyPathToStore, stdenvNoCC, zola, writeScriptBin }: +{ copyPathToStore, stdenvNoCC, zola, writeShellScriptBin }: stdenvNoCC.mkDerivation rec { name = "docs.hacc.space-static"; @@ -15,7 +15,7 @@ stdenvNoCC.mkDerivation rec { zola build --output-dir $out ''; - watch = writeScriptBin "watch" '' + watch = writeShellScriptBin "watch" '' cd $(git rev-parse --show-toplevel)/websites/docs.hacc.space ${zola}/bin/zola serve --output-dir /tmp/hacc-docs "$@" ''; diff --git a/websites/hacc.earth/default.nix b/websites/hacc.earth/default.nix index 4e897f3..18f7596 100644 --- a/websites/hacc.earth/default.nix +++ b/websites/hacc.earth/default.nix @@ -1,4 +1,4 @@ -{ stdenvNoCC, sfz, writeScriptBin }: +{ stdenvNoCC, sfz, writeShellScriptBin }: stdenvNoCC.mkDerivation rec { name = "hacc.earth-static"; @@ -13,7 +13,7 @@ stdenvNoCC.mkDerivation rec { rm $out/default.nix ''; - watch = writeScriptBin "watch" '' + watch = writeShellScriptBin "watch" '' cd $(git rev-parse --show-toplevel)/websites/hacc.earth ${sfz}/bin/sfz "$@" ''; diff --git a/websites/help.studentsforfuture.info/default.nix b/websites/help.studentsforfuture.info/default.nix index f266319..bb72d63 100644 --- a/websites/help.studentsforfuture.info/default.nix +++ b/websites/help.studentsforfuture.info/default.nix @@ -1,4 +1,4 @@ -{ stdenvNoCC, sfz, writeScriptBin }: +{ stdenvNoCC, sfz, writeShellScriptBin }: stdenvNoCC.mkDerivation rec { name = "muc.hacc.earth-static"; @@ -13,7 +13,7 @@ stdenvNoCC.mkDerivation rec { rm $out/default.nix ''; - watch = writeScriptBin "watch" '' + watch = writeShellScriptBin "watch" '' cd $(git rev-parse --show-toplevel)/websites/help.studentsforfuture.info ${sfz}/bin/sfz "$@" ''; diff --git a/websites/infra4future.de/default.nix b/websites/infra4future.de/default.nix index 1365984..b5aa029 100644 --- a/websites/infra4future.de/default.nix +++ b/websites/infra4future.de/default.nix @@ -1,4 +1,4 @@ -{ jekyll, stdenvNoCC, writeScriptBin }: +{ jekyll, stdenvNoCC, writeShellScriptBin }: stdenvNoCC.mkDerivation rec { name = "infra4future.de-static"; @@ -11,7 +11,7 @@ stdenvNoCC.mkDerivation rec { ${jekyll}/bin/jekyll build -d $out --disable-disk-cache ''; - watch = writeScriptBin "watch" '' + watch = writeShellScriptBin "watch" '' cd $(git rev-parse --show-toplevel)/websites/infra4future.de rm -rf /tmp/hacc-website ${jekyll}/bin/jekyll serve --disable-disk-cache -d /tmp/hacc-website "$@" diff --git a/websites/muc.hacc.earth/default.nix b/websites/muc.hacc.earth/default.nix index 34a9d75..d94e8d5 100644 --- a/websites/muc.hacc.earth/default.nix +++ b/websites/muc.hacc.earth/default.nix @@ -1,4 +1,4 @@ -{ stdenvNoCC, sfz, writeScriptBin }: +{ stdenvNoCC, sfz, writeShellScriptBin }: stdenvNoCC.mkDerivation rec { name = "muc.hacc.earth-static"; @@ -13,7 +13,7 @@ stdenvNoCC.mkDerivation rec { rm $out/default.nix ''; - watch = writeScriptBin "watch" '' + watch = writeShellScriptBin "watch" '' cd $(git rev-parse --show-toplevel)/websites/muc.hacc.earth ${sfz}/bin/sfz "$@" ''; diff --git a/websites/mumble.infra4future.de/default.nix b/websites/mumble.infra4future.de/default.nix index 2e0d509..3234243 100644 --- a/websites/mumble.infra4future.de/default.nix +++ b/websites/mumble.infra4future.de/default.nix @@ -1,4 +1,4 @@ -{ jekyll, stdenvNoCC, writeScriptBin }: +{ jekyll, stdenvNoCC, writeShellScriptBin }: stdenvNoCC.mkDerivation rec { name = "mumble.infra4future.de-static"; @@ -11,7 +11,7 @@ stdenvNoCC.mkDerivation rec { ${jekyll}/bin/jekyll build -d $out --disable-disk-cache ''; - watch = writeScriptBin "watch" '' + watch = writeShellScriptBin "watch" '' cd $(git rev-parse --show-toplevel)/websites/mumble.infra4future.de rm -rf /tmp/hacc-website ${jekyll}/bin/jekyll serve --disable-disk-cache -d /tmp/hacc-website "$@"