From 7a06362333b663102a06c24283cf879386dd91cc Mon Sep 17 00:00:00 2001 From: Christopher Davenport Date: Mon, 3 Apr 2017 19:59:39 -0400 Subject: [PATCH 1/4] Initial NixOS Support --- .travis.yml | 3 +++ core/NixOS/latest/Dockerfile | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 core/NixOS/latest/Dockerfile diff --git a/.travis.yml b/.travis.yml index 59efb4c..e25072a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,9 @@ env: - distribution: ArchLinux distribution_version: latest init: /usr/lib/systemd/systemd + - distribution: NixOS + distribution_version: latest + init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - distribution: OracleLinux distribution_version: "7.3" diff --git a/core/NixOS/latest/Dockerfile b/core/NixOS/latest/Dockerfile new file mode 100644 index 0000000..e8bc5d6 --- /dev/null +++ b/core/NixOS/latest/Dockerfile @@ -0,0 +1,12 @@ +FROM nixos/nix +MAINTAINER Christopher Davenport + +RUN nix-channel --add http://nixos.org/channels/nixpkgs-unstable \ + && nix-channel --update \ + && nix-env --install python2.7-ansible-2.2.1.0 \ + && mkdir -p /etc/ansible \ + && echo "[local]" > /etc/ansible/hosts \ + && echo "localhost ansible_connection=local" >> /etc/ansible/hosts + +VOLUME ["/sys/fs/cgroup"] +CMD ["/usr/sbin/init"] From 4caf143fac8fb3eac091c11c48a403cdf789679b Mon Sep 17 00:00:00 2001 From: Christopher Davenport Date: Mon, 3 Apr 2017 20:18:01 -0400 Subject: [PATCH 2/4] Attempt user-environment location --- .travis.yml | 2 +- core/NixOS/latest/Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e25072a..24d9d6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ env: init: /usr/lib/systemd/systemd - distribution: NixOS distribution_version: latest - init: /usr/lib/systemd/systemd + init: /nix/store/4rw227yif8l46w3l99jv0hgq66a38a72-user-environment/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - distribution: OracleLinux distribution_version: "7.3" diff --git a/core/NixOS/latest/Dockerfile b/core/NixOS/latest/Dockerfile index e8bc5d6..75378f2 100644 --- a/core/NixOS/latest/Dockerfile +++ b/core/NixOS/latest/Dockerfile @@ -3,6 +3,7 @@ MAINTAINER Christopher Davenport RUN nix-channel --add http://nixos.org/channels/nixpkgs-unstable \ && nix-channel --update \ + && nix-env --install systemd-232 \ && nix-env --install python2.7-ansible-2.2.1.0 \ && mkdir -p /etc/ansible \ && echo "[local]" > /etc/ansible/hosts \ From 689e3835a04de0cfb304876b0a3eb2fd36056e1d Mon Sep 17 00:00:00 2001 From: Christopher Davenport Date: Mon, 3 Apr 2017 20:30:49 -0400 Subject: [PATCH 3/4] Switched to System level systemd --- .travis.yml | 2 +- core/NixOS/latest/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 24d9d6c..a8af603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ env: init: /usr/lib/systemd/systemd - distribution: NixOS distribution_version: latest - init: /nix/store/4rw227yif8l46w3l99jv0hgq66a38a72-user-environment/lib/systemd/systemd + init: /nix/store/4mhj2swvnacffi9zyj54gd5ig343jwga-systemd-232/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - distribution: OracleLinux distribution_version: "7.3" diff --git a/core/NixOS/latest/Dockerfile b/core/NixOS/latest/Dockerfile index 75378f2..844da78 100644 --- a/core/NixOS/latest/Dockerfile +++ b/core/NixOS/latest/Dockerfile @@ -10,4 +10,4 @@ RUN nix-channel --add http://nixos.org/channels/nixpkgs-unstable \ && echo "localhost ansible_connection=local" >> /etc/ansible/hosts VOLUME ["/sys/fs/cgroup"] -CMD ["/usr/sbin/init"] +CMD ["/nix/store/4mhj2swvnacffi9zyj54gd5ig343jwga-systemd-232/lib/systemd/systemd"] From 95e8b0189d08ca4e6161896413064295eab0aa7d Mon Sep 17 00:00:00 2001 From: Christopher Davenport Date: Mon, 3 Apr 2017 20:51:31 -0400 Subject: [PATCH 4/4] Add Export Find to Build --- core/NixOS/latest/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/NixOS/latest/Dockerfile b/core/NixOS/latest/Dockerfile index 844da78..30dcc59 100644 --- a/core/NixOS/latest/Dockerfile +++ b/core/NixOS/latest/Dockerfile @@ -1,13 +1,13 @@ FROM nixos/nix MAINTAINER Christopher Davenport -RUN nix-channel --add http://nixos.org/channels/nixpkgs-unstable \ - && nix-channel --update \ +RUN nix-channel --update \ && nix-env --install systemd-232 \ && nix-env --install python2.7-ansible-2.2.1.0 \ && mkdir -p /etc/ansible \ && echo "[local]" > /etc/ansible/hosts \ - && echo "localhost ansible_connection=local" >> /etc/ansible/hosts + && echo "localhost ansible_connection=local" >> /etc/ansible/hosts \ + && find / -name "systemd" VOLUME ["/sys/fs/cgroup"] CMD ["/nix/store/4mhj2swvnacffi9zyj54gd5ig343jwga-systemd-232/lib/systemd/systemd"]