2022-04-10 11:54:58 +02:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
options,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
2022-01-11 16:08:21 +01:00
|
|
|
mkEnableOption
|
|
|
|
mkIf
|
|
|
|
optional
|
2022-04-10 11:54:58 +02:00
|
|
|
;
|
|
|
|
in {
|
2022-01-07 17:44:30 +01:00
|
|
|
options.my.gui = {
|
2022-01-11 16:08:21 +01:00
|
|
|
enable = mkEnableOption "System has some kind of screen attached";
|
|
|
|
isNvidia = mkEnableOption "System a NVIDIA GPU";
|
2022-01-07 17:44:30 +01:00
|
|
|
};
|
2021-06-01 14:28:20 +02:00
|
|
|
|
2022-01-11 16:08:21 +01:00
|
|
|
config = mkIf config.my.gui.enable {
|
2022-01-07 17:44:30 +01:00
|
|
|
my.displayManager.sddm.enable = true;
|
|
|
|
|
2022-11-14 20:30:51 +01:00
|
|
|
programs.gnupg.agent = {
|
|
|
|
enable = true;
|
|
|
|
enableSSHSupport = true;
|
2024-05-26 23:40:55 +02:00
|
|
|
pinentryPackage = pkgs.pinentry-qt;
|
2022-11-14 20:30:51 +01:00
|
|
|
};
|
|
|
|
|
2022-01-07 17:44:30 +01:00
|
|
|
services = {
|
|
|
|
xserver = {
|
|
|
|
enable = true;
|
|
|
|
# NOTE: could use `mkOptionDefault` but this feels more explicit
|
2022-04-10 11:54:58 +02:00
|
|
|
videoDrivers =
|
|
|
|
if config.my.gui.isNvidia
|
|
|
|
then ["nvidia"]
|
|
|
|
else options.services.xserver.videoDrivers.default;
|
2024-05-30 01:45:57 +02:00
|
|
|
xkb = {
|
|
|
|
layout = "fr";
|
|
|
|
variant = "us";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
libinput = {
|
|
|
|
enable = true;
|
|
|
|
touchpad = {
|
|
|
|
naturalScrolling = true;
|
2023-07-11 20:39:24 +02:00
|
|
|
};
|
2022-01-07 17:44:30 +01:00
|
|
|
};
|
2022-01-17 22:02:26 +01:00
|
|
|
|
|
|
|
logind.lidSwitch = "ignore";
|
2024-03-05 05:08:09 +01:00
|
|
|
|
|
|
|
printing = {
|
|
|
|
enable = true;
|
|
|
|
cups-pdf.enable = true;
|
|
|
|
};
|
2024-11-07 15:21:15 +01:00
|
|
|
|
|
|
|
udev.packages = [pkgs.chrysalis];
|
2022-01-07 17:44:30 +01:00
|
|
|
};
|
|
|
|
|
2022-01-11 16:08:21 +01:00
|
|
|
environment.systemPackages = builtins.attrValues {
|
2022-04-10 11:54:58 +02:00
|
|
|
inherit
|
|
|
|
(pkgs)
|
2024-03-04 18:53:00 +01:00
|
|
|
arandr
|
2024-11-07 15:21:15 +01:00
|
|
|
chrysalis
|
2024-03-03 02:58:06 +01:00
|
|
|
discord
|
2022-01-11 16:08:21 +01:00
|
|
|
feh
|
|
|
|
ffmpeg
|
2023-03-30 12:40:44 +02:00
|
|
|
gimp-with-plugins
|
2022-01-11 16:08:21 +01:00
|
|
|
imagemagick
|
|
|
|
mpv
|
|
|
|
obs-studio
|
|
|
|
pavucontrol
|
|
|
|
spotify
|
|
|
|
tdesktop
|
|
|
|
thunderbird
|
|
|
|
virt-manager
|
2023-04-04 20:24:34 +02:00
|
|
|
xcolor
|
2022-01-11 16:08:21 +01:00
|
|
|
zathura
|
2022-04-10 11:54:58 +02:00
|
|
|
;
|
2021-04-18 14:46:12 +02:00
|
|
|
|
2023-06-19 17:37:35 +02:00
|
|
|
inherit (pkgs.libsForQt5) okular;
|
2022-01-11 16:08:21 +01:00
|
|
|
};
|
2021-04-19 16:07:38 +02:00
|
|
|
|
2024-03-03 03:29:14 +01:00
|
|
|
networking.networkmanager.enable = true;
|
2022-01-07 17:20:57 +01:00
|
|
|
programs.nm-applet.enable = true;
|
|
|
|
programs.steam.enable = true;
|
|
|
|
|
2022-04-20 11:57:50 +02:00
|
|
|
# this is necessary to set GTK stuff in home manager
|
|
|
|
# FIXME: better interdependency between this and the home part
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
|
2022-01-07 17:20:57 +01:00
|
|
|
# NOTE: needed for home emacs configuration
|
|
|
|
nixpkgs.config.input-fonts.acceptLicense = true;
|
|
|
|
};
|
2021-04-16 21:33:48 +02:00
|
|
|
}
|