Skip to content

Commit 3046318

Browse files
Merge pull request #6 from tahoe-lafs/redeploy-2025-01-09
Deploy on new server, update to run latest upstream master version, fix NixOS module/systemd config
2 parents 89e5e1f + abfa883 commit 3046318

9 files changed

+474
-153
lines changed

testgrid.tahoe-lafs.org/access-control.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ ... }: {
22
# Initial empty root password for easy login:
33
users.users.root.initialHashedPassword = "";
4-
services.openssh.permitRootLogin = "prohibit-password";
4+
services.openssh.settings.PermitRootLogin = "prohibit-password";
55

66
# Enable the OpenSSH daemon.
77
services.openssh.enable = true;
@@ -13,7 +13,7 @@
1313
#
1414
# A good change would be to create actual user accounts with sudo
1515
# configuration instead, probably.
16-
17-
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGN4VQm3BIQKEFTw6aPrEwNuShf640N+Py2LOKznFCRT exarkun@bottom"
16+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHx7wJQNqKn8jOC4AxySRL2UxidNp7uIK9ad3pMb1ifF flo@vantaa"
17+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIZtWY7t8HVnaz6bluYsrAlzZC3MZtb8g0nO5L5fCQKR benoit@leastauthority.com"
1818
];
1919
}

testgrid.tahoe-lafs.org/configuration.nix

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
# Include the results of the hardware scan.
44
./hardware-configuration.nix
55

6-
# Run a Tahoe-LAFS grid
7-
./tahoe-lafs-testgrid.nix
6+
# This was generated while setting up the machine with nixos-infect.
7+
./networking.nix
8+
9+
# Configure the rest of the system
10+
./system-configuration.nix
811

912
# Configure authn/authz for system administration
1013
./access-control.nix
1114

12-
# Configure the rest of the system
13-
./system-configuration.nix
15+
# Run a Tahoe-LAFS grid
16+
./tahoe-lafs-testgrid.nix
1417
];
1518
}

testgrid.tahoe-lafs.org/hardware-configuration.nix

+10-19
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,14 @@
1111
# VM and need a new hardware configuration for it - unless it happens to be
1212
# configured just like this one, which it might be).
1313

14-
{ config, lib, pkgs, modulesPath, ... }:
15-
16-
{
17-
imports =
18-
[ (modulesPath + "/profiles/qemu-guest.nix")
19-
];
20-
21-
boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ];
22-
boot.initrd.kernelModules = [ ];
23-
boot.kernelModules = [ ];
24-
boot.extraModulePackages = [ ];
25-
26-
fileSystems."/" =
27-
{ device = "/dev/disk/by-uuid/32c12782-e288-4ae2-a2bd-796b37087ff4";
28-
fsType = "ext4";
29-
};
30-
31-
swapDevices = [ ];
32-
14+
{ modulesPath, ... }: {
15+
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
16+
boot.loader.grub.device = "/dev/sda";
17+
boot.initrd.availableKernelModules =
18+
[ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
19+
boot.initrd.kernelModules = [ "nvme" ];
20+
fileSystems."/" = {
21+
device = "/dev/sda1";
22+
fsType = "ext4";
23+
};
3324
}
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{ lib, ... }: {
2+
# This file was populated at runtime with the networking
3+
# details gathered from the active system.
4+
networking = {
5+
6+
hostName = "testgrid";
7+
domain = "tahoe-lafs.org";
8+
9+
nameservers =
10+
[ "2a01:4ff:ff00::add:1" "2a01:4ff:ff00::add:2" "185.12.64.2" ];
11+
defaultGateway = "172.31.1.1";
12+
defaultGateway6 = {
13+
address = "fe80::1";
14+
interface = "eth0";
15+
};
16+
dhcpcd.enable = false;
17+
usePredictableInterfaceNames = lib.mkForce false;
18+
interfaces = {
19+
eth0 = {
20+
ipv4.addresses = [{
21+
address = "37.27.215.216";
22+
prefixLength = 32;
23+
}];
24+
ipv6.addresses = [
25+
{
26+
address = "2a01:4f9:c010:d906::1";
27+
prefixLength = 64;
28+
}
29+
{
30+
address = "fe80::9400:3ff:fefa:158c";
31+
prefixLength = 64;
32+
}
33+
];
34+
ipv4.routes = [{
35+
address = "172.31.1.1";
36+
prefixLength = 32;
37+
}];
38+
ipv6.routes = [{
39+
address = "fe80::1";
40+
prefixLength = 128;
41+
}];
42+
};
43+
44+
};
45+
};
46+
services.udev.extraRules = ''
47+
ATTR{address}=="96:00:03:fa:15:8c", NAME="eth0"
48+
49+
'';
50+
}

testgrid.tahoe-lafs.org/repo-tahoe-lafs-master.nix

-9
This file was deleted.

testgrid.tahoe-lafs.org/system-configuration.nix

+9-77
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,9 @@
55
{ config, pkgs, ... }:
66

77
{
8-
# Use the GRUB 2 boot loader.
9-
boot.loader.grub.enable = true;
10-
boot.loader.grub.version = 2;
11-
# boot.loader.grub.efiSupport = true;
12-
# boot.loader.grub.efiInstallAsRemovable = true;
13-
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
14-
# Define on which hard drive you want to install Grub.
15-
# boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
16-
17-
networking.hostName = "testgrid";
18-
networking.domain = "tahoe-lafs.org";
19-
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
20-
21-
# Set your time zone.
22-
# time.timeZone = "Europe/Amsterdam";
23-
24-
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
25-
# Per-interface useDHCP will be mandatory in the future, so this generated config
26-
# replicates the default behaviour.
27-
networking.useDHCP = false;
28-
networking.interfaces.ens3.useDHCP = true;
29-
30-
# Configure network proxy if necessary
31-
# networking.proxy.default = "http://user:password@proxy:port/";
32-
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
33-
34-
# Select internationalisation properties.
35-
# i18n.defaultLocale = "en_US.UTF-8";
36-
# console = {
37-
# font = "Lat2-Terminus16";
38-
# keyMap = "us";
39-
# };
40-
41-
# Enable the X11 windowing system.
42-
# services.xserver.enable = true;
8+
# Enable flakes.
9+
# https://nixos.wiki/wiki/Nix_command
10+
nix.extraOptions = "experimental-features = nix-command flakes";
4311

4412
# Periodically upgrade NixOS to the latest version. If enabled, a systemd
4513
# timer will run `nixos-rebuild switch --upgrade` once a day.
@@ -52,59 +20,23 @@
5220
allowReboot = true;
5321
};
5422

55-
# Configure keymap in X11
56-
# services.xserver.layout = "us";
57-
# services.xserver.xkbOptions = "eurosign:e";
58-
59-
# Enable CUPS to print documents.
60-
# services.printing.enable = true;
61-
62-
# Enable sound.
63-
# sound.enable = true;
64-
# hardware.pulseaudio.enable = true;
65-
66-
# Enable touchpad support (enabled default in most desktopManager).
67-
# services.xserver.libinput.enable = true;
68-
69-
# Define a user account. Don't forget to set a password with ‘passwd’.
70-
# users.users.jane = {
71-
# isNormalUser = true;
72-
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
73-
# };
74-
7523
# List packages installed in system profile. To search, run:
7624
# $ nix search wget
77-
environment.systemPackages = with pkgs; [
78-
# Let us check out and update the system configuration repository.
79-
git
80-
];
81-
82-
# Some programs need SUID wrappers, can be configured further or are
83-
# started in user sessions.
84-
# programs.mtr.enable = true;
85-
# programs.gnupg.agent = {
86-
# enable = true;
87-
# enableSSHSupport = true;
88-
# };
25+
environment.systemPackages = with pkgs;
26+
[
27+
# Let us check out and update the system configuration repository.
28+
git
29+
];
8930

9031
# Make sure the firewall is enabled. This is probably the default but let's
9132
# be explicit and safe.
9233
networking.firewall.enable = true;
9334

94-
# Open ports in the firewall.
95-
# networking.firewall.allowedTCPPorts = [ ... ];
96-
# networking.firewall.allowedUDPPorts = [ ... ];
97-
98-
9935
# This value determines the NixOS release from which the default
10036
# settings for stateful data, like file locations and database versions
10137
# on your system were taken. It‘s perfectly fine and recommended to leave
10238
# this value at the release version of the first install of this system.
10339
# Before changing this value read the documentation for this option
10440
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
105-
106-
system.stateVersion = "21.05"; # Did you read the comment?
107-
108-
boot.loader.grub.devices = [ "/dev/sda" ];
109-
41+
system.stateVersion = "24.11"; # Did you read the comment?
11042
}

testgrid.tahoe-lafs.org/tahoe-lafs-testgrid.nix

+15-27
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Define a NixOS module that sets up the Tahoe-LAFS test grid.
22
{ config, pkgs, ... }:
33
let
4-
# Use upstream packaging. The NixOS 21.05 package is broken (though
5-
# master should already have a fix for that). However, maybe we want to
6-
# run bleeding edge on this deployment anyway.
7-
package = pkgs.callPackage ./tahoe-lafs.nix { };
4+
# Choose the tahoe-lafs package to run:
5+
#
6+
# Some local flavor (see repo history around version 89e5e1f8):
7+
# package = pkgs.callPackage ./tahoe-lafs.nix { };
8+
# The package from nixpkgs:
9+
# package = pkgs.tahoe-lafs;
10+
# The upstream flake:
11+
package = (builtins.getFlake
12+
"github:tahoe-lafs/tahoe-lafs/f45175569e870ccd8a25bd9903ea109eaf25075d").packages.x86_64-linux.default;
813
in {
914
# Configure Tahoe to run here.
1015
services.tahoe = {
@@ -30,10 +35,9 @@ in {
3035
# client. On a more realistic deployment these would all be run
3136
# separately from other to make their failure modes as independent as
3237
# possible.
33-
nodes =
34-
let
38+
nodes = let
3539
# XXX NixOS module doesn't support multi-introducer configuration.
36-
introducer = "pb://fodk4doc64febdoxke3a4ddfyanz7ajd@tcp:157.90.125.177:5000/el4fo3rm2h22cnilukmjqzyopdgqxrd2";
40+
introducer = "pb://flm2vcjxaxoyah3f2ufdk74augada55i@tcp:testgrid.tahoe-lafs.org:5000/s3kbdgg3j4ohifa633tt7yi25drl6jqa";
3741
in {
3842
alpha = {
3943
inherit package;
@@ -69,26 +73,10 @@ in {
6973
};
7074
};
7175

72-
# XXX The NixOS Tahoe service doesn't configure any group for the service
73-
# users it creates. A user cannot be created without a group so without the
74-
# following fixes, NixOS throws an error at us at evaluate time.
75-
76-
# For each service user, assign it to a distinct group.
77-
users.users."tahoe.alpha".group = "tahoe.alpha";
78-
# And also create that group.
79-
users.groups."tahoe.alpha" = {};
80-
81-
users.users."tahoe.beta".group = "tahoe.beta";
82-
users.groups."tahoe.beta" = {};
83-
84-
users.users."tahoe.gamma".group = "tahoe.gamma";
85-
users.groups."tahoe.gamma" = {};
86-
87-
users.users."tahoe.introducer-alpha".group = "tahoe.introducer-alpha";
88-
users.groups."tahoe.introducer-alpha" = {};
89-
90-
users.users."tahoe.introducer-beta".group = "tahoe.introducer-beta";
91-
users.groups."tahoe.introducer-beta" = {};
76+
# The current nixpkgs service definition isn't compatible with the upstream
77+
# flake, use our own
78+
disabledModules = [ "services/network-filesystems/tahoe.nix" ];
79+
imports = [ ./tahoe-service.nix ];
9280

9381
networking.firewall.allowedTCPPorts = with config.services.tahoe; [
9482
# Let traffic through to the introducers

testgrid.tahoe-lafs.org/tahoe-lafs.nix

-14
This file was deleted.

0 commit comments

Comments
 (0)