-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
76 lines (74 loc) · 1.77 KB
/
flake.nix
File metadata and controls
76 lines (74 loc) · 1.77 KB
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
{
description = "WordPress flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
};
outputs =
{
self,
nixpkgs,
...
}:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems =
function: nixpkgs.lib.genAttrs supportedSystems (system: function nixpkgs.legacyPackages.${system});
ourLib = import ./src/lib.nix;
in
{
devShells = forAllSystems (pkgs: {
default =
with pkgs;
mkShell {
buildInputs = [
jq
jsonfmt
nix
omnix
];
};
});
lib = ourLib;
packages = forAllSystems (
pkgs:
with pkgs;
let
mkWPUpdater =
wordpress-source:
(ourLib.mkWPUpdater {
inherit
lib
pkgs
replaceVarsWith
wordpress-source
;
});
versions = lib.attrsets.mapAttrs (
name: data:
(import ./src/wordpress.nix {
inherit (pkgs) lib stdenv fetchzip;
version = data.version;
hash = data.hash;
})
) (lib.importJSON (self + "/wordpress-versions.json"));
latest = versions.wordpress_6_9_4;
updaters = lib.attrsets.mapAttrs' (
name: wordpress-source: lib.attrsets.nameValuePair ("update-" + name) (mkWPUpdater wordpress-source)
) versions;
in
versions
// {
default = latest;
}
// updaters
// {
update-wordpress = mkWPUpdater latest;
}
);
};
}