Add livebook, format vs code settings.json
This commit is contained in:
parent
116c537a65
commit
2bcb880b9e
4 changed files with 887 additions and 470 deletions
File diff suppressed because it is too large
Load diff
|
@ -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" ];
|
||||
|
|
|
@ -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."/" =
|
||||
|
|
39
modules/livebook/default.nix
Normal file
39
modules/livebook/default.nix
Normal 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}"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue