Skip to content

Commit fedd6e6

Browse files
author
Alexander Schmolck
committed
Vanilla default.nix for marge
Still missing: - pinning nixpkgs - building a docker image - convenience nix-shell config
1 parent cf06305 commit fedd6e6

5 files changed

+575
-0
lines changed

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
requirements_frozen.txt requirements.nix requirements_override.nix: requirements.txt
2+
pypi2nix -V 3.6 -r $^
3+
4+
.PHONY: all
5+
all: requirements_frozen.txt requirements.nix requirements_override.nix default.nix
6+
nix-build -K .
7+
8+
.PHONY: clean
9+
clean:
10+
rm -rf .cache result requirements_frozen.txt
11+
12+
.PHONY: bump-requirements
13+
bump-requirements: clean requirements_frozen.txt

default.nix

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
with import <nixpkgs> {};
2+
let version = "0.0.1";
3+
python = (import ./requirements.nix { inherit pkgs; });
4+
py = python.packages;
5+
in
6+
python.mkDerivation {
7+
pversion = "${version}";
8+
name = "marge-${version}";
9+
src = ./.;
10+
# The dependencies, referring to variables in <nixpkgs>.
11+
buildInputs = [py.pylint py.pytest py.pytest-cov];
12+
propagatedBuildInputs = [py.maya py.requests pkgs.openssh pkgs.perl pkgs.git];
13+
checkPhase = ''
14+
export NO_TESTS_OVER_WIRE=1
15+
export PYTHONDONTWRITEBYTECODE=1
16+
#export PYTHONPATH=$PYTHONPATH:/.
17+
# disabled because it fails for now
18+
# pylint marge
19+
# FIXME(alexander): why do I need to screw w/ PYTHONPATH?
20+
PYTHONPATH=$PYTHONPATH:. py.test --cov marge
21+
'';
22+
meta = {
23+
homepage = "http://git.hanson.smarkets.com/hanson/marge";
24+
description = "A build bot for gitlab";
25+
# license = with lib.licenses; [mit] ;
26+
maintainers = [
27+
"Daniel Gorin <daniel.gorin@smarkets.com>"
28+
"Alexander Schmolck <alexander.schmolck@smarkets.com>"
29+
];
30+
platforms = pkgs.lib.platforms.linux ++ pkgs.lib.platforms.darwin;
31+
};
32+
}

0 commit comments

Comments
 (0)