feat: split config more

This commit is contained in:
2024-04-12 11:00:06 +02:00
parent 5d510a1989
commit 6e0e34e425
11 changed files with 199 additions and 61 deletions

View File

@@ -22,6 +22,10 @@
./locales/theaninova.nix
./usecases/gaming.nix
./usecases/3d-printing.nix
./usecases/development.nix
./services/airprint.nix
];
}

View File

@@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.usecases."3d-printing";
in
{
options.usecases."3d-printing" = {
enable = mkEnableOption "Enable 3d printing stuff";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
lpc21isp
dfu-util
cura
openscad-unstable
freecad
];
};
}

View File

@@ -0,0 +1,40 @@
{
config,
lib,
pkgs,
username,
...
}:
with lib;
let
cfg = config.usecases.development;
in
{
imports = [
./development/angular.nix
./development/svelte.nix
./development/docker.nix
];
options.usecases.development = {
enable = mkEnableOption "Enable development tools";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
gh
git-filter-repo
ripgrep
jq
httpie
];
home-manager.users.${username} = {
programs = {
lazygit.enable = true;
};
};
};
}

View File

@@ -0,0 +1,14 @@
{ config, lib, ... }:
with lib;
let
cfg = config.usecases.development.angular;
in
{
options.usecases.development.angular = {
enable = mkEnableOption "Enable Angular develompent";
};
config = mkIf cfg.enable { networking.firewall.allowedTCPPorts = [ 8100 ]; };
}

View File

@@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.usecases.development.docker;
in
{
options.usecases.development.docker = {
enable = mkEnableOption "Enable Docker stuff";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
lazydocker
docker-compose
];
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
};
}

View File

@@ -0,0 +1,19 @@
{ config, lib, ... }:
with lib;
let
cfg = config.usecases.development.svelte;
in
{
options.usecases.development.svelte = {
enable = mkEnableOption "Enable Svelte develompent";
};
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [
5073
5173
];
};
}

View File

@@ -0,0 +1,50 @@
{
config,
lib,
pkgs,
username,
...
}:
with lib;
let
cfg = config.usecases.gaming;
in
{
options.usecases.gaming = {
enable = mkEnableOption "Enable gaming things";
};
config = mkIf cfg.enable {
programs.steam.enable = true;
services.udev.packages = with pkgs; [ oversteer ];
users.users.${username}.extraGroups = [
"wheel"
"input"
];
environment.systemPackages = with pkgs; [
steam
oversteer
obs-studio
(lutris.override {
extraLibraries =
pkgs: with pkgs; [
libgudev
libvdpau
libsoup
];
})
wine
winetricks
protontricks
mangohud
gamescope
gamemode
# fix for some proton games not launching without any error message
libxcrypt
];
};
}