Add livebook, format vs code settings.json

This commit is contained in:
Erwin Boskma 2022-02-11 11:30:51 +01:00
parent 116c537a65
commit 2bcb880b9e
Signed by: erwin
GPG key ID: 270B20D17394F7E5
4 changed files with 887 additions and 470 deletions

File diff suppressed because it is too large Load diff

View file

@ -22,6 +22,11 @@
# inherit (users) users;
# enable = true;
# };
livebook = {
enable = true;
dataDir = "/home/erwin/workspace/livebook";
userMapping = "1000:100";
};
networking = {
enable = true;
dhcpInterfaces = [ "enp4s0" ];

View file

@ -11,7 +11,7 @@
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.kernelModules = [ "kvm-amd" "apple-mfi-fastcharge" ];
boot.extraModulePackages = [ ];
fileSystems."/" =

View file

@ -0,0 +1,39 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.eboskma.livebook;
in
{
options.eboskma.livebook = {
enable = mkEnableOption "Start a livebook container";
dataDir = mkOption {
description = "Livebook data directory";
type = types.path;
};
userMapping = mkOption {
description = "User to run the container as";
type = types.str;
};
};
config = mkIf (cfg.enable) {
eboskma.docker.enable = true;
virtualisation.oci-containers.containers = {
livebook = {
autoStart = true;
image = "livebook/livebook";
ports = [
"8080:8080"
];
volumes = [
"${cfg.dataDir}:/data"
];
extraOptions = [
"--pull=always"
"--user=${cfg.userMapping}"
];
};
};
};
}