Compare commits

...

2 commits

Author SHA1 Message Date
D. Scott Boggs da23b55bfb add services.nix 2023-12-29 07:39:26 -05:00
D. Scott Boggs a909d27908 fix configuration 2023-12-29 07:38:51 -05:00
2 changed files with 30 additions and 3 deletions

View file

@ -8,17 +8,16 @@
./common ./common
./common/sites/gifford ./common/sites/gifford
./common/server ./common/server
./services.nix
]; ];
boot.loader = { boot.loader = {
grub = { grub = {
# Use the GRUB 2 boot loader. # Use the GRUB 2 boot loader.
enable = true; enable = true;
version = 2;
# efiSupport = true; # efiSupport = true;
# efiInstallAsRemovable = false; # efiInstallAsRemovable = false;
# Define on which hard drive you want to install Grub. # Define on which hard drive you want to install Grub.
device = "/dev/disk/by-uuid/caab3f5b-b264-4070-8a98-fb267ed31280"; # or "nodev" for efi only device = "/dev/sda"; # or "nodev" for efi only
}; };
# efi.efiSysMountPoint = "/boot/efi"; # (part of the generated default) # efi.efiSysMountPoint = "/boot/efi"; # (part of the generated default)
}; };
@ -46,6 +45,8 @@
services.xserver.layout = "us"; services.xserver.layout = "us";
fileSystems."/srv".options = [ "nofail" ];
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # on your system were taken. Its perfectly fine and recommended to leave

26
services.nix Normal file
View file

@ -0,0 +1,26 @@
{pkgs, ...}: {
environment.etc."srv/docker-compose.yml" = builtins.readFile ./docker-compose.yml;
systemd.services.load-balancer = let dataset = "gc1_srv";
in {
wantedBy = ["multi-user.target"];
requires = ["public-network.service"
"zfs-import-${dataset}.service"];
after = ["public-network.service"
"zfs-import-${dataset}.service"];
serviceConfig = {
ExecStart = "${pkgs.docker}/bin/docker compose up";
WorkingDirectory = "/etc/srv/load-balancer";
};
};
}
# '//' in nix means "merge attribute sets". We're importing a function at the
# path, then calling it with the attr set as an argument, and merging the
# results with the config above
// import ./common/services/load-balancer { dataset = "gc1_srv"; pkgs = pkgs; }
// import ./common/services/conduit.nix {
dataset = "gc1_srv";
pkgs = pkgs;
domain = "chat.techwork.zone";
}