feat(nixos): add support for sddm (#168)

This commit is contained in:
Isabel 2024-05-14 01:56:27 +00:00 committed by GitHub
parent 0f2d8bba21
commit d8a6d8a146
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 56 additions and 1 deletions

51
modules/nixos/sddm.nix Normal file
View file

@ -0,0 +1,51 @@
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.services.displayManager.sddm.catppuccin;
enable = cfg.enable && config.services.displayManager.sddm.enable;
inherit (lib) mkIf ctp types mkOption;
in
{
options.services.displayManager.sddm.catppuccin =
ctp.mkCatppuccinOpt "sddm"
// {
font = mkOption {
type = types.str;
default = "Noto Sans";
description = "Font to use for the login screen";
};
fontSize = mkOption {
type = types.str;
default = "9";
description = "Font size to use for the login screen";
};
background = mkOption {
type = with types; (either path str);
default = "";
description = "Background image to use for the login screen";
};
loginBackground = mkOption {
type = types.bool;
default = true;
description = "Add an additonal background layer to the login panel";
};
};
config = mkIf enable {
services.displayManager.sddm.theme = "catppuccin-${cfg.flavour}";
environment.systemPackages = [
(pkgs.catppuccin-sddm.override {
flavor = cfg.flavour;
inherit (cfg) font fontSize background loginBackground;
})
];
};
}

View file

@ -13,7 +13,6 @@ let
hash = "sha256-qZjMlZFTzJotOYjURRQMsiOdR2XGGba8XzXwx4+v9tk=";
};
};
};
};
@ -32,6 +31,11 @@ testers.runNixOSTest {
boot.loader.grub = enable;
services = {
displayManager.sddm = enable;
xserver.enable = true; # required for sddm
};
console = enable;
programs.dconf = enable; # required for gtk