dotfiles/system/hosts/phone/default.nix

73 lines
1.8 KiB
Nix
Raw 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;
};
sound.enable = true;
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;
}
});
'';
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;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
};
2023-12-24 14:27:43 +07:00
# services.xserver.desktopManager.phosh = {
# enable = true;
# group = "users";
# user = config.common.mainUsername;
# };
}