Skip to content

Instantly share code, notes, and snippets.

@infinisil
Created April 2, 2018 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infinisil/cd135704e0e09166f3e2c85d3ce4b777 to your computer and use it in GitHub Desktop.
Save infinisil/cd135704e0e09166f3e2c85d3ce4b777 to your computer and use it in GitHub Desktop.
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