feat: Adds system script that enables services during bootstrap.

This commit is contained in:
2025-09-28 20:03:57 -04:00
parent edc3e9c74e
commit 41760ac195
5 changed files with 44 additions and 81 deletions

View File

@@ -26,3 +26,4 @@ echo "Installing packages may require your password multiple times."
echo "Running packages" && $DEV_ENV/run "$args"
echo "Installing configuration" && $DEV_ENV/dev-env "$args"
echo "Installing webapps" && $DEV_ENV/webapp "$args"
echo "Starting system services" && $DEV_ENV/system "$args"

View File

@@ -98,6 +98,7 @@ copy_files() {
############################## MAIN ##############################
# CONFIG
update_dirs $DEV_ENV/env/.config $XDG_CONFIG_HOME
update_dirs $DEV_ENV/env/.local $HOME/.local
@@ -124,6 +125,8 @@ copy_files $DEV_ENV/env/.gnupg $HOME/.gnupg
mkdir $HOME/wallpapers
copy_files $DEV_ENV/env/wallpapers $HOME/wallpapers
# MISC
mkdir $HOME/Pictures
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
systemctl --user daemon-reload

View File

@@ -1,71 +0,0 @@
# NOTE:
# Configuration settings for the `hpa` command line tool.
# You can delete settings that are not applicable to your use case.
# Default arguments / options that get passed into `ansible-playbook` commands.
# WARNING: Do not put arguments / options that contain spaces in the same string,
# they should be separate strings, for example do not do something like
# ['--tags debug'], instead use ['--tags', 'debug'].
#
args = []
# Set to true if you want to pass the vault args to `ansible-playbook` commands.
useVaultArgs = true
# NOTE:
# Configuration for running the generate command(s). This allows custimizations
# to the files that get used to generate the final output (generally a pdf).
# See `pandoc --help`. Below are the defaults that get used, which only need
# adjusted if your template does not follow the default template design or if
# you add extra files to your template that need to be included in the final
# output. Also be aware that any of the files specified in the `files` or
# `includeInHeader` options, need to be inside the `buildDirectory` when generating
# the final output file.
# [generate]
# this relative to the project directory.
# buildDirectory = '.build'
# pdfEngine = 'xelatex'
# includeInHeader = [
# 'head.tex',
# 'footer.tex'
# ]
# files = [
# 'Report.md',
# 'Definitions.md'
# ]
# outputFileName = 'Report'
# NOTE:
# These are more for local development of the ansible playbook and should not be needed
# in most cases. Uncomment the lines if you want to customize the playbook and use it
# instead of the provided / default playbook.
#[playbook]
#directory = '/path/to/local/playbook-directory'
#inventory = '/path/to/local/inventory.ini'
#version = 'main'
# NOTE:
# These are to declare where your template files are either on your local system or
# a remote git repository.
[template]
# The directory path on your local system to the template files.
directory = '/Volumes/Bucket/Repos/hhe-consult-template'
# The url to a git repository that contains your template files.
url = 'https://git.housh.dev/hhe/consult-template.git'
# The version, tag, branch, or sha of the template files to clone from the remote
# template repository. In general it is best practice to use a version instead of a
# branch.
version = 'main'
# NOTE:
# Holds settings for `ansible-vault` commands.
[vault]
# Arguments to pass to commands that use `ansible-vault`, such as encrypting or decrypting
# files.
args = [ '--vault-id=consults@$SCRIPTS/vault-gopass-client' ]
# An id to use when encrypting `ansible-vault` files.
encryptId = 'consults'

View File

@@ -1,10 +0,0 @@
#!/bin/bash
systemctl --user enable --now hyprpaper.service
systemctl --user enable --now hypridle.service
espanso service register
sudo setcap "cap_dac_override+p" $(which espanso)
systemctl --user enable --now logout-task.service
systemctl --user enable --now batter-monitor.timer
sudo sysetmctl enable --now pscsd.service

40
system Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Enable system services.
dry_run="0"
while [[ $# -gt 0 ]]; do
echo "ARG: \"$1\""
# Handle a --dry or --dry-run argument
if [[ "$1" =~ ^--dry ]]; then
dry_run="1"
fi
shift
done
log() {
if [[ $dry_run == "1" ]]; then
echo "[DRY_RUN]: $1"
else
echo "$1"
fi
}
log_and_run() {
log "Running: \"$@\""
if [[ $dry_run == "0" ]]; then
eval $1
fi
}
log_and_run "systemctl --user daemon-reload"
log_and_run "systemctl --user enable --now hyprpaper.service"
log_and_run "systemctl --user enable --now hypridle.service"
log_and_run "espanso service register"
log_and_run "sudo setcap "cap_dac_override+p" $(which espanso)"
log_and_run "systemctl --user enable --now logout-task.service"
log_and_run "systemctl --user enable --now battery-monitor.timer"
log_and_run "sudo systemctl enable --now pcscd.service"