2024-04-21 15:54:59 +00:00
{ config , pkgs , lib , . . . }:
let
cfg = config . services . desktopManager . lomiri ;
in {
options . services . desktopManager . lomiri = {
enable = lib . mkEnableOption ''
the Lomiri graphical shell ( formerly known as Unity8 )
'' ;
} ;
config = lib . mkIf cfg . enable {
environment = {
systemPackages = ( with pkgs ; [
glib # XDG MIME-related tools identify it as GNOME, add gio for MIME identification to work
libayatana-common
ubports-click
] ) ++ ( with pkgs . lomiri ; [
hfd-service
history-service
libusermetrics
lomiri
2024-07-27 06:49:29 +00:00
lomiri-calculator-app
2024-09-19 14:19:46 +00:00
lomiri-camera-app
2024-07-27 06:49:29 +00:00
lomiri-clock-app
2024-10-11 05:15:48 +00:00
lomiri-content-hub
2024-09-19 14:19:46 +00:00
lomiri-docviewer-app
2024-04-21 15:54:59 +00:00
lomiri-download-manager
2024-06-20 14:57:18 +00:00
lomiri-filemanager-app
2024-09-19 14:19:46 +00:00
lomiri-gallery-app
2024-07-27 06:49:29 +00:00
lomiri-polkit-agent
2024-04-21 15:54:59 +00:00
lomiri-schemas # exposes some required dbus interfaces
lomiri-session # wrappers to properly launch the session
lomiri-sounds
lomiri-system-settings
lomiri-terminal-app
lomiri-thumbnailer
lomiri-url-dispatcher
lomiri-wallpapers
mediascanner2 # TODO possibly needs to be kicked off by graphical-session.target
morph-browser
qtmir # not having its desktop file for Xwayland available causes any X11 application to crash the session
suru-icon-theme
2024-07-27 06:49:29 +00:00
telephony-service
teleports
2024-04-21 15:54:59 +00:00
] ) ;
2024-10-09 16:51:18 +00:00
# To override the default keyboard layout in Lomiri
etc . ${ pkgs . lomiri . lomiri . passthru . etcLayoutsFile } . text = lib . strings . replaceStrings [ " , " ] [ " \n " ] config . services . xserver . xkb . layout ;
2024-04-21 15:54:59 +00:00
} ;
2024-09-19 14:19:46 +00:00
hardware = {
bluetooth . enable = lib . mkDefault true ;
} ;
2024-04-21 15:54:59 +00:00
networking . networkmanager . enable = lib . mkDefault true ;
systemd . packages = with pkgs . lomiri ; [
hfd-service
lomiri-download-manager
] ;
services . dbus . packages = with pkgs . lomiri ; [
hfd-service
libusermetrics
lomiri-download-manager
] ;
fonts . packages = with pkgs ; [
# Applications tend to default to Ubuntu font
2024-07-27 06:49:29 +00:00
ubuntu-classic
2024-04-21 15:54:59 +00:00
] ;
# Copy-pasted basic stuff
2024-06-20 14:57:18 +00:00
hardware . graphics . enable = lib . mkDefault true ;
2024-04-21 15:54:59 +00:00
fonts . enableDefaultPackages = lib . mkDefault true ;
programs . dconf . enable = lib . mkDefault true ;
# Xwayland is partly hardcoded in Mir so it can't really be fully turned off, and it must be on PATH for X11 apps *and Lomiri's web browser* to work.
# Until Mir/Lomiri can be properly used without it, force it on so everything behaves as expected.
programs . xwayland . enable = lib . mkForce true ;
services . accounts-daemon . enable = true ;
services . ayatana-indicators = {
enable = true ;
packages = ( with pkgs ; [
ayatana-indicator-datetime
2024-06-05 15:53:02 +00:00
ayatana-indicator-display
2024-04-21 15:54:59 +00:00
ayatana-indicator-messages
2024-06-05 15:53:02 +00:00
ayatana-indicator-power
2024-04-21 15:54:59 +00:00
ayatana-indicator-session
2024-09-19 14:19:46 +00:00
] ++ lib . optionals config . hardware . bluetooth . enable [
ayatana-indicator-bluetooth
2024-06-05 15:53:02 +00:00
] ++ lib . optionals ( config . hardware . pulseaudio . enable || config . services . pipewire . pulse . enable ) [
ayatana-indicator-sound
2024-04-21 15:54:59 +00:00
] ) ++ ( with pkgs . lomiri ; [
2024-07-27 06:49:29 +00:00
telephony-service
2024-04-21 15:54:59 +00:00
] ++ lib . optionals config . networking . networkmanager . enable [
lomiri-indicator-network
] ) ;
} ;
services . udisks2 . enable = true ;
services . upower . enable = true ;
services . geoclue2 . enable = true ;
services . gnome . evolution-data-server = {
enable = true ;
plugins = with pkgs ; [
# TODO: lomiri.address-book-service
] ;
} ;
services . telepathy . enable = true ;
services . displayManager = {
defaultSession = lib . mkDefault " l o m i r i " ;
sessionPackages = with pkgs . lomiri ; [ lomiri-session ] ;
} ;
services . xserver = {
enable = lib . mkDefault true ;
displayManager . lightdm = {
enable = lib . mkDefault true ;
greeters . lomiri . enable = lib . mkDefault true ;
} ;
} ;
environment . pathsToLink = [
# Configs for inter-app data exchange system
2024-10-11 05:15:48 +00:00
" / s h a r e / l o m i r i - c o n t e n t - h u b / p e e r s "
2024-04-21 15:54:59 +00:00
# Configs for inter-app URL requests
" / s h a r e / l o m i r i - u r l - d i s p a t c h e r / u r l s "
# Splash screens & other images for desktop apps launched via lomiri-app-launch
" / s h a r e / l o m i r i - a p p - l a u n c h "
# TODO Try to get maliit stuff working
" / s h a r e / m a l i i t / p l u g i n s "
# At least the network indicator is still under the unity name, due to leftover Unity-isms
" / s h a r e / u n i t y "
# Data
" / s h a r e / l o c a l e " # TODO LUITK hardcoded default locale path, fix individual apps to not rely on it
" / s h a r e / s o u n d s "
" / s h a r e / w a l l p a p e r s "
] ;
systemd . user . services = {
# Unconditionally run service that collects system-installed URL handlers before LUD
# TODO also run user-installed one?
" l o m i r i - u r l - d i s p a t c h e r - u p d a t e - s y s t e m - d i r " = {
description = " L o m i r i U R L d i s p a t c h e r s y s t e m d i r e c t o r y u p d a t e r " ;
wantedBy = [ " l o m i r i - u r l - d i s p a t c h e r . s e r v i c e " ] ;
before = [ " l o m i r i - u r l - d i s p a t c h e r . s e r v i c e " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
ExecStart = " ${ pkgs . lomiri . lomiri-url-dispatcher } / l i b e x e c / l o m i r i - u r l - d i s p a t c h e r / l o m i r i - u p d a t e - d i r e c t o r y / r u n / c u r r e n t - s y s t e m / s w / s h a r e / l o m i r i - u r l - d i s p a t c h e r / u r l s / " ;
} ;
} ;
2024-07-27 06:49:29 +00:00
" l o m i r i - p o l k i t - a g e n t " = rec {
description = " L o m i r i P o l k i t a g e n t " ;
wantedBy = [ " l o m i r i . s e r v i c e " " l o m i r i - f u l l - g r e e t e r . s e r v i c e " " l o m i r i - f u l l - s h e l l . s e r v i c e " " l o m i r i - g r e e t e r . s e r v i c e " " l o m i r i - s h e l l . s e r v i c e " ] ;
after = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
partOf = wantedBy ;
serviceConfig = {
Type = " s i m p l e " ;
Restart = " a l w a y s " ;
ExecStart = " ${ pkgs . lomiri . lomiri-polkit-agent } / l i b e x e c / l o m i r i - p o l k i t - a g e n t / p o l i c y k i t - a g e n t " ;
} ;
} ;
2024-04-21 15:54:59 +00:00
} ;
systemd . services = {
" d b u s - c o m . l o m i r i . U s e r M e t r i c s " = {
serviceConfig = {
Type = " d b u s " ;
BusName = " c o m . l o m i r i . U s e r M e t r i c s " ;
User = " u s e r m e t r i c s " ;
StandardOutput = " s y s l o g " ;
SyslogIdentifier = " c o m . l o m i r i . U s e r M e t r i c s " ;
ExecStart = " ${ pkgs . lomiri . libusermetrics } / l i b e x e c / l i b u s e r m e t r i c s / u s e r m e t r i c s s e r v i c e " ;
} // lib . optionalAttrs ( ! config . security . apparmor . enable ) {
# Due to https://gitlab.com/ubports/development/core/libusermetrics/-/issues/8, auth must be disabled when not using AppArmor, lest the next database usage breaks
Environment = " U S E R M E T R I C S _ N O _ A U T H = 1 " ;
} ;
} ;
} ;
users . users . usermetrics = {
group = " u s e r m e t r i c s " ;
home = " / v a r / l i b / u s e r m e t r i c s " ;
createHome = true ;
isSystemUser = true ;
} ;
users . groups . usermetrics = { } ;
} ;
meta . maintainers = lib . teams . lomiri . members ;
}