Apps : Separate to gaming, creative etc.

This commit is contained in:
Dmitry Voronin 2024-06-26 12:01:23 +03:00
parent 3037873271
commit a624dc8f5c
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
9 changed files with 225 additions and 151 deletions

View file

@ -8,10 +8,19 @@
module = { module = {
amd.gpu.enable = true; amd.gpu.enable = true;
builder.client.enable = true; builder.client.enable = true;
desktop.sway.enable = true;
intel.cpu.enable = true; intel.cpu.enable = true;
print.enable = true; print.enable = true;
strongswan.enable = true; strongswan.enable = true;
tablet.enable = true; tablet.enable = true;
desktop = {
sway.enable = true;
app = {
common.enable = true;
gaming.enable = true;
creative.enable = true;
dev.enable = true;
extra.enable = true;
};
};
}; };
} }

View file

@ -7,7 +7,6 @@
module = { module = {
builder.client.enable = true; builder.client.enable = true;
desktop.sway.enable = true;
print.enable = true; print.enable = true;
virtmanager.enable = true; virtmanager.enable = true;
amd = { amd = {
@ -15,6 +14,16 @@
cpu.enable = true; cpu.enable = true;
gpu.enable = true; gpu.enable = true;
}; };
desktop = {
sway.enable = true;
app = {
common.enable = true;
creative.enable = true;
dev.enable = true;
extra.enable = true;
gaming.enable = true;
};
};
docker = { docker = {
enable = true; enable = true;
autostart = false; autostart = false;

View file

@ -4,5 +4,9 @@
./Root.nix ./Root.nix
]; ];
module.docker.enable = true; module.docker = {
enable = true;
autostart = true;
rootless = false;
};
} }

View file

@ -11,7 +11,12 @@
module = { module = {
builder.server.enable = true; builder.server.enable = true;
desktop.sway.enable = true; desktop = {
sway.enable = true;
app = {
common.enable = true;
};
};
ftpd = { ftpd = {
enable = true; enable = true;
storage = "/storage/hot/ftp"; storage = "/storage/hot/ftp";

View file

@ -1,4 +1,4 @@
{ lib, ... }: { { ... }: {
imports = [ imports = [
./Filesystem.nix ./Filesystem.nix
]; ];
@ -18,5 +18,14 @@
cpu.enable = true; cpu.enable = true;
gpu.enable = true; gpu.enable = true;
}; };
desktop = {
sway.enable = true;
app = {
common.enable = true;
gaming.enable = true;
creative.enable = true;
dev.enable = true;
};
};
}; };
} }

View file

@ -10,9 +10,17 @@
module = { module = {
builder.client.enable = true; builder.client.enable = true;
desktop.sway.enable = true;
intel.cpu.enable = true; intel.cpu.enable = true;
powerlimit.thinkpad.enable = true; powerlimit.thinkpad.enable = true;
print.enable = true; print.enable = true;
desktop = {
sway.enable = true;
app = {
common.enable = true;
gaming.enable = true;
dev.enable = true;
extra.enable = true;
};
};
}; };
} }

View file

@ -5,150 +5,180 @@
firefox = import ./firefox args; firefox = import ./firefox args;
in { in {
options = { options = {
module.desktop.app.enable = mkEnableOption "Desktop Apps."; module.desktop.app = {
common.enable = mkEnableOption "Common Apps.";
gaming.enable = mkEnableOption "Gaming Apps.";
creative.enable = mkEnableOption "Creative Apps.";
dev.enable = mkEnableOption "Dev Apps.";
extra.enable = mkEnableOption "Extra Apps.";
};
}; };
config = mkIf cfg.enable { xdg.mime.defaultApplications = { config = mkMerge [
# Use `file -i file.txt` to find file mime type. # Common apps.
# Use `xdg-mime query default "text/plain"` to find default app. (mkIf cfg.common.enable { xdg.mime.defaultApplications = {
"application/pdf" = "org.gnome.Evince.desktop"; # Use `file -i file.txt` to find file mime type.
"application/vnd.openxmlformats-officedocument.*" = "onlyoffice-desktopeditors.desktop"; # Use `xdg-mime query default "text/plain"` to find default app.
"audio/*" = "mpv.desktop"; "application/pdf" = "org.gnome.Evince.desktop";
"image/*" = "org.gnome.Loupe.desktop"; "application/vnd.openxmlformats-officedocument.*" = "onlyoffice-desktopeditors.desktop";
"text/*" = "nvim.desktop"; "audio/*" = "mpv.desktop";
"video/*" = "mpv.desktop"; "image/*" = "org.gnome.Loupe.desktop";
}; "text/*" = "nvim.desktop";
"video/*" = "mpv.desktop";
hardware.graphics = let
packages = with pkgs; [
dxvk
gamescope
pkgs.mangohud
vkd3d
];
in {
extraPackages = packages;
extraPackages32 = packages;
};
environment = {
systemPackages = with pkgs; [
anilibria-winmaclinux # Anime!
appimage-run # Tool to run .AppImage files in NixOS.
aseprite # Pixel Art draw app. WARNING: Always builds from source.
blanket # Sounds generator.
blender-hip # Blender with HiP support.
calibre # Book library manager.
evince # Document viewer.
foot # Terminal emulator.
gimp # Image manipulation program.
gnome.adwaita-icon-theme # GTK icons.
gnome.gnome-calculator # Calculator.
gnome.gnome-font-viewer # Font viewer.
gnome.nautilus # File manager.
jellyfin-media-player # Jellyfin client (self-hosted Netflix).
loupe # Image viewer.
obs-studio # Streaming/recording app.
onlyoffice-bin # Office documents app suite.
steam-run # Run native apps in Steam environment, like Minecraft. For Windows games use Bottles.
tor-browser # Privacy browser.
android-studio jetbrains.idea-community # JetBrans IDEs.
bottles dxvk gamescope pkgs.mangohud vkd3d wine64 # Gaming!
(mpv.override {scripts = [mpvScripts.mpris];}) # Media player.
];
variables = {
# MangoHud.
MANGOHUD = "1";
MANGOHUD_CONFIGFILE = pkgs.writeText "MangoHudConfig" mangohud.config;
MANGOHUD_PRESETSFILE = pkgs.writeText "MangoHudPreset" mangohud.presets;
# Proton.
WINEFSYNC = "1";
# GTK apps compat.
GTK_CSD = 0;
# Terminal settings.
TERM = "xterm-256color";
TERMINAL = config.setting.terminal.bin;
# Disable Firefox profile switching on rebuild.
MOZ_LEGACY_PROFILES = "1";
};
};
# File manager file previews.
services.gnome.sushi.enable = true;
# File manager network features.
services.gvfs.enable = true;
# Special packages.
programs.steam.enable = true;
programs.firefox = let
mkExtension = install_url: {
inherit install_url;
installation_mode = "force_installed";
}; };
mkBookmark = name: url: { inherit name url; }; environment = {
in { systemPackages = with pkgs; [
enable = true; appimage-run # Tool to run .AppImage files in NixOS.
package = pkgs.firefox-esr; evince # Document viewer.
languagePacks = [ "en-US" "ru" ]; foot # Terminal emulator.
autoConfig = firefox.config; gimp # Image manipulation program.
policies = { gnome.adwaita-icon-theme # GTK icons.
ManagedBookmarks = [ gnome.gnome-calculator # Calculator.
{ toplevel_name = "Pin"; } gnome.nautilus # File manager.
(mkBookmark "Dashboard" "https://home.voronind.com") jellyfin-media-player # Jellyfin client (self-hosted Netflix).
(mkBookmark "Music" "https://music.yandex.ru") loupe # Image viewer.
(mkBookmark "Telegram" "https://web.telegram.org/a") obs-studio # Streaming/recording app.
(mkBookmark "Discord" "https://discord.com") onlyoffice-bin # Office documents app suite.
(mkBookmark "WorkMail" "https://mail.fsight.ru")
(mkBookmark "Git" "https://git.voronind.com") (mpv.override {scripts = [mpvScripts.mpris];}) # Media player.
(mkBookmark "WorkGit" "https://git.fmp.fsight.world")
(mkBookmark "WorkBoard" "https://support.fsight.ru")
(mkBookmark "Hass" "https://iot.voronind.com")
(mkBookmark "Cloud" "https://cloud.voronind.com")
]; ];
ExtensionUpdate = true;
ExtensionSettings = { variables = {
# Block extension installation outside of this config. # GTK apps compat.
"*" = { GTK_CSD = 0;
install_sources = [ "*" ];
installation_mode = "blocked"; # Terminal settings.
}; TERM = "xterm-256color";
"addon@darkreader.org" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; TERMINAL = config.setting.terminal.bin;
"cliget@zaidabdulla.com" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/cliget/latest.xpi";
"uBlock0@raymondhill.net" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; # Disable Firefox profile switching on rebuild.
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; MOZ_LEGACY_PROFILES = "1";
"{d7742d87-e61d-4b78-b8a1-b469842139fa}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi";
"{e7625f06-e252-479d-ac7a-db68aeaff2cb}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/togglefonts/latest.xpi";
"{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi";
# NOTE: This extension is helpful to find the required parameters for this config.
# Or find them yourself inside the `about:support`.
# "queryamoid@kaply.com" = mkExtension "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi";
};
# NOTE: `firefox-esr` edition is required to change default search engine.
SearchEngines = {
Default = "Searx";
Add = [
{
Alias = "s";
Description = "Searx Search";
IconURL = "https://search.voronind.com/favicon.ico";
Method = "POST";
Name = "Searx";
PostData = "q={searchTerms}";
# SuggestURLTemplate = "https://search.voronind.com/autocomplete?q={searchTerms}";
URLTemplate = "https://search.voronind.com/search?q=%{searchTerms}";
}
];
}; };
}; };
};
}; programs.firefox = let
mkExtension = install_url: {
inherit install_url;
installation_mode = "force_installed";
};
mkBookmark = name: url: { inherit name url; };
in {
enable = true;
package = pkgs.firefox-esr;
languagePacks = [ "en-US" "ru" ];
autoConfig = firefox.config;
policies = {
ManagedBookmarks = [
{ toplevel_name = "Pin"; }
(mkBookmark "Dashboard" "https://home.voronind.com")
(mkBookmark "Music" "https://music.yandex.ru")
(mkBookmark "Telegram" "https://web.telegram.org/a")
(mkBookmark "Discord" "https://discord.com")
(mkBookmark "WorkMail" "https://mail.fsight.ru")
(mkBookmark "Git" "https://git.voronind.com")
(mkBookmark "WorkGit" "https://git.fmp.fsight.world")
(mkBookmark "WorkBoard" "https://support.fsight.ru")
(mkBookmark "Hass" "https://iot.voronind.com")
(mkBookmark "Cloud" "https://cloud.voronind.com")
];
ExtensionUpdate = true;
ExtensionSettings = {
# Block extension installation outside of this config.
"*" = {
install_sources = [ "*" ];
installation_mode = "blocked";
};
"addon@darkreader.org" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi";
"cliget@zaidabdulla.com" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/cliget/latest.xpi";
"uBlock0@raymondhill.net" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi";
"{d7742d87-e61d-4b78-b8a1-b469842139fa}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi";
"{e7625f06-e252-479d-ac7a-db68aeaff2cb}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/togglefonts/latest.xpi";
"{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi";
# NOTE: This extension is helpful to find the required parameters for this config.
# Or find them yourself inside the `about:support`.
# "queryamoid@kaply.com" = mkExtension "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi";
};
# NOTE: `firefox-esr` edition is required to change default search engine.
SearchEngines = {
Default = "Searx";
Add = [
{
Alias = "s";
Description = "Searx Search";
IconURL = "https://search.voronind.com/favicon.ico";
Method = "POST";
Name = "Searx";
PostData = "q={searchTerms}";
# SuggestURLTemplate = "https://search.voronind.com/autocomplete?q={searchTerms}";
URLTemplate = "https://search.voronind.com/search?q=%{searchTerms}";
}
];
};
};
};
})
# Gaming.
(mkIf cfg.gaming.enable {
hardware.graphics = let
packages = with pkgs; [
dxvk
gamescope
pkgs.mangohud
vkd3d
];
in {
extraPackages = packages;
extraPackages32 = packages;
};
programs.steam.enable = true;
environment = {
systemPackages = with pkgs; [
steam-run
bottles dxvk gamescope pkgs.mangohud vkd3d wine64 # Gaming!
];
variables = {
MANGOHUD = "1";
MANGOHUD_CONFIGFILE = pkgs.writeText "MangoHudConfig" mangohud.config;
MANGOHUD_PRESETSFILE = pkgs.writeText "MangoHudPreset" mangohud.presets;
WINEFSYNC = "1";
};
};
})
# Creative.
(mkIf cfg.creative.enable {
environment.systemPackages = with pkgs; [
aseprite # Pixel Art draw app. WARNING: Always builds from source.
blender-hip # Blender with HiP support.
krita # Draw!
];
})
# Development.
(mkIf cfg.dev.enable {
environment.systemPackages = with pkgs; [
android-studio
jetbrains.idea-community
];
})
# Extras.
(mkIf cfg.extra.enable {
environment.systemPackages = with pkgs; [
anilibria-winmaclinux # Anime!
blanket # Sounds generator.
calibre # Book library manager.
gnome.gnome-font-viewer # Font viewer.
tor-browser # Privacy browser.
];
})
];
} }

View file

@ -7,11 +7,11 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
module.desktop = { module.desktop = {
app.enable = true; app.common.enable = true;
dconf.enable = true; dconf.enable = true;
dm.enable = true; dm.enable = true;
sound.enable = true; sound.enable = true;
wayland.enable = true; wayland.enable = true;
}; };
services.xserver.displayManager.gdm.enable = true; services.xserver.displayManager.gdm.enable = true;

View file

@ -13,7 +13,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
module.desktop = { module.desktop = {
app.enable = true; app.common.enable = true;
bluetooth.enable = true; bluetooth.enable = true;
brightness.enable = true; brightness.enable = true;
dconf.enable = true; dconf.enable = true;