Add some inline instructions to the demo
This commit is contained in:
parent
1dbf7ddb60
commit
2f6321f6ca
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"username": "alice",
|
||||
"secret": "alpha"
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"username": "bob",
|
||||
"secret": "beta"
|
||||
}
|
|
@ -7,11 +7,13 @@ flake: { pkgs, ... }:
|
|||
users.users.alice = {
|
||||
isNormalUser = true;
|
||||
password = "alpha";
|
||||
uid = 1000;
|
||||
};
|
||||
|
||||
users.users.bob = {
|
||||
isNormalUser = true;
|
||||
password = "beta";
|
||||
uid = 1001;
|
||||
};
|
||||
|
||||
# Put intake on both users' PATH
|
||||
|
@ -46,16 +48,39 @@ flake: { pkgs, ... }:
|
|||
|
||||
# Create an activation script that copies and chowns the demo content
|
||||
# chmod 777 because the users may not exist when the activation script runs
|
||||
system.activationScripts.demoSetup = ''
|
||||
${pkgs.coreutils}/bin/mkdir -p /home/alice/.local/share/intake
|
||||
${pkgs.coreutils}/bin/cp -r /mnt/alice/* /home/alice/.local/share/intake/
|
||||
${pkgs.coreutils}/bin/chmod -R 777 /home/alice/.local
|
||||
|
||||
${pkgs.coreutils}/bin/mkdir -p /home/bob/.local/share/intake
|
||||
${pkgs.coreutils}/bin/cp -r /mnt/bob/* /home/bob/.local/share/intake/
|
||||
${pkgs.coreutils}/bin/chmod -R 777 /home/bob/.local
|
||||
system.activationScripts =
|
||||
let
|
||||
userSetup = name: uid: ''
|
||||
${pkgs.coreutils}/bin/mkdir -p /home/${name}/.local/share/intake
|
||||
${pkgs.coreutils}/bin/cp -r /mnt/${name}/* /home/${name}/.local/share/intake/
|
||||
${pkgs.coreutils}/bin/chown -R ${uid} /home/${name}
|
||||
${pkgs.findutils}/bin/find /home/${name} -type d -exec ${pkgs.coreutils}/bin/chmod 755 {} \;
|
||||
${pkgs.findutils}/bin/find /home/${name} -type f -exec ${pkgs.coreutils}/bin/chmod 644 {} \;
|
||||
'';
|
||||
in
|
||||
{
|
||||
aliceSetup = userSetup "alice" "1000";
|
||||
bobSetup = userSetup "bob" "1001";
|
||||
};
|
||||
|
||||
# Put the demo sources on the global PATH
|
||||
environment.variables.PATH = "/mnt/sources";
|
||||
|
||||
# Include some demo instructions
|
||||
environment.etc.issue.text = ''
|
||||
# Welcome to the intake demo! Log in as `alice` with password `alpha` to begin.
|
||||
|
||||
# Exit the VM with ctrl+a x, or switch to the qemu console with ctrl+a c and `quit`.
|
||||
|
||||
'';
|
||||
users.motd = ''
|
||||
|
||||
# To set a password for the web interface, run `intake passwd` and set a password.
|
||||
|
||||
# Within this demo VM, the main intake entry point can be found at localhost:8080. This is also exposed on the host machine at localhost:5234. After you set a password, navigate to localhost:5234 on your host machine and log in to see the web interface.
|
||||
|
||||
# Try updating the currenttime source by running `intake update -s currenttime`. You should see a new item after refreshing the source's feed.
|
||||
|
||||
# The `echo` source demonstrates the use of `env` source configuration. Try changing the message in the web interface or via `intake edit -s echo`, then updating the source.
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
echo {\"id\": \"$(date +%Y-%m-%d-%H-%M)\"}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import hashlib, json, os, sys
|
||||
|
||||
|
|
Loading…
Reference in New Issue