softinio.com/flake.nix

79 lines
1.8 KiB
Nix
Raw Normal View History

2024-02-10 18:04:44 -08:00
{
2024-02-16 23:22:37 -08:00
description = "Softinio's Zola website: www.softinio.com";
2024-02-10 18:04:44 -08:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
2025-06-14 09:15:14 -07:00
theme = {
url = "github:welpo/tabi/2e29782279d8154cb9c6f1df9a2401612ec77948";
2024-02-10 18:04:44 -08:00
flake = false;
};
};
2025-06-14 09:15:14 -07:00
outputs =
{
self,
nixpkgs,
theme,
}:
let
themeName = ((builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name);
allSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs allSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
packages = forAllSystems (
system:
2024-02-10 18:04:44 -08:00
let
pkgs = nixpkgsFor.${system};
2025-06-14 09:15:14 -07:00
in
{
2024-02-10 18:04:44 -08:00
default = pkgs.stdenv.mkDerivation rec {
name = "softinio-${system}";
version = "0.1";
src = ./.;
2025-06-14 09:15:14 -07:00
nativeBuildInputs = with pkgs; [
nodePackages_latest.wrangler
zola
];
2024-02-10 18:04:44 -08:00
configurePhase = ''
mkdir -p themes
ln -snf "${theme}" "themes/${themeName}"
'';
buildPhase = ''
2024-02-17 10:23:30 -08:00
zola build -f
2024-02-10 18:04:44 -08:00
'';
installPhase = ''
mkdir -p $out
2025-06-14 09:15:14 -07:00
cp -r public/* $out
2024-02-10 18:04:44 -08:00
'';
};
2025-06-14 09:15:14 -07:00
}
);
2024-02-10 18:04:44 -08:00
2025-06-14 09:15:14 -07:00
devShells = forAllSystems (
system:
2024-02-10 18:04:44 -08:00
let
pkgs = nixpkgsFor.${system};
2025-06-14 09:15:14 -07:00
in
{
2024-02-10 18:04:44 -08:00
default = pkgs.mkShell {
2025-06-14 09:15:14 -07:00
buildInputs = with pkgs; [
nodePackages_latest.wrangler
zola
];
2024-02-10 18:04:44 -08:00
shellHook = ''
mkdir -p themes
ln -snf "${theme}" "themes/${themeName}"
'';
};
2025-06-14 09:15:14 -07:00
}
);
};
2024-02-10 18:04:44 -08:00
}