Refactor modules style

This commit is contained in:
Julia Lange 2024-04-07 17:08:48 -07:00
parent ed2a7f94cf
commit cc95386f1a
44 changed files with 455 additions and 297 deletions

View file

@ -0,0 +1,11 @@
{ config, pkgs, lib, ... }:
{
import = [
./games
./input-remapper
./librewolf
./shells
./syncthing
];
}

View file

@ -0,0 +1,26 @@
{ config, inputs, pkgs, lib, ... }:
{
options = {
aagl.enable = lib.mkEnableOption
"Enables another anime game launcher settings";
aagl.honkai-rail = lib.mkEnableOption
"Enables honkai star rail";
aagl.genshin = lib.mkEnableOption
"Enables genshin impact";
aagl.honkai-3rd = lib.mkEnableOption
"Enables honkai 3rd impact";
};
config = lib.mkIf config.aagl.enable {
imports = [ inputs.aagl.nixosModules.default ];
nix.settings = inputs.aagl.nixConfig;
programs.honkers-railway-launcher.enable =
lib.mkIf config.aagl.honkai-rail true;
programs.anime-game-launcher.enable =
lib.mkIf config.aagl.genshin true;
programs.honkers-launcher.enable =
lib.mkIf config.aagl.honkai-3rd true;
};
}

View file

@ -0,0 +1,8 @@
{ config, pkgs, lib, ... }:
{
import = [
./anime-launcher
./steam
];
}

View file

@ -0,0 +1,15 @@
{ config, pkgs, lib, ... }:
{
options = {
steam.enable = lib.mkEnableOption "Enables steam";
};
config = lib.mkIf config.steam.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
};
}

View file

@ -0,0 +1,11 @@
{ config, pkgs, lib, ... }:
{
options = {
input-remapper.enable = lib.mkEnableOption "Enables input-remapper";
};
config = lib.mkIf config.input-remapper.enable {
services.input-remapper.enable = true;
};
}

View file

@ -0,0 +1,12 @@
{ config, pkgs, lib, ... }:
{
options = {
librewolf.enable = lib.mkEnableOption "Enables librewolf";
};
config = lib.mkIf config.librewolf.enable {
environment.variables.BROWSER = "librewolf";
environment.systemPackages = with pkgs; [ librewolf ];
};
}

View file

@ -0,0 +1,15 @@
{ config, pkgs, lib, ... }:
{
options = {
fish.enable = lib.mkEnableOption "Enables fish";
fish.setDefault = lib.mkEnableOption
"Sets fish as the default user's shell";
};
config = lib.mkIf config.fish.enable {
programs.fish.enable = true;
users.users.defaultUser.shell = lib.mkIf config.fish.setDefault pkgs.fish;
environment.shells = with pkgs; [ fish ];
};
}

View file

@ -0,0 +1,15 @@
{ config, pkgs, lib, ... }:
{
options = {
xonsh.enable = lib.mkEnableOption "Enables xonsh";
xonsh.setDefault = lib.mkEnableOption
"Sets xonsh as the default user's shell";
};
config = lib.mkIf config.xonsh.enable {
programs.xonsh.enable = true;
users.users.defaultUser.shell = lib.mkIf config.fish.setDefault pkgs.xonsh;
environment.shells = with pkgs; [ xonsh ];
};
}

View file

@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
{
options = {
syncthing.enable = lib.mkEnableOption "Enables syncthing";
};
config = lib.mkIf config.syncthing.enable {
services.syncthing = {
enable = true;
user = config.user.name;
dataDir = "/home/" + config.user.name + "/dox/Sync";
configDir = "/home/" + config.user.name + "/.config/syncthing";
overrideFolders = true;
overrideDevices = true;
settings = {
gui = {
user = config.user.name;
password = "password";
};
};
};
};
}