move more modules to common section

This commit is contained in:
Noah Masur 2022-05-22 19:43:46 -04:00
parent df96ff6cea
commit 5b9058935d
9 changed files with 131 additions and 125 deletions

View File

@ -1,10 +1,25 @@
{ config, lib, pkgs, ... }: { { 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; config = {
home-manager.useUserPackages = true;
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 ];
};
} }

View File

@ -12,24 +12,12 @@ nixpkgs.lib.nixosSystem {
gui.enable = true; gui.enable = true;
gui.compositor.enable = true; gui.compositor.enable = true;
nixpkgs.overlays = [ nur.overlay ]; nixpkgs.overlays = [ nur.overlay ];
gaming.leagueoflegends = true;
gaming.steam = true;
} }
./hardware-configuration.nix ./hardware-configuration.nix
../common.nix ../common.nix
../../modules/hardware
../../modules/system
../../modules/graphical
../../modules/shell
../../modules/gaming
../../modules/mail/himalaya.nix
../../modules/services/keybase.nix ../../modules/services/keybase.nix
../../modules/services/gnupg.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
]; ];
} }

View File

@ -1,86 +1,88 @@
{ config, pkgs, ... }: { { config, pkgs, lib, ... }: {
home-manager.users.${config.user} = { config = lib.mkIf config.gui.enable {
xsession.windowManager.i3.config.terminal = "alacritty"; home-manager.users.${config.user} = {
programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty"; xsession.windowManager.i3.config.terminal = "alacritty";
programs.alacritty = { programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty";
enable = true; programs.alacritty = {
settings = { enable = true;
window = { settings = {
dimensions = { window = {
columns = 85; dimensions = {
lines = 30; columns = 85;
lines = 30;
};
padding = {
x = 20;
y = 20;
};
opacity = 1.0;
}; };
padding = { scrolling.history = 10000;
x = 20; font = {
y = 20; 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;
}; };
}; };
}; };

View File

@ -0,0 +1,13 @@
{ ... }: {
imports = [
./1password.nix
./alacritty.nix
./calibre.nix
./discord.nix
./firefox.nix
./media.nix
./qbittorrent.nix
];
}

View File

@ -0,0 +1,5 @@
{ ... }: {
imports = [ ./neovim ./notes.nix ];
}

View File

@ -1,15 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }: {
with lib; options.gaming.leagueoflegends = lib.mkEnableOption "League of Legends";
let cfg = config.modules.gaming.leagueoflegends;
in { config = lib.mkIf config.gaming.leagueoflegends {
options.modules.gaming.leagueoflegends = {
enable = mkEnableOption "League of Legends";
};
config = mkIf cfg.enable {
# League of Legends anti-cheat # League of Legends anti-cheat
boot.kernel.sysctl = { "abi.vsyscall32" = 0; }; boot.kernel.sysctl = { "abi.vsyscall32" = 0; };

View File

@ -1,13 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }: {
with lib; options.gaming.lutris = lib.mkEnableOption "Lutris";
let cfg = config.modules.gaming.lutris;
in { config = lib.mkIf (config.gaming.lutris || config.gaming.leagueoflegends) {
options.modules.gaming.lutris = { enable = mkEnableOption "Lutris"; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ lutris amdvlk wine ]; environment.systemPackages = with pkgs; [ lutris amdvlk wine ];
}; };

View File

@ -1,13 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }: {
with lib; options.gaming.steam = lib.mkEnableOption "Steam";
let cfg = config.modules.gaming.steam;
in { config = lib.mkIf config.gaming.steam {
options.modules.gaming.steam = { enable = mkEnableOption "Steam"; };
config = mkIf cfg.enable {
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [ steam ]; environment.systemPackages = with pkgs; [ steam ];

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { { config, pkgs, lib, ... }: {
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.gpg.enable = true; programs.gpg.enable = true;
@ -10,7 +10,7 @@
maxCacheTtlSsh = 34560000; # Can never reset maxCacheTtlSsh = 34560000; # Can never reset
pinentryFlavor = "tty"; pinentryFlavor = "tty";
}; };
home.packages = with pkgs; [ pinentry ]; home = lib.mkIf config.gui.enable { packages = with pkgs; [ pinentry ]; };
}; };
} }