-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
treewide: Refactor to per-project structure
- Loading branch information
1 parent
2b45422
commit 20ef037
Showing
48 changed files
with
316 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Functions to lay on top of Nixpkgs' lib for convenience. | ||
{lib}: let | ||
inherit | ||
(builtins) | ||
mapAttrs | ||
isAttrs | ||
concatStringsSep | ||
; | ||
|
||
inherit | ||
(lib) | ||
attrByPath | ||
concatMapAttrs | ||
; | ||
in rec { | ||
# Takes an attrset of arbitrary nesting (attrset containing attrset) | ||
# and flattens it into an attrset that is *not* nested, i.e., does | ||
# *not* contain attrsets. | ||
# This is done by concatenating the names of nested values using a | ||
# separator. | ||
# | ||
# Type: flattenAttrs :: string -> [string] -> AttrSet -> AttrSet | ||
# | ||
# Example: | ||
# flattenAttrs "~" ["1" "2"] { a = { b = "x"; }; c = { d = { e = "y"; }; }; f = "z"; } | ||
# => { "1~2~a~b" = "x"; "1~2~c~d~e" = "y"; "1~2~f" = "z"; } | ||
flattenAttrs = | ||
# Separator to use to join names of different nesting levels. | ||
separator: | ||
# Prefix to be prepended to all names in the generated attrset, | ||
# as a list that is joined by the separator. | ||
prefix: let | ||
initPath = | ||
if prefix == [] | ||
then "" | ||
else (concatStringsSep separator prefix) + separator; | ||
f = path: | ||
concatMapAttrs ( | ||
name: value: | ||
if isAttrs value | ||
then f (path + name + separator) value | ||
else {${path + name} = value;} | ||
); | ||
in | ||
f initPath; | ||
|
||
flattenAttrsSlash = flattenAttrs "/" []; | ||
|
||
mapAttrByPath = attrPath: default: mapAttrs (_: attrByPath attrPath default); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
{ | ||
# LiberaForms is intentionally disabled. | ||
# Refer to <https://github.com/ngi-nix/ngipkgs/issues/40>. | ||
#liberaforms = import ./liberaforms.nix; | ||
flarum = import ./flarum.nix; | ||
kbin = import ./kbin.nix; | ||
mcaptcha = import ./mcaptcha.nix; | ||
pretalx = import ./pretalx.nix; | ||
unbootable = import ./unbootable.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
{ | ||
fetchFromGitHub, | ||
fetchurl, | ||
lib, | ||
php, | ||
}: let | ||
inherit | ||
(lib) | ||
licenses | ||
; | ||
in | ||
php.buildComposerProject (finalAttrs: { | ||
pname = "flarum"; | ||
version = "1.8.0"; | ||
}: | ||
php.buildComposerProject (finalAttrs: { | ||
pname = "flarum"; | ||
version = "1.8.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "flarum"; | ||
repo = "flarum"; | ||
rev = "v${finalAttrs.version}"; | ||
hash = "sha256-xadZIdyH20mxfxCyiDRtSRSrPj8DWXpuup61WSsjgWw="; | ||
}; | ||
src = fetchFromGitHub { | ||
owner = "flarum"; | ||
repo = "flarum"; | ||
rev = "v${finalAttrs.version}"; | ||
hash = "sha256-xadZIdyH20mxfxCyiDRtSRSrPj8DWXpuup61WSsjgWw="; | ||
}; | ||
|
||
composerLock = ./composer.lock; | ||
composerStrictValidation = false; | ||
vendorHash = "sha256-G/EPHcvcppuyAC0MAzE11ZjlOSTlphQrHnO3yS4+j5g="; | ||
composerLock = ./composer.lock; | ||
composerStrictValidation = false; | ||
vendorHash = "sha256-G/EPHcvcppuyAC0MAzE11ZjlOSTlphQrHnO3yS4+j5g="; | ||
|
||
meta = { | ||
changelog = "https://github.com/flarum/framework/blob/main/CHANGELOG.md"; | ||
description = "Flarum is a delightfully simple discussion platform for your website"; | ||
homepage = "https://github.com/flarum/flarum"; | ||
license = licenses.mit; | ||
}; | ||
}) | ||
meta = { | ||
changelog = "https://github.com/flarum/framework/blob/main/CHANGELOG.md"; | ||
description = "Flarum is a delightfully simple discussion platform for your website"; | ||
homepage = "https://github.com/flarum/flarum"; | ||
license = lib.licenses.mit; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.