From 6790f234741ec9a24b1cf2498b55c1eb88824f3e Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Sun, 28 Jun 2020 14:20:31 -0400 Subject: [PATCH] add nix-build support --- default.nix | 19 +++++++++++++++++++ shell.nix | 12 +----------- whiteboard.py | 2 ++ 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 default.nix mode change 100644 => 100755 whiteboard.py diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..93ae36a --- /dev/null +++ b/default.nix @@ -0,0 +1,19 @@ +{ pkgs ? import {}, shell ? false }: +let + pyenv = pypkgs: with pypkgs; [ + greenlet twisted cython mysqlclient bcrypt + ]; + buildInputs = [ (pkgs.python2.withPackages pyenv) ]; +in +if shell then + pkgs.mkShell { inherit buildInputs; } +else + pkgs.stdenv.mkDerivation { + name = "marmots"; + src = ./.; + inherit buildInputs; + installPhase = '' + mkdir $out + cp -R * $out + ''; + } diff --git a/shell.nix b/shell.nix index ae704f3..fd59ae8 100644 --- a/shell.nix +++ b/shell.nix @@ -1,11 +1 @@ -let - pkgs = import {}; - pyenv = pypkgs: with pypkgs; [ - greenlet twisted cython mysqlclient bcrypt - ]; -in -pkgs.mkShell { - buildInputs = [ - (pkgs.python2.withPackages pyenv) - ]; -} +import ./default.nix { shell = true; } diff --git a/whiteboard.py b/whiteboard.py old mode 100644 new mode 100755 index 6cef686..3049be7 --- a/whiteboard.py +++ b/whiteboard.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 + # This file is part of MarMOTS. # # MarMOTS is free software: you can redistribute it and/or modify it under the terms of the GNU Affero