Avoid importing the same file multiple times

This commit is contained in:
Leonardo Eugênio 2023-01-23 00:35:40 -03:00
parent 59c60cf9b2
commit 794613626e
18 changed files with 21 additions and 20 deletions

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
config = { config = {
programs.alacritty = { programs.alacritty = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
# My bemenu wrapper # My bemenu wrapper
xdg.configFile = { xdg.configFile = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) desktop browser; let inherit (pkgs.uservars) desktop browser;
in { in {
config = { config = {
programs.firefox = { programs.firefox = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
config = { config = {
programs.fish = { programs.fish = {

View file

@ -1,6 +1,6 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }:
let let
inherit (import ./variables.nix) key theme color accent font; inherit (pkgs.uservars) key theme color accent font;
colors = { colors = {
"bg+" = color.bg_light; "bg+" = color.bg_light;

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let inherit (import ./variables.nix) username mail; let inherit (pkgs.uservars) username mail;
in { in {
config = { config = {
programs.git = { programs.git = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
config = { config = {
programs.helix = { programs.helix = {

View file

@ -1,6 +1,4 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }: {
let inherit (import ./variables.nix) desktop;
in {
imports = [ imports = [
./controller.nix ./controller.nix
./waybar.nix ./waybar.nix
@ -30,9 +28,10 @@ in {
./zathura.nix ./zathura.nix
./man.nix ./man.nix
./mpd.nix ./mpd.nix
./sway.nix
inputs.hyprland.homeManagerModules.default inputs.hyprland.homeManagerModules.default
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
] ++ lib.optional (desktop == "sway") ./sway.nix; ];
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font dmenu; let inherit (pkgs.uservars) key theme color accent font dmenu;
in { in {
config = { config = {
programs.kakoune = { programs.kakoune = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }:
let inherit (import ./variables.nix) key theme color accent font desktop; let inherit (pkgs.uservars) key theme color accent font desktop;
in { in {
config = { config = {
programs.man = { programs.man = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
config = { config = {
programs.mangohud = { programs.mangohud = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) browser; let inherit (pkgs.uservars) browser;
in { in {
config = { config = {
xdg.desktopEntries = { xdg.desktopEntries = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
config = { config = {
programs.rofi = { programs.rofi = {

View file

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
inherit (import ./variables.nix) key theme color accent font; inherit (pkgs.uservars) key theme color accent font;
color_picker = pkgs.writeShellScript "color_picker" '' color_picker = pkgs.writeShellScript "color_picker" ''
grim -g "$(slurp -b aabbcc00 -p)" - | grim -g "$(slurp -b aabbcc00 -p)" - |
convert - txt:- | convert - txt:- |

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
services.syncthing = { services.syncthing = {
enable = true; enable = true;

View file

@ -79,6 +79,8 @@ let
}; };
in in
rec { rec {
inherit themes;
key = keys.colemak; key = keys.colemak;
theme = themes.dark; theme = themes.dark;

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (pkgs.uservars) key theme color accent font;
in { in {
config = { config = {
programs.waybar = { programs.waybar = {

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key color accent font; let inherit (pkgs.uservars) key color accent font;
in { in {
config = { config = {
programs.zathura.enable = true; programs.zathura.enable = true;