Change:
<del> { config, lib, pkgs, ... }: with lib; let cfg = config.services.railcar; generateUnit = name: containerConfig: let container = pkgs.ociTools.buildContainer { args = [ (pkgs.writeShellScript "run.sh" containerConfig.cmd).outPath ]; }; in nameValuePair "railcar-${name}" { enable = true; wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = '' ${cfg.package}/bin/railcar -r ${cfg.stateDir} run ${name} -b ${container} ''; Type = containerConfig.runType; }; }; mount = with types; (submodule { options = { type = mkOption { type = str; default = "none"; description = '' The type of the filesystem to be mounted. Linux: filesystem types supported by the kernel as listed in `/proc/filesystems` (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when options include either bind or rbind), the type is a dummy, often "none" (not listed in /proc/filesystems). ''; }; source = mkOption { type = str; description = "Source for the in-container mount"; }; options = mkOption { type = listOf str; default = [ "bind" ]; description = '' Mount options of the filesystem to be used. Support options are listed in the mount(8) man page. Note that both filesystem-independent and filesystem-specific options are listed. ''; }; }; }); in { options.services.railcar = { enable = mkEnableOption "railcar"; containers = mkOption { default = {}; description = "Declarative container configuration"; type = with types; attrsOf (submodule ({ name, config, ... }: { options = { cmd = mkOption { type = types.lines; description = "Command or script to run inside the container"; }; mounts = mkOption { type = with types; attrsOf mount; default = {}; description = '' A set of mounts inside the container. The defaults have been chosen for simple bindmounts, meaning that you only need to provide the "source" parameter. ''; example = { "/data" = { source = "/var/lib/data"; }; }; }; runType = mkOption { type = types.str; default = "oneshot"; description = "The systemd service run type"; }; os = mkOption { type = types.str; default = "linux"; description = "OS type of the container"; }; arch = mkOption { type = types.str; default = "x86_64"; description = "Computer architecture type of the container"; }; }; })); }; stateDir = mkOption { type = types.path; default = "/var/railcar"; description = "Railcar persistent state directory"; }; package = mkOption { type = types.package; default = pkgs.railcar; defaultText = literalExpression "pkgs.railcar"; description = "Railcar package to use"; }; }; config = mkIf cfg.enable { systemd.services = flip mapAttrs' cfg.containers (name: containerConfig: generateUnit name containerConfig ); }; } </del>

Discussion:
I was curious about railcar and noted that it's marked as so I decided to give it a try. The first attempt failed at an error over a missing in libseccomp: I gather this is Linux-only and could find at least one other PR that fixed a macOS build of a different project by just removing it as a buildInput () and the cargo build fell over on some issues with caps: Other notes: I looked to see if Hydra was building this for darwin and don't see any builds. I guess hydra is smart enough not to bother with darwin given the libseccomp input. I noticed that ofborg didn't bother with building darwin on the original PR, either. Also, I noticed that oracle has archived the railcar repo. I only see at the moment. They've done some work on the CI earlier this year, at least, which seems to be a good signal? Notify maintainers Metadata system: host os: multi-user?: sandbox: version: channels(abathur): nixpkgs:
I marked this as stale due to inactivity. &rarr;