Fediversity/website/default.nix

49 lines
1 KiB
Nix
Raw Normal View History

2024-11-13 15:24:40 +01:00
{ sources ? import ./npins
, system ? builtins.currentSystem
, pkgs ? import sources.nixpkgs {
inherit system;
config = { };
overlays = [ ];
}
, lib ? import "${sources.nixpkgs}/lib"
}:
2024-11-13 15:24:41 +01:00
let
2024-11-13 15:24:41 +01:00
lib' = final: prev:
let
new = import ./lib.nix { lib = final; };
in
new // { types = prev.recursiveUpdate prev.types new.types; };
2024-11-13 15:24:41 +01:00
lib'' = lib.extend lib';
2024-11-13 15:24:41 +01:00
# TODO: update when the PR to expose `pkgs.devmode` is merged
# https://github.com/NixOS/nixpkgs/pull/354556
devmode = pkgs.callPackage "${sources.devmode-reusable}/pkgs/by-name/de/devmode/package.nix" {
2024-11-13 15:24:41 +01:00
buildArgs = "${toString ./.} -A build --show-trace";
2024-11-13 15:24:41 +01:00
open = "/index.html";
};
2024-11-13 15:24:41 +01:00
in
rec {
2024-11-13 15:24:41 +01:00
lib = import ./lib.nix { inherit lib; };
result = lib''.evalModules {
modules = [
./structure
./content
./presentation
{
_module.args = {
inherit pkgs;
};
}
];
};
2024-11-13 15:24:41 +01:00
inherit (result.config) build;
2024-11-13 15:24:40 +01:00
2024-11-13 15:24:40 +01:00
shell = pkgs.mkShellNoCC {
packages = with pkgs; [
cmark
npins
2024-11-13 15:24:41 +01:00
devmode
2024-11-13 15:24:40 +01:00
];
};
}