1
0
Fork 0
mirror of https://git.sr.ht/~azikx/wyswort synced 2024-10-30 07:06:19 +00:00

update 

This commit is contained in:
azikx 2024-10-26 22:44:55 +09:00
parent 64f62b5e50
commit 79bf183c6c
43 changed files with 933 additions and 22 deletions

View file

@ -765,6 +765,26 @@
"type": "github"
}
},
"nypkgs": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1726657437,
"narHash": "sha256-eBeVOFceQkYfWHAwdQ+aM8vLAbsuuWUgek2f6dFBTl0=",
"owner": "yunfachi",
"repo": "nypkgs",
"rev": "698ab4159dc38affee2fc5886468af139de8d95e",
"type": "github"
},
"original": {
"owner": "yunfachi",
"repo": "nypkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
@ -802,6 +822,7 @@
"nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable_2",
"nur": "nur",
"nypkgs": "nypkgs",
"spicetify-nix": "spicetify-nix",
"stylix": "stylix",
"walls": "walls",
@ -1074,15 +1095,15 @@
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1729404148,
"narHash": "sha256-OxLb5uMhJI65zQXY+Altq1mI4mDgYkc/ZeQwwRBMsxY=",
"owner": "axax-loll",
"lastModified": 1729457884,
"narHash": "sha256-oNuY6kQDfqpe1K6dEP7IIoegnSZvvv/WKD/6xcefncc=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "8062a16083cda535819698aebf08f68f89f607b4",
"rev": "8146e6a761f9d51f1a93528709733685ff046e2c",
"type": "github"
},
"original": {
"owner": "axax-loll",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"type": "github"
}

View file

@ -18,6 +18,9 @@
modules = [ ./home ];
};
};
hostModules = import ./modules/host;
homeModules = import ./modules/home;
};
inputs = {
@ -30,7 +33,7 @@
ayugram-desktop.url = "github:kaeeraa/ayugram-desktop/release?submodules=1";
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
zen-browser.url = "github:axax-loll/zen-browser-flake";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
stylix.url = "github:danth/stylix";
yazi.url = "github:sxyazi/yazi";
@ -47,6 +50,10 @@
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
nypkgs = {
url = "github:yunfachi/nypkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
auto-cpufreq = {
url = "github:AdnanHodzic/auto-cpufreq";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -41,7 +41,7 @@
config.nur.repos.abszero.palgen
config.nur.repos.rycee.mozilla-addons-to-nix
inputs.ayugram-desktop.packages.${pkgs.system}.default
inputs.ayugram-desktop.packages.${pkgs.system}.ayugram-desktop
inputs.zen-browser.packages."${pkgs.system}".specific
];
}

View file

@ -34,7 +34,7 @@ in {
videos = "${hmdir}/Videos";
};
desktopEntries = {
zen = {
/* zen = {
name = "Zen Browser";
exec = "appimage-run ${hmdir}/.local/share/zen-specific.AppImage";
terminal = false;
@ -49,6 +49,7 @@ in {
];
type = "Application";
};
*/
};
};
}

5
modules/host/default.nix Normal file
View file

@ -0,0 +1,5 @@
{ lib, ... }: {
imports = lib.fileset.toList (
# All default.nix files in ./.
lib.fileset.fileFilter (file: file.name == "default.nix") ./.);
}

View file

@ -0,0 +1,20 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.hardware.bluetooth;
in {
options = { module.hardware.bluetooth = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
hardware.bluetooth = { # BLUETOOTH LOL
enable = true;
powerOnBoot = true;
};
environment.systemPackages = with pkgs; [ # TUI FOR BLUETOOTH
bluetuith
bluetooth_battery
];
};
}

View file

@ -0,0 +1,65 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.hardware.boot;
in {
options = { module.hardware.boot = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
boot = { # ITSELF LOL
kernelPackages = pkgs.linuxPackages_zen;
kernelModules = [ "kvm-amd" ];
consoleLogLevel = 0;
kernelParams = [
"quiet"
"loglevel=3"
"nowatchdog"
"page_alloc.shuffle=1"
"threadirqs"
"split_lock_detect=off"
"pci=pcie_bus_perf"
"psmouse.synaptics_intertouch=0"
"rd.systemd.show_status=false"
];
loader = { # SYSTEMD BOOT AS DEFAULT
systemd-boot = {
enable = true;
configurationLimit = 4;
};
efi.canTouchEfiVariables = true;
timeout = 0; # TIMEOUT FOR LAUNCH
};
initrd = { # IDK
availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"ohci_pci"
"ehci_pci"
"pata_atiixp"
"ums_realtek"
"sd_mod"
"sr_mod"
"sdhci_pci"
"usb_storage"
];
systemd.enable = true;
compressor = "zstd";
compressorArgs = [ "-9" ];
verbose = false;
};
plymouth = { # PLYMOUTH WITH NIXOS LOGO
enable = true;
logo =
"${pkgs.nixos-icons}/share/icons/hicolor/48x48/apps/nix-snowflake-white.png";
};
tmp.cleanOnBoot = true;
};
};
}

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.hardware.cpu;
in {
options = { module.hardware.cpu = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
hardware.cpu.amd = { # OPTIMIZATION FOR CPU
updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
ryzen-smu.enable = true;
};
};
}

View file

@ -0,0 +1,5 @@
{ lib, ... }: {
imports = lib.fileset.toList (
# All default.nix files in ./.
lib.fileset.fileFilter (file: file.name == "default.nix") ./.);
}

View file

@ -0,0 +1,25 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.hardware.gpu;
in {
options = { module.hardware.gpu = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
hardware = {
graphics = { # GPU
enable = true;
enable32Bit = true;
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
};
amdgpu = {
amdvlk = {
enable = true;
support32Bit.enable = true;
supportExperimental.enable = true;
};
};
};
};
}

View file

@ -0,0 +1,40 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.hardware.network;
in {
options = {
module.hardware.network = {
enable = mkEnableOption "";
host = mkOption {
type = types.str;
default = null;
};
};
};
config = mkIf cfg.enable {
networking = { # FOR NETWORK
hostName = cfg.host;
networkmanager = {
enable = true;
insertNameservers = [ "1.1.1.1" "1.0.0.1" ];
dns = "systemd-resolved";
wifi = {
powersave = true;
macAddress = "random";
backend = "iwd";
};
};
useDHCP = mkDefault true;
nftables.enable = true;
};
services.resolved.enable = true;
systemd.services = { # IDK
NetworkManager-wait-online.enable = false;
systemd-networkd-wait-online.enable = mkForce false;
};
};
}

View file

@ -0,0 +1,42 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.hardware.security;
in {
options = {
module.hardware.security = {
enable = mkEnableOption "";
username = mkOption {
default = null;
type = types.str;
};
};
};
config = mkIf cfg.enable {
security = {
sudo.enable = false;
sudo-rs = {
enable = true;
execWheelOnly = true;
wheelNeedsPassword = true;
};
doas = { # VERY TOP
enable = true;
wheelNeedsPassword = true;
extraRules = [{
users = [ cfg.username ];
keepEnv = true;
persist = true;
}];
};
pam.services = {
gtklock = { };
swaylock = { };
hyprlock = { };
};
};
};
}

View file

@ -0,0 +1,27 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.hardware.sound;
in {
options = { module.hardware.sound = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
wireplumber.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
lowLatency = {
enable = true;
quantum = 64;
rate = 48000;
};
};
};
}

View file

@ -0,0 +1,5 @@
{ lib, ... }: {
imports = lib.fileset.toList (
# All default.nix files in ./.
lib.fileset.fileFilter (file: file.name == "default.nix") ./.);
}

View file

@ -0,0 +1,18 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.misc.locales;
in {
options = { module.misc.locales = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
time.timeZone = "Asia/Chita"; # TIME
services.chrony.enable = true; # SYNC TIME
i18n = { # LOCALE LANG
defaultLocale = "en_US.UTF-8";
supportedLocales = [ "all" ];
};
};
}

View file

@ -0,0 +1,21 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.misc.minimal;
in {
options = { module.misc.minimal = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
programs.command-not-found.enable = mkDefault false;
documentation = { # DISABLE MAN AND GUIDES
enable = mkDefault false;
doc.enable = mkDefault false;
info.enable = mkDefault false;
man.enable = mkDefault false;
nixos.enable = mkDefault false;
};
};
}

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.misc.power;
in {
options = { module.misc.power = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
powerManagement = { # POWER OPTIMIZATION
enable = true;
powertop.enable = true;
};
};
}

View file

@ -0,0 +1,25 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.misc.system76;
in {
options = { module.misc.system76 = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
hardware.system76 = { # OPTIMIZATIONS
enableAll = true;
power-daemon.enable = true;
firmware-daemon.enable = true;
kernel-modules.enable = true;
};
services.system76-scheduler = { # SCHEDULER
enable = true;
settings = {
cfsProfiles.enable = true;
processScheduler.pipewireBoost.enable = true;
};
};
};
}

View file

@ -0,0 +1,27 @@
{ lib, config, ... }:
with lib;
let
cfg = config.module.misc.torrserver;
torr = pkgs.callPackage ./package.nix { };
in {
options = { module.misc.torrserver = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
systemd.services = {
torrserver = { # TORRSERVER
enable = true;
after = [ "multi-user.target" "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${torr}/bin/torrserver";
Restart = "on-failure";
Type = "simple";
TimeoutSec = 30;
};
};
};
};
}

View file

@ -0,0 +1,27 @@
{ lib, stdenv, fetchurl, autoPatchelfHook }:
let
version = "134";
hash = "sha256-WDygG9aGnD20nGxtG0t+T2KEwbJ+fZ0uRaCndirrsXI=";
in stdenv.mkDerivation {
name = "torrserver";
dontUnpack = true;
src = fetchurl {
url =
"https://github.com/YouROK/TorrServer/releases/download/MatriX.${version}/TorrServer-linux-amd64";
sha256 = "${hash}";
};
nativeBuildInputs = [ autoPatchelfHook ];
installPhase =
" mkdir -p $out/bin\n cp $src $out/bin/torrserver\n chmod +x $out/bin/torrserver\n";
meta = with lib; {
description = "Torrserver";
homepage = "https://github.com/YouROK/TorrServer";
license = licenses.unlicense;
meta.platforms = platforms.all;
mainProgram = "torrserver";
};
}

View file

@ -0,0 +1,40 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.misc.users;
in {
options = {
module.misc.users = {
enable = mkEnableOption "";
shell = mkOption {
type = types.str;
default = null;
};
user = mkOption {
type = types.str;
default = null;
};
};
};
config = mkIf cfg.enable {
users = {
mutableUsers = false;
defaultUserShell = cfg.shell;
users = {
root.useDefaultShell = true;
${cfg.user} = {
uid = 1000;
home = "/home/${cfg.user}";
useDefaultShell = true;
createHome = true;
isSystemUser = true;
extraGroups =
[ "video" "audio" "networkmanager" "wheel" "docker" "libvirtd" ];
};
};
};
};
}

View file

@ -0,0 +1,32 @@
{ lib, config, ... }:
with lib;
let
cfg = config.module.misc.variables;
usr = config.module.misc.users;
in {
options = { module.misc.variables = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
environment.variables = {
QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland";
CLUTTER_BACKEND = "wayland";
GDK_BACKEND = "wayland";
NIXPKGS_ALLOW_UNFREE = "1";
NIXPKGS_ALLOW_INSECURE = "1";
MOZ_ENABLE_WAYLAND = "1";
XDG_SESSION_TYPE = "wayland";
NIXOS_OZONE_WL = "1";
};
environment.sessionVariables = {
MOZ_LEGACY_PROFILES = "1";
FLAKE = "/home/${usr.user}/.flake";
QT_QPA_PLATFORMTHEME = "gtk3";
TDESKTOP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY = "1";
};
};
}

View file

@ -0,0 +1,57 @@
{ lib, config, pkgs, ... }:
with lib;
let cfg = config.module.misc.zapret;
in {
options = { module.misc.zapret = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
systemd = {
services = {
zapret = {
wantedBy = [ "multi-user.target" ];
requires = [ "network.target" ];
path = with pkgs; [ iptables nftables zapret ipset curl gawk ];
serviceConfig = {
Type = "forking";
Restart = "no";
TimeoutSec = "30sec";
IgnoreSIGPIPE = "no";
KillMode = "none";
GuessMainPID = "no";
ExecStart = "${pkgs.zapret}/bin/zapret start";
ExecStop = "${pkgs.zapret}/bin/zapret stop";
EnvironmentFile = pkgs.writeText "zapret-environment" ''
FWTYPE="iptables"
SET_MAXELEM=522288
IPSET_OPT="hashsize 262144 maxelem $SET_MAXELEM"
AUTOHOSTLIST_RETRANS_THRESHOLD=3
AUTOHOSTLIST_FAIL_THRESHOLD=3
AUTOHOSTLIST_FAIL_TIME=60
AUTOHOSTLIST_DEBUGLOG=0
MDIG_THREADS=30
GZIP_LISTS=1
MODE=nfqws
MODE_HTTP=1
MODE_HTTP_KEEPALIVE=0
MODE_HTTPS=1
MODE_QUIC=0
MODE_FILTER=none
DESYNC_MARK=0x40000000
DESYNC_MARK_POSTNAT=0x20000000
NFQWS_OPT_DESYNC="--dpi-desync=fake,split2 --dpi-desync-ttl=3"
TPWS_OPT="--hostspell=HOST --split-http-req=method --split-pos=3 --oob"
FLOWOFFLOAD=donttouch
INIT_APPLY_FW=1
DISABLE_IPV6=0
'';
};
};
};
};
};
}

View file

@ -0,0 +1,5 @@
{ lib, ... }: {
imports = lib.fileset.toList (
# All default.nix files in ./.
lib.fileset.fileFilter (file: file.name == "default.nix") ./.);
}

View file

@ -0,0 +1,11 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.programs.fish;
in {
options = { module.programs.fish.enable = mkEnableOption ""; };
config = mkIf cfg.enable { programs.fish.enable = true; };
}

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.programs.git;
in {
options = { module.programs.git.enable = mkEnableOption ""; };
config = mkIf cfg.enable {
programs.git = {
enable = true;
package = pkgs.gitMinimal;
};
};
}

View file

@ -0,0 +1,17 @@
{ inputs, lib, config, ... }:
with lib;
let cfg = config.module.programs.hm;
in {
options = { module.programs.hm.enable = mkEnableOption ""; };
config = mkIf cfg.enable {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
};
};
}

View file

@ -0,0 +1,19 @@
{ inputs, pkgs, lib, config, ... }:
with lib;
let
cfg = config.module.programs.hyprland;
hpkg = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system};
in {
options = { module.programs.hyprland.enable = mkEnableOption ""; };
config = mkIf cfg.enable {
programs.hyprland = {
enable = true;
package = hpkg.hyprland;
portalPackage = hpkg.xdg-desktop-portal-hyprland;
};
};
}

View file

@ -0,0 +1,11 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.programs.light;
in {
options = { module.programs.light.enable = mkEnableOption ""; };
config = mkIf cfg.enable { programs.light.enable = true; };
}

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
with lib;
let
cfg = config.module.programs.nh;
usr = config.module.misc.users;
in {
options = { module.programs.nh.enable = mkEnableOption ""; };
config = mkIf cfg.enable {
programs.nh = {
enable = true;
flake = "/home/${usr.user}/.flake";
clean = {
enable = true;
extraArgs = "--keep-since 3d --keep 3";
};
};
};
}

View file

@ -0,0 +1,13 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.module.programs.packages;
in {
options = { module.programs.packages.enable = mkEnableOption ""; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ helix killall ];
};
}

View file

@ -0,0 +1,28 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.module.programs.steam;
in {
options = { module.programs.steam.enable = mkEnableOption ""; };
config = mkIf cfg.enable {
hardware.xone.enable = true;
programs = {
gamescope.enable = true;
steam = { # GAMING
enable = true;
package = pkgs.steam.override {
extraEnv = {
MANGOHUD = true;
OBS_VKCAPTURE = true;
RADV_TEX_ANISO = 16;
};
};
extraCompatPackages = with pkgs; [ proton-ge-bin ];
protontricks.enable = true;
};
};
};
}

View file

@ -0,0 +1,28 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.autocpu;
in {
options = { module.services.autocpu = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
services.auto-cpufreq = {
enable = true;
settings = {
charger = { # AC MODE
governor = "performance";
turbo = "auto";
};
battery = { # BAT MODE
governor = "powersave";
turbo = "auto";
energy_perf_bias = "balance_power";
platform_profile = "low-power";
enable_thresholds = true;
};
};
};
};
}

View file

@ -0,0 +1,11 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.dbus;
in {
options = { module.services.dbus = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable { services.dbus.implementation = "broker"; };
}

View file

@ -0,0 +1,6 @@
{ lib, ... }: {
imports = lib.fileset.toList (
# All default.nix files in ./.
lib.fileset.fileFilter (file: file.name == "default.nix") ./.);
}

View file

@ -0,0 +1,18 @@
{ lib, config, ... }:
with lib;
let
cfg = config.module.services.getty;
usr = config.module.misc.users;
in {
options = { module.services.getty = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
services.getty = {
autologinUser = usr.user;
greetingLine = "Good day my lord ahhhh";
};
};
}

View file

@ -0,0 +1,11 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.gvfs;
in {
options = { module.services.gvfs = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable { services.gvfs.enable = true; };
}

View file

@ -0,0 +1,63 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.tlp;
in {
options = { module.services.tlp = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
services = {
thermald.enable = true;
upower.enable = true;
fprintd = { # FINGER PRINT
enable = true;
package = pkgs.fprintd-tod;
tod = {
enable = true;
driver = pkgs.libfprint-2-tod1-vfs0090;
};
};
tlp = {
enable = true;
settings = {
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "balanced";
# CPU
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_performance";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 40;
# NETWORKING
WIFI_PWR_ON_AC = "off";
WIFI_PWR_ON_BAT = "on";
# GRAPHICS
RADEON_DPM_STATE_ON_AC = "performance";
RADEON_DPM_STATE_ON_BAT = "battery";
RADEON_POWER_PROFILE_ON_AC = "default";
RADEON_POWER_PROFILE_ON_BAT = "default";
# IDK
TLP_DEFAULT_MODE = "BAT";
RUNTIME_PM_ON_AC = "auto";
RUNTIME_PM_ON_BAT = "auto";
USB_AUTOSUSPEND = 0;
};
};
};
};
}

View file

@ -0,0 +1,11 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.polkit;
in {
options = { module.services.polkit = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable { security.polkit.enable = true; };
}

View file

@ -0,0 +1,11 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.printing;
in {
options = { module.services.printing = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable { services.printing.enable = true; };
}

View file

@ -0,0 +1,18 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.tailscale;
in {
options = { module.services.tailscale = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
services = {
tailscale = { # OWN VPN NETWORK
enable = true;
useRoutingFeatures = "both";
};
};
};
}

View file

@ -0,0 +1,23 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.xserver;
in {
options = { module.services.xserver = { enable = mkEnableOption ""; }; };
config = mkIf cfg.enable {
services = {
xserver = {
enable = true;
libinput.enable = true;
xkb = {
layout = "us";
variant = "qwerty";
options = "grp:caps_toggle";
};
};
};
};
}

View file

@ -0,0 +1,27 @@
{ lib, config, ... }:
with lib;
let cfg = config.module.services.zram;
in {
options = {
module.services.zram = {
enable = mkEnableOption "";
algo = mkOption {
type = types.str;
default = null;
};
};
};
config = mkIf cfg.enable {
zramSwap = {
enable = true;
priority = 1000;
algorithm = cfg.algo;
swapDevices = 1;
memoryPercent = 100;
};
};
}