Generate docs (#1)
* feat: Reorganize code * feat: Generate docs as mdbook * feat: Add deploy github action * fix: formatting
This commit is contained in:
parent
ca6bf00ad6
commit
63034a2af9
11 changed files with 144 additions and 70 deletions
64
module/default.nix
Normal file
64
module/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{ stylix }: { config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.jconfig;
|
||||
in
|
||||
{
|
||||
imports = [ ./gui ] ++ lib.optional (cfg.enable && cfg.styling.enable) stylix.nixosModules.stylix;
|
||||
|
||||
options = import ../options.nix;
|
||||
|
||||
config = lib.optionalAttrs cfg.enable {
|
||||
boot.plymouth.enable = cfg.styling.enable;
|
||||
stylix = lib.optionalAttrs cfg.styling.enable (import ./stylix-config.nix);
|
||||
|
||||
# Enable unlocking the gpg-agent at boot (configured through home.nix)
|
||||
security.pam.services.login.gnupg.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
# Dev tools
|
||||
pkgs.gcc
|
||||
pkgs.just
|
||||
pkgs.clang
|
||||
# CLI tools
|
||||
pkgs.fd
|
||||
pkgs.bat
|
||||
pkgs.skim
|
||||
pkgs.ripgrep
|
||||
pkgs.du-dust
|
||||
pkgs.curl
|
||||
pkgs.wget
|
||||
pkgs.eza
|
||||
];
|
||||
|
||||
# Shell prompt
|
||||
programs.starship.enable = true;
|
||||
programs.starship.settings = lib.optionalAttrs cfg.styling.enable {
|
||||
format = "$time$all";
|
||||
add_newline = false;
|
||||
cmd_duration.min_time = 500;
|
||||
cmd_duration.show_milliseconds = true;
|
||||
time.format = "[$time](bold yellow) ";
|
||||
time.disabled = false;
|
||||
status.format = "[$signal_name$common_meaning$maybe_int](red)";
|
||||
status.symbol = "[✗](bold red)";
|
||||
status.disabled = false;
|
||||
sudo.disabled = false;
|
||||
};
|
||||
# Default shell
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
# Open ports for spotifyd
|
||||
networking.firewall.allowedUDPPorts = [ 5353 ];
|
||||
networking.firewall.allowedTCPPorts = [ 2020 ];
|
||||
|
||||
# Nix Settings
|
||||
nix.gc.automatic = true;
|
||||
nix.gc.dates = "weekly";
|
||||
nix.gc.options = "--delete-older-than 30d";
|
||||
# run between 0 and 45min after boot if run was missed
|
||||
nix.gc.randomizedDelaySec = "45min";
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
};
|
||||
}
|
77
module/gui/default.nix
Normal file
77
module/gui/default.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.jconfig.gui;
|
||||
in
|
||||
{
|
||||
config = lib.optionalAttrs (config.jconfig.enable && cfg.enable)
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.gnome.adwaita-icon-theme
|
||||
pkgs.adwaita-qt
|
||||
pkgs.nordzy-cursor-theme
|
||||
pkgs.pinentry-qt
|
||||
] ++ lib.optional cfg.ydotool.enable pkgs.ydotool;
|
||||
|
||||
systemd.user.services.ydotool = lib.optionalAttrs cfg.ydotool.enable {
|
||||
enable = cfg.ydotool.autoStart;
|
||||
wantedBy = [ "default.target" ];
|
||||
description = "Generic command-line automation tool";
|
||||
documentation = [ "man:ydotool(1)" "man:ydotoold(8)" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
ExecStart = "${pkgs.ydotool}/bin/ydotoold";
|
||||
ExecReload = "${pkgs.util-linux}/bin/kill -HUP $MAINPID";
|
||||
KillMode = "process";
|
||||
TimeoutSec = 180;
|
||||
};
|
||||
};
|
||||
|
||||
fonts.fontDir.enable = true;
|
||||
|
||||
# Backlight control
|
||||
programs.light.enable = true;
|
||||
programs.dconf.enable = true;
|
||||
|
||||
security.polkit.enable = true;
|
||||
security.rtkit.enable = true; # Recommended for pipewire
|
||||
|
||||
services.flatpak.enable = true;
|
||||
# Audio
|
||||
services.pipewire.enable = true;
|
||||
services.pipewire.alsa.enable = true;
|
||||
services.pipewire.alsa.support32Bit = true;
|
||||
services.pipewire.pulse.enable = true;
|
||||
services.pipewire.wireplumber.enable = true;
|
||||
# Dbus
|
||||
services.dbus.enable = true;
|
||||
|
||||
# XDG portals
|
||||
xdg.portal.enable = true;
|
||||
xdg.portal.wlr.enable = true;
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
xdg.portal.config.preferred.default = "wlr"; # Default to wlr
|
||||
xdg.portal.config.preferred."org.freedesktop.impl.portal.FileChooser" = "gtk"; # But choose files with "gtk"
|
||||
|
||||
hardware.opengl.enable = true;
|
||||
hardware.uinput.enable = true;
|
||||
hardware.steam-hardware.enable = cfg.steamHardwareSupport;
|
||||
} // lib.optionalAttrs cfg."8bitdoFix" {
|
||||
# Udev rules to start or stop systemd service when controller is connected or disconnected
|
||||
services.udev.extraRules = ''
|
||||
# May vary depending on your controller model, find product id using 'lsusb'
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3106", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl start 8bitdo-ultimate-xinput@2dc8:3106"
|
||||
# This device (2dc8:3016) is "connected" when the above device disconnects
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3016", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl stop 8bitdo-ultimate-xinput@2dc8:3106"
|
||||
'';
|
||||
|
||||
# Systemd service which starts xboxdrv in xbox360 mode
|
||||
systemd.services."8bitdo-ultimate-xinput@" = {
|
||||
unitConfig.Description = "8BitDo Ultimate Controller XInput mode xboxdrv daemon";
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.xboxdrv}/bin/xboxdrv --mimic-xpad --silent --type xbox360 --device-by-id %I --force-feedback";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
26
module/stylix-config.nix
Normal file
26
module/stylix-config.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.jconfig.gui.styling;
|
||||
nerdFontSymbols = pkgs.nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; };
|
||||
fallbackSymbols = {
|
||||
name = "Symbols Nerd Font";
|
||||
package = nerdFontSymbols;
|
||||
};
|
||||
in
|
||||
{
|
||||
image = cfg.wallpaper;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
||||
polarity = "dark";
|
||||
fonts.monospace.name = "JetBrains Mono";
|
||||
fonts.monospace.package = pkgs.jetbrains-mono;
|
||||
fonts.sansSerif.name = "Noto Sans";
|
||||
fonts.sansSerif.package = pkgs.noto-fonts;
|
||||
fonts.serif.name = "Noto Serif";
|
||||
fonts.serif.package = pkgs.noto-fonts;
|
||||
fonts.fallbackFonts.monospace = [ fallbackSymbols ];
|
||||
fonts.fallbackFonts.sansSerif = [ fallbackSymbols ];
|
||||
fonts.fallbackFonts.serif = [ fallbackSymbols ];
|
||||
fonts.sizes.popups = 12;
|
||||
targets.plymouth.logoAnimated = false;
|
||||
targets.plymouth.logo = cfg.bootLogo;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue