-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
94 lines (84 loc) · 2.56 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
composer2nix = {
url = "github:svanderburg/composer2nix";
flake = false;
};
mediawiki-extdist = {
url = "github:Die-KoMa/mediawiki-extdist";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [
inputs.mediawiki-extdist.overlays.default
inputs.mediawiki-extdist.overlays.poetry2nix
];
};
composer2nix = import inputs.composer2nix {
inherit pkgs system;
noDev = true;
};
in
{
nixosModules.komapedia = import ./modules/komapedia.nix (self.packages."${system}");
apps."${system}".update-extensions = {
type = "app";
program =
let
updateScript = pkgs.writeShellScript "komapedia-update-extensions" ''
pushd packages
TMPDIR=$(mktemp --directory)
${pkgs.mediawiki-extdist}/bin/mediawiki-extdist \
--mw-version REL1_39 --output $TMPDIR \
--extension Description2 \
--extension EditSubpages \
--extension Interwiki \
--extension NativeSvgHandler \
--extension OpenGraphMeta \
--extension UserMerge \
--extension Variables
cp $TMPDIR/*.tar.gz .
git add *.tar.gz
pushd PageForms
rm composer.lock
composer2nix -p mediawiki/page-forms
popd
git add PageForms
pushd SemanticMediaWiki
rm composer.lock
composer2nix -p mediawiki/semantic-media-wiki
popd
git add SemanticMediaWiki
pushd SemanticResultFormats
rm composer.lock
composer2nix -p mediawiki/semantic-result-formats
popd
git add SemanticResultFormats
popd
'';
in
"${updateScript}";
};
packages."${system}" = import ./packages {
inherit pkgs system composer2nix;
lib = pkgs.lib;
};
devShells."${system}".default = pkgs.mkShell {
nativeBuildInputs = [
composer2nix
pkgs.php
pkgs.phpPackages.composer
];
};
# build everything as part of nix flake check
checks = self.packages;
formatter."${system}" = pkgs.treefmt;
};
}