noogle/website/flake-module.nix

37 lines
1.0 KiB
Nix
Raw Normal View History

2023-11-23 14:31:33 +03:00
{ self, ... }: {
perSystem = { self', pkgs, ... }:
let
inherit (self.inputs) floco;
2023-11-29 23:37:07 +03:00
hooks = {
2023-12-22 23:09:02 +03:00
prepare =
let
data_path = "src/models/data";
fonts_path = "src/fonts";
in
''
# New data
cp -f ${self'.packages.data-json} ${data_path}/data.json
cp -f ${self'.packages.pasta-meta} ${data_path}/meta.json
cp -rf ${self'.packages.salt}/* ${data_path}
chmod -R +w ${data_path}
# Website fonts
cp -rf ${pkgs.inter}/share/fonts/opentype/* ${fonts_path}
cp -rf ${pkgs.fira-code}/share/fonts/truetype/* ${fonts_path}
chmod -R +w ${fonts_path}
2023-11-29 23:37:07 +03:00
'';
};
2023-11-23 14:31:33 +03:00
base = pkgs.callPackage ./default.nix {
2023-11-29 23:37:07 +03:00
inherit floco hooks;
2023-11-23 14:31:33 +03:00
};
2023-11-28 19:28:51 +03:00
in
{
2023-11-23 14:31:33 +03:00
packages = { ui = base.pkg.global; };
devShells.ui = pkgs.callPackage ./shell.nix {
2023-11-29 23:37:07 +03:00
inherit pkgs hooks;
2023-11-23 14:31:33 +03:00
inherit (base) fmod pkg;
2023-12-22 22:34:22 +03:00
inherit (self'.packages) data-json pasta-meta;
2023-11-23 14:31:33 +03:00
};
};
}