Move steam and fonts settings to profile option

This commit is contained in:
Mateusz Słodkowicz 2023-05-18 22:29:52 +02:00
parent c635de13f3
commit 03e5106791
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
6 changed files with 112 additions and 73 deletions

View File

@ -16,5 +16,7 @@
materus.profile.nix.enable = true; materus.profile.nix.enable = true;
materus.profile.nixpkgs.enable = true; materus.profile.nixpkgs.enable = true;
materus.profile.fonts.enable = true;
materus.profile.steam.enable = true;
} }

View File

@ -1,47 +1,5 @@
{ config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }: { config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }:
let let
steam = pkgs.steam.override {
extraPkgs = pkgs: [
pkgs.nss_latest
pkgs.libstrangle
pkgs.libkrb5
pkgs.keyutils
pkgs.libGL
pkgs.libglvnd
pkgs.gamescope
pkgs.steamPackages.steam
pkgs.libxcrypt
pkgs.gnutls
pkgs.xorg.libXcursor
pkgs.xorg.libXi
pkgs.xorg.libXinerama
pkgs.xorg.libXScrnSaver
pkgs.openvdb
pkgs.tbb_2021_8
pkgs.gtk4
pkgs.gtk3
pkgs.glib
pkgs.gsettings-desktop-schemas
];
extraLibraries = pkgs: [
pkgs.libkrb5
pkgs.keyutils
pkgs.ncurses6
pkgs.fontconfig
pkgs.libxcrypt
pkgs.gnutls
pkgs.gsettings-desktop-schemas
];
extraEnv = { XDG_DATA_DIRS = "/usr/share:$XDG_DATA_DIRS"; };
};
grml-config = pkgs.fetchFromGitHub { grml-config = pkgs.fetchFromGitHub {
owner = "grml"; owner = "grml";
@ -210,8 +168,6 @@ in
#SSH_ASKPASS_REQUIRE = "prefer"; #SSH_ASKPASS_REQUIRE = "prefer";
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
MOZ_USE_XINPUT2 = "1"; MOZ_USE_XINPUT2 = "1";
PATH = [ PATH = [
"\${XDG_BIN_HOME}" "\${XDG_BIN_HOME}"
@ -250,11 +206,6 @@ in
environment.pathsToLink = [ "/share/zsh" "/share/bash-completion" "/share/fish" ]; environment.pathsToLink = [ "/share/zsh" "/share/bash-completion" "/share/fish" ];
environment.shells = with pkgs; [ zsh bashInteractive fish ]; environment.shells = with pkgs; [ zsh bashInteractive fish ];
programs = { programs = {
steam = {
enable = true;
dedicatedServer.openFirewall = true;
remotePlay.openFirewall = true;
};
fish.enable = true; fish.enable = true;
zsh = { zsh = {
enable = true; enable = true;
@ -271,28 +222,6 @@ in
command-not-found.enable = false; command-not-found.enable = false;
dconf.enable = true; dconf.enable = true;
}; };
fonts.fontDir.enable = true;
fonts.enableDefaultFonts = true;
fonts.fonts = with pkgs; [
dejavu_fonts
hack-font
noto-fonts
noto-fonts-extra
noto-fonts-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
ubuntu_font_family
wqy_zenhei
monocraft
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Meslo" "ProFont" ]; })
];
fonts.fontconfig.enable = true;
fonts.fontconfig.cache32Bit = true;
fonts.fontconfig.defaultFonts.sansSerif = [ "Noto Sans" "DejaVu Sans" "WenQuanYi Zen Hei" "Noto Color Emoji" ];
fonts.fontconfig.defaultFonts.serif = [ "Noto Serif" "DejaVu Serif" "WenQuanYi Zen Hei" "Noto Color Emoji"];
fonts.fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" "OpenMoji Color" ];
fonts.fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font Mono" "Noto Sans Mono" "WenQuanYi Zen Hei Mono" ];
networking.networkmanager.extraConfig = lib.mkDefault '' networking.networkmanager.extraConfig = lib.mkDefault ''
[connectivity] [connectivity]
uri=http://nmcheck.gnome.org/check_network_status.txt uri=http://nmcheck.gnome.org/check_network_status.txt
@ -300,8 +229,6 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
firefox firefox
steam
steam.run
gamescope gamescope
(pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; }) (pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; })
materusPkgs.amdgpu-pro-libs.prefixes materusPkgs.amdgpu-pro-libs.prefixes

View File

@ -2,5 +2,8 @@
{ {
imports = [ imports = [
./nix.nix ./nix.nix
./fonts.nix
./games
]; ];
} }

View File

@ -0,0 +1,24 @@
{ config, pkgs, lib, materusPkgs, ... }:
let
packages = config.materus.profile.packages;
cfg = config.materus.profile.fonts;
in
{
options.materus.profile.fonts.enable = materusPkgs.lib.mkBoolOpt false "Enable materus font settings for OS";
config = lib.mkIf cfg.enable {
fonts.fonts = packages.list.fonts ++ packages.list.moreFonts;
fonts.enableDefaultFonts = lib.mkDefault true;
fonts.fontconfig.enable = lib.mkDefault true;
fonts.fontconfig.cache32Bit = lib.mkDefault true;
fonts.fontconfig.defaultFonts.sansSerif = lib.mkDefault [ "Noto Sans" "DejaVu Sans" "WenQuanYi Zen Hei" "Noto Color Emoji" ];
fonts.fontconfig.defaultFonts.serif = lib.mkDefault [ "Noto Serif" "DejaVu Serif" "WenQuanYi Zen Hei" "Noto Color Emoji" ];
fonts.fontconfig.defaultFonts.emoji = lib.mkDefault [ "Noto Color Emoji" "OpenMoji Color" ];
fonts.fontconfig.defaultFonts.monospace = lib.mkDefault [ "FiraCode Nerd Font Mono" "Noto Sans Mono" "WenQuanYi Zen Hei Mono" ];
fonts.fontDir.enable = lib.mkDefault true;
};
}

View File

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
imports = [
./steam.nix
];
}

View File

@ -0,0 +1,77 @@
{ config, pkgs, lib, materusPkgs, ... }:
let
steamPkg = pkgs.steam.override {
extraPkgs = pkgs: [
pkgs.nss_latest
pkgs.libstrangle
pkgs.libkrb5
pkgs.keyutils
pkgs.libGL
pkgs.libglvnd
pkgs.gamescope
pkgs.steamPackages.steam
pkgs.libxcrypt
pkgs.gnutls
pkgs.xorg.libXcursor
pkgs.xorg.libXi
pkgs.xorg.libXinerama
pkgs.xorg.libXScrnSaver
pkgs.openvdb
pkgs.tbb_2021_8
pkgs.gtk4
pkgs.gtk3
pkgs.glib
pkgs.gsettings-desktop-schemas
pkgs.fuse
];
extraLibraries = pkgs: [
pkgs.libkrb5
pkgs.keyutils
pkgs.ncurses6
pkgs.fontconfig
pkgs.libxcrypt
pkgs.gnutls
] ++
(with config.hardware.opengl; if pkgs.hostPlatform.is64bit
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32);
extraEnv = {
XDG_DATA_DIRS = "/usr/share:\${XDG_DATA_DIRS}";
OBS_VKCAPTURE = "1";
};
};
cfg = config.materus.profile.steam;
in
{
options.materus.profile.steam.enable = materusPkgs.lib.mkBoolOpt false "Enable materus steam settings for OS";
options.materus.profile.steam.package = lib.mkOption {
type = lib.types.package;
default = steamPkg;
description = "Package used by steam";
};
config = lib.mkIf cfg.enable {
hardware.steam-hardware.enable = lib.mkDefault true;
programs.steam = {
enable = lib.mkDefault true;
dedicatedServer.openFirewall = lib.mkDefault true;
remotePlay.openFirewall = lib.mkDefault true;
};
environment.sessionVariables = rec {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = lib.mkDefault "\${HOME}/.steam/root/compatibilitytools.d";
};
environment.systemPackages = [
steamPkg
steamPkg.run
];
};
}