softinio.com/flake.nix
2024-02-10 18:04:44 -08:00

37 lines
951 B
Nix

{
description = "Softinio's Zola website";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
theme = {
url = "github:welpo/tabi/7fa208a2a5dffbc83dd2b71de1e804c2f2eaad01";
flake = false;
};
};
outputs = { self, nixpkgs, theme }:
let
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs allSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
themeName = ((builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name);
in {
default = pkgs.mkShell {
buildInputs = with pkgs; [ zola ];
shellHook = ''
mkdir -p themes
ln -snf "${theme}" "themes/${themeName}"
'';
};
});
};
}