diff --git a/hosts/common.nix b/hosts/common.nix index 6359e5d..7ba995e 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,10 +1,25 @@ { config, lib, pkgs, ... }: { - nix.extraOptions = "experimental-features = nix-command flakes"; + imports = [ + ../modules/hardware + ../modules/system + ../modules/graphical + ../modules/shell + ../modules/gaming + ../modules/applications + ../modules/editor + ../modules/mail/himalaya.nix + ]; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; + config = { - environment.systemPackages = with pkgs; [ git vim wget curl ]; + nix.extraOptions = "experimental-features = nix-command flakes"; + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + environment.systemPackages = with pkgs; [ git vim wget curl ]; + + }; } diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index eecca93..a6d5af7 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -12,24 +12,12 @@ nixpkgs.lib.nixosSystem { gui.enable = true; gui.compositor.enable = true; nixpkgs.overlays = [ nur.overlay ]; + gaming.leagueoflegends = true; + gaming.steam = true; } ./hardware-configuration.nix ../common.nix - ../../modules/hardware - ../../modules/system - ../../modules/graphical - ../../modules/shell - ../../modules/gaming - ../../modules/mail/himalaya.nix ../../modules/services/keybase.nix ../../modules/services/gnupg.nix - ../../modules/applications/firefox.nix - ../../modules/applications/alacritty.nix - ../../modules/applications/media.nix - ../../modules/applications/1password.nix - ../../modules/applications/discord.nix - ../../modules/applications/calibre.nix - ../../modules/editor/neovim - ../../modules/editor/notes.nix ]; } diff --git a/modules/applications/alacritty.nix b/modules/applications/alacritty.nix index 6803ad1..2b99484 100644 --- a/modules/applications/alacritty.nix +++ b/modules/applications/alacritty.nix @@ -1,86 +1,88 @@ -{ config, pkgs, ... }: { +{ config, pkgs, lib, ... }: { - home-manager.users.${config.user} = { - xsession.windowManager.i3.config.terminal = "alacritty"; - programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty"; - programs.alacritty = { - enable = true; - settings = { - window = { - dimensions = { - columns = 85; - lines = 30; + config = lib.mkIf config.gui.enable { + home-manager.users.${config.user} = { + xsession.windowManager.i3.config.terminal = "alacritty"; + programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty"; + programs.alacritty = { + enable = true; + settings = { + window = { + dimensions = { + columns = 85; + lines = 30; + }; + padding = { + x = 20; + y = 20; + }; + opacity = 1.0; }; - padding = { - x = 20; - y = 20; + scrolling.history = 10000; + font = { + size = 14.0; + normal = { + family = + builtins.head config.fonts.fontconfig.defaultFonts.monospace; + }; }; - opacity = 1.0; + key_bindings = [ + { + key = "L"; + mods = "Control|Shift"; + chars = "\\x1F"; + } + { + key = "K"; + mods = "Control"; + mode = "~Vi"; + action = "ToggleViMode"; + } + { + key = "Return"; + mode = "Vi"; + action = "ToggleViMode"; + } + # Used to enable $ keybind in Vi mode + { + key = 5; # Scancode for key4 + mods = "Shift"; + mode = "Vi|~Search"; + action = "Last"; + } + ]; + colors = { + primary = { + background = config.gui.colorscheme.base00; + foreground = config.gui.colorscheme.base05; + }; + cursor = { + text = "#1d2021"; + cursor = config.gui.colorscheme.base05; + }; + normal = { + black = "#1d2021"; + red = config.gui.colorscheme.base08; + green = config.gui.colorscheme.base0B; + yellow = config.gui.colorscheme.base0A; + blue = config.gui.colorscheme.base0D; + magenta = config.gui.colorscheme.base0E; + cyan = config.gui.colorscheme.base0C; + white = config.gui.colorscheme.base05; + }; + bright = { + black = config.gui.colorscheme.base03; + red = config.gui.colorscheme.base09; + green = config.gui.colorscheme.base01; + yellow = config.gui.colorscheme.base02; + blue = config.gui.colorscheme.base04; + magenta = config.gui.colorscheme.base06; + cyan = config.gui.colorscheme.base0F; + white = config.gui.colorscheme.base07; + }; + }; + draw_bold_text_with_bright_colors = false; }; - scrolling.history = 10000; - font = { - size = 14.0; - normal = { - family = - builtins.head config.fonts.fontconfig.defaultFonts.monospace; - }; - }; - key_bindings = [ - { - key = "L"; - mods = "Control|Shift"; - chars = "\\x1F"; - } - { - key = "K"; - mods = "Control"; - mode = "~Vi"; - action = "ToggleViMode"; - } - { - key = "Return"; - mode = "Vi"; - action = "ToggleViMode"; - } - # Used to enable $ keybind in Vi mode - { - key = 5; # Scancode for key4 - mods = "Shift"; - mode = "Vi|~Search"; - action = "Last"; - } - ]; - colors = { - primary = { - background = config.gui.colorscheme.base00; - foreground = config.gui.colorscheme.base05; - }; - cursor = { - text = "#1d2021"; - cursor = config.gui.colorscheme.base05; - }; - normal = { - black = "#1d2021"; - red = config.gui.colorscheme.base08; - green = config.gui.colorscheme.base0B; - yellow = config.gui.colorscheme.base0A; - blue = config.gui.colorscheme.base0D; - magenta = config.gui.colorscheme.base0E; - cyan = config.gui.colorscheme.base0C; - white = config.gui.colorscheme.base05; - }; - bright = { - black = config.gui.colorscheme.base03; - red = config.gui.colorscheme.base09; - green = config.gui.colorscheme.base01; - yellow = config.gui.colorscheme.base02; - blue = config.gui.colorscheme.base04; - magenta = config.gui.colorscheme.base06; - cyan = config.gui.colorscheme.base0F; - white = config.gui.colorscheme.base07; - }; - }; - draw_bold_text_with_bright_colors = false; }; }; }; diff --git a/modules/applications/default.nix b/modules/applications/default.nix new file mode 100644 index 0000000..23c110d --- /dev/null +++ b/modules/applications/default.nix @@ -0,0 +1,13 @@ +{ ... }: { + + imports = [ + ./1password.nix + ./alacritty.nix + ./calibre.nix + ./discord.nix + ./firefox.nix + ./media.nix + ./qbittorrent.nix + ]; + +} diff --git a/modules/editor/default.nix b/modules/editor/default.nix new file mode 100644 index 0000000..f8f6f75 --- /dev/null +++ b/modules/editor/default.nix @@ -0,0 +1,5 @@ +{ ... }: { + + imports = [ ./neovim ./notes.nix ]; + +} diff --git a/modules/gaming/leagueoflegends.nix b/modules/gaming/leagueoflegends.nix index ea951aa..e12bb69 100644 --- a/modules/gaming/leagueoflegends.nix +++ b/modules/gaming/leagueoflegends.nix @@ -1,15 +1,8 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: { -with lib; -let cfg = config.modules.gaming.leagueoflegends; + options.gaming.leagueoflegends = lib.mkEnableOption "League of Legends"; -in { - - options.modules.gaming.leagueoflegends = { - enable = mkEnableOption "League of Legends"; - }; - - config = mkIf cfg.enable { + config = lib.mkIf config.gaming.leagueoflegends { # League of Legends anti-cheat boot.kernel.sysctl = { "abi.vsyscall32" = 0; }; diff --git a/modules/gaming/lutris.nix b/modules/gaming/lutris.nix index 123b4c1..66de3c6 100644 --- a/modules/gaming/lutris.nix +++ b/modules/gaming/lutris.nix @@ -1,13 +1,8 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: { -with lib; -let cfg = config.modules.gaming.lutris; + options.gaming.lutris = lib.mkEnableOption "Lutris"; -in { - - options.modules.gaming.lutris = { enable = mkEnableOption "Lutris"; }; - - config = mkIf cfg.enable { + config = lib.mkIf (config.gaming.lutris || config.gaming.leagueoflegends) { environment.systemPackages = with pkgs; [ lutris amdvlk wine ]; }; diff --git a/modules/gaming/steam.nix b/modules/gaming/steam.nix index 6b49351..a52e611 100644 --- a/modules/gaming/steam.nix +++ b/modules/gaming/steam.nix @@ -1,13 +1,8 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: { -with lib; -let cfg = config.modules.gaming.steam; + options.gaming.steam = lib.mkEnableOption "Steam"; -in { - - options.modules.gaming.steam = { enable = mkEnableOption "Steam"; }; - - config = mkIf cfg.enable { + config = lib.mkIf config.gaming.steam { hardware.steam-hardware.enable = true; nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ steam ]; diff --git a/modules/services/gnupg.nix b/modules/services/gnupg.nix index 99939cb..d36f262 100644 --- a/modules/services/gnupg.nix +++ b/modules/services/gnupg.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: { +{ config, pkgs, lib, ... }: { home-manager.users.${config.user} = { programs.gpg.enable = true; @@ -10,7 +10,7 @@ maxCacheTtlSsh = 34560000; # Can never reset pinentryFlavor = "tty"; }; - home.packages = with pkgs; [ pinentry ]; + home = lib.mkIf config.gui.enable { packages = with pkgs; [ pinentry ]; }; }; }