Compare commits

..

25 commits

Author SHA1 Message Date
d53dff003e
upgrade memory to resolve oom 2025-07-01 17:57:00 +02:00
604803aea3
[wip] handling env file (still fails) 2025-07-01 17:57:00 +02:00
5d0ecc08c1
use templating fork 2025-07-01 17:57:00 +02:00
c1141534a9
add tests, fix some things 2025-07-01 17:57:00 +02:00
441097a49b
unrelated improvements 2025-07-01 17:57:00 +02:00
86bed1ced1
move from dev to operator 2025-07-01 17:57:00 +02:00
721e0ae961
WIP: add attic cache, see #92
flesh out attic

TODO keys nginx-port testing

fix key

fix key
2025-07-01 17:57:00 +02:00
c1dc0fef01 Split nameservers between IPv4 and IPv6 (#420)
Reviewed-on: Fediversity/Fediversity#420
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-07-01 13:09:06 +02:00
5a3cbe4d83 fix agenix package in shell (#422)
as per Fediversity/Fediversity#419 (comment)

Reviewed-on: Fediversity/Fediversity#422
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-07-01 11:29:38 +02:00
fd1d55df5f
move shell from flake 2025-07-01 10:22:58 +02:00
0c23115cff allow configuring network interface (#413)
Reviewed-on: Fediversity/Fediversity#413
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-30 19:23:51 +02:00
3f1c8a9bb7
Document why Nix and OpenSSH
lost in #412. Alternatively, we could have a comment on both lines
saying eg. “for NixOps4”
2025-06-30 14:30:29 +02:00
737aecaba6 set default value for nixops4Package (#412)
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Reviewed-on: Fediversity/Fediversity#412
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-30 12:44:53 +02:00
d7dbdd923c make CI test invocations idempotent to better facilitate manual use (#416)
Reviewed-on: Fediversity/Fediversity#416
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-30 12:42:19 +02:00
1c44004cfe update documentation for #375 (#406)
Reviewed-on: Fediversity/Fediversity#406
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-27 14:40:40 +02:00
ae444d5352 simplify imports (#415)
Reviewed-on: Fediversity/Fediversity#415
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-27 14:01:41 +02:00
e77fdd9eec expose nixops4 in nix-shell (#411)
Instead of Fediversity/Fediversity#406

Eventually we should merge `//panel/default.nix` with `//default.nix` of course.

Co-authored-by: Nicolas Jeannerod <nicolas.jeannerod@moduscreate.com>
Reviewed-on: Fediversity/Fediversity#411
Reviewed-by: Nicolas Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-committed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2025-06-27 12:00:47 +02:00
1f1cf0d516 unset class, fixing #408 (#410)
Reviewed-on: Fediversity/Fediversity#410
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-27 11:53:17 +02:00
f94eac698a
disable updater schedule while it hangs 2025-06-26 17:01:40 +02:00
46182e7512 fix workflow step title (#404)
split off from #399

Reviewed-on: Fediversity/Fediversity#404
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-24 08:58:01 +02:00
9a25a04bfa specify _class module attributes to explicitly declare module types (#398)
closes #93.

note that this includes classes:

- `nixos`
- `nixosTest`
- `nixops4Resource`
- `nixops4Deployment`

.. and my (made-up, as per the [docs](https://ryantm.github.io/nixpkgs/module-system/module-system/#module-system-lib-evalModules-param-class)):

- `nix-unit`
- `package`

.. while i did not manage to cover:

- service tests, given `pkgs.nixosTest` seemed to not actually like `_class = "nixosTest"` (?!)

... nor #93's mentioned destructured arguments for that matter, as per Fediversity/Fediversity#93 (comment) - let me know if that is still desired as well.

Reviewed-on: Fediversity/Fediversity#398
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-23 17:24:54 +02:00
c1b33121b6 expose npins in shell for CI (#403)
Should fix Fediversity/Fediversity#65 (comment)

Reviewed-on: Fediversity/Fediversity#403
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-committed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2025-06-23 17:21:32 +02:00
d073bd706d
cast DEPLOYMENT_FLAKE to string 2025-06-22 14:42:14 +02:00
486b316885 run updater natively (#394)
see Fediversity/Fediversity#65 (comment).

closes #65.

Reviewed-on: Fediversity/Fediversity#394
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-20 09:41:38 +02:00
611c961dcf separate test declarations from invocations (#396)
see Fediversity/Fediversity#395 (comment)

Reviewed-on: Fediversity/Fediversity#396
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-19 18:11:08 +02:00
70 changed files with 227 additions and 81 deletions

View file

@ -2,20 +2,22 @@ name: update-dependencies
on: on:
workflow_dispatch: # allows manual triggering workflow_dispatch: # allows manual triggering
schedule: # FIXME: re-enable when manual run works
- cron: '0 0 1 * *' # monthly # schedule:
# - cron: '0 0 1 * *' # monthly
jobs: jobs:
lockfile: lockfile:
runs-on: ubuntu-latest runs-on: native
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Nix - name: Update pins
uses: cachix/install-nix-action@v31 run: nix-shell --run "npins update"
- name: Install npins - name: Create PR
run: nix profile install 'nixpkgs#npins' uses: peter-evans/create-pull-request@v7
- name: Update npins sources
uses: getchoo/update-npins@v0
with: with:
token: "${{ secrets.DEPLOY_KEY }}" token: "${{ secrets.DEPLOY_KEY }}"
branch: npins-update
commit-message: "npins: update sources"
title: "npins: update sources"

View file

@ -10,6 +10,8 @@ let
gitignore gitignore
; ;
inherit (pkgs) lib; inherit (pkgs) lib;
inherit (import sources.flake-inputs) import-flake;
inherit ((import-flake { src = ./.; }).inputs) nixops4;
pre-commit-check = pre-commit-check =
(import "${git-hooks}/nix" { (import "${git-hooks}/nix" {
inherit nixpkgs system; inherit nixpkgs system;
@ -55,8 +57,15 @@ in
}; };
in in
[ [
pkgs.npins
pkgs.nil
(pkgs.callPackage "${sources.agenix}/pkgs/agenix.nix" { })
pkgs.openssh
pkgs.httpie
pkgs.jq
pkgs.nix-unit pkgs.nix-unit
test-loop test-loop
nixops4.packages.${system}.default
]; ];
}; };

View file

@ -17,6 +17,8 @@ let
in in
{ {
_class = "flake";
perSystem = perSystem =
{ pkgs, ... }: { pkgs, ... }:
{ {

View file

@ -1,6 +1,8 @@
{ inputs, ... }: { inputs, ... }:
{ {
_class = "nixosTest";
name = "deployment-basic"; name = "deployment-basic";
nodes.deployer = nodes.deployer =

View file

@ -21,6 +21,8 @@ let
in in
{ {
_class = "flake";
perSystem = perSystem =
{ pkgs, ... }: { pkgs, ... }:
{ {

View file

@ -7,6 +7,8 @@ let
in in
{ {
_class = "nixosTest";
name = "deployment-cli"; name = "deployment-cli";
nodes.deployer = nodes.deployer =

View file

@ -18,6 +18,8 @@ let
in in
{ {
_class = "nixos";
imports = [ ./sharedOptions.nix ]; imports = [ ./sharedOptions.nix ];
options.system.extraDependenciesFromModule = mkOption { options.system.extraDependenciesFromModule = mkOption {

View file

@ -42,6 +42,8 @@ let
in in
{ {
_class = "nixosTest";
imports = [ imports = [
./sharedOptions.nix ./sharedOptions.nix
]; ];

View file

@ -11,6 +11,7 @@ let
inherit (lib) mkOption types; inherit (lib) mkOption types;
in in
# `config` not set and imported from multiple places: no fixed module class
{ {
options = { options = {
targetMachines = mkOption { targetMachines = mkOption {

View file

@ -12,6 +12,8 @@ let
in in
{ {
_class = "nixos";
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
(modulesPath + "/../lib/testing/nixos-test-base.nix") (modulesPath + "/../lib/testing/nixos-test-base.nix")

View file

@ -12,6 +12,8 @@ let
in in
{ {
_class = "nixops4Resource";
imports = [ ./sharedOptions.nix ]; imports = [ ./sharedOptions.nix ];
options = { options = {

View file

@ -24,6 +24,8 @@ let
in in
{ {
_class = "flake";
perSystem = perSystem =
{ pkgs, ... }: { pkgs, ... }:
{ {

View file

@ -123,6 +123,8 @@ let
in in
{ {
_class = "nixosTest";
name = "deployment-panel"; name = "deployment-panel";
## The panel's module sets `nixpkgs.overlays` which clashes with ## The panel's module sets `nixpkgs.overlays` which clashes with
@ -155,7 +157,6 @@ in
SECRET_KEY = dummyFile; SECRET_KEY = dummyFile;
}; };
port = panelPort; port = panelPort;
nixops4Package = inputs.nixops4.packages.${pkgs.system}.default;
deployment = { deployment = {
flake = "/run/fedipanel/flake"; flake = "/run/fedipanel/flake";

View file

@ -11,6 +11,8 @@ let
}).config; }).config;
in in
{ {
_class = "nix-unit";
test-eval = { test-eval = {
expr = expr =
let let

View file

@ -7,6 +7,8 @@ let
in in
with types; with types;
{ {
_class = "nixops4Deployment";
options = { options = {
runtime-environments = mkOption { runtime-environments = mkOption {
description = "Collection of runtime environments into which applications can be deployed"; description = "Collection of runtime environments into which applications can be deployed";

View file

@ -67,6 +67,8 @@ let
cfg = config.deployment; cfg = config.deployment;
in in
{ {
_class = "nixops4Deployment";
options = { options = {
deployment = lib.mkOption { deployment = lib.mkOption {
description = '' description = ''

View file

@ -1,4 +1,6 @@
{ {
_class = "flake";
imports = [ imports = [
./check/basic/flake-part.nix ./check/basic/flake-part.nix
./check/cli/flake-part.nix ./check/cli/flake-part.nix

View file

@ -17,6 +17,8 @@ let
inherit (lib) types mkOption; inherit (lib) types mkOption;
in in
{ {
_class = "nixops4Deployment";
options = { options = {
enable = lib.mkEnableOption "Fediversity configuration"; enable = lib.mkEnableOption "Fediversity configuration";
domain = mkOption { domain = mkOption {

View file

@ -11,7 +11,7 @@
let let
sources = import ./npins; sources = import ./npins;
inherit (import sources.flake-inputs) import-flake; inherit (import sources.flake-inputs) import-flake;
inherit (sources) git-hooks agenix; inherit (sources) git-hooks;
# XXX(@fricklerhandwerk): this atrocity is required to splice in a foreign Nixpkgs via flake-parts # XXX(@fricklerhandwerk): this atrocity is required to splice in a foreign Nixpkgs via flake-parts
# XXX - this is just importing a flake # XXX - this is just importing a flake
nixpkgs = import-flake { src = sources.nixpkgs; }; nixpkgs = import-flake { src = sources.nixpkgs; };
@ -43,7 +43,7 @@
]; ];
imports = [ imports = [
(import "${git-hooks}/flake-module.nix") "${git-hooks}/flake-module.nix"
inputs.nixops4.modules.flake.default inputs.nixops4.modules.flake.default
./deployment/flake-part.nix ./deployment/flake-part.nix
@ -54,7 +54,6 @@
{ {
pkgs, pkgs,
lib, lib,
inputs',
... ...
}: }:
{ {
@ -73,21 +72,6 @@
trim-trailing-whitespace.enable = true; trim-trailing-whitespace.enable = true;
shellcheck.enable = true; shellcheck.enable = true;
}; };
devShells.default = pkgs.mkShell {
packages = [
pkgs.npins
pkgs.nil
(pkgs.callPackage "${agenix}/pkgs/agenix.nix" { })
pkgs.openssh
pkgs.httpie
pkgs.jq
# exposing this env var as a hack to pass info in from form
(inputs'.nixops4.packages.default.overrideAttrs {
impureEnvVars = [ "DEPLOYMENT" ];
})
];
};
}; };
} }
); );

View file

@ -5,6 +5,8 @@ let
in in
{ {
_class = "nixos";
imports = [ imports = [
./hardware.nix ./hardware.nix
./networking.nix ./networking.nix

View file

@ -1,6 +1,8 @@
{ modulesPath, ... }: { modulesPath, ... }:
{ {
_class = "nixos";
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot = { boot = {

View file

@ -1,63 +1,64 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib) mkDefault; inherit (lib) mkDefault mkIf mkMerge;
in in
{ {
_class = "nixos";
config = { config = {
services.openssh = { services.openssh = {
enable = true; enable = true;
settings.PasswordAuthentication = false; settings.PasswordAuthentication = false;
}; };
networking = { networking = mkMerge [
hostName = config.fediversityVm.name; {
domain = config.fediversityVm.domain; hostName = config.fediversityVm.name;
domain = config.fediversityVm.domain;
## REVIEW: Do we actually need that, considering that we have static IPs? ## REVIEW: Do we actually need that, considering that we have static IPs?
useDHCP = mkDefault true; useDHCP = mkDefault true;
interfaces = { ## Disable the default firewall and use nftables instead, with a custom
eth0 = { ## Procolix-made ruleset.
ipv4 = { firewall.enable = false;
addresses = [ nftables = {
{ enable = true;
inherit (config.fediversityVm.ipv4) address prefixLength; rulesetFile = ./nftables-ruleset.nft;
}
];
};
ipv6 = {
addresses = [
{
inherit (config.fediversityVm.ipv6) address prefixLength;
}
];
};
}; };
}; }
defaultGateway = { ## IPv4
address = config.fediversityVm.ipv4.gateway; (mkIf config.fediversityVm.ipv4.enable {
interface = "eth0"; interfaces.${config.fediversityVm.ipv4.interface}.ipv4.addresses = [
}; { inherit (config.fediversityVm.ipv4) address prefixLength; }
defaultGateway6 = { ];
address = config.fediversityVm.ipv6.gateway; defaultGateway = {
interface = "eth0"; address = config.fediversityVm.ipv4.gateway;
}; interface = config.fediversityVm.ipv4.interface;
};
nameservers = [
"95.215.185.6"
"95.215.185.7"
];
})
nameservers = [ ## IPv6
"95.215.185.6" (mkIf config.fediversityVm.ipv6.enable {
"95.215.185.7" interfaces.${config.fediversityVm.ipv6.interface}.ipv6.addresses = [
"2a00:51c0::5fd7:b906" { inherit (config.fediversityVm.ipv6) address prefixLength; }
"2a00:51c0::5fd7:b907" ];
]; defaultGateway6 = {
address = config.fediversityVm.ipv6.gateway;
firewall.enable = false; interface = config.fediversityVm.ipv6.interface;
nftables = { };
enable = true; nameservers = [
rulesetFile = ./nftables-ruleset.nft; "2a00:51c0::5fd7:b906"
}; "2a00:51c0::5fd7:b907"
}; ];
})
];
}; };
} }

View file

@ -1,4 +1,6 @@
{ {
_class = "nixos";
users.users = { users.users = {
procolix = { procolix = {
isNormalUser = true; isNormalUser = true;

View file

@ -6,6 +6,8 @@ let
in in
{ {
# `config` not set and imported from multiple places: no fixed module class
options.fediversityVm = { options.fediversityVm = {
########################################################################## ##########################################################################
@ -89,6 +91,17 @@ in
}; };
ipv4 = { ipv4 = {
enable = mkOption {
default = true;
};
interface = mkOption {
description = ''
The interface that carries the machine's IPv4 network.
'';
default = "eth0";
};
address = mkOption { address = mkOption {
description = '' description = ''
The IP address of the machine, version 4. It will be injected as a The IP address of the machine, version 4. It will be injected as a
@ -114,6 +127,17 @@ in
}; };
ipv6 = { ipv6 = {
enable = mkOption {
default = true;
};
interface = mkOption {
description = ''
The interface that carries the machine's IPv6 network.
'';
default = "eth0";
};
address = mkOption { address = mkOption {
description = '' description = ''
The IP address of the machine, version 6. It will be injected as a The IP address of the machine, version 6. It will be injected as a

View file

@ -18,6 +18,8 @@ let
in in
{ {
_class = "nixops4Resource";
imports = [ ./options.nix ]; imports = [ ./options.nix ];
fediversityVm.hostPublicKey = mkDefault keys.systems.${config.fediversityVm.name}; fediversityVm.hostPublicKey = mkDefault keys.systems.${config.fediversityVm.name};

View file

@ -159,6 +159,8 @@ let
in in
{ {
_class = "flake";
## - Each normal or test machine gets a NixOS configuration. ## - Each normal or test machine gets a NixOS configuration.
## - Each normal or test machine gets a VM options entry. ## - Each normal or test machine gets a VM options entry.
## - Each normal machine gets a deployment. ## - Each normal machine gets a deployment.

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 200; vmId = 200;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 201; vmId = 201;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -6,6 +6,8 @@ let
name = "panel"; name = "panel";
in in
{ {
_class = "nixos";
imports = [ imports = [
(import ../../../panel { }).module (import ../../../panel { }).module
]; ];

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 2116; vmId = 2116;
proxmox = "procolix"; proxmox = "procolix";

View file

@ -5,6 +5,8 @@ let
in in
{ {
_class = "nixos";
services.forgejo = { services.forgejo = {
enable = true; enable = true;

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 2187; vmId = 2187;
proxmox = "procolix"; proxmox = "procolix";

View file

@ -1,6 +1,8 @@
{ config, ... }: { config, ... }:
{ {
_class = "nixos";
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;

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7001; vmId = 7001;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7002; vmId = 7002;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7003; vmId = 7003;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7004; vmId = 7004;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7005; vmId = 7005;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7006; vmId = 7006;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7011; vmId = 7011;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7012; vmId = 7012;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7013; vmId = 7013;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -1,4 +1,6 @@
{ {
_class = "nixops4Resource";
fediversityVm = { fediversityVm = {
vmId = 7014; vmId = 7014;
proxmox = "fediversity"; proxmox = "fediversity";

View file

@ -22,12 +22,12 @@ in
manage manage
# NixOps4 and its dependencies # NixOps4 and its dependencies
# FIXME: grab NixOps4 and add it here pkgs.nixops4
pkgs.nix pkgs.nix
pkgs.openssh pkgs.openssh
]; ];
env = { env = {
DEPLOYMENT_FLAKE = ../.; DEPLOYMENT_FLAKE = toString ../.;
DEPLOYMENT_NAME = "test"; DEPLOYMENT_NAME = "test";
NPINS_DIRECTORY = toString ../npins; NPINS_DIRECTORY = toString ../npins;
CREDENTIALS_DIRECTORY = toString ./.credentials; CREDENTIALS_DIRECTORY = toString ./.credentials;

View file

@ -76,6 +76,8 @@ in
# https://git.dgnum.eu/mdebray/djangonix/ # https://git.dgnum.eu/mdebray/djangonix/
# unlicensed at the time of writing, but surely worth taking some inspiration from... # unlicensed at the time of writing, but surely worth taking some inspiration from...
{ {
_class = "nixos";
options.services.${name} = { options.services.${name} = {
enable = mkEnableOption "Service configuration for `${name}`"; enable = mkEnableOption "Service configuration for `${name}`";
production = mkOption { production = mkOption {
@ -145,6 +147,7 @@ in
NixOps4 from the package's npins-based code, we will have to do with NixOps4 from the package's npins-based code, we will have to do with
this workaround. this workaround.
''; '';
default = pkgs.nixops4;
}; };
deployment = { deployment = {

View file

@ -8,4 +8,17 @@ let
in in
{ {
python3 = prev.lib.attrsets.recursiveUpdate prev.python3 { pkgs = extraPython3Packages; }; python3 = prev.lib.attrsets.recursiveUpdate prev.python3 { pkgs = extraPython3Packages; };
nixops4 =
let
sources = import ../../npins;
inherit (import sources.flake-inputs) import-flake;
inherit
(import-flake {
src = ../../.;
})
inputs
;
inherit (inputs) nixops4;
in
nixops4.packages.${prev.system}.default;
} }

View file

@ -60,6 +60,8 @@ let
]; ];
in in
python3.pkgs.buildPythonPackage { python3.pkgs.buildPythonPackage {
_class = "package";
pname = name; pname = name;
inherit (pyproject.project) version; inherit (pyproject.project) version;
pyproject = true; pyproject = true;

View file

@ -8,6 +8,8 @@
}: }:
buildPythonPackage rec { buildPythonPackage rec {
_class = "package";
pname = "django-pydantic-field"; pname = "django-pydantic-field";
version = "v0.3.12"; version = "v0.3.12";
pyproject = true; pyproject = true;

View file

@ -10,6 +10,8 @@
}: }:
buildPythonPackage rec { buildPythonPackage rec {
_class = "package";
pname = "drf-pydantic"; pname = "drf-pydantic";
version = "v2.7.1"; version = "v2.7.1";
pyproject = true; pyproject = true;

View file

@ -13,7 +13,6 @@ let
secrets = { secrets = {
SECRET_KEY = pkgs.writeText "SECRET_KEY" "secret"; SECRET_KEY = pkgs.writeText "SECRET_KEY" "secret";
}; };
nixops4Package = pkgs.hello; # FIXME: actually pass NixOps4
}; };
virtualisation = { virtualisation = {

View file

@ -6,8 +6,8 @@
}: }:
{ {
tests = { tests = {
mastodon = import ./tests/mastodon.nix { inherit pkgs; }; mastodon = pkgs.nixosTest ./tests/mastodon.nix;
pixelfed-garage = import ./tests/pixelfed-garage.nix { inherit pkgs; }; pixelfed-garage = pkgs.nixosTest ./tests/pixelfed-garage.nix;
peertube = import ./tests/peertube.nix { inherit pkgs; }; peertube = pkgs.nixosTest ./tests/peertube.nix;
}; };
} }

View file

@ -6,6 +6,8 @@ let
in in
{ {
_class = "nixos";
imports = [ imports = [
./garage ./garage
./mastodon ./mastodon

View file

@ -97,6 +97,8 @@ let
in in
{ {
_class = "nixos";
imports = [ ./options.nix ]; imports = [ ./options.nix ];
config = mkIf config.fediversity.garage.enable { config = mkIf config.fediversity.garage.enable {

View file

@ -5,6 +5,8 @@ let
in in
{ {
_class = "nixos";
options.fediversity.garage = { options.fediversity.garage = {
enable = mkEnableOption "Enable a Garage server on the machine"; enable = mkEnableOption "Enable a Garage server on the machine";

View file

@ -11,6 +11,8 @@ let
in in
{ {
_class = "nixos";
imports = [ ./options.nix ]; imports = [ ./options.nix ];
config = mkMerge [ config = mkMerge [

View file

@ -1,6 +1,8 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
_class = "nixos";
options.fediversity.mastodon = options.fediversity.mastodon =
(import ../sharedOptions.nix { (import ../sharedOptions.nix {
inherit config lib; inherit config lib;

View file

@ -5,6 +5,8 @@ let
in in
{ {
_class = "nixos";
imports = [ ./options.nix ]; imports = [ ./options.nix ];
config = mkMerge [ config = mkMerge [

View file

@ -6,6 +6,8 @@ let
in in
{ {
_class = "nixos";
options.fediversity.peertube = options.fediversity.peertube =
(import ../sharedOptions.nix { (import ../sharedOptions.nix {
inherit config lib; inherit config lib;

View file

@ -15,6 +15,8 @@ let
in in
{ {
_class = "nixos";
imports = [ ./options.nix ]; imports = [ ./options.nix ];
config = mkMerge [ config = mkMerge [

View file

@ -1,6 +1,8 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
_class = "nixos";
options.fediversity.pixelfed = options.fediversity.pixelfed =
(import ../sharedOptions.nix { (import ../sharedOptions.nix {
inherit config lib; inherit config lib;

View file

@ -14,6 +14,8 @@ let
in in
{ {
_class = "nixos";
enable = mkEnableOption "Enable a ${serviceDocName} server on the machine"; enable = mkEnableOption "Enable a ${serviceDocName} server on the machine";
s3AccessKeyFile = mkOption { s3AccessKeyFile = mkOption {

View file

@ -42,7 +42,7 @@ let
''; '';
in in
pkgs.nixosTest { {
name = "mastodon"; name = "mastodon";
nodes = { nodes = {

View file

@ -161,7 +161,7 @@ let
''; '';
in in
pkgs.nixosTest { {
name = "peertube"; name = "peertube";
nodes = { nodes = {

View file

@ -114,7 +114,7 @@ let
${seleniumQuit}''; ${seleniumQuit}'';
in in
pkgs.nixosTest { {
name = "test-pixelfed-garage"; name = "test-pixelfed-garage";
nodes = { nodes = {

View file

@ -127,6 +127,8 @@ let
preOverride = pkgs.nixosTest ( preOverride = pkgs.nixosTest (
test test
// { // {
_class = "nixosTest";
interactive = (test.interactive or { }) // { interactive = (test.interactive or { }) // {
# no need to // with test.interactive.nodes here, since we are iterating # no need to // with test.interactive.nodes here, since we are iterating
# over all of them, and adding back in the config via `imports` # over all of them, and adding back in the config via `imports`

View file

@ -10,6 +10,8 @@ let
in in
{ {
_class = "nixos";
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ]; imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
fediversity.garage.enable = true; fediversity.garage.enable = true;

View file

@ -1,6 +1,8 @@
# customize nixos-rebuild build-vm to be a bit more convenient # customize nixos-rebuild build-vm to be a bit more convenient
{ pkgs, ... }: { pkgs, ... }:
{ {
_class = "nixos";
# let us log in # let us log in
users.mutableUsers = false; users.mutableUsers = false;
users.users.root.hashedPassword = ""; users.users.root.hashedPassword = "";

View file

@ -6,6 +6,7 @@
... ...
}: }:
{ {
_class = "nixos";
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ]; imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];

View file

@ -5,6 +5,8 @@
}: }:
{ {
_class = "nixos";
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ]; imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
fediversity = { fediversity = {

View file

@ -11,6 +11,8 @@ let
in in
{ {
_class = "nixos";
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ]; imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
fediversity = { fediversity = {