project-cloud/flake.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

2023-11-14 14:17:08 +01:00
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.theme_anemone = {
url = "github:Speyll/anemone";
flake = false;
};
2023-11-15 16:43:50 +01:00
inputs.theme_deepthought = {
url = "github:RatanShreshtha/DeepThought";
flake = false;
};
2023-11-14 14:17:08 +01:00
outputs = {
self,
nixpkgs,
theme_anemone,
2023-11-15 16:43:50 +01:00
theme_deepthought,
2023-11-14 14:17:08 +01:00
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
url_deploy = "https://project-cloud.net";
url_local = "http://localhost:8080";
2023-11-14 14:17:08 +01:00
name = "project-cloud";
2023-11-15 16:43:50 +01:00
theme = theme_deepthought;
package = system: url:
pkgs.${system}.stdenv.mkDerivation {
2023-11-14 14:17:08 +01:00
inherit name;
nativeBuildInputs = with pkgs.${system}; [zola];
src = ./.;
submodules = true;
buildPhase = ''
2023-11-15 16:43:50 +01:00
ln -s ${theme} themes/DeepThought
2023-11-14 14:18:53 +01:00
zola build -u ${url}
2023-11-14 14:17:08 +01:00
'';
installPhase = ''
mkdir $out
cp -r public/ $out/
'';
};
in {
packages = forAllSystems (system: rec {
project-cloud = package system url_deploy;
test = package system url_local;
default = project-cloud;
2023-11-14 14:17:08 +01:00
});
devShells = forAllSystems (system: {
default = pkgs.${system}.mkShellNoCC {
packages = with pkgs.${system}; [zola caddy];
2023-11-14 14:17:08 +01:00
};
});
};
}