i hate sed

This commit is contained in:
Adam Perkowski 2024-10-05 13:46:53 +02:00
parent 4d478a1047
commit 1d9471a3ce
No known key found for this signature in database
GPG Key ID: 7CBDB58ECF1D3478
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ install_docker() {
;; ;;
nix-env) nix-env)
"$PACKAGER" -iA nixpkgs.docker "$PACKAGER" -iA nixpkgs.docker
"$ESCALATION_TOOL" sed -i -E '/^[[:space:]]*virtualisation\.docker\.enable/!b; s/^([[:space:]]*)virtualisation\.docker\.enable.*/\1virtualisation.docker.enable = true;/' "$NIXOS_CONFIG" || echo 'virtualisation.docker.enable = true;' | "$ESCALATION_TOOL" tee -a "$NIXOS_CONFIG" "$ESCALATION_TOOL" sed -i'' -E '/^[[:space:]]*virtualisation\.docker\.enable/!b; s/^([[:space:]]*)virtualisation\.docker\.enable.*/\1virtualisation.docker.enable = true;/' "$NIXOS_CONFIG" || echo 'virtualisation.docker.enable = true;' | "$ESCALATION_TOOL" tee -a "$NIXOS_CONFIG"
"$ESCALATION_TOOL" nixos-rebuild switch "$ESCALATION_TOOL" nixos-rebuild switch
;; ;;
*) *)

View File

@ -27,7 +27,7 @@ setup_flatpak() {
;; ;;
nix-env) nix-env)
"$PACKAGER" -iA nixpkgs.flatpak "$PACKAGER" -iA nixpkgs.flatpak
"$ESCALATION_TOOL" sed -i -E '/^[[:space:]]*services\.flatpak\.enable/!b; s/^([[:space:]]*)services\.flatpak\.enable.*/\1services.flatpak.enable = true;/' "$NIXOS_CONFIG" || echo 'services.flatpak.enable = true;' | "$ESCALATION_TOOL" tee -a "$NIXOS_CONFIG" "$ESCALATION_TOOL" sed -i'' -E '/^[[:space:]]*services\.flatpak\.enable/!b; s/^([[:space:]]*)services\.flatpak\.enable.*/\1services.flatpak.enable = true;/' "$NIXOS_CONFIG" || echo 'services.flatpak.enable = true;' | "$ESCALATION_TOOL" tee -a "$NIXOS_CONFIG"
"$ESCALATION_TOOL" nixos-rebuild switch "$ESCALATION_TOOL" nixos-rebuild switch
;; ;;
*) *)