add SELinux check and adjust mode in setup script for non-NixOS systems
All checks were successful
Nix Format Check / check-format (push) Successful in 38s
All checks were successful
Nix Format Check / check-format (push) Successful in 38s
This commit is contained in:
parent
e06b93215f
commit
c11c4e7482
18
setup.sh
18
setup.sh
@ -409,6 +409,23 @@ warning_prompt() {
|
||||
log_info "Starting setup..."
|
||||
}
|
||||
|
||||
check_selinux() {
|
||||
# Only on Non-NixOS based systems
|
||||
if ! command -v nixos-version >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -eq "$(getenforce)" "Enforcing" ]; then
|
||||
log_warning "SELinux is enabled. Adjusting SELinux to permissive mode..."
|
||||
sudo setenforce Permissive || die "Failed to disable SELinux"
|
||||
tee /etc/selinux/config <<EOF
|
||||
SELINUX=permissive
|
||||
SELINUXTYPE=targeted
|
||||
EOF
|
||||
log_success "SELinux disabled successfully."
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
# Check if setup has already been run
|
||||
if [ -f "$SETUP_MARKER" ]; then
|
||||
@ -428,6 +445,7 @@ main() {
|
||||
# Run setup steps
|
||||
warning_prompt
|
||||
prepare_hostname
|
||||
check_selinux
|
||||
install_nix
|
||||
install_home_manager
|
||||
setup_symlinks
|
||||
|
Loading…
x
Reference in New Issue
Block a user