xieme-art/nix/packages.nix
Yorick Barbanneau ffea2b6857 ci: rework flake integration
Now Use flake part and integrate a build system using nix package building and treefmt-nix as a flake-part module
2025-05-04 23:44:51 +02:00

105 lines
3.1 KiB
Nix

{
lib,
inputs,
...
}:
let
inherit (lib) mkOption mdDoc types;
inherit (inputs.flake-parts.lib) mkPerSystemOption;
in
{
options.perSystem = mkPerSystemOption (
{
pkgs,
config,
...
}:
{
options = {
buildPackages = mkOption {
description = mdDoc "Python package used in the project";
type = types.listOf types.package;
default = with pkgs; [
python311
python311Packages.markdown-include
python311Packages.pelican
python311Packages.typogrify
];
};
develPackages = mkOption {
description = mdDoc "Python package used to development";
type = types.listOf types.package;
default = with pkgs; [
convco
go-task
lefthook
python3Packages.invoke
python3Packages.livereload
shellcheck
shfmt
typos
];
};
deployPackages = mkOption {
description = mdDoc "Package use to deploy";
type = types.listOf types.package;
default = with pkgs; [
rsync
];
};
pelicanplugins = mkOption {
type = types.package;
description = mdDoc "Pelican plugins used in my blog";
default =
with pkgs;
stdenvNoCC.mkDerivation {
name = "pelicanplugins";
pname = "pelicanplugins";
version = "1.0.0";
sourceRoot = ".";
srcs = [
(pkgs.fetchFromGitHub {
name = "neighbors";
owner = "pelican-plugins";
repo = "neighbors";
rev = "60649ac6f3494d01a37b9c6d3d455f9dc2502d55";
hash = "sha256-c6etuRqve9xj6NhGRAim2A0ae8xv6mI/yez+suQuZ8U=";
})
(pkgs.fetchFromGitHub {
name = "markdown-include";
owner = "pelican-plugins";
repo = "markdown-include";
rev = "df0b3e55c45471283ca62d6e157b61a8caa35e37";
hash = "sha256-y0dIvyEYLbYqkm+6yJOUYI3apzEMJ/N/JUwWTqjdsNg=";
})
];
installPhase = ''
cp -r markdown-include/pelican/plugins/ $out/
cp -r neighbors/pelican/plugins/neighbors $out/
'';
};
};
pelicantheme = mkOption {
type = types.package;
description = mdDoc "My personnal Pelican theme";
default = (
with pkgs;
stdenvNoCC.mkDerivation {
name = "pelicantheme-atilla";
pname = "pelicantheme-atilla";
version = "main";
src = pkgs.fetchgit {
url = "https://git.epha.se/ephase/attila_pelican_theme";
rev = "c5923a4be38d9c646a9dc261fb0ba4f24fe5655a";
hash = "sha256-DaaumjR23pXrACRHX9FssxE56nV7vLRy7HjRclm6rgs=";
};
installPhase = ''
cp -r $src/ $out
'';
}
);
};
};
}
);
}