Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild web.entropia.de with nixos #41

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions hosts/web01/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ inputs, config, ... }: {

imports = [
./disko.nix
inputs.disko.nixosModules.disko
../../profiles/entropia-cluster-vm
inputs.self.nixosModules.mediawiki
];

disabledModules = [
"services/web-apps/mediawiki.nix"
];

networking.hostName = "web01";
networking.domain = "entropia.de";
deployment.targetHost = config.networking.fqdn;

boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
system.stateVersion = "24.11";

networking.useNetworkd = true;
systemd.network.wait-online.anyInterface = true;
systemd.network.networks."10-eth" = {
enable = true;
name = "en*";
dns = [ "1.1.1.1" ];
address = [
"45.140.180.57/27"
"2a0e:c5c0:0:201::18/64"
];
routes = [
{ routeConfig = { Destination = "0.0.0.0/0"; Gateway = "45.140.180.33"; }; }
{ routeConfig = { Destination = "::/0"; Gateway = "2a0e:c5c0:0:201::1"; }; }
];
};
services.resolved.enable = true;
}
36 changes: 36 additions & 0 deletions hosts/web01/disko.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "xfs";
mountpoint = "/";
};
};
};
};
};
};
};
}
8 changes: 6 additions & 2 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
genAttrs
filterAttrs
attrNames
attrValues;
attrValues
pathIsRegularFile
;

isDir = _name: type: type == "directory";

Expand All @@ -23,9 +25,11 @@
};

modules = genAttrs moduleFolders buildModule;

defaultModules = filterAttrs (name: _: ! pathIsRegularFile (./. + "/${name}/non-default")) modules;
in
{
default.imports = attrValues modules;
default.imports = attrValues defaultModules;
} // modules;
}

Loading
Loading