2024-01-06 01:19:35 +01:00
|
|
|
# SPDX-FileCopyrightText: 2020-2023 Simon Bruder <simon@sbruder.de>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2020-12-05 13:48:06 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2020-08-22 17:44:39 +02:00
|
|
|
|
2020-12-05 15:44:58 +01:00
|
|
|
lib.mkIf config.sbruder.gui.enable {
|
2020-12-05 20:39:41 +01:00
|
|
|
# used to set up system wide configuration, actual configuration happens in
|
|
|
|
# home-manager
|
|
|
|
programs.sway = {
|
|
|
|
enable = true;
|
|
|
|
extraPackages = [ ];
|
|
|
|
};
|
2020-08-22 17:44:39 +02:00
|
|
|
|
2021-07-10 16:27:26 +02:00
|
|
|
xdg = {
|
|
|
|
portal = {
|
|
|
|
enable = true;
|
|
|
|
extraPortals = with pkgs; [
|
|
|
|
xdg-desktop-portal-wlr
|
|
|
|
xdg-desktop-portal-gtk
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-12-10 15:17:12 +01:00
|
|
|
# can have side effects (https://github.com/NixOS/nixpkgs/pull/179204)
|
|
|
|
environment.sessionVariables.GTK_USE_PORTAL = "1";
|
|
|
|
|
2021-10-10 16:32:03 +02:00
|
|
|
services.upower.enable = true;
|
|
|
|
|
2022-12-22 22:52:24 +01:00
|
|
|
services.udisks2.enable = true;
|
|
|
|
|
2021-01-01 12:33:13 +01:00
|
|
|
# steam (and other high quality software) still ships 32 bit binaries
|
2021-01-24 12:51:56 +01:00
|
|
|
hardware.opengl.driSupport32Bit = lib.mkDefault pkgs.stdenv.isx86_64;
|
2021-03-27 13:22:34 +01:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
pkgs.gnome3.adwaita-icon-theme # lutris requires system-wide installation
|
|
|
|
];
|
2022-12-02 18:54:51 +01:00
|
|
|
|
|
|
|
services.input-remapper = lib.mkIf config.sbruder.full {
|
|
|
|
enable = true;
|
|
|
|
serviceWantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
security.polkit.extraConfig = lib.optionalString config.sbruder.full ''
|
|
|
|
// Potential security problem, but required because there is no graphical polkit authentication agent
|
2022-12-11 16:22:23 +01:00
|
|
|
polkit.addRule(function(action, subject) {
|
2022-12-02 18:54:51 +01:00
|
|
|
if (action.id == "org.freedesktop.policykit.exec" && action.lookup("program") == "${config.services.input-remapper.package}/bin/input-remapper-control" && subject.isInGroup("users")) {
|
|
|
|
return polkit.Result.YES;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
'';
|
2023-09-18 15:30:59 +02:00
|
|
|
|
|
|
|
sops.secrets = lib.mkIf config.sbruder.trusted {
|
|
|
|
listenbrainz-token = {
|
|
|
|
group = "users";
|
|
|
|
mode = "440";
|
|
|
|
};
|
|
|
|
};
|
2023-12-20 23:32:44 +01:00
|
|
|
|
|
|
|
# required for pinentry-gnome3
|
|
|
|
services.dbus.packages = [ pkgs.gcr ];
|
2020-08-22 17:44:39 +02:00
|
|
|
}
|