From 1ab33067a8d53d7c0ac0b934a540809e56a12ee0 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Mon, 20 Feb 2023 14:10:43 +0100 Subject: [PATCH] add nix run --- Makefile | 5 +---- README.md | 4 ++-- flake.nix | 10 +++++++++- server | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 1bf0b85..9591c96 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,4 @@ build: cd calendar && make build-js clean: - rm nixos.qcow2 - -run: - QEMU_NET_OPTS="hostfwd=tcp::8080-:80,hostfwd=tcp::1433-:143,hostfwd=tcp::5877-:587" nixos-shell vm-nextcloud.nix + rm nixos.qcow2 \ No newline at end of file diff --git a/README.md b/README.md index b8f5e2a..9f81726 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Build test environment git clone https://github.com/onny/nixos-nextcloud-testumgebung.git cd nixos-nextcloud-testumgebung nix develop -make +make build ``` Run virtual machine ``` -make run +nix run ``` Requires NixOS :) diff --git a/flake.nix b/flake.nix index 59262e5..2e2d1a2 100644 --- a/flake.nix +++ b/flake.nix @@ -6,16 +6,24 @@ outputs = { self, nixpkgs }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; + start = + pkgs.writeShellScriptBin "start" '' + set -e + export QEMU_NET_OPTS="hostfwd=tcp::8080-:80,hostfwd=tcp::1433-:143,hostfwd=tcp::5877-:587" + ${pkgs.nixos-shell}/bin/nixos-shell vm-nextcloud.nix + ''; in { devShells.x86_64-linux.default = pkgs.mkShell { packages = with pkgs; [ phpPackages.composer - phpPackages.phpunit + phpunit nixos-shell nodejs ]; }; + packages = { inherit start; }; + defaultPackage = start; }; } diff --git a/server b/server index 6e77eaa..95eeba8 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 6e77eaa618820ca61fadaa3bbc8950efad3602ce +Subproject commit 95eeba83b6570b3cf7cbb79aea42222f7d3e03f4