We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Nix and legacy enterprise software development: an unlikely match made in heaven

00:00

Formal Metadata

Title
Nix and legacy enterprise software development: an unlikely match made in heaven
Title of Series
Number of Parts
28
Author
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
This talk is supposed to demonstrate a nice side effect of being able to build old Nix expressions and even having a binary cache with the build artefacts available: for the data migration from a legacy project, we had to debug a flash-based component. Even in 2021 where the Flash player is dead and unavailable, it was trivial to revive this piece of old software with Nix (and web.archive.org).
SoftwareSoftware maintenancePhysical systemText editorComputer-generated imageryFlash memoryNon-volatile memoryVisualization (computer graphics)Integrated development environmentServer (computing)Execution unitBinary fileCache (computing)Web browserSystem callRectangleMereologyBuildingData storage deviceHash functionProcess (computing)ResultantMedical imagingPhysical systemLink (knot theory)Human migrationFunction (mathematics)Reverse engineeringSoftware maintenanceSoftware developerCache (computing)System administratorFlash memoryFile archiverVirtual machineSoftwareDerivation (linguistics)Goodness of fitRevision controlDefault (computer science)Set (mathematics)BitSoftware testingSoftware frameworkTable (information)WindowWrapper (data mining)MathematicsCategory of beingException handlingExpressionProjective planePoint (geometry)CodeRight angleCodeCartesian coordinate systemBootstrap aggregatingMultiplication signNon-volatile memoryServer (computing)Computer animation
Transcript: English(auto-generated)
Hello everyone, I'm Maximilian, I'm also known as MA27 and I work for Mayflower as a systems administrator and software developer and today I'm going to talk about one time where Nix became useful in a legacy project by accident, also that's my first conference
talk so I'm horribly nervous. So first of all, one confession I have to make is we never really use Nix in production, that's a longer story I can tell you after but it's not really part of the talk. In fact, some of my colleagues were actually kind of skeptical about Nix but more on that later and today I'm going to talk about this one time where Nix became quite useful
and yeah, actually by accident. So a little bit of background, the software I'm talking about is a big bunch of PHP codes to create maintenance manuals for like big engines and it was planned to migrate it to a new system so as you can imagine there's a big bunch of data we have to migrate
and one of the bigger issues is that there's a baked-in image editor. The biggest issue is yeah, it's written in Flash and we didn't manage to recompile the code and we also had no idea what it was actually doing because none of us actually had experience with Flash but we had to reverse engineer this mess because we had to migrate
like the images and the changes of the images to the new system to make sure that these images are still editable in the new system. So the idea was basically to throw a bunch of test images against an editor and see what happens to better understand it for the migration.
Unfortunately all of that happened in 2021 and yeah, Flash was dead. So the big question is how do we revive Flash for five minutes? Not that much longer please, sorry. So at first we were discussing approaches like building some Windows VMs but then I
had an idea. I was like yeah, hold my beer and I decided to use a Nixos build VMs. That's basically a small wrapper on top of the testing framework that Linus already told you about and the idea was to build a recent Nixos VM and yeah, just install a Firefox from 1609 into it because back then even we had Flash support in it.
And yeah, that's basically most of the magic so I basically imported a table from GitHub with a revision from Nixos 1609 and I enabled Adobe Flash because even we didn't want to have it by default back then and from this package set I imported Firefox also
while I obviously had to increase the memory a bit and I needed an X server but it's not that interesting so I left it out here. Now I thought while the job is done, unfortunately I had another problem. So Flash is obviously unfree and not redistributable so it is not part of our binary cache and I had to build a few derivations on my own but that was kind of a problem
because yeah, the downloadings are dead which is actually a good thing I'd say. So then I came up with another idea, there's this beautiful thing called archive.org and I basically scrolled down the wayback machine until I found a working download link
and I did Nix prefetch URL and after that, yeah, I had a fixed output path in my store with a matching hash so I could build the VM and yeah, job was done. And here's a heavily censored screenshot of the result that's basically a Nixos 2105 from back then and in this browser it's still called nightly because in 1609 we weren't
even allowed to call Firefox Firefox and so basically you see the gray rectangle is the part on the right and it's some kind of engine, I've forgotten what it was and yeah, we could basically reverse engineer the editor with that. Okay, and that's basically it. The first thing I have to say for the final notes is I hope you'll never ever
need this because while if you do, you're in big trouble but the interesting thing is it's fairly trivial to revive old applications with Nix. So first of all, we have a binary cache with all the built artifacts in it so we don't have to like bootstrap a standard and yeah, compile all this stuff
on our own, we can download most of this stuff but yeah, with a few exceptions. Then also it's kind of cool that we can instantiate any kind of old Nix expression so we can like resume old projects at some point later and yeah, if we've done everything right, we can get the same build result and can continue to work on it and that's
actually I think an underestimated feature of Nix that's kind of nicely demonstrated. I just needed a funny story to tell you about it and I think it's important that we keep it that way so yes, we're doing a lot of cool stuff with Nix. I really enjoy all of the new features but I think it's important to remember
that this is a property that yeah, we should keep and finally, a fun fact. One of the colleagues admitted later that he was actually kind of impressed by what Nix could do and he seems to just somehow have changed his mind. Thank you.