fmt
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.nixos.programs.hyprland;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
nixos.programs.hyprland.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland";
|
||||
nixos.programs.hyprland.appearance.enable =
|
||||
mkEnableOption "Enables appearance settings in Hyprland";
|
||||
};
|
||||
config = mkIf cfg.appearance.enable {
|
||||
programs.hyprland.settings = {
|
||||
|
||||
@@ -4,10 +4,17 @@
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption mkOption mkDefault;
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkOption
|
||||
mkDefault
|
||||
;
|
||||
cfg = config.nixos.programs.hyprland;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.hyprland.nixosModules.default
|
||||
./appearance.nix
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption mkMerge;
|
||||
cfg = config.nixos.programs.hyprland;
|
||||
host = config.networking.hostName;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
nixos.programs.hyprland.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
|
||||
};
|
||||
|
||||
@@ -3,17 +3,22 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption mkMerge;
|
||||
cfg = config.nixos.programs.hyprland;
|
||||
host = config.networking.hostName;
|
||||
|
||||
toggle = program: let
|
||||
prog = builtins.substring 0 14 program;
|
||||
in "pkill ${prog} || uwsm app -- ${program}";
|
||||
toggle =
|
||||
program:
|
||||
let
|
||||
prog = builtins.substring 0 14 program;
|
||||
in
|
||||
"pkill ${prog} || uwsm app -- ${program}";
|
||||
|
||||
runOnce = program: "pgrep ${program} || uwsm app -- ${program}";
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
nixos.programs.hyprland.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland";
|
||||
};
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption mkMerge;
|
||||
host = config.networking.hostName;
|
||||
cfg = config.nixos.programs.hyprland.rules;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
nixos.programs.hyprland.rules.enable = mkEnableOption "Enables window rule settings in Hyprland";
|
||||
};
|
||||
@@ -14,37 +16,30 @@ in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
programs.hyprland.settings = {
|
||||
monitor =
|
||||
map (
|
||||
m: let
|
||||
resolution =
|
||||
if m.width != null && m.height != null
|
||||
then "${toString m.width}x${toString m.height}@${toString m.refreshRate}"
|
||||
else "preferred";
|
||||
monitor = map (
|
||||
m:
|
||||
let
|
||||
resolution =
|
||||
if m.width != null && m.height != null then
|
||||
"${toString m.width}x${toString m.height}@${toString m.refreshRate}"
|
||||
else
|
||||
"preferred";
|
||||
|
||||
position = m.position or "auto";
|
||||
scale = m.scale;
|
||||
position = m.position or "auto";
|
||||
scale = m.scale;
|
||||
|
||||
transformStr =
|
||||
if m.transform != 0
|
||||
then ",transform,${toString m.transform}"
|
||||
else "";
|
||||
transformStr = if m.transform != 0 then ",transform,${toString m.transform}" else "";
|
||||
|
||||
bitdepthStr =
|
||||
if m.bitDepth != null
|
||||
then ",bitdepth,${toString m.bitDepth}"
|
||||
else "";
|
||||
in "${m.name},${
|
||||
if m.enable
|
||||
then "${resolution},${position},${scale}${transformStr}${bitdepthStr}"
|
||||
else "disable"
|
||||
}"
|
||||
)
|
||||
config.settings.monitors;
|
||||
bitdepthStr = if m.bitDepth != null then ",bitdepth,${toString m.bitDepth}" else "";
|
||||
in
|
||||
"${m.name},${
|
||||
if m.enable then "${resolution},${position},${scale}${transformStr}${bitdepthStr}" else "disable"
|
||||
}"
|
||||
) config.settings.monitors;
|
||||
|
||||
workspace = map (
|
||||
m: "${m.workspace},monitor:${m.name}"
|
||||
) (lib.filter (m: m.enable && m.workspace != null) config.settings.monitors);
|
||||
workspace = map (m: "${m.workspace},monitor:${m.name}") (
|
||||
lib.filter (m: m.enable && m.workspace != null) config.settings.monitors
|
||||
);
|
||||
|
||||
windowrule = [
|
||||
"size 843 650, initialTitle:^(floatcal)$"
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption mkMerge;
|
||||
cfg = config.nixos.programs.hyprland;
|
||||
host = config.networking.hostName;
|
||||
@@ -12,7 +13,8 @@
|
||||
"uwsm app -- keepassxc"
|
||||
"uwsm app -- nm-applet --indicator"
|
||||
];
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
nixos.programs.hyprland.startup.enable = mkEnableOption "Enables startup settings in Hyprland";
|
||||
};
|
||||
@@ -28,30 +30,27 @@ in {
|
||||
}
|
||||
|
||||
(mkIf (host == "kima") {
|
||||
programs.hyprland.settings.exec-once =
|
||||
[
|
||||
"uwsm app -- mullvad-vpn"
|
||||
"uwsm app -- solaar -w hide -b regular"
|
||||
"uwsm app -- blueman-applet"
|
||||
]
|
||||
++ commonExecOnce;
|
||||
programs.hyprland.settings.exec-once = [
|
||||
"uwsm app -- mullvad-vpn"
|
||||
"uwsm app -- solaar -w hide -b regular"
|
||||
"uwsm app -- blueman-applet"
|
||||
]
|
||||
++ commonExecOnce;
|
||||
})
|
||||
|
||||
(mkIf (host == "bunk") {
|
||||
programs.hyprland.settings.exec-once =
|
||||
[
|
||||
"uwsm app -- blueman-applet"
|
||||
]
|
||||
++ commonExecOnce;
|
||||
programs.hyprland.settings.exec-once = [
|
||||
"uwsm app -- blueman-applet"
|
||||
]
|
||||
++ commonExecOnce;
|
||||
})
|
||||
|
||||
(mkIf (host == "toothpc") {
|
||||
programs.hyprland.settings.exec-once =
|
||||
[
|
||||
"uwsm app -- mullvad-vpn"
|
||||
"uwsm app -- solaar -w hide -b regular"
|
||||
]
|
||||
++ commonExecOnce;
|
||||
programs.hyprland.settings.exec-once = [
|
||||
"uwsm app -- mullvad-vpn"
|
||||
"uwsm app -- solaar -w hide -b regular"
|
||||
]
|
||||
++ commonExecOnce;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user