Merge pull request #4640 from lethalman/installer-icons
kde installer: Add gparted, nixos manual and konsole in the desktop
This commit is contained in:
commit
dabdab8dce
@ -11,6 +11,9 @@ with lib;
|
||||
# Provide wicd for easy wireless configuration.
|
||||
#networking.wicd.enable = true;
|
||||
|
||||
# Include gparted for partitioning disks
|
||||
environment.systemPackages = [ pkgs.gparted ];
|
||||
|
||||
# KDE complains if power management is disabled (to be precise, if
|
||||
# there is no power management backend such as upower).
|
||||
powerManagement.enable = true;
|
||||
@ -27,4 +30,70 @@ with lib;
|
||||
AutoLoginUser=root
|
||||
AutoLoginPass=""
|
||||
'';
|
||||
|
||||
# Custom kde-workspace adding some icons on the desktop
|
||||
|
||||
system.activationScripts.installerDesktop = let
|
||||
openManual = pkgs.writeScript "nixos-manual.sh" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
cd ${config.system.build.manual.manual}/share/doc/nixos/
|
||||
konqueror ./index.html
|
||||
'';
|
||||
|
||||
desktopFile = pkgs.writeText "nixos-manual.desktop" ''
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=NixOS Manual
|
||||
Exec=${openManual}
|
||||
Icon=konqueror
|
||||
'';
|
||||
|
||||
in ''
|
||||
mkdir -p /root/Desktop
|
||||
ln -sfT ${desktopFile} /root/Desktop/nixos-manual.desktop
|
||||
ln -sfT ${pkgs.kde4.konsole}/share/applications/kde4/konsole.desktop /root/Desktop/konsole.desktop
|
||||
ln -sfT ${pkgs.gparted}/share/applications/gparted.desktop /root/Desktop/gparted.desktop
|
||||
'';
|
||||
|
||||
services.xserver.desktopManager.kde4.kdeWorkspacePackage = let
|
||||
pkg = pkgs.kde4.kde_workspace;
|
||||
|
||||
plasmaInit = pkgs.writeText "00-defaultLayout.js" ''
|
||||
loadTemplate("org.kde.plasma-desktop.defaultPanel")
|
||||
|
||||
for (var i = 0; i < screenCount; ++i) {
|
||||
var desktop = new Activity
|
||||
desktop.name = i18n("Desktop")
|
||||
desktop.screen = i
|
||||
desktop.wallpaperPlugin = 'image'
|
||||
desktop.wallpaperMode = 'SingleImage'
|
||||
|
||||
var folderview = desktop.addWidget("folderview");
|
||||
folderview.writeConfig("url", "desktop:/");
|
||||
|
||||
//Create more panels for other screens
|
||||
if (i > 0){
|
||||
var panel = new Panel
|
||||
panel.screen = i
|
||||
panel.location = 'bottom'
|
||||
panel.height = screenGeometry(i).height > 1024 ? 35 : 27
|
||||
var tasks = panel.addWidget("tasks")
|
||||
tasks.writeConfig("showOnlyCurrentScreen", true);
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit (pkg) name meta;
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cp -prf ${pkg}/* $out/
|
||||
chmod a+w $out/share/apps/plasma-desktop/init
|
||||
cp -f ${plasmaInit} $out/share/apps/plasma-desktop/init/00-defaultLayout.js
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ let
|
||||
xcfg = config.services.xserver;
|
||||
cfg = xcfg.desktopManager.kde4;
|
||||
xorg = pkgs.xorg;
|
||||
kde_workspace = config.services.xserver.desktopManager.kde4.kdeWorkspacePackage;
|
||||
|
||||
# Disable Nepomuk and Strigi by default. As of KDE 4.7, they don't
|
||||
# really work very well (e.g. searching files often fails to find
|
||||
@ -61,6 +62,13 @@ in
|
||||
example = ["gstreamer" "vlc"];
|
||||
description = "Which phonon multimedia backend kde should use";
|
||||
};
|
||||
|
||||
kdeWorkspacePackage = mkOption {
|
||||
internal = true;
|
||||
default = pkgs.kde4.kde_workspace;
|
||||
type = types.package;
|
||||
description = "Custom kde-workspace, used for NixOS rebranding.";
|
||||
};
|
||||
};
|
||||
|
||||
environment.kdePackages = mkOption {
|
||||
@ -108,13 +116,13 @@ in
|
||||
fi
|
||||
|
||||
# Start KDE.
|
||||
exec ${pkgs.kde4.kdebase_workspace}/bin/startkde
|
||||
exec ${kde_workspace}/bin/startkde
|
||||
'';
|
||||
};
|
||||
|
||||
security.setuidOwners = singleton
|
||||
{ program = "kcheckpass";
|
||||
source = "${pkgs.kde4.kdebase_workspace}/lib/kde4/libexec/kcheckpass";
|
||||
source = "${kde_workspace}/lib/kde4/libexec/kcheckpass";
|
||||
owner = "root";
|
||||
group = "root";
|
||||
setuid = true;
|
||||
@ -124,7 +132,7 @@ in
|
||||
[ pkgs.kde4.kdelibs
|
||||
|
||||
pkgs.kde4.kde_baseapps # Splitted kdebase
|
||||
pkgs.kde4.kde_workspace
|
||||
kde_workspace
|
||||
pkgs.kde4.kde_runtime
|
||||
pkgs.kde4.konsole
|
||||
pkgs.kde4.kate
|
||||
|
Loading…
Reference in New Issue
Block a user