Skip to content

Commit 48fb8cf

Browse files
committed
lockers: First pass at various bits of locker infrastructure
I think that *running software* from a locker is a poor fit for Nix (I guess you could use some FHS-compatible environment?), but this sets up the packages for pyhesiodfs to access *files* using the /mit/ automounter.
1 parent 8c2e0d7 commit 48fb8cf

File tree

8 files changed

+228
-3
lines changed

8 files changed

+228
-3
lines changed

default.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,19 @@ in
2121
additions = final: prev: {athena-pkgs=builtins.trace "evaluating the overlay" athena-pkgs;};
2222
};
2323

24+
inherit athena-pkgs;
2425
debathena-aclocal = athena-pkgs.debathena-aclocal;
2526
discuss = athena-pkgs.discuss;
27+
python-discuss = athena-pkgs.python-discuss;
28+
python-afs = athena-pkgs.python-afs;
29+
python-hesiod = athena-pkgs.python-hesiod;
30+
pyhesiodfs = athena-pkgs.pyhesiodfs;
2631
remctl = athena-pkgs.remctl;
2732
example-package = pkgs.callPackage ./pkgs/example-package { };
2833
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
2934
# ...
35+
athena-python3 = (pkgs.python3.withPackages (ps: (map (pkg: pkg ps) [
36+
athena-pkgs.python-discuss
37+
athena-pkgs.python-afs
38+
])));
3039
}

pkgs/default.nix

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
# default.nix
33
{ pkgs }:
44
let
5-
debathena-aclocal = pkgs.callPackage ./aclocal.nix { };
6-
in
5+
in rec
76
{
8-
inherit debathena-aclocal;
7+
debathena-aclocal = pkgs.callPackage ./aclocal.nix { };
98
discuss = pkgs.callPackage ./discuss.nix { inherit debathena-aclocal; };
9+
python-discuss = ps: ps.callPackage ./python-discuss.nix { };
10+
python-afs = ps: ps.callPackage ./python-afs.nix { };
11+
hesiod = pkgs.callPackage ./hesiod.nix { };
12+
python-hesiod = ps: ps.callPackage ./python-hesiod.nix { inherit hesiod; };
13+
locker-support = ps: ps.callPackage ./locker-support.nix { inherit python-afs python-hesiod; };
14+
pyhesiodfs = pkgs.callPackage ./pyhesiodfs.nix { inherit python-hesiod locker-support; };
1015
remctl = pkgs.callPackage ./remctl.nix { };
1116
# https://ryantm.github.io/nixpkgs/builders/images/dockertools/
1217
# docker = pkgs.dockerTools.buildLayeredImage {

pkgs/hesiod.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{ stdenv, pkgs, lib, fetchFromGitHub,
2+
autoreconfHook, autoconf, automake, pkg-config,
3+
libidn,
4+
}:
5+
6+
stdenv.mkDerivation rec {
7+
pname = "hesiod";
8+
version = "3.2.1-nix1";
9+
src = fetchFromGitHub {
10+
owner = "achernya";
11+
repo = "hesiod";
12+
rev = "39b21dac9bc6473365de04d94be0da94941c7c73";
13+
hash = "sha256-nDZEOR5W4nRFbOdEh+qyMYQquNHyNR4oKrj8WhbKeno=";
14+
};
15+
16+
buildInputs = [
17+
autoreconfHook
18+
libidn
19+
];
20+
}

pkgs/locker-support.nix

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{ stdenv, pkgs, lib, fetchFromGitHub,
2+
python3Packages, buildPythonPackage, setuptools,
3+
python-afs, python-hesiod,
4+
}:
5+
6+
# TODO: Also install binaries
7+
8+
let
9+
fs = lib.fileset;
10+
in buildPythonPackage {
11+
pname = "locker-support";
12+
version = "10.4.7";
13+
14+
src = fetchFromGitHub {
15+
owner = "mit-athena";
16+
repo = "locker-support";
17+
rev = "10.4.7";
18+
hash = "sha256-s/L6LbBcRdno1EFbTDeQg5CMV2uJLn7xaOQgpiFLOfQ=";
19+
};
20+
21+
build-system = [
22+
setuptools
23+
];
24+
25+
dependencies = [
26+
(python-afs python3Packages)
27+
(python-hesiod python3Packages)
28+
];
29+
30+
buildInputs = [
31+
];
32+
33+
nativeBuildInputs = [
34+
];
35+
36+
pythonImportsCheck = [
37+
"locker"
38+
"athdir"
39+
];
40+
41+
#meta = with lib; {
42+
# description = "Python library for Project Athena forum system";
43+
# homepage = "https://github.com/mit-athena/python-discuss";
44+
# platforms = platforms.linux;
45+
#};
46+
}

pkgs/pyhesiodfs.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{ stdenv, pkgs, lib, fetchFromGitHub,
2+
python3Packages,
3+
python-hesiod, locker-support,
4+
}:
5+
6+
let
7+
fs = lib.fileset;
8+
in python3Packages.buildPythonApplication {
9+
pname = "pyhesiodfs";
10+
version = "1.1";
11+
12+
src = fetchFromGitHub {
13+
#owner = "mit-athena";
14+
owner = "dehnert";
15+
repo = "pyhesiodfs";
16+
rev = "master";
17+
hash = "sha256-5Y10agUgfPuJ7Mg8IR0ZMtgqMXmG8F+kTQyjXrBGnBk=";
18+
};
19+
20+
dependencies = with python3Packages; [
21+
fuse
22+
(python-hesiod python3Packages)
23+
(locker-support python3Packages)
24+
#(builtins.trace python-hesiod python-hesiod)
25+
];
26+
27+
#meta = with lib; {
28+
# description = "Python library for Project Athena forum system";
29+
# homepage = "https://github.com/mit-athena/python-discuss";
30+
# platforms = platforms.linux;
31+
#};
32+
}

pkgs/python-afs.nix

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{ stdenv, pkgs, lib, fetchFromGitHub, buildPythonPackage, setuptools, python3,
2+
openafs, krb5, }:
3+
4+
let
5+
fs = lib.fileset;
6+
in buildPythonPackage {
7+
pname = "python-afs";
8+
version = "0.2.2";
9+
10+
src = fetchFromGitHub {
11+
owner = "dehnert";
12+
repo = "python-afs";
13+
rev = "2a12421d4b94fbfecf6ea3cec459848a651f6be1"; # nix branch
14+
hash = "sha256-5tiABlKD3Vbb+fSrxVcZmqqi0ArBEwbJDhslk/r/QGs=";
15+
};
16+
17+
build-system = [
18+
setuptools
19+
];
20+
21+
buildInputs = [
22+
openafs
23+
krb5
24+
];
25+
26+
nativeBuildInputs = [
27+
python3.pkgs.cython
28+
python3.pkgs.nose
29+
];
30+
31+
pythonImportsCheck = [
32+
"afs"
33+
];
34+
35+
#meta = with lib; {
36+
# description = "Python library for Project Athena forum system";
37+
# homepage = "https://github.com/mit-athena/python-discuss";
38+
# platforms = platforms.linux;
39+
#};
40+
}

pkgs/python-discuss.nix

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{ stdenv, pkgs, lib, fetchFromGitHub, buildPythonPackage, setuptools, }:
2+
3+
let
4+
fs = lib.fileset;
5+
in buildPythonPackage {
6+
pname = "python-discuss";
7+
version = "1.2";
8+
9+
src = fetchFromGitHub {
10+
owner = "mit-athena";
11+
repo = "python-discuss";
12+
rev = "1.2";
13+
hash = "sha256-8/ew78oM39U+ibbQvYkCe0kzIBYgK2YznVWQiA7nWds=";
14+
};
15+
16+
build-system = [
17+
setuptools
18+
];
19+
20+
pythonImportsCheck = [
21+
"discuss"
22+
"discuss.client"
23+
"discuss.constants"
24+
];
25+
26+
#meta = with lib; {
27+
# description = "Python library for Project Athena forum system";
28+
# homepage = "https://github.com/mit-athena/python-discuss";
29+
# platforms = platforms.linux;
30+
#};
31+
}

pkgs/python-hesiod.nix

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{ stdenv, pkgs, lib, fetchFromGitHub,
2+
python3Packages, buildPythonPackage, setuptools,
3+
hesiod,
4+
}:
5+
6+
let
7+
fs = lib.fileset;
8+
in buildPythonPackage {
9+
pname = "python-hesiod";
10+
version = "0.2.13";
11+
12+
src = fetchFromGitHub {
13+
#owner = "mit-athena";
14+
owner = "macathena";
15+
repo = "python-hesiod";
16+
#rev = "master";
17+
rev = "python3";
18+
hash = "sha256-Lsq5LCQvEjL7Pga+LLpkTjYWBQM3VLmQ8LWVYI+Llkc=";
19+
};
20+
21+
build-system = [
22+
setuptools
23+
];
24+
25+
buildInputs = [
26+
hesiod
27+
];
28+
29+
nativeBuildInputs = [
30+
python3Packages.cython
31+
];
32+
33+
pythonImportsCheck = [
34+
"hesiod"
35+
];
36+
37+
#meta = with lib; {
38+
# description = "Python library for Project Athena forum system";
39+
# homepage = "https://github.com/mit-athena/python-discuss";
40+
# platforms = platforms.linux;
41+
#};
42+
}

0 commit comments

Comments
 (0)