Skip to content
Snippets Groups Projects
Commit 6d037e00 authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.add-example

parent 5c32d008
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,6 @@
|Example|Note|
|---|---|
|[template](template)|Complete documented empty config|
|[archlinux-gnome](archlinux-gnome)|An example config for archlinux and gnome|
|[archlinux-gnome](archlinux-gnome)|An example config with archlinux and gnome|
|[ubuntu-server](ubuntu-server)|An example config for someone's ubuntu server|
lc_assert_user_is root
lc_init () {
# my favorite package
pacman -Sy --noconfirm fish dhcpcd vim sudo openssh
pacman -Sy --noconfirm --asdeps openssl
pacman -Sy --noconfirm gnome networkmanager power-profiles-daemon nextcloud-client firefox
# add primary user
useradd --create-home --shell /usr/bin/fish rtest
echo 'rtest ALL=(ALL) NOPASSWD: ALL' | EDITOR='tee -a' visudo
usermod --password $(echo testpass | openssl passwd -1 -stdin) rtest
systemctl enable gdm NetworkManager power-profiles-daemon
}
#!/bin/bash
TODO: this is a wrapper. it should download & install real linuxconf binary.
# setup this linuxconf on fresh-installed archlinux
lc_include conf.d/*
lc_assert_user_is root
# I strongly suggest u design lc_init() as an idempotent operation. Just in case u accidentally run `linuxconf register` elsewhere.
function lc_init () {
# as root / as user?
# note: in demo, append /etc/profile for PATH
}
function lc_startup () {
# as root / as user?
# with desktop env? (not supported yet)
}
function lc_login () {
# warning: less useful. happens again if user logout/login again.
# (no plan to support in first ver)
lc_login_is_x11?
}
function lc_cron () {
# hourly / daily / weekly / monthly?
# as root / as user?
}
# Warning: watch out for unintended user
lc_fsmap files/vimrc $LC_USER_HOME/.vimrc
......@@ -25,11 +25,12 @@ function lc_include () {
# print the return code of the eval-ed function to stderr, but this function should always return success.
for script in "$@"; do
echo2 "$script -- $LCI_SUBSHELL_OP started as $(whoami), at $(pwd)"
(
source "$script"
eval "$LCI_SUBSHELL_OP"
)
echo2 "$script -- $LCI_SUBSHELL_OP completed. return_val = $return_code"
echo2 "$script -- $LCI_SUBSHELL_OP completed with status $return_code"
done
return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment