Packaging Perl and Shell for NixOS Deployment
entropicthoughts.com·7w·
Discuss: Hacker News
Preview
Report Post

As a complete beginner to Nix and NixOS, I recently had some trouble packaging up a Perl script and a shell script with their dependencies for deployment on a NixOS system. Here’s what I learned.

The traditional setup: scripts, system packages, and cronjobs

Let’s imagine we have a Perl script that gets the expiration times of some tls certificates. It does this using the cpan module IPC::Run to call out to openssl. That’s probably not the best way to do it, but it is an illustrative example. A simplified version of the script might look like this.

In[1]:

use v5.16;
use warnings;
use strict;
use IPC::Run qw( run timeout );

sub openssl_get_dates {
my ($host) = @_;
my @openssl_client = qw( openssl s_cli...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help