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,5 +1,18 @@
{ config, lib, pkgs, ... }: { { config, lib, pkgs, ... }: {
imports = [
../modules/hardware
../modules/system
../modules/graphical
../modules/shell
../modules/gaming
../modules/applications
../modules/editor
../modules/mail/himalaya.nix
];
config = {
nix.extraOptions = "experimental-features = nix-command flakes"; nix.extraOptions = "experimental-features = nix-command flakes";
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
@ -7,4 +20,6 @@
environment.systemPackages = with pkgs; [ git vim wget curl ]; 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,5 +1,6 @@
{ config, pkgs, ... }: { { config, pkgs, lib, ... }: {
config = lib.mkIf config.gui.enable {
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
xsession.windowManager.i3.config.terminal = "alacritty"; xsession.windowManager.i3.config.terminal = "alacritty";
programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty"; programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty";
@ -84,4 +85,5 @@
}; };
}; };
}; };
};
} }

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 ]; };
}; };
} }