From 49b0dc2d5bfe9b92e6e02e6f0fa1076c4204f8b8 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 16 Nov 2022 16:28:18 +0100 Subject: poc 2 for nix containers: use nomad-driver-nix --- nix/nomad-driver-nix.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 nix/nomad-driver-nix.nix (limited to 'nix') diff --git a/nix/nomad-driver-nix.nix b/nix/nomad-driver-nix.nix new file mode 100644 index 0000000..9d3638d --- /dev/null +++ b/nix/nomad-driver-nix.nix @@ -0,0 +1,31 @@ +{ + pkgs ? import {} +}: +pkgs.buildGoModule rec { + pname = "nomad-driver-nix"; + version = "0.1.0"; + + src = pkgs.fetchFromGitHub { + owner = "input-output-hk"; + repo = "nomad-driver-nix"; + rev = "010b09c680887d0cade86e8ac136c3a04609e04a"; + sha256 = "sha256-hET+b7XhDLSuVQwXLI2V5nYCcdvxQQj9BAG8z4ta6CE="; + }; + + vendorSha256 = "sha256-FDJpbNtcFEHnZvWip2pvUHF3BFyfcSohrr/3nk9YS24="; + + ldflags = [ + "-X github.com/input-output-hk/nomad-driver-nix/nix.pluginVersion=${version}" + ]; + + postInstall = '' + mv $out/bin/nomad-driver-nix $out/bin/nix-driver + ''; + + meta = with pkgs.lib; { + description = "Nomad driver to run Nix packages / NixOS in systemd-nspawn containers"; + homepage = "https://github.com/input-output-hk/nomad-driver-nix"; + license = licenses.mpl20; + platforms = platforms.linux; + }; +} -- cgit v1.2.3