Created
April 2, 2018 22:15
-
-
Save infinisil/cd135704e0e09166f3e2c85d3ce4b777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs/nixos> { | |
configuration = { pkgs, config, lib, ... }: with lib;{ | |
services.nix-serve.enable = true; | |
systemd.services.nix-serve = let cfg = config.services.nix-serve; in { | |
serviceConfig.ExecStart = lib.mkForce (pkgs.writeScript "nix-serve" '' | |
#!${pkgs.stdenv.shell} | |
export NIX_REMOTE="" | |
${pkgs.nix-serve}/bin/nix-serve --listen ${cfg.bindAddress}:${toString cfg.port} ${cfg.extraParams} | |
''); | |
serviceConfig.User = lib.mkForce "paul"; | |
}; | |
# Ignore the following 2 lines | |
fileSystems."/" = {}; | |
boot.loader.grub.device = "nodev"; | |
}; | |
}; | |
config.system.build.units."nix-serve.service".unit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment