forked from mirrors_public/oddlama_nix-config
refactor: split "real" modules and "config" modules
This commit is contained in:
parent
045f15239a
commit
cceae6c63c
60 changed files with 126 additions and 113 deletions
126
config/graphical/default.nix
Normal file
126
config/graphical/default.nix
Normal file
|
@ -0,0 +1,126 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
minimal,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit
|
||||
(lib)
|
||||
mkIf
|
||||
mkOption
|
||||
types
|
||||
optionalAttrs
|
||||
;
|
||||
in
|
||||
{
|
||||
options.graphical.gaming.enable = mkOption {
|
||||
description = "Enables gaming on this machine and will add a lot of gaming related packages and configuration.";
|
||||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
}
|
||||
// optionalAttrs (!minimal) {
|
||||
imports = [
|
||||
inputs.stylix.nixosModules.stylix
|
||||
|
||||
./fonts.nix
|
||||
./steam.nix
|
||||
./wayland.nix
|
||||
./xserver.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
# For Star Citizen. See https://github.com/starcitizen-lug/knowledge-base/wiki for more info.
|
||||
boot.kernel.sysctl = mkIf config.graphical.gaming.enable {
|
||||
"vm.max_map_count" = 16777216;
|
||||
"fs.file-max" = 524288;
|
||||
};
|
||||
|
||||
# Needed for gtk
|
||||
programs.dconf.enable = true;
|
||||
# Required for gnome3 pinentry
|
||||
services.dbus.packages = [pkgs.gcr];
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
config.common = {
|
||||
default = ["gtk"];
|
||||
"org.freedesktop.impl.portal.Secret" = [
|
||||
"gnome-keyring"
|
||||
];
|
||||
};
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
};
|
||||
|
||||
stylix = {
|
||||
# I want to choose what to style myself.
|
||||
autoEnable = false;
|
||||
image = config.lib.stylix.pixel "base00";
|
||||
|
||||
polarity = "dark";
|
||||
|
||||
# onedark
|
||||
# base16Scheme = {
|
||||
# base00 = "#282c34";
|
||||
# base01 = "#353b45";
|
||||
# base02 = "#3e4451";
|
||||
# base03 = "#545862";
|
||||
# base04 = "#565c64";
|
||||
# base05 = "#abb2bf";
|
||||
# base06 = "#b6bdca";
|
||||
# base07 = "#c8ccd4";
|
||||
# base08 = "#e06c75";
|
||||
# base09 = "#d19a66";
|
||||
# base0A = "#e5c07b";
|
||||
# base0B = "#98c379";
|
||||
# base0C = "#56b6c2";
|
||||
# base0D = "#61afef";
|
||||
# base0E = "#c678dd";
|
||||
# base0F = "#9378de";
|
||||
# };
|
||||
|
||||
# based on decaycs-dark, normal variant
|
||||
base16Scheme = {
|
||||
base00 = "#101419";
|
||||
base01 = "#171b20";
|
||||
base02 = "#21262e";
|
||||
base03 = "#242931";
|
||||
base04 = "#485263";
|
||||
base05 = "#b6beca";
|
||||
base06 = "#dee1e6";
|
||||
base07 = "#e3e6eb";
|
||||
base08 = "#e05f65";
|
||||
base09 = "#f9a872";
|
||||
base0A = "#f1cf8a";
|
||||
base0B = "#78dba9";
|
||||
base0C = "#74bee9";
|
||||
base0D = "#70a5eb";
|
||||
base0E = "#c68aee";
|
||||
base0F = "#9378de";
|
||||
};
|
||||
|
||||
## based on decaycs-dark, bright variant
|
||||
#base16Scheme = {
|
||||
# base00 = "#101419";
|
||||
# base01 = "#171B20";
|
||||
# base02 = "#21262e";
|
||||
# base03 = "#242931";
|
||||
# base04 = "#485263";
|
||||
# base05 = "#b6beca";
|
||||
# base06 = "#dee1e6";
|
||||
# base07 = "#e3e6eb";
|
||||
# base08 = "#e5646a";
|
||||
# base09 = "#f7b77c";
|
||||
# base0A = "#f6d48f";
|
||||
# base0B = "#94F7C5";
|
||||
# base0C = "#79c3ee";
|
||||
# base0D = "#75aaf0";
|
||||
# base0E = "#cb8ff3";
|
||||
# base0F = "#9d85e1";
|
||||
#};
|
||||
};
|
||||
};
|
||||
}
|
62
config/graphical/fonts.nix
Normal file
62
config/graphical/fonts.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{pkgs, ...}: {
|
||||
fonts = {
|
||||
# Always prefer emojis even if the original font would provide a glyph
|
||||
fontconfig.localConf = ''
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<alias binding="weak">
|
||||
<family>monospace</family>
|
||||
<prefer>
|
||||
<family>emoji</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
<alias binding="weak">
|
||||
<family>sans-serif</family>
|
||||
<prefer>
|
||||
<family>emoji</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
<alias binding="weak">
|
||||
<family>serif</family>
|
||||
<prefer>
|
||||
<family>emoji</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
packages = with pkgs; [
|
||||
(pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-emoji
|
||||
noto-fonts-extra
|
||||
];
|
||||
};
|
||||
|
||||
stylix.fonts = {
|
||||
serif = {
|
||||
package = pkgs.dejavu_fonts;
|
||||
name = "IBM Plex Serif";
|
||||
};
|
||||
|
||||
sansSerif = {
|
||||
package = pkgs.segoe-ui-ttf;
|
||||
name = "Segoe UI";
|
||||
};
|
||||
|
||||
monospace = {
|
||||
# No need for patched nerd fonts, kitty can pick up on them automatically,
|
||||
# and ideally every program should do that: https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font
|
||||
package = pkgs.jetbrains-mono;
|
||||
name = "JetBrains Mono";
|
||||
};
|
||||
|
||||
emoji = {
|
||||
package = pkgs.segoe-ui-ttf;
|
||||
name = "Segoe UI Emoji";
|
||||
};
|
||||
};
|
||||
}
|
18
config/graphical/steam.nix
Normal file
18
config/graphical/steam.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf config.graphical.gaming.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
package = pkgs.steam.override {
|
||||
extraPkgs = pkgs:
|
||||
with pkgs; [
|
||||
# add packages here in case any game needs them...
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
config/graphical/wayland.nix
Normal file
6
config/graphical/wayland.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
xdg.portal = {
|
||||
wlr.enable = true;
|
||||
config.sway.default = ["wlr"];
|
||||
};
|
||||
}
|
34
config/graphical/xserver.nix
Normal file
34
config/graphical/xserver.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
dpi = 96;
|
||||
displayManager.startx.enable = true;
|
||||
desktopManager.xterm.enable = false;
|
||||
autoRepeatDelay = 235;
|
||||
autoRepeatInterval = 60;
|
||||
videoDrivers = ["modesetting"];
|
||||
xkb.layout = "de";
|
||||
xkb.variant = "nodeadkeys";
|
||||
};
|
||||
services.libinput = {
|
||||
enable = true;
|
||||
mouse = {
|
||||
accelProfile = "flat";
|
||||
accelSpeed = "0";
|
||||
middleEmulation = false;
|
||||
};
|
||||
# touchpad = {
|
||||
# accelProfile = "flat";
|
||||
# accelSpeed = "0.5";
|
||||
# naturalScrolling = true;
|
||||
# disableWhileTyping = true;
|
||||
# };
|
||||
};
|
||||
services.autorandr.enable = true;
|
||||
|
||||
# Enable for Xorg debugging
|
||||
# services.xserver.modules = lib.mkBefore [(pkgs.enableDebugging pkgs.xorg.xorgserver).out];
|
||||
# environment.etc."X11/xinit/xserverrc".source = lib.mkForce (pkgs.writeShellScript "xserverrc" ''
|
||||
# exec ${pkgs.enableDebugging pkgs.xorg.xorgserver}/bin/X ${toString config.services.xserver.displayManager.xserverArgs} "$@"
|
||||
# '');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue