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

@@ -1,4 +1,4 @@
{ pkgs, config, ... }:
{ config, ... }:
let
cfg = config.desktop;

View File

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

View File

@@ -1,15 +1,17 @@
{ config, pkgs, inputs, lib, ... }:
{ pkgs, ... }:
{
imports = [
../shared-configuration.nix
];
set-user.users = [
{
username = "guz";
shell = pkgs.zsh;
home = import ./home.nix;
}
];
options.default.configuration = { };
config = {
set-user.users = [
{
username = "guz";
shell = pkgs.zsh;
home = import ./home.nix;
}
];
};
}

View File

@@ -1,12 +1,15 @@
{ config, pkgs, inputs, ... }:
{ ... }:
{
imports = [
../shared-home.nix
];
librewolf.profiles.guz.isDefault = true;
options.default.home = { };
config = {
librewolf.profiles.guz.isDefault = true;
services.flatpak.packages = [
"com.valvesoftware.Steam"
];
services.flatpak.packages = [
"com.valvesoftware.Steam"
];
};
}

View File

@@ -7,98 +7,97 @@
# Include the results of the hardware scan.
./hardware-configuration.nix
];
options.shared.configuration = { };
config = {
sops.defaultSopsFile = ../../secrets/desktop-secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.defaultSopsFile = ../../secrets/desktop-secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.secrets.lon = {
owner = config.users.users.guz.name;
sops.secrets.lon = {
owner = config.users.users.guz.name;
};
sops.secrets.lat = {
owner = config.users.users.guz.name;
};
sops.age.keyFile = "/home/guz/.config/sops/age/keys.txt";
programs.hyprland = {
enable = true;
xwayland.enable = true;
package = inputs.hyprland.packages."${pkgs.system}".hyprland;
portalPackage = inputs.xdg-desktop-portal-hyprland.packages."${pkgs.system}".xdg-desktop-portal-hyprland;
};
xdg.portal.enable = true;
xdg.portal.extraPortals = with pkgs; [
xdg-desktop-portal-gnome
];
environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
NIXOS_OZONE_WL = "1";
};
environment.systemPackages = with pkgs; [
inputs.xdg-desktop-portal-hyprland.packages."${pkgs.system}".xdg-desktop-portal-hyprland
inputs.hyprland.packages."${pkgs.system}".hyprland
electron_28
wlroots
kitty
rofi-wayland
dunst
libnotify
swww
sops
wl-clipboard
];
hardware = {
opengl.enable = true;
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
programs.zsh.enable = true;
# Define a user account. Don't forget to set a password with passwd.
services.flatpak.enable = true;
environment.pathsToLink = [ " /share/zsh " ];
services.tailscale = {
enable = true;
useRoutingFeatures = "client";
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
};
sops.secrets.lat = {
owner = config.users.users.guz.name;
};
sops.age.keyFile = "/home/guz/.config/sops/age/keys.txt";
programs.hyprland = {
enable = true;
xwayland.enable = true;
package = inputs.hyprland.packages."${pkgs.system}".hyprland;
portalPackage = inputs.xdg-desktop-portal-hyprland.packages."${pkgs.system}".xdg-desktop-portal-hyprland;
};
xdg.portal.enable = true;
xdg.portal.extraPortals = with pkgs; [
xdg-desktop-portal-gnome
];
environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
NIXOS_OZONE_WL = "1";
};
environment.systemPackages = with pkgs; [
inputs.xdg-desktop-portal-hyprland.packages."${pkgs.system}".xdg-desktop-portal-hyprland
inputs.hyprland.packages."${pkgs.system}".hyprland
electron_28
wlroots
kitty
rofi-wayland
dunst
libnotify
swww
sops
wl-clipboard
];
hardware = {
opengl.enable = true;
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
programs.zsh.enable = true;
# Define a user account. Don't forget to set a password with passwd.
services.flatpak.enable = true;
environment.pathsToLink = [ " /share/zsh " ];
services.tailscale = {
enable = true;
useRoutingFeatures = "client";
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
}

View File

@@ -11,115 +11,113 @@
./keybinds.nix
./.desktop
];
options.shared.home = { };
config = {
programs.bash = {
enable = true;
initExtra = ''
export XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share"
programs.bash = {
enable = true;
initExtra = ''
export XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share"
export GPG_TTY=$(tty)
'';
};
export GPG_TTY=$(tty)
'';
};
services.gnome-keyring.enable = true;
services.gnome-keyring.enable = true;
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
pinentryFlavor = "gnome3";
};
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
pinentryFlavor = "gnome3";
};
librewolf = {
enable = true;
profiles = {
guz = {
id = 0;
settings = {
"webgl.disabled" = false;
"browser.startup.homepage" = "https://search.brave.com";
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.downloads" = false;
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
"privacy.clearOnShutdown.cookies" = false;
librewolf = {
enable = true;
profiles = {
guz = {
id = 0;
settings = {
"webgl.disabled" = false;
"browser.startup.homepage" = "https://search.brave.com";
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.downloads" = false;
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
"privacy.clearOnShutdown.cookies" = false;
};
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
darkreader
canvasblocker
smart-referer
libredirect
tridactyl
];
};
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
darkreader
canvasblocker
smart-referer
libredirect
tridactyl
];
};
};
};
services.flatpak.packages = [
"nz.mega.MEGAsync"
"md.obsidian.Obsidian"
"com.bitwarden.desktop"
"org.prismlauncher.PrismLauncher"
"org.mozilla.Thunderbird"
"net.blockbench.Blockbench"
];
# services.flatpak.overrides = { };
services.flatpak.packages = [
"nz.mega.MEGAsync"
"md.obsidian.Obsidian"
"com.bitwarden.desktop"
"org.prismlauncher.PrismLauncher"
"org.mozilla.Thunderbird"
"net.blockbench.Blockbench"
];
# services.flatpak.overrides = { };
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = _: true;
home.packages = with pkgs; [
## Programs
webcord-vencord
gimp
inkscape
pureref
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = _: true;
home.packages = with pkgs; [
## Programs
webcord-vencord
gimp
inkscape
pureref
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
## Fonts
fira-code
(nerdfonts.override { fonts = [ "FiraCode" ]; })
];
## Fonts
fira-code
(nerdfonts.override { fonts = [ "FiraCode" ]; })
];
fonts.fontconfig.enable = true;
fonts.fontconfig.enable = true;
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home
# Manager then you have to manually source 'hm-session-vars.sh' located at
# either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/guz/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home
# Manager then you have to manually source 'hm-session-vars.sh' located at
# either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/guz/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
EDITOR = "neovim";
};
};
}

View File

@@ -1,15 +1,17 @@
{ config, pkgs, inputs, lib, ... }:
{ pkgs, ... }:
{
imports = [
../shared-configuration.nix
];
set-user.users = [
{
username = "guz";
shell = pkgs.zsh;
home = import ./home.nix;
}
];
options.work.configuration = { };
config = {
set-user.users = [
{
username = "guz";
shell = pkgs.zsh;
home = import ./home.nix;
}
];
};
}

View File

@@ -1,31 +1,32 @@
{ config, pkgs, inputs, ... }:
{ inputs, ... }:
{
imports = [
../shared-home.nix
];
theme.accent = "94e2d5";
wm.wallpaper = ../../../static/guz-wallpaper-work.png;
librewolf.profiles.work = {
isDefault = true;
id = 1;
settings = {
"webgl.disabled" = false;
"browser.startup.homepage" = "https://github.com";
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.downloads" = false;
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
"privacy.clearOnShutdown.cookies" = false;
options.work.home = { };
config = {
theme.accent = "94e2d5";
wm.wallpaper = ../../../static/guz-wallpaper-work.png;
librewolf.profiles.work = {
isDefault = true;
id = 1;
settings = {
"webgl.disabled" = false;
"browser.startup.homepage" = "https://github.com";
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.downloads" = false;
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
"privacy.clearOnShutdown.cookies" = false;
};
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
darkreader
canvasblocker
smart-referer
github-file-icons
libredirect
tridactyl
];
};
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
darkreader
canvasblocker
smart-referer
github-file-icons
libredirect
tridactyl
];
};
}

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 =