Use defaultMonitor instead of monitor

This commit is contained in:
DashieTM 2024-09-08 15:20:26 +02:00
parent 3ac742cc45
commit 2c45bcf6ad
8 changed files with 128 additions and 93 deletions

View file

@ -60,7 +60,11 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang
conf = { conf = {
# change this to your monitor and your pc name # change this to your monitor and your pc name
# should be something like DP-1 # should be something like DP-1
monitor = "YOURMONITOR"; defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate
defaultMonitorMode = "1920x1080@60";
# scale for your main monitor
defaultMonitorScale = "1";
# your username # your username
username = "YOURNAME"; username = "YOURNAME";
# TODO only needed when you use intel -> amd is default # TODO only needed when you use intel -> amd is default
@ -72,41 +76,46 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang
mods = { mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different # default disk config has root home boot and swap partition, overwrite if you want something different
drives = { drives = {
defaultDrives.enable = false; # default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
extraDrives = [ # for an example without HOME see below
{ # defaultDrives.enable = false;
name = "boot"; # extraDrives = [
drive = { # {
device = "/dev/disk/by-label/BOOT"; # name = "boot";
fsType = "vfat"; # drive = {
options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ]; # device = "/dev/disk/by-label/BOOT";
}; # fsType = "vfat";
} # options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
{ # };
name = ""; # }
drive = { # {
device = "/dev/disk/by-label/ROOT"; # name = "";
fsType = "ext4"; # drive = {
options = [ "noatime" "nodiratime" "discard" ]; # device = "/dev/disk/by-label/ROOT";
}; # fsType = "ext4";
} # options = [ "noatime" "nodiratime" "discard" ];
]; # };
# }
# ];
}; };
sops.enable = false; sops.enable = false;
nextcloud.enable = false; nextcloud.enable = false;
hyprland.monitor = [ # default hyprland monitor config -> uncomment when necessary
# default # TODO: Add more monitors when needed
# TODO change this to your resolution # hyprland.monitor = [
"${config.conf.monitor},1920x1080@144,0x0,1" # # default
# all others # "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
",highrr,auto,1" # # all others
]; # ",highrr,auto,1"
# ];
# or amd, whatever you have # or amd, whatever you have
gpu.nvidia.enable = true; gpu.nvidia.enable = true;
kde_connect.enable = true; kde_connect.enable = true;
# TODO change this to your main resolution # login manager:
# -> this will be your login manager # default is greetd
greetd = { resolution = "3440x1440@180"; }; # greetd = { };
# sddm = { };
# gdm = { };
}; };
} }
``` ```

View file

@ -5,7 +5,11 @@
conf = { conf = {
# change this to your monitor and your pc name # change this to your monitor and your pc name
# should be something like DP-1 # should be something like DP-1
monitor = "YOURMONITOR"; defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate
defaultMonitorMode = "1920x1080@60";
# scale for your main monitor
defaultMonitorScale = "1";
# your username # your username
username = "YOURNAME"; username = "YOURNAME";
# TODO only needed when you use intel -> amd is default # TODO only needed when you use intel -> amd is default
@ -17,51 +21,54 @@
mods = { mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different # default disk config has root home boot and swap partition, overwrite if you want something different
drives = { drives = {
defaultDrives.enable = false; # default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
extraDrives = [ # for an example without HOME see below
{ #defaultDrives.enable = false;
name = "boot"; #extraDrives = [
drive = { # {
device = "/dev/disk/by-label/BOOT"; # name = "boot";
fsType = "vfat"; # drive = {
options = [ # device = "/dev/disk/by-label/BOOT";
"rw" # fsType = "vfat";
"fmask=0022" # options = [
"dmask=0022" # "rw"
"noatime" # "fmask=0022"
]; # "dmask=0022"
}; # "noatime"
} # ];
{ # };
name = ""; # }
drive = { # {
device = "/dev/disk/by-label/ROOT"; # name = "";
fsType = "ext4"; # drive = {
options = [ # device = "/dev/disk/by-label/ROOT";
"noatime" # fsType = "ext4";
"nodiratime" # options = [
"discard" # "noatime"
]; # "nodiratime"
}; # "discard"
} # ];
]; # };
# }
#];
}; };
sops.enable = false; sops.enable = false;
nextcloud.enable = false; nextcloud.enable = false;
hyprland.monitor = [ # default hyprland monitor config -> uncomment when necessary
# default # TODO: Add more monitors when needed
# TODO change this to your resolution # hyprland.monitor = [
"${config.conf.monitor},1920x1080@144,0x0,1" # # default
# all others # "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
",highrr,auto,1" # # all others
]; # ",highrr,auto,1"
# ];
# or amd, whatever you have # or amd, whatever you have
gpu.nvidia.enable = true; gpu.nvidia.enable = true;
kde_connect.enable = true; kde_connect.enable = true;
# TODO change this to your main resolution # login manager:
# -> this will be your login manager # default is greetd
greetd = { # greetd = { };
resolution = "3440x1440@180"; # sddm = { };
}; # gdm = { };
}; };
} }

View file

@ -39,7 +39,7 @@
''; '';
}; };
monitor = lib.mkOption { defaultMonitor = lib.mkOption {
default = ""; default = "";
example = "eDP-1"; example = "eDP-1";
type = lib.types.str; type = lib.types.str;
@ -48,12 +48,21 @@
''; '';
}; };
scale = lib.mkOption { defaultMonitorMode = lib.mkOption {
default = "1.0"; default = "";
example = "1.0"; example = "3440x1440@180";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
Scale for the monitor main monitor
'';
};
defaultMonitorScale = lib.mkOption {
default = "1";
example = "1.5";
type = lib.types.str;
description = ''
main monitor scaling
''; '';
}; };

View file

@ -1,9 +1,10 @@
{ config {
, lib config,
, inputs lib,
, pkgs inputs,
, options pkgs,
, ... options,
...
}: }:
{ {
options.mods = { options.mods = {
@ -17,7 +18,7 @@
''; '';
}; };
monitor = lib.mkOption { monitor = lib.mkOption {
default = "${config.conf.monitor}"; default = "${config.conf.defaultMonitor}";
example = "eDP-1"; example = "eDP-1";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -26,7 +27,7 @@
''; '';
}; };
scale = lib.mkOption { scale = lib.mkOption {
default = "${config.conf.scale}"; default = "${config.conf.defaultMonitorScale}";
example = "1.5"; example = "1.5";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -35,7 +36,7 @@
''; '';
}; };
resolution = lib.mkOption { resolution = lib.mkOption {
default = "auto"; default = "${config.conf.defaultMonitorMode}";
example = "3440x1440@180"; example = "3440x1440@180";
type = lib.types.str; type = lib.types.str;
description = '' description = ''

View file

@ -42,9 +42,13 @@
''; '';
}; };
custom_css = lib.mkOption { custom_css = lib.mkOption {
default = { }; default = '''';
example = { }; example = ''
type = with lib.types; attrsOf anything; #window {
border-radius: none;
}
'';
type = lib.types.lines;
description = '' description = ''
Custom anyrun css. Custom anyrun css.
Will be merged with default css if enabled. Will be merged with default css if enabled.
@ -133,7 +137,7 @@
border-radius: 10px; border-radius: 10px;
} }
'' ''
++ config.mods.hyprland.anyrun.custom_css + config.mods.hyprland.anyrun.custom_css
else else
config.mods.hyprland.anyrun.custom_css; config.mods.hyprland.anyrun.custom_css;
}; };

View file

@ -17,7 +17,12 @@
''; '';
}; };
monitor = lib.mkOption { monitor = lib.mkOption {
default = [ ]; default = [
# main monitor
"${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# all others
",highrr,auto,1"
];
example = [ "DP-1,3440x1440@180,2560x0,1,vrr,0" ]; example = [ "DP-1,3440x1440@180,2560x0,1,vrr,0" ];
type = with lib.types; listOf str; type = with lib.types; listOf str;
description = '' description = ''

View file

@ -33,7 +33,7 @@
input-field = [ input-field = [
{ {
monitor = "${config.conf.monitor}"; monitor = "${config.conf.defaultMonitor}";
placeholder_text = "password or something"; placeholder_text = "password or something";
} }
@ -41,7 +41,7 @@
label = [ label = [
{ {
monitor = "${config.conf.monitor}"; monitor = "${config.conf.defaultMonitor}";
text = "$TIME"; text = "$TIME";
font_size = 50; font_size = 50;
position = "0, 200"; position = "0, 200";

View file

@ -162,7 +162,7 @@ in
#"another_feature" #"another_feature"
]; ];
config = { config = {
monitors."${config.conf.monitor}" = { monitors."${config.conf.defaultMonitor}" = {
end = config.conf.ironbar.modules ++ [ end = config.conf.ironbar.modules ++ [
{ {
type = "sys_info"; type = "sys_info";