From 252af79e3dc647cd57a7d4622345d672852bc65e Mon Sep 17 00:00:00 2001 From: Lord Anton Hvornum Date: Thu, 24 May 2018 20:09:51 +0200 Subject: * New feature: deployment structure can now import/include other templates (Included templates will be installed first, since we'll assume those are baselines/requirements for slimmer deploy-structs) * Deployment scripts strings now supports python string formatting, if parameter or is given as options to each command-line (TODO: Add as a global parameter as well, and treat all strings as formatable) * Added two templates: workstation + 00:11:22:33:44:55, a example of how to set up a workstation using a template and a custom addition. Also added a default template that is similar to the workstation but does everything in one template. They all use some awk magic to fix alt-tab in Awesome WM, it also creates a "desktop" environment and installs some useful tools and fixes the start menu in Awesome WM. * Reordering mirrors is now a configurable option (Default turned off, to better suit offline environments) * Disk/root password now configurable as either a fixed string, or ask for via STDIN (Syntax for now is: ) * deployment targets now a variable (todo: add a parameter/argument) * SSL support (ignores certificate validation for now, I know this is bad, but until a parameter etc is in place, this has to be a nessecary evil for now) * Cleaned up a lot of custom variables and baked them into so it's easier to format strings based off information gathered along the way (such as partition names). * Error handling: Mostly for missing dependencies and situations, such as not booted in UEFI environment --- deployments/default.json | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 deployments/default.json (limited to 'deployments/default.json') diff --git a/deployments/default.json b/deployments/default.json new file mode 100644 index 00000000..c2d34267 --- /dev/null +++ b/deployments/default.json @@ -0,0 +1,37 @@ +{ + "args" : { + "password" : "", + "user" : "anton", + "_webbrowser" : "chromium", + "_window_manager" : "awesome", + "_keyboard_layout" : "sv-latin1" + }, + "post" : { + "Install workstation packages": { + "pacman -Syy --noconfirm {_webbrowser} {_window_manager} openssh sshfs git dhclient ttf-freefont xorg-server xorg-xrandr xorg-xinit xterm nano wget pulseaudio pulseaudio-alsa pavucontrol smbclient cifs-utils xscreensaver" : null + }, + "Enable autostarts": { + "systemctl enable dhcpcd" : null + }, + "Setup desktop environment" : { + "sed -i 's/^twm &/#&/' /etc/X11/xinit/xinitrc" : null, + "sed -i 's/^xclock/#&/' /etc/X11/xinit/xinitrc" : null, + "sed -i 's/^xterm/#&/' /etc/X11/xinit/xinitrc" : null, + "sed -i 's/^exec xterm/#&/' /etc/X11/xinit/xinitrc" : null, + "sh -c \"echo 'setxkbmap se' >> /etc/X11/xinit/xinitrc\"" : null, + "sh -c \"echo 'xscreensaver -no-splash &' >> /etc/X11/xinit/xinitrc\"" : null, + "sh -c \"echo 'exec {_window_manager}' >> /etc/X11/xinit/xinitrc\"" : {"pass-args" : true}, + "sh -c \"echo 'KEYMAP={_keyboard_layout}\nFONT=lat9w-16' >> /etc/vconsole.conf\"" : {"pass-args" : true}, + "sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"Chromium\\\", \\\"chromium\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null, + "sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"File handler\\\", \\\"nemo\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null, + "sh -c \"sed -i 's/^globalkeys = gears.table.join(/&\n awful.key({ modkey, }, \\\"l\\\", function() awful.spawn(\\\"xscreensaver-command -lock &\\\") end),\n/' /etc/xdg/awesome/rc.lua\"" : null, + "sh -c \"awk -i inplace -v RS='' '{gsub(/awful.key\\({ modkey,.*?}, \\\"Tab\\\",.*?\\\"client\\\"}\\),/, \\\"awful.key({ modkey, }, \\\"Tab\\\",\\\n function ()\\\n awful.client.focus.byidx(-1)\\\n if client.focus then\\\n client.focus:raise()\\\n end\\\n end),\\\n awful.key({ modkey, \\\"Shift\\\" }, \\\"Tab\\\",\\\n function ()\\\n awful.client.focus.byidx(1)\\\n if client.focus then\\\n client.focus.raise()\\\n end\\\n end),\\\"); print}' /etc/xdg/awesome/rc.lua\"" : null, + "gsettings set org.nemo.desktop show-desktop-icons false" : null, + "xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search" : null + }, + "Setup users" : { + "useradd -m -G wheel -s /bin/bash anton" : null, + "sh -c \"echo {user}:{password} | chpasswd\"" : {"pass-args" : true} + } + } +} -- cgit v1.2.3-70-g09d2