refactor: consistency between files

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-02-10 18:27:02 -03:00
parent a0bf703eee
commit bb84b44861
20 changed files with 330 additions and 309 deletions

View File

@@ -11,8 +11,12 @@ let
'';
in
{
home.packages = [
nixi
];
imports = [ ];
options.nixi = { };
config = {
home.packages = [
nixi
];
};
}

View File

@@ -11,8 +11,12 @@ let
'';
in
{
home.packages = [
nixx
];
imports = [ ];
options.nixx = { };
config = {
home.packages = [
nixx
];
};
}

View File

@@ -1,21 +1,23 @@
{ config, lib, pkgs, inputs, ... }:
{ config, inputs, lib, pkgs, ... }:
let
cfg = config.hyprland;
in
{
imports = [ ];
options.hyprland = with lib; with lib.types; {
enable = mkEnableOption "";
monitors = mkOption {
default = [ ];
# TODO: Fix types
/* type = lib.types.listOf {
name = lib.types.str;
resolution = lib.types.str;
hz = lib.types.nullOr lib.types.int;
offset = lib.types.nullOr lib.types.str;
scale = lib.types.nullOr lib.types.int;
}; */
type = listOf (submodule ({ ... }: {
options = {
name = str;
resolution = str;
hz = nullOr int;
offset = nullOr str;
scale = nullOr int;
};
}));
};
exec = mkOption {
default = [ ];
@@ -28,7 +30,7 @@ in
windowRules = mkOption {
default = { };
description = "window = [ \"rule\" ]";
# type = attrsOf listOf str;
type = attrsOf (listOf str);
};
input = {
keyboard.layout = mkOption {
@@ -105,7 +107,7 @@ in
monitor = nullOr str;
default = nullOr bool;
extraRules = nullOr str;
}; */
}; */
};
binds = {
mod = mkOption {

View File

@@ -31,7 +31,7 @@
SOFTWARE.
*/
{ inputs, config, lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
with lib;
let
@@ -183,6 +183,7 @@ let
);
in
{
imports = [ ];
options.librewolf = with lib; with lib.types; {
enable = mkEnableOption "Enable module";
overrides = mkOption {

View File

@@ -1,13 +1,14 @@
{ inputs, config, lib, pkgs, ... }:
{ config, lib, ... }:
let
cfg = config.starship;
in
{
options.starship = {
enable = lib.mkEnableOption "Enable module";
enableZsh = lib.mkEnableOption "Enable Zsh Integration";
enableBash = lib.mkEnableOption "Enable Bash Integration";
imports = [ ];
options.starship = with lib; with lib.types; {
enable = mkEnableOption "Enable module";
enableZsh = mkEnableOption "Enable Zsh Integration";
enableBash = mkEnableOption "Enable Bash Integration";
};
config = lib.mkIf cfg.enable {
programs.starship.enable = true;

View File

@@ -1,21 +1,22 @@
{ inputs, config, pkgs, lib, ... }:
{ config, inputs, lib, pkgs, ... }:
let
cfg = config.tmux;
in
{
options.tmux = {
enable = lib.mkEnableOption "Enable Tmux module";
baseIndex = lib.mkOption {
type = lib.types.ints.unsigned;
imports = [ ];
options.tmux = with lib; with lib.types; {
enable = mkEnableOption "Enable Tmux module";
baseIndex = mkOption {
type = ints.unsigned;
default = 1;
};
prefix = lib.mkOption {
type = lib.types.str;
prefix = mkOption {
type = str;
default = "C-Space";
};
shell = lib.mkOption {
type = lib.types.str;
shell = mkOption {
type = str;
default = "\${pkgs.bash}/bin/bash";
};
};

View File

@@ -1,9 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{ config, lib, ... }:
let
cfg = config.wezterm;
in
{
imports = [ ];
options.wezterm = with lib; with lib.types; {
enable = mkEnableOption "Enable Wezterm";
integration = {

View File

@@ -1,9 +1,10 @@
{ inputs, config, pkgs, lib, ... }:
{ config, lib, ... }:
let
cfg = config.zsh;
in
{
imports = [ ];
options.zsh = with lib; with lib.types; {
enable = mkEnableOption "Enable Zsh shell";
plugins = {

View File

@@ -7,19 +7,19 @@ in
imports = [
inputs.nix-colors.homeManagerModules.default
];
options.theme = {
accent = lib.mkOption {
type = lib.types.str;
options.theme = with lib; with lib.types; {
accent = mkOption {
type = str;
default = "cdd6f4";
description = "The accent color of Frappuccino";
};
accentBase = lib.mkOption {
type = lib.types.str;
accentBase = mkOption {
type = str;
default = "magenta";
description = "The base name for the accent color to be used in the terminal";
};
scheme = lib.mkOption {
type = lib.types.path;
scheme = mkOption {
type = path;
default = ../../themes/frappuccino.yaml;
};
};

View File

@@ -10,22 +10,22 @@ in
inputs.sops-nix.nixosModules.sops
../systems/localization.nix
];
options.host = {
options.host = with lib; with lib.types; {
networking = {
hostName = lib.mkOption {
hostName = mkOption {
default = "nixos";
type = lib.types.str;
type = str;
description = "Define the host's network name";
};
wireless.enable = lib.mkOption {
wireless.enable = mkOption {
default = false;
type = lib.types.bool;
type = bool;
description = "Enables wireless support";
};
};
time = {
timeZone = lib.mkOption {
type = lib.types.str;
timeZone = mkOption {
type = str;
description = "Sets host's time zone";
};
};

View File

@@ -4,13 +4,13 @@ let
cfg = config.localization;
in
{
options.localization = {
locale = lib.mkOption {
options.localization = with lib; with lib.types; {
locale = mkOption {
default = "en_US.UTF-8";
type = lib.types.str;
type = str;
description = "Sets default locale of the host";
};
extraLocales = lib.mkOption {
extraLocales = mkOption {
default = rec {
LC_ADDRESS = "pt_BR.UTF-8";
LC_IDENTIFICATION = LC_ADDRESS;
@@ -24,24 +24,22 @@ in
};
description = "Extra localization settings";
};
keymap.layout = lib.mkOption {
keymap.layout = mkOption {
default = "br";
type = lib.types.str;
type = str;
};
keymap.variant = lib.mkOption {
keymap.variant = mkOption {
default = "";
type = lib.types.str;
type = str;
};
keymap.console = lib.mkOption {
keymap.console = mkOption {
default = "br-abnt2";
type = lib.types.str;
type = str;
};
time = {
zone = lib.mkOption {
zone = mkOption {
default = "America/Sao_Paulo";
type = lib.types.str;
type = str;
};
};
};

View File

@@ -4,20 +4,19 @@ let
cfg = config.set-user;
in
{
options.set-user = {
users = lib.mkOption {
options.set-user = with lib; with lib.types; {
users = mkOption {
default = [ ];
# TODO: Fix types
/* type = lib.types.listOf {
username = lib.types.str;
description = lib.types.str;
normalUser = lib.types.bool;
shell = lib.types.package;
packages = lib.types.pkgs;
extraGroups = lib.types.listOf lib.types.str;
home = lib.types.anything;
flatpak = lib.types.bool;
}; */
type = listOf (submodule ({ ... }: {
username = str;
description = str;
normalUser = bool;
shell = package;
packages = types.pkgs;
extraGroups = listOf str;
home = anything;
flatpak = bool;
}));
};
};
config =