at 25.11-pre 1.0 kB view raw
1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: 7with lib; 8let 9 cfg = config.services.fractalart; 10in 11{ 12 options.services.fractalart = { 13 enable = mkOption { 14 type = types.bool; 15 default = false; 16 example = true; 17 description = "Enable FractalArt for generating colorful wallpapers on login"; 18 }; 19 20 width = mkOption { 21 type = types.nullOr types.int; 22 default = null; 23 example = 1920; 24 description = "Screen width"; 25 }; 26 27 height = mkOption { 28 type = types.nullOr types.int; 29 default = null; 30 example = 1080; 31 description = "Screen height"; 32 }; 33 }; 34 35 config = mkIf cfg.enable { 36 environment.systemPackages = [ pkgs.haskellPackages.FractalArt ]; 37 services.xserver.displayManager.sessionCommands = 38 "${pkgs.haskellPackages.FractalArt}/bin/FractalArt --no-bg -f .background-image" 39 + optionalString (cfg.width != null) " -w ${toString cfg.width}" 40 + optionalString (cfg.height != null) " -h ${toString cfg.height}"; 41 }; 42}