Refactor modules style
This commit is contained in:
parent
ed2a7f94cf
commit
cc95386f1a
44 changed files with 455 additions and 297 deletions
11
nixosModules/apps/default.nix
Normal file
11
nixosModules/apps/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
import = [
|
||||
./games
|
||||
./input-remapper
|
||||
./librewolf
|
||||
./shells
|
||||
./syncthing
|
||||
];
|
||||
}
|
||||
26
nixosModules/apps/games/anime-launcher/default.nix
Normal file
26
nixosModules/apps/games/anime-launcher/default.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
8
nixosModules/apps/games/default.nix
Normal file
8
nixosModules/apps/games/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
import = [
|
||||
./anime-launcher
|
||||
./steam
|
||||
];
|
||||
}
|
||||
15
nixosModules/apps/games/steam/default.nix
Normal file
15
nixosModules/apps/games/steam/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
11
nixosModules/apps/input-remapper/default.nix
Normal file
11
nixosModules/apps/input-remapper/default.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
12
nixosModules/apps/librewolf/default.nix
Normal file
12
nixosModules/apps/librewolf/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
||||
15
nixosModules/apps/shells/fish/default.nix
Normal file
15
nixosModules/apps/shells/fish/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
||||
15
nixosModules/apps/shells/xonsh/default.nix
Normal file
15
nixosModules/apps/shells/xonsh/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
||||
25
nixosModules/apps/syncthing/default.nix
Normal file
25
nixosModules/apps/syncthing/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue