Compare commits

...

6 commits

Author SHA1 Message Date
9f04edc071 allow configuring whether a node uses QEMU 2025-06-30 17:18:02 +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
10 changed files with 99 additions and 57 deletions

View file

@ -25,13 +25,13 @@ jobs:
runs-on: native
steps:
- uses: actions/checkout@v4
- run: cd services && nix-build -A tests.peertube
- run: nix-build services -A tests.peertube
check-panel:
runs-on: native
steps:
- uses: actions/checkout@v4
- run: cd panel && nix-build -A tests
- run: nix-build panel -A tests
check-deployment-basic:
runs-on: native

View file

@ -155,7 +155,6 @@ in
SECRET_KEY = dummyFile;
};
port = panelPort;
nixops4Package = inputs.nixops4.packages.${pkgs.system}.default;
deployment = {
flake = "/run/fedipanel/flake";

View file

@ -43,7 +43,7 @@
];
imports = [
(import "${git-hooks}/flake-module.nix")
"${git-hooks}/flake-module.nix"
inputs.nixops4.modules.flake.default
./deployment/flake-part.nix

View file

@ -1,64 +1,86 @@
{ modulesPath, ... }:
{ config, lib, ... }:
let
inherit (lib) mkIf mkMerge;
in
{
_class = "nixos";
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
config = mkMerge [
{
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
}
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
(mkIf config.fediversityVm.isQemuVm {
initrd = {
availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
kernelModules = [ "dm-snapshot" ];
};
};
boot.initrd = {
availableKernelModules = [
"ata_piix"
"uhci_hcd"
"sd_mod"
"sr_mod"
disko.devices.disk.main = {
device = "/dev/sda";
type = "disk";
# from `/profiles/qemu-guest.nix`
"virtio_net"
"virtio_pci"
"virtio_mmio"
"virtio_blk"
"virtio_scsi"
"9p"
"9pnet_virtio"
];
kernelModules = [
"dm-snapshot"
content = {
type = "gpt";
# from `/profiles/qemu-guest.nix`
"virtio_balloon"
"virtio_console"
"virtio_rng"
"virtio_gpu"
];
};
partitions = {
MBR = {
priority = 0;
size = "1M";
type = "EF02";
};
disko.devices.disk.main = {
device = "/dev/sda";
type = "disk";
ESP = {
priority = 1;
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
content = {
type = "gpt";
root = {
priority = 2;
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
partitions = {
MBR = {
priority = 0;
size = "1M";
type = "EF02";
};
ESP = {
priority = 1;
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
priority = 2;
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
})
];
}

View file

@ -155,5 +155,13 @@ in
this for testing machines, as it is a security hole for so many reasons.
'';
};
isQemuVm = mkOption {
description = ''
Whether the machine is a QEMU VM. This will import all the necessary
things.
'';
default = true;
};
};
}

View file

@ -36,8 +36,8 @@ in
## should go into the `./nixos` subdirectory.
nixos.module = {
imports = [
(import "${agenix}/modules/age.nix")
(import "${disko}/module.nix")
"${agenix}/modules/age.nix"
"${disko}/module.nix"
./options.nix
./nixos
];

View file

@ -22,7 +22,7 @@ in
manage
# NixOps4 and its dependencies
# FIXME: grab NixOps4 and add it here
pkgs.nixops4
pkgs.nix
pkgs.openssh
];

View file

@ -147,6 +147,7 @@ in
NixOps4 from the package's npins-based code, we will have to do with
this workaround.
'';
default = pkgs.nixops4;
};
deployment = {

View file

@ -8,4 +8,17 @@ let
in
{
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

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