From a2a14d26b45312138014e168e3f9db6c4349d719 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Mon, 5 Jun 2023 16:58:27 -0700 Subject: [PATCH] Get the demo running an intake server --- flake.nix | 2 +- tests/demo.nix | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index d950c17..bad6c05 100644 --- a/flake.nix +++ b/flake.nix @@ -52,7 +52,7 @@ modules = [ nixos-shell.nixosModules.nixos-shell self.nixosModules.intake - ./tests/demo.nix + (import ./tests/demo.nix self) ]; }; }; diff --git a/tests/demo.nix b/tests/demo.nix index 32447db..85f0e54 100644 --- a/tests/demo.nix +++ b/tests/demo.nix @@ -1,6 +1,15 @@ -{ pkgs, ... }: +flake: { pkgs, ... }: -{ +let + intake = flake.packages.${pkgs.stdenv.hostPlatform.system}.default; + + pythonPkg = pkgs.python38; + pythonEnv = pythonPkg.withPackages (pypkgs: [ intake ]); + + intakeRun = pkgs.writeShellScript "intake-run.sh" '' + ${pythonEnv}/bin/intake run -d /home/alpha/.local/share/intake + ''; +in { system.stateVersion = "22.11"; nixos-shell.mounts = { @@ -9,6 +18,19 @@ cache = "none"; }; + systemd.services."intake@alpha" = { + description = "Intake service for user alpha"; + script = "${intakeRun}"; + path = [ ]; + serviceConfig = { + User = "alpha"; + Type = "simple"; + }; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + enable = true; + }; + services.nginx.enable = true; services.nginx.virtualHosts = { alpha-fsid = {