organizing config and getting rid of withs as much as possible

This commit is contained in:
Christoph Hollizeck 2024-09-06 21:28:59 +02:00
parent 42c647cb63
commit c365ba3827
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
12 changed files with 142 additions and 57 deletions

View file

@ -1,17 +1,16 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
let
inherit(lib) mkIf;
inherit(lib.wyrdgard) mkBoolOpt;
cfg = config.wyrdgard.apps.cli-apps.nixvim;
in
{
options.wyrdgard.apps.cli-apps.nixvim = with types; {
options.wyrdgard.apps.cli-apps.nixvim = {
enable = mkBoolOpt true "Whether to enable nixvim or not (Default true)";
};

View file

@ -1,62 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.apps.factorio-server;
inherit (config.wyrdgard.user) name;
in
{
options.wyrdgard.apps.factorio-server = with types; {
enable = mkEnableOption "Enable Factorio Headless Server";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ factorio-headless ];
sops = {
secrets = {
factorio_token = {
restartUnits = [ "factorio.service" ];
};
factorio_username = {
restartUnits = [ "factorio.service" ];
};
factorio_game_password = {
restartUnits = [ "factorio.service" ];
};
};
templates."extraSettingsFile.json".content = ''
{
"name": "Alles Nix!",
"description": "Trying to run a factorio-headless-server on my nix system",
"tags": ["vanilla"],
"max_players": 10,
"game_password": "${config.sops.placeholder.factorio_game_password}",
"allow_commands": "admins-only",
"autosave_slots": 5,
"ignore_player_limit_for_returning_players": true,
"username" : "${config.sops.placeholder.factorio_username}",
"admins": ["${config.sops.placeholder.factorio_username}"],
"token": "${config.sops.placeholder.factorio_token}"
}
'';
templates."extraSettingsFile.json".mode = "0444";
};
services.factorio = {
enable = true;
openFirewall = true;
public = true;
lan = true;
nonBlockingSaving = true;
autosave-interval = 5;
loadLatestSave = true;
bind = "192.168.178.34";
extraSettingsFile = config.sops.templates."extraSettingsFile.json".path;
};
};
}

View file

@ -1,17 +0,0 @@
{ lib, config, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.apps.onedrive;
in
{
options.wyrdgard.apps.onedrive = with types; {
enable = mkEnableOption "Enable OneDrive integration";
};
config = mkIf cfg.enable {
services.onedrive = {
enable = true;
};
};
}

View file

@ -22,6 +22,15 @@ in
qt5.qtwayland
];
environment.etc = {
"1password/custom_allowed_browsers" = {
text = ''
vivaldi-bin
'';
mode = "0755";
};
};
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
};
}

View file

@ -0,0 +1,34 @@
{
options,
config,
lib,
pkgs,
system,
inputs,
...
}:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.apps.zen-browser;
in
{
options.wyrdgard.apps.zen-browser = with types; {
enable = mkBoolOpt false "Whether or not to enable zen browser";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
inputs.zen-browser.packages."${system}".default
];
environment.etc = {
"1password/custom_allowed_browsers" = {
text = ''
.zen-wrapped
'';
mode = "0755";
};
};
};
}