Add real home-manager and nixos modules
This commit is contained in:
parent
2e20534bba
commit
63c3d1af27
8
modules/home-manager/default.nix
Normal file
8
modules/home-manager/default.nix
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
fonts = import ./fonts.nix;
|
||||||
|
monitors = import ./monitors.nix;
|
||||||
|
# pass-secret-service = import ./pass-secret-service.nix;
|
||||||
|
# wallpaper = import ./wallpaper.nix;
|
||||||
|
# xpo = import ./xpo.nix;
|
||||||
|
# colors = import ./colors.nix;
|
||||||
|
}
|
43
modules/home-manager/fonts.nix
Normal file
43
modules/home-manager/fonts.nix
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
mkFontOption = kind: {
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = null;
|
||||||
|
description = "Family name for ${kind} font profile";
|
||||||
|
example = "Fira Code";
|
||||||
|
};
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = null;
|
||||||
|
description = "Package for ${kind} font profile";
|
||||||
|
example = "pkgs.fira-code";
|
||||||
|
};
|
||||||
|
size = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 12;
|
||||||
|
description = "Size in pixels for ${kind} font profile";
|
||||||
|
example = "14";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
cfg = config.fontProfiles;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.fontProfiles = {
|
||||||
|
enable = lib.mkEnableOption "Whether to enable font profiles";
|
||||||
|
monospace = mkFontOption "monospace";
|
||||||
|
regular = mkFontOption "regular";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
home.packages = [
|
||||||
|
cfg.monospace.package
|
||||||
|
cfg.regular.package
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
61
modules/home-manager/monitors.nix
Normal file
61
modules/home-manager/monitors.nix
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
3
modules/nixos/default.nix
Normal file
3
modules/nixos/default.nix
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
# hydra-auto-upgrade = import ./hydra-auto-upgrade.nix;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user