forked from fediversity/fediversity
Compare commits
No commits in common. "3780885e03fff1b6da5ab79d2e16af9d20cbe758" and "e62f14d9be5aa329b76dad161097e5cbbe12a84f" have entirely different histories.
3780885e03
...
e62f14d9be
9 changed files with 44 additions and 67 deletions
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up SSH key for age secrets and SSH
|
- name: Set up SSH key to access age secrets
|
||||||
run: |
|
run: |
|
||||||
env
|
env
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|
@ -21,4 +21,4 @@ jobs:
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: nix-shell --run 'eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_ed25519 && SHELL=$(which bash) nixops4 apply -v default'
|
run: nix-shell --run 'nixops4 apply default'
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,6 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: nix build .#checks.x86_64-linux.test-mastodon-service -L
|
- run: nix build .#checks.x86_64-linux.test-mastodon-service -L
|
||||||
|
|
||||||
check-pixelfed:
|
|
||||||
runs-on: native
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: nix build .#checks.x86_64-linux.test-pixelfed-garage-service -L
|
|
||||||
|
|
||||||
check-peertube:
|
check-peertube:
|
||||||
runs-on: native
|
runs-on: native
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
# Infra
|
# Infra
|
||||||
|
|
||||||
This directory contains the definition of [the VMs](../machines/machines.md) that host our
|
This directory contains the definition of [the VMs](machines.md) that host our
|
||||||
infrastructure.
|
infrastructure.
|
||||||
|
|
||||||
## Provisioning VMs with an initial configuration
|
## Provisioning VMs with an initial configuration
|
||||||
|
|
||||||
> NOTE[Niols]: This is still very manual and clunky. Two things will happen:
|
NOTE[Niols]: This is very manual and clunky. Two things will happen. In the near
|
||||||
> 1. In the near future, I will improve the provisioning script to make this a bit less clunky.
|
future, I will improve the provisioning script to make this a bit less clunky.
|
||||||
> 2. In the far future, NixOps4 will be able to communicate with Proxmox directly and everything will become much cleaner.
|
In the far future, NixOps4 will be able to communicate with Proxmox directly and
|
||||||
|
everything will become much cleaner.
|
||||||
|
|
||||||
1. Choose names for your VMs. It is recommended to choose `fediXXX`, with `XXX`
|
1. Choose names for your VMs. It is recommended to choose `fediXXX`, with `XXX`
|
||||||
above 100. For instance, `fedi117`.
|
above 100. For instance, `fedi117`.
|
||||||
|
|
@ -24,7 +25,8 @@ infrastructure.
|
||||||
Those files need to exist during provisioning, but their content matters only
|
Those files need to exist during provisioning, but their content matters only
|
||||||
when updating the machines' configuration.
|
when updating the machines' configuration.
|
||||||
|
|
||||||
> FIXME: Remove this step by making the provisioning script not fail with the public key does not exist yet.
|
FIXME: Remove this step by making the provisioning script not fail with the
|
||||||
|
public key does not exist yet.
|
||||||
|
|
||||||
3. Run the provisioning script:
|
3. Run the provisioning script:
|
||||||
```
|
```
|
||||||
|
|
@ -42,7 +44,7 @@ infrastructure.
|
||||||
ssh fedi117.abundos.eu 'sudo cat /etc/ssh/ssh_host_ed25519_key.pub' > keys/systems/fedi117.pub
|
ssh fedi117.abundos.eu 'sudo cat /etc/ssh/ssh_host_ed25519_key.pub' > keys/systems/fedi117.pub
|
||||||
```
|
```
|
||||||
|
|
||||||
> FIXME: Make the provisioning script do that for us.
|
FIXME: Make the provisioning script do that for us.
|
||||||
|
|
||||||
7. Regenerate the list of machines:
|
7. Regenerate the list of machines:
|
||||||
```
|
```
|
||||||
|
|
@ -54,7 +56,7 @@ infrastructure.
|
||||||
just enough for it to boot and be reachable. Go on to the next section to
|
just enough for it to boot and be reachable. Go on to the next section to
|
||||||
update the machine and put an actual configuration.
|
update the machine and put an actual configuration.
|
||||||
|
|
||||||
> FIXME: Figure out why the full configuration isn't on the machine at this
|
FIXME: Figure out why the full configuration isn't on the machine at this
|
||||||
point and fix it.
|
point and fix it.
|
||||||
|
|
||||||
## Updating existing VM configurations
|
## Updating existing VM configurations
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,15 @@
|
||||||
{ sources, ... }:
|
let
|
||||||
|
# pulling this in manually over from module args resolves an infinite recursion.
|
||||||
|
# FIXME: instead untangle `//infra/flake-part.nix` and make it stop passing wild functions.
|
||||||
|
# move moving towards a portable-services-like pattern where some things are submodules.
|
||||||
|
# Right now those wild functions are for parameterising a bunch of things,
|
||||||
|
# and the modular way to do that would be options --
|
||||||
|
# obviously you can't use those for `imports`,
|
||||||
|
# so one way to decouple fixpoints is to isolate them into submodules.
|
||||||
|
# Therefore one approach would be to try to go down the call graph,
|
||||||
|
# and see where what's currently a function could be a `submodule` field of something else.
|
||||||
|
sources = import ../../npins;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
_class = "nixos";
|
_class = "nixos";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,6 @@ in
|
||||||
users.users.root.openssh.authorizedKeys.keys = attrValues keys.contributors ++ [
|
users.users.root.openssh.authorizedKeys.keys = attrValues keys.contributors ++ [
|
||||||
# allow our panel vm access to the test machines
|
# allow our panel vm access to the test machines
|
||||||
keys.panel
|
keys.panel
|
||||||
# allow continuous deployment access
|
|
||||||
keys.cd
|
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,19 +23,20 @@ let
|
||||||
makeResourceModule =
|
makeResourceModule =
|
||||||
{ vmName, isTestVm }:
|
{ vmName, isTestVm }:
|
||||||
{
|
{
|
||||||
nixos.module.imports = [
|
# TODO(@fricklerhandwerk): this is terrible but IMO we should just ditch flake-parts and have our own data model for how the project is organised internally
|
||||||
./common/proxmox-qemu-vm.nix
|
_module.args = {
|
||||||
];
|
|
||||||
|
|
||||||
nixos.specialArgs = {
|
|
||||||
inherit
|
inherit
|
||||||
sources
|
|
||||||
inputs
|
inputs
|
||||||
|
sources
|
||||||
keys
|
keys
|
||||||
secrets
|
secrets
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixos.module.imports = [
|
||||||
|
./common/proxmox-qemu-vm.nix
|
||||||
|
];
|
||||||
|
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
./common/resource.nix
|
./common/resource.nix
|
||||||
|
|
@ -65,39 +66,17 @@ let
|
||||||
vmNames:
|
vmNames:
|
||||||
{ providers, ... }:
|
{ providers, ... }:
|
||||||
{
|
{
|
||||||
# XXX: this type merge is for adding `specialArgs` to resource modules
|
providers.local = inputs.nixops4.modules.nixops4Provider.local;
|
||||||
options.resources = mkOption {
|
resources = genAttrs vmNames (vmName: {
|
||||||
type =
|
type = providers.local.exec;
|
||||||
with lib.types;
|
imports = [
|
||||||
lazyAttrsOf (submoduleWith {
|
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
||||||
class = "nixops4Resource";
|
(makeResourceModule {
|
||||||
modules = [ ];
|
inherit vmName;
|
||||||
# TODO(@fricklerhandwerk): we may want to pass through all of `specialArgs`
|
isTestVm = false;
|
||||||
# once we're sure it's sane. leaving it here for better control during refactoring.
|
})
|
||||||
specialArgs = {
|
];
|
||||||
inherit
|
});
|
||||||
sources
|
|
||||||
inputs
|
|
||||||
keys
|
|
||||||
secrets
|
|
||||||
|
|
||||||
;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
config = {
|
|
||||||
providers.local = inputs.nixops4.modules.nixops4Provider.local;
|
|
||||||
resources = genAttrs vmNames (vmName: {
|
|
||||||
type = providers.local.exec;
|
|
||||||
imports = [
|
|
||||||
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
|
||||||
(makeResourceModule {
|
|
||||||
inherit vmName;
|
|
||||||
isTestVm = false;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
makeDeployment' = vmName: makeDeployment [ vmName ];
|
makeDeployment' = vmName: makeDeployment [ vmName ];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
sources,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
name = "panel";
|
name = "panel";
|
||||||
|
sources = import ../../../npins;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
_class = "nixos";
|
_class = "nixos";
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
(import ../../../panel { }).module
|
(import ../../../panel { }).module
|
||||||
"${sources.home-manager}/nixos"
|
(import "${sources.home-manager}/nixos")
|
||||||
];
|
];
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
module = ./nix/configuration.nix;
|
module = import ./nix/configuration.nix;
|
||||||
tests = pkgs.callPackage ./nix/tests.nix { };
|
tests = pkgs.callPackage ./nix/tests.nix { };
|
||||||
|
|
||||||
# re-export inputs so they can be overridden granularly
|
# re-export inputs so they can be overridden granularly
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,6 @@ let
|
||||||
|
|
||||||
${seleniumQuit}'';
|
${seleniumQuit}'';
|
||||||
|
|
||||||
dummyFile = pkgs.writeText "dummy" "dummy";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
name = "test-pixelfed-garage";
|
name = "test-pixelfed-garage";
|
||||||
|
|
@ -171,12 +170,6 @@ in
|
||||||
users.users.selenium = {
|
users.users.selenium = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
};
|
};
|
||||||
fediversity.temp.initialUser = {
|
|
||||||
username = "dummy";
|
|
||||||
displayName = "dummy";
|
|
||||||
email = "dummy";
|
|
||||||
passwordFile = dummyFile;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue