dotfiles/system/hosts/phone/default.nix

75 lines
1.9 KiB
Nix
Raw Permalink Normal View History

{ pkgs
2023-12-19 11:12:34 +07:00
, lib
2023-12-24 14:27:43 +07:00
, config
2023-12-19 11:12:34 +07:00
, ...
}:
{
2023-12-24 14:27:43 +07:00
imports = [ ./options.nix ];
system.stateVersion = "23.11";
2023-12-24 14:27:43 +07:00
systemd.network.links."40-wlan0" = {
matchConfig.OriginalName = "wlan0";
linkConfig.MACAddressPolicy = "none";
linkConfig.MACAddress = config.phone.mac;
};
services.logind.powerKey = "ignore";
services.logind.powerKeyLongPress = "poweroff";
hardware.sensor.iio.enable = true;
services.pipewire.enable = false;
hardware.pulseaudio.enable = lib.mkForce true;
users.users.${config.common.mainUsername}.extraGroups = [
"dialout"
"feedbackd"
"video"
] ++ lib.optional (config.networking.modemmanager.enable || config.networking.networkmanager.enable) "networkmanager";
2023-12-24 16:28:34 +07:00
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if ((action.id.indexOf("org.freedesktop.login1.suspend" == 0)
|| action.id.indexOf("org.freedesktop.login1.reboot" == 0)
|| action.id.indexOf("org.freedesktop.login1.power-off" == 0)
|| action.id.indexOf("org.freedesktop.inhibit") == 0)
&& subject.user == "${config.common.mainUsername}")
{
return polkit.Result.YES;
}
});
'';
phone.buffyboard.enable = true;
phone.rndis.enable = true;
2023-12-24 14:27:43 +07:00
common.minimal = false;
services.sshd.enable = true;
services.tlp.enable = true;
# kde connect
networking.firewall.allowedTCPPortRanges = [
{ from = 1714; to = 1764; }
];
networking.firewall.allowedUDPPortRanges = [
{ from = 1714; to = 1764; }
];
2023-12-24 14:27:43 +07:00
programs.calls.enable = true;
environment.systemPackages = with pkgs; [
# IM and SMS
chatty
];
2023-12-19 11:12:34 +07:00
programs.sway.enable = true;
xdg.portal = {
enable = true;
2024-08-15 09:06:06 +07:00
wlr.enable = lib.mkForce false;
2024-08-15 07:14:30 +07:00
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
};
2023-12-24 14:27:43 +07:00
# services.xserver.desktopManager.phosh = {
# enable = true;
# group = "users";
# user = config.common.mainUsername;
# };
}