treewide: format with nixfmt
This commit is contained in:
parent
303e982a8e
commit
26ad72592a
47 changed files with 380 additions and 725 deletions
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
mkFontOption = kind: {
|
||||
family = lib.mkOption {
|
||||
|
@ -19,8 +15,7 @@ let
|
|||
};
|
||||
};
|
||||
cfg = config.fontProfiles;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options.fontProfiles = {
|
||||
enable = lib.mkEnableOption "Whether to enable font profiles";
|
||||
monospace = mkFontOption "monospace";
|
||||
|
@ -30,10 +25,7 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = [
|
||||
cfg.monospace.package
|
||||
cfg.regular.package
|
||||
cfg.bitmap.package
|
||||
];
|
||||
home.packages =
|
||||
[ cfg.monospace.package cfg.regular.package cfg.bitmap.package ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,65 +1,54 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
in
|
||||
{
|
||||
{ lib, config, ... }:
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
options.monitors = mkOption {
|
||||
type = types.listOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
example = "DP-1";
|
||||
};
|
||||
primary = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
width = mkOption {
|
||||
type = types.int;
|
||||
example = 1920;
|
||||
};
|
||||
height = mkOption {
|
||||
type = types.int;
|
||||
example = 1080;
|
||||
};
|
||||
refreshRate = mkOption {
|
||||
type = types.int;
|
||||
default = 60;
|
||||
};
|
||||
position = mkOption {
|
||||
type = types.str;
|
||||
default = "auto";
|
||||
};
|
||||
enabled = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
workspace = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
scale = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "1";
|
||||
};
|
||||
type = types.listOf (types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
example = "DP-1";
|
||||
};
|
||||
}
|
||||
);
|
||||
primary = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
width = mkOption {
|
||||
type = types.int;
|
||||
example = 1920;
|
||||
};
|
||||
height = mkOption {
|
||||
type = types.int;
|
||||
example = 1080;
|
||||
};
|
||||
refreshRate = mkOption {
|
||||
type = types.int;
|
||||
default = 60;
|
||||
};
|
||||
position = mkOption {
|
||||
type = types.str;
|
||||
default = "auto";
|
||||
};
|
||||
enabled = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
workspace = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
scale = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "1";
|
||||
};
|
||||
};
|
||||
});
|
||||
default = [ ];
|
||||
};
|
||||
config = {
|
||||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
((lib.length config.monitors) != 0)
|
||||
-> ((lib.length (lib.filter (m: m.primary) config.monitors)) == 1);
|
||||
message = "Exactly one monitor must be set to primary.";
|
||||
}
|
||||
];
|
||||
assertions = [{
|
||||
assertion = ((lib.length config.monitors) != 0)
|
||||
-> ((lib.length (lib.filter (m: m.primary) config.monitors)) == 1);
|
||||
message = "Exactly one monitor must be set to primary.";
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue