treewide: move nixos modules
This commit is contained in:
parent
d84be7c616
commit
8eff4c5e4f
73 changed files with 62 additions and 62 deletions
24
modules/nixos/games/default.nix
Normal file
24
modules/nixos/games/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./minecraft
|
||||
./mumble
|
||||
./particles
|
||||
./steam
|
||||
./tetris
|
||||
];
|
||||
|
||||
options.chvp.games.enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.games.enable {
|
||||
chvp.games = {
|
||||
minecraft.client = lib.mkDefault false;
|
||||
mumble.enable = lib.mkDefault true;
|
||||
steam.enable = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
}
|
32
modules/nixos/games/minecraft/default.nix
Normal file
32
modules/nixos/games/minecraft/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.chvp.games.minecraft = {
|
||||
client = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
server = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.chvp.games.minecraft.client || config.chvp.games.minecraft.server) {
|
||||
home-manager.users.charlotte = lib.mkIf config.chvp.games.minecraft.client ({ ... }: {
|
||||
home.packages = [ pkgs.minecraft ];
|
||||
});
|
||||
chvp.base = {
|
||||
zfs.homeLinks = lib.optional config.chvp.games.minecraft.client { path = ".minecraft"; type = "cache"; };
|
||||
nix.unfreePackages =
|
||||
(lib.optional config.chvp.games.minecraft.client "minecraft-launcher") ++
|
||||
(lib.optional config.chvp.games.minecraft.server "minecraft-server");
|
||||
};
|
||||
services.minecraft-server = lib.mkIf config.chvp.games.minecraft.server {
|
||||
enable = true;
|
||||
dataDir = "${config.chvp.dataPrefix}/var/lib/minecraft-server";
|
||||
eula = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
}
|
19
modules/nixos/games/mumble/default.nix
Normal file
19
modules/nixos/games/mumble/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.chvp.games.mumble.enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.games.mumble.enable {
|
||||
chvp.base.zfs.homeLinks = [
|
||||
{ path = ".config/Mumble"; type = "data"; }
|
||||
{ path = ".local/share/Mumble"; type = "data"; }
|
||||
];
|
||||
|
||||
home-manager.users.charlotte = { ... }: {
|
||||
home.packages = with pkgs; [ mumble ];
|
||||
};
|
||||
};
|
||||
}
|
24
modules/nixos/games/particles/default.nix
Normal file
24
modules/nixos/games/particles/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
particles = pkgs.fetchgit {
|
||||
url = "https://git.zeus.gent/midgard/particles.git";
|
||||
sha256 = "0weSBjhSS0XuII5yZXWYUJpPOhetFJKbcsS8WWpodhs=";
|
||||
};
|
||||
in
|
||||
{
|
||||
options.chvp.games.particles.server = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.games.particles.server {
|
||||
chvp.services.nginx.hosts = [{
|
||||
fqdn = "particles.vanpetegem.me";
|
||||
options = {
|
||||
root = "${particles}/public";
|
||||
locations."/".index = "index.html";
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
29
modules/nixos/games/steam/default.nix
Normal file
29
modules/nixos/games/steam/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.chvp.games.steam.enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.games.steam.enable {
|
||||
hardware.graphics = {
|
||||
enable32Bit = true;
|
||||
extraPackages = with pkgs.pkgsi686Linux; [ libva ];
|
||||
};
|
||||
services.pipewire.alsa.support32Bit = true;
|
||||
chvp.base = {
|
||||
nix.unfreePackages = [ "steam" "steam-original" "steam-runtime" "steam-run" ];
|
||||
zfs.homeLinks = [
|
||||
{ path = ".paradoxlauncher"; type = "cache"; }
|
||||
{ path = ".steam"; type = "cache"; }
|
||||
{ path = ".local/share/Steam"; type = "cache"; }
|
||||
{ path = ".local/share/Paradox Interactive"; type = "cache"; }
|
||||
];
|
||||
};
|
||||
|
||||
home-manager.users.charlotte = { pkgs, ... }: {
|
||||
home.packages = [ pkgs.steam pkgs.protontricks pkgs.wine ];
|
||||
};
|
||||
};
|
||||
}
|
18
modules/nixos/games/tetris/default.nix
Normal file
18
modules/nixos/games/tetris/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.chvp.games.tetris.server = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.games.tetris.server {
|
||||
chvp.services.nginx.hosts = [{
|
||||
fqdn = "tetris.vanpetegem.me";
|
||||
options = {
|
||||
root = "${pkgs.tetris}";
|
||||
locations."/".index = "index.html";
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue