Skip to content

Commit

Permalink
feat: sddm
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed May 13, 2024
1 parent 29239ae commit 76cc743
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 5 deletions.
51 changes: 51 additions & 0 deletions modules/nixos/sddm.nix
Original file line number Diff line number Diff line change
@@ -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;
})
];
};
}
20 changes: 15 additions & 5 deletions test.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{ testers, fetchFromGitHub, home-manager }:
{ testers
, fetchFromGitHub
, home-manager
,
}:
let
common = {
catppuccin = {
Expand All @@ -13,7 +17,6 @@ let
hash = "sha256-qZjMlZFTzJotOYjURRQMsiOdR2XGGba8XzXwx4+v9tk=";
};
};

};
};

Expand All @@ -32,6 +35,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
Expand Down Expand Up @@ -101,9 +109,11 @@ testers.runNixOSTest {
yazi = enable;
zathura = enable;
zellij = enable;
zsh = enable // {
syntaxHighlighting = enable;
};
zsh =
enable
// {
syntaxHighlighting = enable;
};
};

gtk = lib.recursiveUpdate enable { catppuccin.cursor.enable = true; };
Expand Down

0 comments on commit 76cc743

Please sign in to comment.