Skip to content

Commit

Permalink
Merge branch 'main' into mCaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzleutgeb authored Nov 24, 2023
2 parents 9ca9dcb + f0d36a5 commit bc0dc15
Show file tree
Hide file tree
Showing 33 changed files with 1,172 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@main
with:
upstream-cache: https://ngi.cachix.org/
- run: nix flake check
- run: nix ${{ runner.debug && '--debug --print-build-logs' }} flake check
3 changes: 2 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ jobs:
with:
name: ngi
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix flake check
- run: nix ${{ runner.debug && '--debug --print-build-logs' }} flake check

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 NGIpkgs contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions configs/all-configurations.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@
./dummy.nix
];
};
kbin = {
imports = [
./kbin
./dummy.nix
];
};
}
23 changes: 23 additions & 0 deletions configs/kbin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{...}: {
networking.firewall.allowedTCPPorts = [80];

services = {
kbin = {
enable = true;
# settings.APP_DEBUG = "1";
};

postgresql = {
enable = true;
authentication = "host all all 127.0.0.1/32 trust";
ensureUsers = [
{
name = "kbin";
ensurePermissions."DATABASE \"kbin\"" = "ALL PRIVILEGES";
}
];
ensureDatabases = ["kbin"];
enableTCPIP = true;
};
};
}
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 16 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,26 @@
in
mapAttrs (name: _:
pkgs.nixosTest (import (dir + "/${name}") {
inherit pkgs;
inherit (pkgs) lib;
modules = extendedModules;
configurations = importNixosConfigurations;
})) (readDir dir)
);
callPackage = pkgs.newScope (
result // {inherit callPackage nixosTests;}
allPackages // {inherit callPackage nixosTests;}
);
args = {
pkgsByName = import ./pkgs/by-name {
inherit (pkgs) lib;
inherit callPackage;
};
result = (import ./pkgs/by-name args) // (import ./pkgs args);
explicitPkgs = import ./pkgs {
inherit (pkgs) lib;
inherit callPackage;
};
allPackages = pkgsByName // explicitPkgs;
in
result;
allPackages;

importNixpkgs = system: overlays:
import nixpkgs {
Expand Down Expand Up @@ -100,29 +106,31 @@
linuxSystem = "x86_64-linux";
pkgs = importNixpkgs linuxSystem [self.overlays.default];
treefmtEval = loadTreefmt pkgs;
nonBrokenPkgs =
nixpkgs.lib.attrsets.filterAttrs (_: v: !v.meta.broken)
self.packages.${linuxSystem};
in {
# Github Actions executes `nix flake check` therefore this output
# should only contain derivations that can built within CI.
# See `.github/workflows/ci.yaml`.
checks.${linuxSystem} =
# For `nix flake check` to *build* all packages, because by default
# `nix flake check` only evaluates packages and does not build them.
self.packages.${linuxSystem}
nonBrokenPkgs
// {
formatting = treefmtEval.config.build.check self;
};

# To generate a Hydra jobset for CI builds of all packages and tests.
# See <https://hydra.ngi0.nixos.org/jobset/ngipkgs/main>.
hydraJobs = let
packages = self.packages.${linuxSystem};
passthruTests = concatMapAttrs (name: value:
if value ? passthru.tests
then {${name} = value.passthru.tests;}
else {})
packages;
nonBrokenPkgs;
in {
packages.${linuxSystem} = packages;
packages.${linuxSystem} = nonBrokenPkgs;
tests.${linuxSystem} = passthruTests;
};
})
Expand Down
2 changes: 1 addition & 1 deletion modules/all-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# 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;
rosenpass = import ./rosenpass.nix;
unbootable = import ./unbootable.nix;
}
Loading

0 comments on commit bc0dc15

Please sign in to comment.