lightdm-mini-greeter: init at 0.3.2

This commit is contained in:
Mitsuhiro Nakamura 2018-04-19 12:45:06 +09:00
parent 4b649a99d8
commit 83b389394b
4 changed files with 135 additions and 0 deletions

View File

@ -0,0 +1,100 @@
{ config, lib, pkgs, ... }:
with lib;
let
dmcfg = config.services.xserver.displayManager;
ldmcfg = dmcfg.lightdm;
cfg = ldmcfg.greeters.mini;
xgreeters = pkgs.linkFarm "lightdm-mini-greeter-xgreeters" [{
path = "${pkgs.lightdm-mini-greeter}/share/xgreeters/lightdm-mini-greeter.desktop";
name = "lightdm-mini-greeter.desktop";
}];
miniGreeterConf = pkgs.writeText "lightdm-mini-greeter.conf"
''
[greeter]
user = ${cfg.user}
show-password-label = true
password-label-text = Password:
show-input-cursor = true
[greeter-hotkeys]
mod-key = meta
shutdown-key = s
restart-key = r
hibernate-key = h
suspend-key = u
[greeter-theme]
font = Sans
font-size = 1em
text-color = "#080800"
error-color = "#F8F8F0"
background-image = "${ldmcfg.background}"
background-color = "#1B1D1E"
window-color = "#F92672"
border-color = "#080800"
border-width = 2px
layout-space = 15
password-color = "#F8F8F0"
password-background-color = "#1B1D1E"
${cfg.extraConfig}
'';
in
{
options = {
services.xserver.displayManager.lightdm.greeters.mini = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable lightdm-mini-greeter as the lightdm greeter.
Note that this greeter starts only the default X session.
You can configure the default X session by
<option>services.xserver.desktopManager.default</option> and
<option>services.xserver.windowManager.default</option>.
'';
};
user = mkOption {
type = types.str;
default = "root";
description = ''
The user to login as.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the lightdm-mini-greeter.conf
configuration file.
'';
};
};
};
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
services.xserver.displayManager.lightdm.greeter = mkDefault {
package = xgreeters;
name = "lightdm-mini-greeter";
};
environment.etc."lightdm/lightdm-mini-greeter.conf".source = miniGreeterConf;
};
}

View File

@ -72,6 +72,7 @@ in
# preferred.
imports = [
./lightdm-greeters/gtk.nix
./lightdm-greeters/mini.nix
];
options = {

View File

@ -0,0 +1,32 @@
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, lightdm, gtk3 }:
stdenv.mkDerivation rec {
name = "lightdm-mini-greeter-${version}";
version = "0.3.2";
src = fetchFromGitHub {
owner = "prikhi";
repo = "lightdm-mini-greeter";
rev = version;
sha256 = "1g3lrh034w38hiq96b0xmghmlf87hcycwdh06dwkdksr0hl08wxy";
};
nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [ lightdm gtk3 ];
configureFlags = [ "--sysconfdir=/etc" ];
makeFlags = [ "configdir=$(out)/etc" ];
postInstall = ''
substituteInPlace "$out/share/xgreeters/lightdm-mini-greeter.desktop" \
--replace "Exec=lightdm-mini-greeter" "Exec=$out/bin/lightdm-mini-greeter"
'';
meta = with stdenv.lib; {
description = "A minimal, configurable, single-user GTK3 LightDM greeter";
homepage = https://github.com/prikhi/lightdm-mini-greeter;
license = licenses.gpl3;
maintainers = with maintainers; [ mnacamura ];
platforms = platforms.linux;
};
}

View File

@ -18006,6 +18006,8 @@ with pkgs;
inherit (xfce) exo;
};
lightdm-mini-greeter = callPackage ../applications/display-managers/lightdm-mini-greeter { };
slic3r = callPackage ../applications/misc/slic3r { };
slic3r-prusa3d = callPackage ../applications/misc/slic3r/prusa3d.nix { };