Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimal example config #241

Open
rG2ee opened this issue Oct 8, 2024 · 3 comments
Open

minimal example config #241

rG2ee opened this issue Oct 8, 2024 · 3 comments

Comments

@rG2ee
Copy link

rG2ee commented Oct 8, 2024

Hello,

I'm relatively new to NixOS, in the sense that I've only created configurations so far and haven't delved deeper into the language.
Would it be possible to create a minimal example configuration that makes use of hardware features with Wayland?
With all the options and GitHub discussions, it's difficult for me to understand what's happening.

Maybe there is already an example repository from which I can start?

@darbster145
Copy link

darbster145 commented Oct 12, 2024

Hi, I was in the same place you are. I'll share a few resources.

  1. Once installed, if you want graphics acceleration, you need to add this to your /etc/nixos/configuration:
  hardware.asahi = {
    useExperimentalGPUDriver = true;
    experimentalGPUInstallMode = "replace";
    setupAsahiSound = true;
  };

These are a few other things that took me a while to figure out:

Persistant Battery Charge Limit at 80%:

services.udev.extraRules = ''
    SUBSYSTEM=="power_supply", KERNEL=="macsmc-battery", ATTR{charge_control_end_threshold}="80"
  '';

Enable the notch (I prefer the extra real estate and just move my dock up to the top like on macos):

boot.kernelParams = [ "apple_dcp.show_notch=1" ];

You can take a look at my config but it is using a multi host flake. (My asahi system is the 'nixi' one in my flake). So if you are using channels, it will look a little different.

There is another persons repo that I look at as well for help. They also use flakes but its a much better setup than mine:
https://github.com/yusefnapora/nix-config/blob/main/nixos/hosts/asahi/default.nix

I feel like there should be a piece added to the documentation on how to enable hardware graphics acceleration as that is what most people want but I hope that helps.

@foldfree
Copy link

foldfree commented Oct 13, 2024

If you do anything that takes a bit of ram, I recommend that you enable zram in your config.

  zramSwap.enable = true;

also this can be handy on a laptop:

  services.logind.extraConfig = ''
    # don’t shutdown when power button is short-pressed
    HandlePowerKey=ignore
  '';

@rG2ee
Copy link
Author

rG2ee commented Oct 19, 2024

Thank you very much. That was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants