2024年03月31日

NixOS

If I want to install VMWare, I just have to enable it like this.

virtualisation.vmware.host = {
  enable = true;
};

Enabling Polkit can be done this way.

security.polkit.enable = true;

Although, I cannot do anything remotely useful to this since I get errors regarding Error executing command as another user: Not authorized. Unlike Arch Linux, I can use polkit on the spot without having to configure it. To solve this issue, I just installed lxqt.lxqt-policykit and ran it manually. This works as a temporary solution for now. I need a better solution for polkit.

Note that when you want to disable a service or stop it from loading from start up, just do this.

systemd.services = {
  vmware-networks.wantedBy = lib.mkForce [ ];
}

Not this like this.

systemd.services = {
  vmware-networks.enable = false;
}

Because this will mask the service and make it impossible to enable it.

If I want to see the output of something.

nix eval .\#nixosConfigurations.AtomicBird.config.boot.kernelModule (1)
1 AtomicBird is my hostname, change it to your hostname

As of today, this would output

[ "kvm-amd" "vmw_pvscsi" "vmw_vmci" "vmmon" "vmnet" "fuse" "bridge" "macvlan" "tap" "tun" "loop" "atkbd" "ctr" ]

VMWare Keys

Oh, lmao, I could’ve just googled the developer keys…​ I guess I just didn’t bother since VMWare wasn’t that much of a use for me unlike QEMU/KVM.

grep and sed

I can delete a line of text that contains a string in a file by doing

grep -v "string" input.txt > output.txt (1)
1 -v means invert the match

I can also do this by using sed

sed -i '/string/d' input.txt

This would leave an empty line after it is removed. To clean empty lines, simply do

sed -i '/^\s*$/d' input.txt