forked from Fediversity/Fediversity
Compare commits
10 commits
d2638845d0
...
ea92d2d137
Author | SHA1 | Date | |
---|---|---|---|
Valentin Gagarin | ea92d2d137 | ||
Valentin Gagarin | 38d60e0108 | ||
Valentin Gagarin | 746fddcbbb | ||
Nicolas Jeannerod | 243ff8f070 | ||
Nicolas Jeannerod | b04b3c457f | ||
Nicolas Jeannerod | da25f9221a | ||
Nicolas Jeannerod | 5bc7f954bd | ||
Nicolas Jeannerod | e4c891b284 | ||
Nicolas Jeannerod | 104827746a | ||
Nicolas Jeannerod | 2beb64af83 |
|
@ -703,16 +703,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1727672256,
|
"lastModified": 1732350895,
|
||||||
"narHash": "sha256-9/79hjQc9+xyH+QxeMcRsA6hDyw6Z9Eo1/oxjvwirLk=",
|
"narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1719f27dd95fd4206afb9cec9f415b539978827e",
|
"rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-24.05",
|
"ref": "nixos-24.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
## FIXME: Remove direct root authentication once NixOps4 supports users with
|
## FIXME: Remove direct root authentication once NixOps4 supports users with
|
||||||
## password-less sudo.
|
## password-less sudo.
|
||||||
users.root.openssh.authorizedKeys.keys = [
|
users.users.root.openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEElREJN0AC7lbp+5X204pQ5r030IbgCllsIxyU3iiKY"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEElREJN0AC7lbp+5X204pQ5r030IbgCllsIxyU3iiKY"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJg5TlS1NGCRZwMjDgBkXeFUXqooqRlM8fJdBAQ4buPg"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJg5TlS1NGCRZwMjDgBkXeFUXqooqRlM8fJdBAQ4buPg"
|
||||||
];
|
];
|
||||||
|
|
|
@ -17,11 +17,7 @@
|
||||||
};
|
};
|
||||||
nixpkgs = inputs.nixpkgs;
|
nixpkgs = inputs.nixpkgs;
|
||||||
nixos.module = {
|
nixos.module = {
|
||||||
imports = [
|
imports = [ ./vm02116 ];
|
||||||
./vm02116/configuration.nix
|
|
||||||
./vm02116/forgejo.nix
|
|
||||||
./vm02116/hardware-configuration.nix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,11 +31,7 @@
|
||||||
};
|
};
|
||||||
nixpkgs = inputs.nixpkgs;
|
nixpkgs = inputs.nixpkgs;
|
||||||
nixos.module = {
|
nixos.module = {
|
||||||
imports = [
|
imports = [ ./vm02179 ];
|
||||||
./vm02179/configuration.nix
|
|
||||||
./vm02179/hardware-configuration.nix
|
|
||||||
./vm02179/gitea-runner.nix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,11 +45,7 @@
|
||||||
};
|
};
|
||||||
nixpkgs = inputs.nixpkgs;
|
nixpkgs = inputs.nixpkgs;
|
||||||
nixos.module = {
|
nixos.module = {
|
||||||
imports = [
|
imports = [ ./vm02186 ];
|
||||||
./vm02186/procolix-configuration.nix
|
|
||||||
./vm02186/hardware-configuration.nix
|
|
||||||
./vm02186/gitea-runner.nix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -79,10 +67,7 @@
|
||||||
};
|
};
|
||||||
nixpkgs = inputs.nixpkgs;
|
nixpkgs = inputs.nixpkgs;
|
||||||
nixos.module = {
|
nixos.module = {
|
||||||
imports = [
|
imports = [ ./vm02187 ];
|
||||||
./vm02187/configuration.nix
|
|
||||||
./vm02187/hardware-configuration.nix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{
|
{
|
||||||
imports = [ ../common ];
|
imports = [
|
||||||
|
../common
|
||||||
|
./forgejo.nix
|
||||||
|
];
|
||||||
|
|
||||||
procolix.vm = {
|
procolix.vm = {
|
||||||
name = "vm02116";
|
name = "vm02116";
|
||||||
|
@ -12,4 +15,14 @@
|
||||||
## two options can safely be removed.
|
## two options can safely be removed.
|
||||||
boot.initrd.availableKernelModules = [ "xen_blkfront" ];
|
boot.initrd.availableKernelModules = [ "xen_blkfront" ];
|
||||||
services.xe-guest-utilities.enable = true;
|
services.xe-guest-utilities.enable = true;
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/3802a66d-e31a-4650-86f3-b51b11918853";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/2CE2-1173";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ in
|
||||||
{
|
{
|
||||||
services.forgejo = {
|
services.forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
lfs.enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
service = {
|
service = {
|
||||||
DISABLE_REGISTRATION = true;
|
DISABLE_REGISTRATION = true;
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/disk/by-uuid/3802a66d-e31a-4650-86f3-b51b11918853";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/2CE2-1173";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
imports = [ ../common ];
|
|
||||||
|
|
||||||
procolix.vm = {
|
|
||||||
name = "vm02179";
|
|
||||||
ip4 = "185.206.232.179";
|
|
||||||
ip6 = "2a00:51c0:12:1201::179";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,4 +1,15 @@
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../common
|
||||||
|
./gitea-runner.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
procolix.vm = {
|
||||||
|
name = "vm02179";
|
||||||
|
ip4 = "185.206.232.179";
|
||||||
|
ip6 = "2a00:51c0:12:1201::179";
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/119863f8-55cf-4e2f-ac17-27599a63f241";
|
device = "/dev/disk/by-uuid/119863f8-55cf-4e2f-ac17-27599a63f241";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
|
@ -1,4 +1,15 @@
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../common
|
||||||
|
./gitea-runner.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
procolix.vm = {
|
||||||
|
name = "vm02186";
|
||||||
|
ip4 = "185.206.232.186";
|
||||||
|
ip6 = "2a00:51c0:12:1201::186";
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/833ac0f9-ad8c-45ae-a9bf-5844e378c44a";
|
device = "/dev/disk/by-uuid/833ac0f9-ad8c-45ae-a9bf-5844e378c44a";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
imports = [ ../common ];
|
|
||||||
|
|
||||||
procolix.vm = {
|
|
||||||
name = "vm02186";
|
|
||||||
ip4 = "185.206.232.186";
|
|
||||||
ip6 = "2a00:51c0:12:1201::186";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,4 +1,15 @@
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../common
|
||||||
|
./wiki.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
procolix.vm = {
|
||||||
|
name = "vm02187";
|
||||||
|
ip4 = "185.206.232.187";
|
||||||
|
ip6 = "2a00:51c0:12:1201::187";
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/a46a9c46-e32b-4216-a4aa-8819b2cd0d49";
|
device = "/dev/disk/by-uuid/a46a9c46-e32b-4216-a4aa-8819b2cd0d49";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
|
@ -1,14 +1,6 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ../common ];
|
|
||||||
|
|
||||||
procolix.vm = {
|
|
||||||
name = "vm02187";
|
|
||||||
ip4 = "185.206.232.187";
|
|
||||||
ip6 = "2a00:51c0:12:1201::187";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.phpfpm.pools.mediawiki.phpOptions = ''
|
services.phpfpm.pools.mediawiki.phpOptions = ''
|
||||||
upload_max_filesize = 1024M;
|
upload_max_filesize = 1024M;
|
||||||
post_max_size = 1024M;
|
post_max_size = 1024M;
|
|
@ -30,6 +30,26 @@ Structured content is managed through Nix expressions, and copy is written in [C
|
||||||
|
|
||||||
- Edit any of the files, see [repository layout](#repository-layout) for guidance
|
- Edit any of the files, see [repository layout](#repository-layout) for guidance
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
|
||||||
|
As a derivation, e.g. for CI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix-build -A tests
|
||||||
|
```
|
||||||
|
|
||||||
|
In the development shell:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
run-tests
|
||||||
|
```
|
||||||
|
|
||||||
|
Running tests in a loop on source code changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
test-loop
|
||||||
|
```
|
||||||
|
|
||||||
# Repository layout
|
# Repository layout
|
||||||
|
|
||||||
- [content](./content)
|
- [content](./content)
|
||||||
|
|
|
@ -14,16 +14,11 @@ let
|
||||||
in
|
in
|
||||||
new // { types = prev.recursiveUpdate prev.types new.types; };
|
new // { types = prev.recursiveUpdate prev.types new.types; };
|
||||||
lib'' = lib.extend lib';
|
lib'' = lib.extend lib';
|
||||||
# TODO: update when the PR to expose `pkgs.devmode` is merged
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/354556
|
|
||||||
devmode = pkgs.callPackage "${sources.devmode-reusable}/pkgs/by-name/de/devmode/package.nix" {
|
|
||||||
buildArgs = "${toString ./.} -A build --show-trace";
|
|
||||||
open = "/index.html";
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
lib = import ./lib.nix { inherit lib; };
|
lib = lib'';
|
||||||
result = lib''.evalModules {
|
result = lib.evalModules {
|
||||||
modules = [
|
modules = [
|
||||||
./structure
|
./structure
|
||||||
./content
|
./content
|
||||||
|
@ -38,11 +33,36 @@ rec {
|
||||||
|
|
||||||
inherit (result.config) build;
|
inherit (result.config) build;
|
||||||
|
|
||||||
shell = pkgs.mkShellNoCC {
|
shell =
|
||||||
packages = with pkgs; [
|
let
|
||||||
cmark
|
run-tests = pkgs.writeShellApplication {
|
||||||
npins
|
name = "run-tests";
|
||||||
|
text = with pkgs; with lib; ''
|
||||||
|
${getExe nix-unit} ${toString ./tests.nix} "$@"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
test-loop = pkgs.writeShellApplication {
|
||||||
|
name = "test-loop";
|
||||||
|
text = with pkgs; with lib; ''
|
||||||
|
${getExe watchexec} -w ${toString ./.} -- ${getExe nix-unit} ${toString ./tests.nix}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
devmode = pkgs.devmode.override {
|
||||||
|
buildArgs = "${toString ./.} -A build --show-trace";
|
||||||
|
open = "/index.html";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.mkShellNoCC {
|
||||||
|
packages = [
|
||||||
|
pkgs.npins
|
||||||
|
run-tests
|
||||||
|
test-loop
|
||||||
devmode
|
devmode
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tests = with pkgs; with lib; runCommand "run-tests" { } ''
|
||||||
|
touch $out
|
||||||
|
${getExe nix-unit} ${./tests.nix} "$@"
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ rec {
|
||||||
path1 = subpath.components path1';
|
path1 = subpath.components path1';
|
||||||
prefix1 = with lib; take (length path1 - 1) path1;
|
prefix1 = with lib; take (length path1 - 1) path1;
|
||||||
path2 = subpath.components path2';
|
path2 = subpath.components path2';
|
||||||
prefix2 = with lib; take (length path1 - 1) path2;
|
prefix2 = with lib; take (length path2 - 1) path2;
|
||||||
|
|
||||||
commonPrefixLength = with lists;
|
commonPrefixLength = with lists;
|
||||||
findFirstIndex (i: i.fst != i.snd)
|
findFirstIndex (i: i.fst != i.snd)
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
{
|
{
|
||||||
"pins": {
|
"pins": {
|
||||||
"devmode-reusable": {
|
"nix-unit": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "GitHub",
|
"type": "GitHub",
|
||||||
"owner": "fricklerhandwerk",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs"
|
"repo": "nix-unit"
|
||||||
},
|
},
|
||||||
"branch": "refactor-devmode",
|
"branch": "main",
|
||||||
"revision": "f0746a6690939987734d6519a2e3daf28ed36d87",
|
"revision": "2071bbb765681ac3d8194ec560c8b27ff2a3b541",
|
||||||
"url": "https://github.com/fricklerhandwerk/nixpkgs/archive/f0746a6690939987734d6519a2e3daf28ed36d87.tar.gz",
|
"url": "https://github.com/nix-community/nix-unit/archive/2071bbb765681ac3d8194ec560c8b27ff2a3b541.tar.gz",
|
||||||
"hash": "011kg3c2mfy7y808llpmq3hf6vv6rlazx8m11w41pnym4kwr3ivz"
|
"hash": "0blz1kcmn9vnr9q3iqp2mv13hv3pdccljmmc54f8j7ybf5v0wgmp"
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"type": "Channel",
|
"type": "Channel",
|
||||||
"name": "nixpkgs-unstable",
|
"name": "nixpkgs-unstable",
|
||||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre691017.b69de56fac8c/nixexprs.tar.xz",
|
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.05pre711046.8edf06bea5bc/nixexprs.tar.xz",
|
||||||
"hash": "0z32pj0lh5ng2a6cn0qfmka8cynnygckn5615mkaxq2aplkvgzx3"
|
"hash": "1mwsn0rvfm603svrq3pca4c51zlix5gkyr4gl6pxhhq3q6xs5s8y"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": 3
|
"version": 3
|
||||||
|
|
11
website/tests.nix
Normal file
11
website/tests.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# tests written for running with `nix-unit`
|
||||||
|
# https://github.com/nix-community/nix-unit
|
||||||
|
let
|
||||||
|
inherit (import ./. { }) lib;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
test-relativePath = {
|
||||||
|
expr = with lib; relativePath "bar" "baz";
|
||||||
|
expected = "./baz";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue