Skip to content

Commit 814c452

Browse files
authored
Merge pull request #26 from darktable-org/add_flake
added flake.nix to tell the deploy jobs what to do
2 parents 6b745d2 + ad7ce26 commit 814c452

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

flake.nix

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
description = "An environment for developing darktable's documentation";
3+
4+
inputs = {
5+
nixpkgs = {
6+
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
7+
};
8+
};
9+
10+
outputs = { self, nixpkgs }: {
11+
devShell.x86_64-linux =
12+
let
13+
pkgs = nixpkgs.legacyPackages.x86_64-linux;
14+
in
15+
pkgs.mkShell {
16+
packages = with pkgs; [
17+
hugo
18+
yarn
19+
rsync
20+
gitFull
21+
perlPackages.Po4a
22+
python311Packages.weasyprint
23+
lychee
24+
zip
25+
];
26+
shellHook = ''
27+
PROJECTDIR=`pwd`
28+
hugo-deploy() {
29+
echo "This doesn't do anything, but maybe it will one day."
30+
}
31+
update-assets() {
32+
cd $PROJECTDIR && cd themes/hugo-darktable-docs-theme/assets && yarn install && cd $PROJECTDIR
33+
}
34+
check-links() {
35+
cd $PROJECTDIR/content && lychee . && cd $PROJECTDIR
36+
}
37+
generate-po() {
38+
cd $PROJECTDIR && cd tools/ && ./generate-translations.sh --no-translations && cd $PROJECTDIR
39+
}
40+
generate-translated-files() {
41+
cd $PROJECTDIR && cd tools/ && ./generate-translations.sh --no-update && cd $PROJECTDIR
42+
}
43+
remove-translated-files() {
44+
# cd $PROJECTDIR && cd tools/ && ./generate-translations.sh --rm-translations && cd $PROJECTDIR # This is really slow
45+
cd $PROJECTDIR
46+
find . -name '*.de.md' -exec rm {} \;
47+
find . -name '*.es.md' -exec rm {} \;
48+
find . -name '*.fr.md' -exec rm {} \;
49+
find . -name '*.nl.md' -exec rm {} \;
50+
find . -name '*.pl.md' -exec rm {} \;
51+
find . -name '*.pt_br.md' -exec rm {} \;
52+
find . -name '*.uk.md' -exec rm {} \;
53+
}
54+
'';
55+
};
56+
};
57+
}

0 commit comments

Comments
 (0)