2021-11-25 11:55:30 +00:00
|
|
|
# This is where extra desktop goodies can be found.
|
|
|
|
# As a note, this is not where you set the aesthetics of your graphical sessions.
|
|
|
|
# That can be found in the `themes` module.
|
2023-12-24 10:18:23 +00:00
|
|
|
{ config, lib, pkgs, options, ... }:
|
2021-11-25 11:55:30 +00:00
|
|
|
|
2024-01-22 06:48:55 +00:00
|
|
|
let cfg = config.suites.desktop;
|
2021-11-25 13:45:48 +00:00
|
|
|
in {
|
2024-01-22 06:48:55 +00:00
|
|
|
options.suites.desktop = {
|
2021-12-11 05:16:45 +00:00
|
|
|
enable =
|
2022-11-30 00:40:49 +00:00
|
|
|
lib.mkEnableOption "basic desktop-related services and default programs";
|
|
|
|
cleanup.enable = lib.mkEnableOption "activation of various cleanup services";
|
2022-04-16 16:17:19 +00:00
|
|
|
autoUpgrade.enable = lib.mkEnableOption "auto-upgrade service with this system";
|
2021-11-25 11:55:30 +00:00
|
|
|
};
|
|
|
|
|
2021-11-25 13:45:48 +00:00
|
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
2021-11-25 11:55:30 +00:00
|
|
|
({
|
|
|
|
# Enable Flatpak for additional options for installing desktop applications.
|
|
|
|
services.flatpak.enable = true;
|
2022-07-07 14:34:46 +00:00
|
|
|
xdg.portal.enable = true;
|
|
|
|
|
2022-08-20 06:13:54 +00:00
|
|
|
environment.etc =
|
|
|
|
let
|
|
|
|
urls = {
|
|
|
|
"flathub" = {
|
|
|
|
url = "https://flathub.org/repo/flathub.flatpakrepo";
|
2023-06-05 04:04:24 +00:00
|
|
|
hash = "sha256-M3HdJQ5h2eFjNjAHP+/aFTzUQm9y9K+gwzc64uj+oDo=";
|
2022-08-20 06:13:54 +00:00
|
|
|
};
|
|
|
|
"flathub-beta" = {
|
|
|
|
url = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo";
|
2023-06-05 04:04:24 +00:00
|
|
|
hash = "sha256-WCyuPJ+dRjnwJ976/m+jO9oKOk1EEpDZJq2For4PcgY=";
|
2022-08-20 06:13:54 +00:00
|
|
|
};
|
|
|
|
"gnome-nightly" = {
|
|
|
|
url = "https://nightly.gnome.org/gnome-nightly.flatpakrepo";
|
2023-06-05 04:04:24 +00:00
|
|
|
hash = "sha256-rFluVpCvgs1iy7YKVnkPh3p6YuF4orbVuOhLUUFRyYM=";
|
2022-08-20 06:13:54 +00:00
|
|
|
};
|
|
|
|
"kdeapps" = {
|
|
|
|
url = "https://distribute.kde.org/kdeapps.flatpakrepo";
|
2023-06-05 04:04:24 +00:00
|
|
|
hash = "sha256-dCF9QQYMmqMuzwAS+HYoPAAtwfzO7aVCl8s4RwhneqI=";
|
2022-08-20 06:13:54 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.mapAttrs'
|
2023-08-27 05:41:29 +00:00
|
|
|
(name: remote:
|
|
|
|
lib.nameValuePair
|
|
|
|
"flatpak/remotes.d/${name}.flatpakrepo"
|
|
|
|
{ source = pkgs.fetchurl remote; })
|
2022-08-20 06:13:54 +00:00
|
|
|
urls;
|
2021-11-25 11:55:30 +00:00
|
|
|
|
2022-08-13 00:31:09 +00:00
|
|
|
programs.extra-container.enable = true;
|
|
|
|
|
2021-11-25 11:55:30 +00:00
|
|
|
# Enable font-related options for more smoother and consistent experience.
|
2022-04-16 16:17:19 +00:00
|
|
|
fonts.fontconfig.enable = true;
|
2022-01-12 02:45:06 +00:00
|
|
|
|
|
|
|
# Run unpatched binaries with these!
|
2023-12-24 10:18:23 +00:00
|
|
|
programs.nix-ld = {
|
|
|
|
enable = true;
|
2024-01-01 05:56:10 +00:00
|
|
|
libraries =
|
|
|
|
let
|
|
|
|
xorgLibs = with pkgs.xorg; [
|
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libxcb
|
|
|
|
libxkbfile
|
|
|
|
libxshmfence
|
|
|
|
];
|
|
|
|
commonLibs = with pkgs; [
|
|
|
|
alsa-lib
|
|
|
|
cairo
|
|
|
|
freetype
|
|
|
|
dbus
|
|
|
|
icu
|
|
|
|
libGL
|
|
|
|
libnotify
|
|
|
|
mesa
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
pipewire
|
|
|
|
];
|
|
|
|
in
|
2023-12-24 10:18:23 +00:00
|
|
|
commonLibs ++ xorgLibs ++ options.programs.nix-ld.libraries.default;
|
|
|
|
};
|
2023-07-16 10:12:18 +00:00
|
|
|
|
2022-01-12 02:45:06 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
2022-12-12 06:20:20 +00:00
|
|
|
steam-run # For the heathens that still uses FHS.
|
2022-01-12 02:45:06 +00:00
|
|
|
];
|
2022-06-09 05:00:07 +00:00
|
|
|
|
|
|
|
# Enable running GNOME apps outside GNOME.
|
|
|
|
programs.dconf.enable = true;
|
2023-12-20 02:44:42 +00:00
|
|
|
|
|
|
|
# Enable virtual camera.
|
|
|
|
boot.kernelModules = [ "v4l2loopback" ];
|
2021-11-25 11:55:30 +00:00
|
|
|
})
|
|
|
|
|
2021-12-11 05:16:45 +00:00
|
|
|
(lib.mkIf cfg.cleanup.enable {
|
|
|
|
# Weekly garbage collection of Nix store.
|
|
|
|
nix.gc = {
|
|
|
|
automatic = true;
|
|
|
|
persistent = true;
|
|
|
|
dates = "weekly";
|
2022-02-11 04:31:44 +00:00
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Run the optimizer.
|
|
|
|
nix.optimise = {
|
|
|
|
automatic = true;
|
2022-07-09 02:44:49 +00:00
|
|
|
dates = [ "weekly" ];
|
2021-12-11 05:16:45 +00:00
|
|
|
};
|
|
|
|
|
2023-07-16 10:12:18 +00:00
|
|
|
# Journal settings for retention.
|
|
|
|
services.journald.extraConfig = ''
|
|
|
|
MaxRetentionSec="3 month"
|
|
|
|
'';
|
2021-12-11 05:16:45 +00:00
|
|
|
})
|
2021-12-25 13:30:10 +00:00
|
|
|
|
2022-04-16 16:17:19 +00:00
|
|
|
(lib.mkIf cfg.autoUpgrade.enable {
|
|
|
|
system.autoUpgrade = {
|
|
|
|
enable = true;
|
2022-06-26 00:45:57 +00:00
|
|
|
flake = "github:foo-dogsquared/nixos-config";
|
2022-04-16 16:17:19 +00:00
|
|
|
allowReboot = true;
|
2022-08-20 06:13:54 +00:00
|
|
|
persistent = true;
|
2022-04-16 16:17:19 +00:00
|
|
|
rebootWindow = {
|
|
|
|
lower = "22:00";
|
|
|
|
upper = "00:00";
|
|
|
|
};
|
|
|
|
dates = "weekly";
|
2022-07-13 23:59:18 +00:00
|
|
|
flags = [
|
2022-11-19 03:05:31 +00:00
|
|
|
"--update-input"
|
|
|
|
"nixpkgs"
|
2022-07-13 23:59:18 +00:00
|
|
|
"--commit-lock-file"
|
|
|
|
"--no-write-lock-file"
|
|
|
|
];
|
2022-06-26 00:45:57 +00:00
|
|
|
randomizedDelaySec = "1min";
|
2022-04-16 16:17:19 +00:00
|
|
|
};
|
|
|
|
})
|
2021-11-25 11:55:30 +00:00
|
|
|
]);
|
|
|
|
}
|