Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created February 26, 2018 09:45
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 cleverca22/2477211344d358476e805976c23657d3 to your computer and use it in GitHub Desktop.
Save cleverca22/2477211344d358476e805976c23657d3 to your computer and use it in GitHub Desktop.
[clever@system76:~]$ nix-build unit.nix -o thing.service
/nix/store/xibndqk75icrnrf1rsc9jjq3x8a9mlgj-yourthing.service
[clever@system76:~]$ cat thing.service
[Unit]
Description=your thing
[Service]
ExecStart=/nix/store/kmwd1hq55akdb9sc7l3finr175dajlby-hello-2.10/bin/hello
[clever@system76:~]$ cat unit.nix
with import <nixpkgs> {};
let
yourthing = callPackage ./yourthing.nix {};
in writeText "yourthing.service" ''
[Unit]
Description=your thing
[Service]
ExecStart=${hello}/bin/hello
''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment