From 7775d877d857dc732564e23d5c5d16720404ee26 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 19 May 2021 22:05:59 -0400 Subject: Provide sample configuration file showing how one would use commands --- examples/custom-command-sample.json | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 examples/custom-command-sample.json (limited to 'examples/custom-command-sample.json') diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json new file mode 100644 index 00000000..1ef40208 --- /dev/null +++ b/examples/custom-command-sample.json @@ -0,0 +1,36 @@ +{ + "audio": "pipewire", + "bootloader": "systemd-bootctl", + "custom-commands": [ + "cd /tmp; git clone https://aur.archlinux.org/paru.git; cd paru; makepkg -si", + "paru -S --noconfirm bitwarden discord etcher-bin google-chrome steam visual-studio-code-bin" + ], + "desktop": "gnome", + "!encryption-password": "supersecret", + "filesystem": "btrfs", + "harddrive": { + "path": "/dev/nvme0n1" + }, + "hostname": "development-box", + "kernels": [ + "linux" + ], + "keyboard-language": "us", + "mirror-region": { + "Worldwide": { + "https://mirror.rackspace.com/archlinux/$repo/os/$arch": true + } + }, + "nic": { + "NetworkManager": true + }, + "packages": ["docker", "firefox", "gimp", "git", "hexchat", "libreoffice-fresh", "vlc", "wget", "zsh"], + "superusers": { + "devel": { + "!password": "devel" + } + }, + "timezone": "US/Eastern", + "users": {} + } +} -- cgit v1.2.3-70-g09d2 From f137bc4076ec7e4e0914be466ef403810ab02fca Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 19 May 2021 22:41:07 -0400 Subject: Modify custom profile example to try to get it working --- examples/custom-command-sample.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples/custom-command-sample.json') diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json index 1ef40208..0ddf62b9 100644 --- a/examples/custom-command-sample.json +++ b/examples/custom-command-sample.json @@ -2,8 +2,9 @@ "audio": "pipewire", "bootloader": "systemd-bootctl", "custom-commands": [ - "cd /tmp; git clone https://aur.archlinux.org/paru.git; cd paru; makepkg -si", - "paru -S --noconfirm bitwarden discord etcher-bin google-chrome steam visual-studio-code-bin" + "cd /home/devel; git clone https://aur.archlinux.org/paru.git", + "chown -R devel:devel /home/devel/paru", + "usermod -aG docker devel" ], "desktop": "gnome", "!encryption-password": "supersecret", @@ -24,7 +25,8 @@ "nic": { "NetworkManager": true }, - "packages": ["docker", "firefox", "gimp", "git", "hexchat", "libreoffice-fresh", "vlc", "wget", "zsh"], + "packages": ["docker", "git", "wget", "zsh"], + "profile": "desktop", "superusers": { "devel": { "!password": "devel" @@ -32,5 +34,4 @@ }, "timezone": "US/Eastern", "users": {} - } } -- cgit v1.2.3-70-g09d2 From 5fe3a77aedb8d0f9230c13c89139c77328ed28f7 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 20 May 2021 08:41:18 -0400 Subject: Update configuration script to work with changes --- examples/custom-command-sample.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/custom-command-sample.json') diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json index 0ddf62b9..0518d3db 100644 --- a/examples/custom-command-sample.json +++ b/examples/custom-command-sample.json @@ -6,7 +6,6 @@ "chown -R devel:devel /home/devel/paru", "usermod -aG docker devel" ], - "desktop": "gnome", "!encryption-password": "supersecret", "filesystem": "btrfs", "harddrive": { @@ -26,7 +25,7 @@ "NetworkManager": true }, "packages": ["docker", "git", "wget", "zsh"], - "profile": "desktop", + "profile": "gnome", "superusers": { "devel": { "!password": "devel" -- cgit v1.2.3-70-g09d2 From ebf59809432ac205d7b77b44dbcf611d98078a0c Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Fri, 21 May 2021 06:29:10 -0400 Subject: Add ability to provide an array of services to enable in config file --- examples/custom-command-sample.json | 1 + examples/guided.py | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'examples/custom-command-sample.json') diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json index 0518d3db..5e7a70e3 100644 --- a/examples/custom-command-sample.json +++ b/examples/custom-command-sample.json @@ -26,6 +26,7 @@ }, "packages": ["docker", "git", "wget", "zsh"], "profile": "gnome", + "services": ["docker"], "superusers": { "devel": { "!password": "devel" diff --git a/examples/guided.py b/examples/guided.py index d23c483e..f61548e1 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -379,6 +379,11 @@ def perform_installation(mountpoint): archinstall.log(' * Profile\'s post configuration requirements was not fulfilled.', fg='red') exit(1) + # If the user provided a list of services to be enabled, pass the list to the enable_service function. + # Note that while it's called enable_service, it can actually take a list of services and iterate it. + if archinstall.arguments.get('services', None): + installation.enable_service(*archinstall.arguments['services']) + # If the user provided custom commands to be run post-installation, execute them now. if archinstall.arguments.get('custom-commands', None): run_custom_user_commands(archinstall.arguments['custom-commands'], installation) -- cgit v1.2.3-70-g09d2