Compare commits

..

No commits in common. "cb8597a97ab8fff714b55fccc7cf161376ca22cf" and "7472b94108d61f6fb4c99a97e2885a4614762779" have entirely different histories.

3 changed files with 8 additions and 48 deletions

View file

@ -20,10 +20,8 @@
webis.enable = true; webis.enable = true;
impermanence.enable = true; impermanence.enable = true;
}; };
programs.hyprland = { programs.hyprland.enable = true;
enable = true; programs.gitbutler.enable = true;
monitors.DP-3.scale = "auto";
};
programs.exercism.enable = true; programs.exercism.enable = true;
}; };

View file

@ -3,18 +3,10 @@
, ... , ...
}: }:
with lib;
let let
inherit (lib) concatStringsSep flip boolToString mapAttrsToList;
cfg = config.my.programs.hyprland; cfg = config.my.programs.hyprland;
mkMonitor = { name, resolution, position, scale, disabled, extra }:
if disabled
then "monitor=${name},disabled"
else "monitor=${name},${resolution},${position},${scale},${extra}";
monitorsList = mapAttrsToList (name: value: { name = name; } // value) cfg.monitors;
monitors = map mkMonitor monitorsList;
mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}"; mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}";
mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules); mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules);
in in
@ -25,7 +17,7 @@ in
# #
# See https://wiki.hyprland.org/Configuring/Monitors/ # See https://wiki.hyprland.org/Configuring/Monitors/
${concatStringsSep "\n" monitors} ${concatLines (map (x: "monitor=${x}") cfg.monitors)}
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Keywords/ for more

View file

@ -5,8 +5,8 @@
, ... , ...
} @ args: } @ args:
with lib;
let let
inherit (lib) mkOption mkEnableOption mkIf types getExe genAttrs optionalAttrs optional;
cfg = config.my.programs.hyprland; cfg = config.my.programs.hyprland;
hyprland = inputs.hyprland.packages.${pkgs.system}.default; hyprland = inputs.hyprland.packages.${pkgs.system}.default;
@ -31,38 +31,9 @@ in
default = [ "de" "us" ]; default = [ "de" "us" ];
}; };
monitors = mkOption { monitors = mkOption {
type = types.attrsOf ( type = types.listOf types.str;
let description = "monitor settings";
sub = types.submodule { default = [ ",preferred,auto,1" ];
options = {
resolution = mkOption {
type = types.strMatching "\(preferred\)|\([[:digit:]]+x[[:digit:]]+\(@[[:digit:]]+\)\?\)";
default = "preferred";
};
position = mkOption {
type = types.strMatching "\(auto\)|\(-\?[[:digit:]]+x-?[[:digit:]]+\)";
default = "auto";
};
disabled = mkEnableOption "disabled";
scale = mkOption {
type = types.oneOf [ types.float (types.strMatching "auto") ];
default = 1.0;
apply = x: if lib.isFloat x then lib.strings.floatToString x else x;
};
extra = mkOption {
type = types.listOf types.str;
default = [ ];
apply = lib.concatStringsSep ",";
};
};
};
in
sub
);
description = "monitor setting";
default = {
"" = { };
};
}; };
extraConfig = mkOption { extraConfig = mkOption {
type = types.str; type = types.str;
@ -80,7 +51,6 @@ in
# foot.enable = true; # foot.enable = true;
kitty.enable = true; kitty.enable = true;
rofi.enable = true; rofi.enable = true;
hyprland.monitors."" = lib.mkDefault { };
}; };
wallpapers.enable = true; wallpapers.enable = true;
services = { services = {