Fixes to plasma5, gnss-share
This commit is contained in:
parent
f6c6ba872c
commit
27b7a85215
@ -957,11 +957,11 @@
|
||||
},
|
||||
"nixpkgs_9": {
|
||||
"locked": {
|
||||
"lastModified": 1675942811,
|
||||
"narHash": "sha256-/v4Z9mJmADTpXrdIlAjFa1e+gkpIIROR670UVDQFwIw=",
|
||||
"lastModified": 1676973346,
|
||||
"narHash": "sha256-rft8oGMocTAhUVqG3LW6I8K/Fo9ICGmNjRqaWTJwav0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "724bfc0892363087709bd3a5a1666296759154b1",
|
||||
"rev": "d0d55259081f0b97c828f38559cad899d351cad1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -151,6 +151,11 @@
|
||||
modules = __attrValues self.nixosModules ++ [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
|
||||
{
|
||||
disabledModules =
|
||||
[ "services/x11/desktop-managers/plasma5.nix" ];
|
||||
}
|
||||
|
||||
(import (./machines + "/${name}"))
|
||||
{ nixpkgs.pkgs = pkgs; }
|
||||
{ device = name; }
|
||||
|
@ -48,8 +48,55 @@
|
||||
themes.fonts = {
|
||||
main.size = 10;
|
||||
serif.size = 10;
|
||||
mono.size = 10;
|
||||
mono.size = 11;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.pure-maps ];
|
||||
environment.systemPackages = [ pkgs.pure-maps pkgs.plasma5Packages.elisa ];
|
||||
|
||||
environment.etc."gnss-share.conf".text = ''
|
||||
# Socket to sent NMEA location to
|
||||
socket="/var/run/gnss-share.sock"
|
||||
# Group to set as owner for the socket
|
||||
group="geoclue"
|
||||
|
||||
# GPS device driver to use
|
||||
# Supported values: stm, stm_serial
|
||||
device_driver="stm"
|
||||
|
||||
# Path to GPS device to use
|
||||
device_path="/dev/gnss0"
|
||||
|
||||
# Baud rate for GPS serial device
|
||||
device_baud_rate=9600
|
||||
|
||||
# Directory to load/store almanac and ephemeris data
|
||||
agps_directory="/var/cache/gnss-share"
|
||||
'';
|
||||
|
||||
systemd.services.gnss-share = {
|
||||
script = "gnss-share";
|
||||
description = "GNSS location manager";
|
||||
path = [ pkgs.gnss-share ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
before = [ "geoclue.service" ];
|
||||
};
|
||||
|
||||
environment.etc."geoclue/geoclue.conf".text = lib.mkForce
|
||||
(lib.generators.toINI { } {
|
||||
network-nmea = {
|
||||
enable = true;
|
||||
nmea-socket = "/var/run/gnss-share.sock";
|
||||
};
|
||||
modem-gps.enable = true;
|
||||
cdma.enable = true;
|
||||
"3g".enable = true;
|
||||
agent.whitelist = "geoclue-demo-agent";
|
||||
wifi = {
|
||||
enable = true;
|
||||
url = "https://location.services.mozilla.com/v1/geolocate?key=geoclue";
|
||||
};
|
||||
});
|
||||
|
||||
home-manager.users.balsoft.programs.git.signing.signByDefault =
|
||||
lib.mkForce false;
|
||||
}
|
||||
|
577
modules/plasma5.nix
Normal file
577
modules/plasma5.nix
Normal file
@ -0,0 +1,577 @@
|
||||
{ config, lib, pkgs, utils, ... }:
|
||||
|
||||
let
|
||||
xcfg = config.services.xserver;
|
||||
cfg = xcfg.desktopManager.plasma5;
|
||||
|
||||
# Use only for **internal** options.
|
||||
# This is not exactly user-friendly.
|
||||
kdeConfigurationType = with types;
|
||||
let
|
||||
valueTypes = (oneOf [
|
||||
bool
|
||||
float
|
||||
int
|
||||
str
|
||||
]) // {
|
||||
description = "KDE Configuration value";
|
||||
emptyValue.value = "";
|
||||
};
|
||||
set = (nullOr (lazyAttrsOf valueTypes)) // {
|
||||
description = "KDE Configuration set";
|
||||
emptyValue.value = {};
|
||||
};
|
||||
in (lazyAttrsOf set) // {
|
||||
description = "KDE Configuration file";
|
||||
emptyValue.value = {};
|
||||
};
|
||||
|
||||
libsForQt5 = pkgs.plasma5Packages;
|
||||
inherit (libsForQt5) kdeGear kdeFrameworks plasma5;
|
||||
inherit (lib)
|
||||
getBin optionalString literalExpression
|
||||
mkRemovedOptionModule mkRenamedOptionModule
|
||||
mkDefault mkIf mkMerge mkOption mkPackageOptionMD types;
|
||||
|
||||
activationScript = ''
|
||||
${set_XDG_CONFIG_HOME}
|
||||
|
||||
# The KDE icon cache is supposed to update itself automatically, but it uses
|
||||
# the timestamp on the icon theme directory as a trigger. This doesn't work
|
||||
# on NixOS because the timestamp never changes. As a workaround, delete the
|
||||
# icon cache at login and session activation.
|
||||
# See also: http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
|
||||
rm -fv $HOME/.cache/icon-cache.kcache
|
||||
|
||||
# xdg-desktop-settings generates this empty file but
|
||||
# it makes kbuildsyscoca5 fail silently. To fix this
|
||||
# remove that menu if it exists.
|
||||
rm -fv ''${XDG_CONFIG_HOME}/menus/applications-merged/xdg-desktop-menu-dummy.menu
|
||||
|
||||
# Qt writes a weird ‘libraryPath’ line to
|
||||
# ~/.config/Trolltech.conf that causes the KDE plugin
|
||||
# paths of previous KDE invocations to be searched.
|
||||
# Obviously using mismatching KDE libraries is potentially
|
||||
# disastrous, so here we nuke references to the Nix store
|
||||
# in Trolltech.conf. A better solution would be to stop
|
||||
# Qt from doing this wackiness in the first place.
|
||||
trolltech_conf="''${XDG_CONFIG_HOME}/Trolltech.conf"
|
||||
if [ -e "$trolltech_conf" ]; then
|
||||
${getBin pkgs.gnused}/bin/sed -i "$trolltech_conf" -e '/nix\\store\|nix\/store/ d'
|
||||
fi
|
||||
|
||||
# Remove the kbuildsyscoca5 cache. It will be regenerated
|
||||
# immediately after. This is necessary for kbuildsyscoca5 to
|
||||
# recognize that software that has been removed.
|
||||
rm -fv $HOME/.cache/ksycoca*
|
||||
|
||||
${libsForQt5.kservice}/bin/kbuildsycoca5
|
||||
'';
|
||||
|
||||
set_XDG_CONFIG_HOME = ''
|
||||
# Set the default XDG_CONFIG_HOME if it is unset.
|
||||
# Per the XDG Base Directory Specification:
|
||||
# https://specifications.freedesktop.org/basedir-spec/latest
|
||||
# 1. Never export this variable! If it is unset, then child processes are
|
||||
# expected to set the default themselves.
|
||||
# 2. Contaminate / if $HOME is unset; do not check if $HOME is set.
|
||||
XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options.services.xserver.desktopManager.plasma5 = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc "Enable the Plasma 5 (KDE 5) desktop environment.";
|
||||
};
|
||||
|
||||
phononBackend = mkOption {
|
||||
type = types.enum [ "gstreamer" "vlc" ];
|
||||
default = "vlc";
|
||||
example = "gstreamer";
|
||||
description = lib.mdDoc "Phonon audio backend to install.";
|
||||
};
|
||||
|
||||
supportDDC = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Support setting monitor brightness via DDC.
|
||||
|
||||
This is not needed for controlling brightness of the internal monitor
|
||||
of a laptop and as it is considered experimental by upstream, it is
|
||||
disabled by default.
|
||||
'';
|
||||
};
|
||||
|
||||
useQtScaling = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc "Enable HiDPI scaling in Qt.";
|
||||
};
|
||||
|
||||
runUsingSystemd = mkOption {
|
||||
description = lib.mdDoc "Use systemd to manage the Plasma session";
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
excludePackages = mkOption {
|
||||
description = lib.mdDoc "List of default packages to exclude from the configuration";
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
example = literalExpression "[ pkgs.plasma5Packages.oxygen ]";
|
||||
};
|
||||
|
||||
notoPackage = mkPackageOptionMD pkgs "Noto fonts" {
|
||||
default = [ "noto-fonts" ];
|
||||
example = "noto-fonts-lgc-plus";
|
||||
};
|
||||
|
||||
# Internally allows configuring kdeglobals globally
|
||||
kdeglobals = mkOption {
|
||||
internal = true;
|
||||
default = {};
|
||||
type = kdeConfigurationType;
|
||||
};
|
||||
|
||||
# Internally allows configuring kwin globally
|
||||
kwinrc = mkOption {
|
||||
internal = true;
|
||||
default = {};
|
||||
type = kdeConfigurationType;
|
||||
};
|
||||
|
||||
mobile.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Enable support for running the Plasma Mobile shell.
|
||||
'';
|
||||
};
|
||||
|
||||
mobile.installRecommendedSoftware = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = lib.mdDoc ''
|
||||
Installs software recommended for use with Plasma Mobile, but which
|
||||
is not strictly required for Plasma Mobile to run.
|
||||
'';
|
||||
};
|
||||
|
||||
bigscreen.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Enable support for running the Plasma Bigscreen session.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "services" "xserver" "desktopManager" "plasma5" "enableQt4Support" ] "Phonon no longer supports Qt 4.")
|
||||
(mkRenamedOptionModule [ "services" "xserver" "desktopManager" "kde5" ] [ "services" "xserver" "desktopManager" "plasma5" ])
|
||||
];
|
||||
|
||||
config = mkMerge [
|
||||
# Common Plasma dependencies
|
||||
(mkIf (cfg.enable || cfg.mobile.enable || cfg.bigscreen.enable) {
|
||||
|
||||
security.wrappers = {
|
||||
kscreenlocker_greet = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${getBin libsForQt5.kscreenlocker}/libexec/kscreenlocker_greet";
|
||||
};
|
||||
start_kdeinit = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${getBin libsForQt5.kinit}/libexec/kf5/start_kdeinit";
|
||||
};
|
||||
kwin_wayland = {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
capabilities = "cap_sys_nice+ep";
|
||||
source = "${getBin plasma5.kwin}/bin/kwin_wayland";
|
||||
};
|
||||
};
|
||||
|
||||
# DDC support
|
||||
boot.kernelModules = lib.optional cfg.supportDDC "i2c_dev";
|
||||
services.udev.extraRules = lib.optionalString cfg.supportDDC ''
|
||||
KERNEL=="i2c-[0-9]*", TAG+="uaccess"
|
||||
'';
|
||||
|
||||
environment.systemPackages =
|
||||
with libsForQt5;
|
||||
with plasma5; with kdeGear; with kdeFrameworks;
|
||||
let
|
||||
requiredPackages = [
|
||||
frameworkintegration
|
||||
kactivities
|
||||
kauth
|
||||
kcmutils
|
||||
kconfig
|
||||
kconfigwidgets
|
||||
kcoreaddons
|
||||
kdoctools
|
||||
kdbusaddons
|
||||
kdeclarative
|
||||
kded
|
||||
kdesu
|
||||
kdnssd
|
||||
kemoticons
|
||||
kfilemetadata
|
||||
kglobalaccel
|
||||
kguiaddons
|
||||
kiconthemes
|
||||
kidletime
|
||||
kimageformats
|
||||
kinit
|
||||
kirigami2 # In system profile for SDDM theme. TODO: wrapper.
|
||||
kio
|
||||
kjobwidgets
|
||||
knewstuff
|
||||
knotifications
|
||||
knotifyconfig
|
||||
kpackage
|
||||
kparts
|
||||
kpeople
|
||||
krunner
|
||||
kservice
|
||||
ktextwidgets
|
||||
kwayland
|
||||
kwayland-integration
|
||||
kwidgetsaddons
|
||||
kxmlgui
|
||||
kxmlrpcclient
|
||||
plasma-framework
|
||||
solid
|
||||
sonnet
|
||||
threadweaver
|
||||
|
||||
breeze-qt5
|
||||
kactivitymanagerd
|
||||
kde-cli-tools
|
||||
kdecoration
|
||||
kdeplasma-addons
|
||||
kgamma5
|
||||
khotkeys
|
||||
kscreen
|
||||
kscreenlocker
|
||||
kwayland
|
||||
kwin
|
||||
kwrited
|
||||
libkscreen
|
||||
libksysguard
|
||||
milou
|
||||
plasma-integration
|
||||
polkit-kde-agent
|
||||
|
||||
plasma-desktop
|
||||
plasma-workspace
|
||||
plasma-workspace-wallpapers
|
||||
|
||||
oxygen-sounds
|
||||
|
||||
breeze-icons
|
||||
pkgs.hicolor-icon-theme
|
||||
|
||||
kde-gtk-config
|
||||
breeze-gtk
|
||||
|
||||
qtvirtualkeyboard
|
||||
|
||||
pkgs.xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
|
||||
];
|
||||
optionalPackages = [
|
||||
pkgs.aha # needed by kinfocenter for fwupd support
|
||||
plasma-browser-integration
|
||||
konsole
|
||||
oxygen
|
||||
(lib.getBin qttools) # Expose qdbus in PATH
|
||||
];
|
||||
in
|
||||
requiredPackages
|
||||
++ utils.removePackagesByName optionalPackages cfg.excludePackages
|
||||
|
||||
# Phonon audio backend
|
||||
++ lib.optional (cfg.phononBackend == "gstreamer") libsForQt5.phonon-backend-gstreamer
|
||||
++ lib.optional (cfg.phononBackend == "vlc") libsForQt5.phonon-backend-vlc
|
||||
|
||||
# Optional hardware support features
|
||||
++ lib.optionals config.hardware.bluetooth.enable [ bluedevil bluez-qt pkgs.openobex pkgs.obexftp ]
|
||||
++ lib.optional config.networking.networkmanager.enable plasma-nm
|
||||
++ lib.optional config.hardware.pulseaudio.enable plasma-pa
|
||||
++ lib.optional config.services.pipewire.pulse.enable plasma-pa
|
||||
++ lib.optional config.powerManagement.enable powerdevil
|
||||
++ lib.optional config.services.colord.enable pkgs.colord-kde
|
||||
++ lib.optional config.services.hardware.bolt.enable pkgs.plasma5Packages.plasma-thunderbolt
|
||||
++ lib.optionals config.services.samba.enable [ kdenetwork-filesharing pkgs.samba ]
|
||||
++ lib.optional config.services.xserver.wacom.enable pkgs.wacomtablet
|
||||
++ lib.optional config.services.flatpak.enable flatpak-kcm;
|
||||
|
||||
# Extra services for D-Bus activation
|
||||
services.dbus.packages = [
|
||||
plasma5.kactivitymanagerd
|
||||
];
|
||||
|
||||
environment.pathsToLink = [
|
||||
# FIXME: modules should link subdirs of `/share` rather than relying on this
|
||||
"/share"
|
||||
];
|
||||
|
||||
environment.etc."X11/xkb".source = xcfg.xkbDir;
|
||||
|
||||
environment.sessionVariables = {
|
||||
PLASMA_USE_QT_SCALING = mkIf cfg.useQtScaling "1";
|
||||
|
||||
# Needed for things that depend on other store.kde.org packages to install correctly,
|
||||
# notably Plasma look-and-feel packages (a.k.a. Global Themes)
|
||||
#
|
||||
# FIXME: this is annoyingly impure and should really be fixed at source level somehow,
|
||||
# but kpackage is a library so we can't just wrap the one thing invoking it and be done.
|
||||
# This also means things won't work for people not on Plasma, but at least this way it
|
||||
# works for SOME people.
|
||||
KPACKAGE_DEP_RESOLVERS_PATH = "${pkgs.plasma5Packages.frameworkintegration.out}/libexec/kf5/kpackagehandlers";
|
||||
};
|
||||
|
||||
# Enable GTK applications to load SVG icons
|
||||
services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
|
||||
|
||||
fonts.fonts = with pkgs; [ cfg.notoPackage hack-font ];
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
monospace = [ "Hack" "Noto Sans Mono" ];
|
||||
sansSerif = [ "Noto Sans" ];
|
||||
serif = [ "Noto Serif" ];
|
||||
};
|
||||
|
||||
programs.ssh.askPassword = mkDefault "${plasma5.ksshaskpass.out}/bin/ksshaskpass";
|
||||
|
||||
# Enable helpful DBus services.
|
||||
services.accounts-daemon.enable = true;
|
||||
# when changing an account picture the accounts-daemon reads a temporary file containing the image which systemsettings5 may place under /tmp
|
||||
systemd.services.accounts-daemon.serviceConfig.PrivateTmp = false;
|
||||
services.power-profiles-daemon.enable = mkDefault true;
|
||||
services.system-config-printer.enable = mkIf config.services.printing.enable (mkDefault true);
|
||||
services.udisks2.enable = true;
|
||||
services.upower.enable = config.powerManagement.enable;
|
||||
services.xserver.libinput.enable = mkDefault true;
|
||||
|
||||
# Extra UDEV rules used by Solid
|
||||
services.udev.packages = [
|
||||
# libmtp has "bin", "dev", "out" outputs. UDEV rules file is in "out".
|
||||
pkgs.libmtp.out
|
||||
pkgs.media-player-info
|
||||
];
|
||||
|
||||
services.xserver.displayManager.sddm = {
|
||||
theme = mkDefault "breeze";
|
||||
};
|
||||
|
||||
security.pam.services.kde = { allowNullPassword = true; };
|
||||
|
||||
systemd.user.services = {
|
||||
plasma-early-setup = mkIf cfg.runUsingSystemd {
|
||||
description = "Early Plasma setup";
|
||||
wantedBy = [ "graphical-session-pre.target" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = activationScript;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal.enable = true;
|
||||
xdg.portal.extraPortals = [ plasma5.xdg-desktop-portal-kde ];
|
||||
# xdg-desktop-portal-kde expects PipeWire to be running.
|
||||
# This does not, by default, replace PulseAudio.
|
||||
services.pipewire.enable = mkDefault true;
|
||||
|
||||
# Update the start menu for each user that is currently logged in
|
||||
system.userActivationScripts.plasmaSetup = activationScript;
|
||||
|
||||
nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
|
||||
})
|
||||
|
||||
(mkIf (cfg.kwinrc != {}) {
|
||||
environment.etc."xdg/kwinrc".text = lib.generators.toINI {} cfg.kwinrc;
|
||||
})
|
||||
|
||||
(mkIf (cfg.kdeglobals != {}) {
|
||||
environment.etc."xdg/kdeglobals".text = lib.generators.toINI {} cfg.kdeglobals;
|
||||
})
|
||||
|
||||
# Plasma Desktop
|
||||
(mkIf cfg.enable {
|
||||
|
||||
# Seed our configuration into nixos-generate-config
|
||||
system.nixos-generate-config.desktopConfiguration = [
|
||||
''
|
||||
# Enable the Plasma 5 Desktop Environment.
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
''
|
||||
];
|
||||
|
||||
services.xserver.displayManager.sessionPackages = [ pkgs.libsForQt5.plasma5.plasma-workspace ];
|
||||
# Default to be `plasma` (X11) instead of `plasmawayland`, since plasma wayland currently has
|
||||
# many tiny bugs.
|
||||
# See: https://github.com/NixOS/nixpkgs/issues/143272
|
||||
services.xserver.displayManager.defaultSession = mkDefault "plasma";
|
||||
|
||||
environment.systemPackages =
|
||||
with libsForQt5;
|
||||
with plasma5; with kdeGear; with kdeFrameworks;
|
||||
let
|
||||
requiredPackages = [
|
||||
ksystemstats
|
||||
kinfocenter
|
||||
kmenuedit
|
||||
plasma-systemmonitor
|
||||
spectacle
|
||||
systemsettings
|
||||
|
||||
dolphin
|
||||
dolphin-plugins
|
||||
ffmpegthumbs
|
||||
kdegraphics-thumbnailers
|
||||
pkgs.kio-admin
|
||||
kio-extras
|
||||
];
|
||||
optionalPackages = [
|
||||
elisa
|
||||
gwenview
|
||||
okular
|
||||
khelpcenter
|
||||
print-manager
|
||||
];
|
||||
in requiredPackages ++ utils.removePackagesByName optionalPackages cfg.excludePackages;
|
||||
|
||||
systemd.user.services = {
|
||||
plasma-run-with-systemd = {
|
||||
description = "Run KDE Plasma via systemd";
|
||||
wantedBy = [ "basic.target" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
${set_XDG_CONFIG_HOME}
|
||||
|
||||
${kdeFrameworks.kconfig}/bin/kwriteconfig5 \
|
||||
--file startkderc --group General --key systemdBoot ${lib.boolToString cfg.runUsingSystemd}
|
||||
'';
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
# Plasma Mobile
|
||||
(mkIf cfg.mobile.enable {
|
||||
assertions = [
|
||||
{
|
||||
# The user interface breaks without NetworkManager
|
||||
assertion = config.networking.networkmanager.enable;
|
||||
message = "Plasma Mobile requires NetworkManager.";
|
||||
}
|
||||
{
|
||||
# The user interface breaks without bluetooth
|
||||
assertion = config.hardware.bluetooth.enable;
|
||||
message = "Plasma Mobile requires Bluetooth.";
|
||||
}
|
||||
{
|
||||
# The user interface breaks without pulse
|
||||
assertion = config.hardware.pulseaudio.enable || (config.services.pipewire.enable && config.services.pipewire.pulse.enable);
|
||||
message = "Plasma Mobile requires pulseaudio.";
|
||||
}
|
||||
];
|
||||
|
||||
environment.systemPackages =
|
||||
with libsForQt5;
|
||||
with plasma5; with kdeApplications; with kdeFrameworks;
|
||||
[
|
||||
# Basic packages without which Plasma Mobile fails to work properly.
|
||||
plasma-mobile
|
||||
plasma-nano
|
||||
pkgs.maliit-framework
|
||||
pkgs.maliit-keyboard
|
||||
]
|
||||
++ lib.optionals (cfg.mobile.installRecommendedSoftware) (with libsForQt5.plasmaMobileGear;[
|
||||
# Additional software made for Plasma Mobile.
|
||||
alligator
|
||||
angelfish
|
||||
audiotube
|
||||
calindori
|
||||
kalk
|
||||
kasts
|
||||
kclock
|
||||
keysmith
|
||||
koko
|
||||
krecorder
|
||||
ktrip
|
||||
kweather
|
||||
plasma-dialer
|
||||
plasma-phonebook
|
||||
plasma-settings
|
||||
spacebar
|
||||
])
|
||||
;
|
||||
|
||||
# The following services are needed or the UI is broken.
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.pulseaudio.enable = true;
|
||||
networking.networkmanager.enable = true;
|
||||
# Required for autorotate
|
||||
hardware.sensor.iio.enable = lib.mkDefault true;
|
||||
|
||||
# Recommendations can be found here:
|
||||
# - https://invent.kde.org/plasma-mobile/plasma-phone-settings/-/tree/master/etc/xdg
|
||||
# This configuration is the minimum required for Plasma Mobile to *work*.
|
||||
services.xserver.desktopManager.plasma5 = {
|
||||
kdeglobals = {
|
||||
KDE = {
|
||||
# This forces a numeric PIN for the lockscreen, which is the
|
||||
# recommendation from upstream.
|
||||
LookAndFeelPackage = lib.mkDefault "org.kde.plasma.phone";
|
||||
};
|
||||
};
|
||||
kwinrc = {
|
||||
"Wayland" = {
|
||||
"InputMethod[$e]" = "/run/current-system/sw/share/applications/com.github.maliit.keyboard.desktop";
|
||||
"VirtualKeyboardEnabled" = "true";
|
||||
};
|
||||
"org.kde.kdecoration2" = {
|
||||
# No decorations (title bar)
|
||||
NoPlugin = lib.mkDefault "true";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.displayManager.sessionPackages = [ pkgs.libsForQt5.plasma5.plasma-mobile ];
|
||||
})
|
||||
|
||||
# Plasma Bigscreen
|
||||
(mkIf cfg.bigscreen.enable {
|
||||
environment.systemPackages =
|
||||
with pkgs.plasma5Packages;
|
||||
[
|
||||
plasma-nano
|
||||
plasma-settings
|
||||
plasma-bigscreen
|
||||
plasma-remotecontrollers
|
||||
|
||||
aura-browser
|
||||
plank-player
|
||||
|
||||
plasma-pa
|
||||
plasma-nm
|
||||
kdeconnect-kde
|
||||
];
|
||||
|
||||
services.xserver.displayManager.sessionPackages = [ pkgs.plasma5Packages.plasma-bigscreen ];
|
||||
|
||||
# required for plasma-remotecontrollers to work correctly
|
||||
hardware.uinput.enable = true;
|
||||
})
|
||||
];
|
||||
}
|
90
overlay.nix
90
overlay.nix
@ -37,7 +37,16 @@ in rec {
|
||||
|
||||
nerdfonts = nur.balsoft.pkgs.roboto-mono-nerd;
|
||||
|
||||
pass-secret-service = prev.pass-secret-service.overrideAttrs (_: {
|
||||
pass-secret-service = (prev.pass-secret-service.override {
|
||||
python3 = final.python3 // { pkgs = final.python3Packages; };
|
||||
}).overrideAttrs (_: {
|
||||
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "mdellweg";
|
||||
repo = "pass_secret_service";
|
||||
rev = "fadc09be718ae1e507eeb8719f3a2ea23edb6d7a";
|
||||
hash = "sha256-lrNU5bkG4/fMu5rDywfiI8vNHyBsMf/fiWIeEHug03c=";
|
||||
};
|
||||
installCheckPhase = null;
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/{dbus-1/services,xdg-desktop-portal/portals}
|
||||
@ -131,43 +140,17 @@ in rec {
|
||||
patches = [ ];
|
||||
});
|
||||
|
||||
qmlkonsole = final'.callPackage ({ lib, mkDerivation, cmake
|
||||
, extra-cmake-modules, kconfig, ki18n, kirigami-addons, kirigami2
|
||||
, kcoreaddons, qtquickcontrols2, kwindowsystem, qmltermwidget }:
|
||||
|
||||
mkDerivation {
|
||||
pname = "qmlkonsole";
|
||||
|
||||
inherit ((final.callPackage
|
||||
"${inputs.nixpkgs}/pkgs/applications/plasma-mobile/srcs.nix" {
|
||||
mirror = "mirror://kde";
|
||||
}).qmlkonsole)
|
||||
version src;
|
||||
|
||||
nativeBuildInputs = [ cmake extra-cmake-modules ];
|
||||
|
||||
buildInputs = [
|
||||
kconfig
|
||||
ki18n
|
||||
kirigami-addons
|
||||
kirigami2
|
||||
qtquickcontrols2
|
||||
kcoreaddons
|
||||
kwindowsystem
|
||||
qmltermwidget
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Terminal app for Plasma Mobile";
|
||||
homepage = "https://invent.kde.org/plasma-mobile/qmlkonsole";
|
||||
license = with licenses; [ gpl2Plus gpl3Plus cc0 ];
|
||||
maintainers = with maintainers; [ balsoft ];
|
||||
};
|
||||
}) { };
|
||||
|
||||
audiotube = prev'.audiotube.overrideAttrs (_: {
|
||||
audiotube = prev'.audiotube.overrideAttrs (oa: {
|
||||
patches = oa.patches or [ ] ++ [
|
||||
(final.fetchpatch {
|
||||
url =
|
||||
"https://invent.kde.org/multimedia/audiotube/-/commit/c42e2f3b42d62e889182fa2b7d831363f9d9d74d.diff";
|
||||
hash = "sha256-gO0yqeJp3iaug7sFwlXwNgR9qrnnldkLuEqxj2d7hTQ=";
|
||||
})
|
||||
];
|
||||
desktopItem = final.makeDesktopItem {
|
||||
name = "Audiotube";
|
||||
name = "audiotube";
|
||||
desktopName = "Audiotube (proxy)";
|
||||
exec = "https_proxy=socks5://localhost:5555 audiotube";
|
||||
icon = "org.kde.audiotube";
|
||||
type = "Application";
|
||||
@ -181,6 +164,39 @@ in rec {
|
||||
|
||||
python3Packages = prev.python3Packages.overrideScope (final': prev': {
|
||||
yt-dlp = prev'.yt-dlp.overrideAttrs (_: { src = inputs.yt-dlp; });
|
||||
|
||||
pypass = prev'.pypass.overrideAttrs (o:
|
||||
let
|
||||
version = "f86cf0ba0e5cb6a1236ff16d8f238b92bc49c517";
|
||||
sha256 = "sha256-PEPgWdsBjyHpgqPx2MNtYnn0wxI0KtlE+uCD7xO0pvE=";
|
||||
in {
|
||||
inherit version;
|
||||
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "nazarewk";
|
||||
# see https://github.com/aviau/python-pass/pull/34
|
||||
repo = "python-pass";
|
||||
rev = version;
|
||||
inherit sha256;
|
||||
};
|
||||
doInstallCheck = false;
|
||||
# Set absolute nix store paths to the executables that pypass uses
|
||||
patches = [
|
||||
(with final;
|
||||
substituteAll {
|
||||
src = final.fetchpatch {
|
||||
url =
|
||||
"https://raw.githubusercontent.com/nazarewk-iac/nix-configs/4eb0baf5e5b3692c07e626316257c115b7c79b3a/packages/overlays/pypass-mark-executables.patch";
|
||||
hash = "sha256-V8HIeaK+EYX8bgodFumki10xynNqS3u6RCkHnsyxTCg=";
|
||||
};
|
||||
git_exec = "${git}/bin/git";
|
||||
grep_exec = "${gnugrep}/bin/grep";
|
||||
gpg_exec = "${gnupg}/bin/gpg2";
|
||||
tree_exec = "${tree}/bin/tree";
|
||||
xclip_exec = "${xclip}/bin/xclip";
|
||||
})
|
||||
];
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
{
|
||||
{ lib, ... }: {
|
||||
home-manager.users.balsoft = {
|
||||
services.kdeconnect.enable = true;
|
||||
systemd.user.services.kdeconnect = {
|
||||
Service.Environment = lib.mkForce [
|
||||
"PATH=/etc/profiles/per-user/balsoft/bin"
|
||||
];
|
||||
};
|
||||
};
|
||||
persist.state.directories = [ "/home/balsoft/.config/kdeconnect" ];
|
||||
}
|
||||
|
@ -1,10 +1,19 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
environment.sessionVariables = {
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
kwallet = null;
|
||||
kwallet-pam = null;
|
||||
kwalletmanager = null;
|
||||
libsForQt5 = prev.libsForQt5 // {
|
||||
kwallet = null;
|
||||
kwallet-pam = null;
|
||||
kwalletmanager = null;
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
@ -34,11 +43,13 @@
|
||||
|
||||
services.upower.enable = true;
|
||||
|
||||
services.geoclue2.enable = true;
|
||||
|
||||
home-manager.users.balsoft = {
|
||||
home.activation.removeGtkRc = {
|
||||
data = "rm $HOME/.gtkrc-2.0";
|
||||
data = "rm -f $HOME/.gtkrc-2.0";
|
||||
before = [ "checkLinkTargets" ];
|
||||
after = [];
|
||||
after = [ ];
|
||||
};
|
||||
|
||||
xdg.configFile."autostart/org_kde_powerdevil.desktop".text = ''
|
||||
@ -56,10 +67,13 @@
|
||||
actionDrawerTopRightMode = "0";
|
||||
vibrationDuration = "100";
|
||||
vibrationIntensity = "0.5";
|
||||
vibrationsEnabled = "true";
|
||||
navigationPanelEnabled = "false";
|
||||
taskSwitcherPreviewsEnabled = "false";
|
||||
animationsEnabled = "false";
|
||||
};
|
||||
QuickSettings = {
|
||||
disabledQuickSettings = builtins.concatStringsSep ","
|
||||
[ "org.kde.plasma.quicksetting.record" ];
|
||||
disabledQuickSettings = builtins.concatStringsSep "," [ ];
|
||||
enabledQuickSettings = builtins.concatStringsSep "," [
|
||||
"org.kde.plasma.quicksetting.wifi"
|
||||
"org.kde.plasma.quicksetting.mobiledata"
|
||||
@ -77,8 +91,11 @@
|
||||
"org.kde.plasma.quicksetting.donotdisturb"
|
||||
"org.kde.plasma.quicksetting.caffeine"
|
||||
"org.kde.plasma.quicksetting.keyboardtoggle"
|
||||
"org.kde.plasma.quicksetting.record"
|
||||
];
|
||||
};
|
||||
};
|
||||
xdg.configFile."plasmaparc".text =
|
||||
lib.generators.toGitINI { General.VolumeStep = 2; };
|
||||
};
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ let
|
||||
widgetStyle = "Breeze";
|
||||
};
|
||||
General = {
|
||||
TerminalApplication = "alacritty";
|
||||
TerminalApplication = config.defaultApplications.term.cmd;
|
||||
fixed =
|
||||
"${fonts.mono.family},${toString fonts.mono.size},-1,5,50,0,0,0,0,0";
|
||||
font =
|
||||
|
Loading…
Reference in New Issue
Block a user