mirror of
https://git.sr.ht/~azikx/karbur
synced 2024-10-30 09:26:20 +00:00
Compare commits
2 commits
ce54edbf09
...
12fb173620
Author | SHA1 | Date | |
---|---|---|---|
azikx | 12fb173620 | ||
azikx | d2dac1d471 |
10
flake.nix
10
flake.nix
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
outputs = { nixpkgs, home-manager, ... }@inputs: {
|
||||
description = "azikx snowflake palace";
|
||||
|
||||
outputs = { nixpkgs, home-manager, flake-parts, ... }@inputs: {
|
||||
nixosConfigurations.karbur = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [ ./host ];
|
||||
|
@ -27,6 +29,10 @@
|
|||
yazi.url = "github:sxyazi/yazi";
|
||||
|
||||
# TWO LINE SOFTWARE
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -43,6 +49,8 @@
|
|||
url = "github:pyt0xic/hyprfocus";
|
||||
inputs.hyprland.follows = "hyprland";
|
||||
};
|
||||
|
||||
# WALLPAPERS
|
||||
walls = {
|
||||
url = "git+https://git.pub.solar/azikx/wallpapers?ref=main";
|
||||
flake = false;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
extraConfig = {
|
||||
color.ui = true;
|
||||
init.defaultBranch = "main";
|
||||
safe.directory = "/home/dragora/.flake";
|
||||
safe.directory = "*";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ in {
|
|||
# MPV & ANIME
|
||||
"nodim, ${cl}(mpv)$"
|
||||
"float, ${cl}(anicliru)$"
|
||||
"size 660 630, ${cl}(anicliru)$"
|
||||
"size 810 630, ${cl}(anicliru)$"
|
||||
"bordercolor rgb(${base08}) rgb(${base09}) 45deg, ${cl}(anicliru)$"
|
||||
|
||||
# KOMIKKU
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./torrserver
|
||||
|
||||
./locale.nix
|
||||
./nh.nix
|
||||
./nix.nix
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{ ... }: {
|
||||
programs.nh = { # NIX HELPER
|
||||
enable = true;
|
||||
clean.enable = true;
|
||||
clean.extraArgs = "--keep-since 4d --keep 3";
|
||||
flake = "/home/dragora/.flake";
|
||||
clean = {
|
||||
enable = true;
|
||||
extraArgs = "--keep-since 4d --keep 3";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
];
|
||||
trusted-users = [ "dragora" "@wheel" ];
|
||||
trusted-users = [ "@wheel" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,32 +1,12 @@
|
|||
{ pkgs, inputs, lib, ... }:
|
||||
{ pkgs, inputs, ... }:
|
||||
let hpkg = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
in {
|
||||
# OS PACKAGES
|
||||
nixpkgs = { hostPlatform = lib.mkDefault "x86_64-linux"; };
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
helix
|
||||
hyprland
|
||||
home-manager
|
||||
# (callPackage ./torrserver/package.nix { })
|
||||
];
|
||||
environment.systemPackages = with pkgs; [ git helix home-manager ];
|
||||
|
||||
# PROGRAMS ENABLE
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
gamescope.enable = true;
|
||||
steam = {
|
||||
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;
|
||||
};
|
||||
hyprland = {
|
||||
enable = true;
|
||||
package = hpkg.hyprland;
|
||||
|
|
|
@ -1,30 +1,32 @@
|
|||
{ ... }: {
|
||||
{ comp, ... }: {
|
||||
security = {
|
||||
sudo.enable = true;
|
||||
doas = { # VERY TOP
|
||||
enable = true;
|
||||
wheelNeedsPassword = true;
|
||||
extraRules = [{
|
||||
users = [ "dragora" ];
|
||||
users = [ comp.user ];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}];
|
||||
extraConfig = ''
|
||||
permit nopass dragora as root cmd light
|
||||
permit nopass dragora as root cmd tee
|
||||
permit nopass ${comp.user} as root cmd light
|
||||
permit nopass ${comp.user} as root cmd tee
|
||||
'';
|
||||
};
|
||||
sudo-rs = {
|
||||
enable = true;
|
||||
sudo-rs = { # FAST SUDO
|
||||
enable = false;
|
||||
wheelNeedsPassword = true;
|
||||
extraRules = [{
|
||||
groups = [ "sudo" ];
|
||||
commands = [ "ALL" ];
|
||||
}
|
||||
# {
|
||||
# users = [ "megamozg" ];
|
||||
# commands = [ "light" "tee" ];
|
||||
# }
|
||||
];
|
||||
extraRules = [
|
||||
{
|
||||
groups = [ "sudo" ];
|
||||
commands = [ "ALL" ];
|
||||
}
|
||||
{
|
||||
groups = [ "wheel" ];
|
||||
commands = [ "light" "tee" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
polkit = { enable = true; };
|
||||
};
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{ pkgs, ... }: {
|
||||
{ pkgs, comp, ... }: {
|
||||
system.stateVersion = "24.05";
|
||||
users = {
|
||||
users = { # USERS
|
||||
dragora = {
|
||||
"${comp.user}" = {
|
||||
shell = pkgs.fish;
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "networkmanager" "wheel" "video" ];
|
||||
|
|
8
host/specific/comp/default.nix
Normal file
8
host/specific/comp/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./modules
|
||||
|
||||
./torrserver
|
||||
../../default.nix
|
||||
];
|
||||
}
|
1
host/specific/comp/modules/default.nix
Normal file
1
host/specific/comp/modules/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ imports = [ ./disks.nix ./hardware.nix ./user-like.nix ]; }
|
19
host/specific/comp/modules/hardware.nix
Normal file
19
host/specific/comp/modules/hardware.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, ... }: {
|
||||
hardware = {
|
||||
# AND VIDEOCARD DRIVE (maybe)
|
||||
amdgpu = {
|
||||
amdvlk = {
|
||||
enable = true;
|
||||
supportExperimental.enable = true;
|
||||
support32Bit.enable = true;
|
||||
};
|
||||
};
|
||||
# PROCCESOR
|
||||
cpu.amd = {
|
||||
updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
ryzen-smu.enable = true;
|
||||
};
|
||||
xone.enable = true;
|
||||
};
|
||||
}
|
20
host/specific/comp/modules/user-like.nix
Normal file
20
host/specific/comp/modules/user-like.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, comp, ... }: {
|
||||
networking.hostName = comp.host;
|
||||
services.getty.autologinUser = comp.user;
|
||||
programs = {
|
||||
nh.flake = "/home/${comp.user}/.flake"; # NIX-HELPER
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./disks.nix
|
||||
./hardware.nix
|
||||
./services.nix
|
||||
./network.nix
|
||||
./services.nix
|
||||
./sound.nix
|
||||
./minimal.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,30 +1,20 @@
|
|||
{ config, lib, ... }: {
|
||||
{ pkgs, ... }: {
|
||||
hardware = {
|
||||
# AND VIDEOCARD DRIVE (maybe)
|
||||
amdgpu = {
|
||||
# opencl.enable = true;
|
||||
amdvlk = {
|
||||
enable = true;
|
||||
supportExperimental.enable = true;
|
||||
support32Bit.enable = true;
|
||||
};
|
||||
};
|
||||
# OPENGL
|
||||
graphics = {
|
||||
graphics = { # GPU
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
# PROCCESOR
|
||||
cpu.amd = {
|
||||
updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
ryzen-smu.enable = true;
|
||||
extraPackages = with pkgs; [ amdvlk ];
|
||||
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
|
||||
};
|
||||
# BLUETOOTH
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
|
||||
xone.enable = true;
|
||||
system76.enableAll = true;
|
||||
firmware = [ pkgs.linux-firmware ];
|
||||
};
|
||||
}
|
||||
|
|
9
host/system/minimal.nix
Normal file
9
host/system/minimal.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
documentation = {
|
||||
enable = false;
|
||||
doc.enable = false;
|
||||
info.enable = false;
|
||||
man.enable = false;
|
||||
nixos.enable = false;
|
||||
};
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
{ lib, ... }: {
|
||||
networking = { # NETWORK
|
||||
hostName = "karbur";
|
||||
networkmanager = { # NETWORK MANAGER
|
||||
enable = true;
|
||||
insertNameservers = [ "1.1.1.1" "1.0.0.1" ];
|
||||
|
@ -9,6 +8,5 @@
|
|||
};
|
||||
useDHCP = lib.mkDefault true;
|
||||
nftables.enable = true;
|
||||
# resolvconf.dnsSingleRequest = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{ ... }: {
|
||||
services = { # SERVICES
|
||||
getty.autologinUser = "dragora";
|
||||
xserver = { # XORG?
|
||||
xkb = {
|
||||
layout = "us";
|
||||
|
|
8
modules(WIP)/host/default.nix
Normal file
8
modules(WIP)/host/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ systemModules, lib, ... }:
|
||||
|
||||
{
|
||||
# Read all directories from systemModules
|
||||
imports = builtins.filter (module: lib.pathIsDirectory module)
|
||||
(map (module: "${systemModules}/${module}")
|
||||
(builtins.attrNames (builtins.readDir systemModules)));
|
||||
}
|
20
modules(WIP)/host/hardware/bluetooth/default.nix
Normal file
20
modules(WIP)/host/hardware/bluetooth/default.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
65
modules(WIP)/host/hardware/boot/default.nix
Normal file
65
modules(WIP)/host/hardware/boot/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
16
modules(WIP)/host/hardware/cpu/default.nix
Normal file
16
modules(WIP)/host/hardware/cpu/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
9
modules(WIP)/host/hardware/default.nix
Normal file
9
modules(WIP)/host/hardware/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ systemModules, lib, ... }:
|
||||
|
||||
let hostProgramModulesPath = "${systemModules}/hardware";
|
||||
in {
|
||||
imports = builtins.filter (module: lib.pathIsDirectory module)
|
||||
(map (module: "${hostProgramModulesPath}/${module}")
|
||||
(builtins.attrNames (builtins.readDir hostProgramModulesPath)));
|
||||
}
|
||||
|
25
modules(WIP)/host/hardware/gpu/default.nix
Normal file
25
modules(WIP)/host/hardware/gpu/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.hardware.graphics;
|
||||
in {
|
||||
options = { module.hardware.graphics.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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
37
modules(WIP)/host/hardware/network/default.nix
Normal file
37
modules(WIP)/host/hardware/network/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ lib, config, hostname, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.hardware.network;
|
||||
in {
|
||||
options = { module.hardware.network.enable = mkEnableOption ""; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.resolved.enable = true;
|
||||
systemd.services = { # IDK
|
||||
NetworkManager-wait-online.enable = false;
|
||||
systemd-networkd-wait-online.enable = mkForce false;
|
||||
};
|
||||
|
||||
networking = { # FOR NETWORK
|
||||
hostName = hostname;
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
insertNameservers = [ "1.1.1.1" "1.0.0.1" ];
|
||||
dns = "systemd-resolved";
|
||||
wifi = {
|
||||
powersave = true;
|
||||
macAddress = "random";
|
||||
backend = "iwd";
|
||||
};
|
||||
};
|
||||
wireless.iwd = {
|
||||
enable = true;
|
||||
settings = { Settings = { AutoConnect = true; }; };
|
||||
};
|
||||
useDHCP = mkDefault true;
|
||||
nftables.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
34
modules(WIP)/host/hardware/security/default.nix
Normal file
34
modules(WIP)/host/hardware/security/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ lib, config, username, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.hardware.security;
|
||||
in {
|
||||
options = { module.hardware.security.enable = mkEnableOption ""; };
|
||||
|
||||
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 = [ username ];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}];
|
||||
};
|
||||
pam.services = {
|
||||
gtklock = { };
|
||||
swaylock = { };
|
||||
hyprlock = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
27
modules(WIP)/host/hardware/sound/default.nix
Normal file
27
modules(WIP)/host/hardware/sound/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
9
modules(WIP)/host/misc/default.nix
Normal file
9
modules(WIP)/host/misc/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ systemModules, lib, ... }:
|
||||
|
||||
let hostProgramModulesPath = "${systemModules}/misc";
|
||||
in {
|
||||
imports = builtins.filter (module: lib.pathIsDirectory module)
|
||||
(map (module: "${hostProgramModulesPath}/${module}")
|
||||
(builtins.attrNames (builtins.readDir hostProgramModulesPath)));
|
||||
}
|
||||
|
18
modules(WIP)/host/misc/locales/default.nix
Normal file
18
modules(WIP)/host/misc/locales/default.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
21
modules(WIP)/host/misc/minimal/default.nix
Normal file
21
modules(WIP)/host/misc/minimal/default.nix
Normal 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;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
16
modules(WIP)/host/misc/power/default.nix
Normal file
16
modules(WIP)/host/misc/power/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
25
modules(WIP)/host/misc/system76/default.nix
Normal file
25
modules(WIP)/host/misc/system76/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
27
modules(WIP)/host/misc/torrserver/default.nix
Normal file
27
modules(WIP)/host/misc/torrserver/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
27
modules(WIP)/host/misc/torrserver/package.nix
Normal file
27
modules(WIP)/host/misc/torrserver/package.nix
Normal 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";
|
||||
};
|
||||
}
|
30
modules(WIP)/host/misc/users/default.nix
Normal file
30
modules(WIP)/host/misc/users/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, lib, config, username, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.misc.users;
|
||||
in {
|
||||
options = { module.misc.users.enable = mkEnableOption ""; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
defaultUserShell = pkgs.fish;
|
||||
groups = { ${username} = { gid = 1000; }; };
|
||||
users = {
|
||||
root.useDefaultShell = true;
|
||||
${username} = {
|
||||
uid = 1000;
|
||||
home = "/home/${username}";
|
||||
group = "${username}";
|
||||
useDefaultShell = true;
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
extraGroups =
|
||||
[ "video" "audio" "networkmanager" "wheel" "docker" "libvirtd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
30
modules(WIP)/host/misc/variables/default.nix
Normal file
30
modules(WIP)/host/misc/variables/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ lib, config, username, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.misc.variables;
|
||||
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/${username}/.flake";
|
||||
QT_QPA_PLATFORMTHEME = "gtk3";
|
||||
TDESKTOP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY = "1";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
57
modules(WIP)/host/misc/zapret/default.nix
Normal file
57
modules(WIP)/host/misc/zapret/default.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
9
modules(WIP)/host/programs/default.nix
Normal file
9
modules(WIP)/host/programs/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ systemModules, lib, ... }:
|
||||
|
||||
let hostProgramModulesPath = "${systemModules}/programs";
|
||||
in {
|
||||
imports = builtins.filter (module: lib.pathIsDirectory module)
|
||||
(map (module: "${hostProgramModulesPath}/${module}")
|
||||
(builtins.attrNames (builtins.readDir hostProgramModulesPath)));
|
||||
}
|
||||
|
11
modules(WIP)/host/programs/fish/default.nix
Normal file
11
modules(WIP)/host/programs/fish/default.nix
Normal 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; };
|
||||
}
|
||||
|
16
modules(WIP)/host/programs/git/default.nix
Normal file
16
modules(WIP)/host/programs/git/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
17
modules(WIP)/host/programs/hm/default.nix
Normal file
17
modules(WIP)/host/programs/hm/default.nix
Normal 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; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
16
modules(WIP)/host/programs/hyprland/default.nix
Normal file
16
modules(WIP)/host/programs/hyprland/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.programs.hyprland;
|
||||
in {
|
||||
options = { module.programs.hyprland.enable = mkEnableOption ""; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
11
modules(WIP)/host/programs/light/default.nix
Normal file
11
modules(WIP)/host/programs/light/default.nix
Normal 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; };
|
||||
}
|
||||
|
20
modules(WIP)/host/programs/nh/default.nix
Normal file
20
modules(WIP)/host/programs/nh/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ lib, config, username, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.programs.nh;
|
||||
in {
|
||||
options = { module.programs.nh.enable = mkEnableOption ""; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = "/home/${username}/.flake";
|
||||
clean = {
|
||||
enable = true;
|
||||
extraArgs = "--keep-since 3d --keep 3";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
13
modules(WIP)/host/programs/packages/default.nix
Normal file
13
modules(WIP)/host/programs/packages/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
||||
|
28
modules(WIP)/host/programs/steam/default.nix
Normal file
28
modules(WIP)/host/programs/steam/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
28
modules(WIP)/host/services/autocpu/default.nix
Normal file
28
modules(WIP)/host/services/autocpu/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
11
modules(WIP)/host/services/dbus/default.nix
Normal file
11
modules(WIP)/host/services/dbus/default.nix
Normal 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"; };
|
||||
}
|
||||
|
9
modules(WIP)/host/services/default.nix
Normal file
9
modules(WIP)/host/services/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ systemModules, lib, ... }:
|
||||
|
||||
let hostServicesModulesPath = "${systemModules}/services";
|
||||
in {
|
||||
imports = builtins.filter (module: lib.pathIsDirectory module)
|
||||
(map (module: "${hostServicesModulesPath}/${module}")
|
||||
(builtins.attrNames (builtins.readDir hostServicesModulesPath)));
|
||||
}
|
||||
|
16
modules(WIP)/host/services/getty/default.nix
Normal file
16
modules(WIP)/host/services/getty/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ lib, config, username, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.services.getty;
|
||||
in {
|
||||
options = { module.services.getty.enable = mkEnableOption ""; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.getty = {
|
||||
autologinUser = username;
|
||||
greetingLine = "Good day my lord ahhhh";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
11
modules(WIP)/host/services/gvfs/default.nix
Normal file
11
modules(WIP)/host/services/gvfs/default.nix
Normal 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; };
|
||||
}
|
||||
|
63
modules(WIP)/host/services/laptop/default.nix
Normal file
63
modules(WIP)/host/services/laptop/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
11
modules(WIP)/host/services/polkit/default.nix
Normal file
11
modules(WIP)/host/services/polkit/default.nix
Normal 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; };
|
||||
}
|
||||
|
11
modules(WIP)/host/services/printing/default.nix
Normal file
11
modules(WIP)/host/services/printing/default.nix
Normal 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; };
|
||||
}
|
||||
|
18
modules(WIP)/host/services/syncthing/default.nix
Normal file
18
modules(WIP)/host/services/syncthing/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ lib, config, username, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.services.syncthing;
|
||||
in {
|
||||
options = { module.services.syncthing.enable = mkEnableOption ""; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.syncthing = {
|
||||
enable = false;
|
||||
user = username;
|
||||
dataDir = "/home/${username}/.obsidian/obsidian";
|
||||
configDir = "/home/${username}/.config/syncthing";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
18
modules(WIP)/host/services/tailscale/default.nix
Normal file
18
modules(WIP)/host/services/tailscale/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
23
modules(WIP)/host/services/xserver/default.nix
Normal file
23
modules(WIP)/host/services/xserver/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
19
modules(WIP)/host/services/zram/default.nix
Normal file
19
modules(WIP)/host/services/zram/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.module.services.zram;
|
||||
in {
|
||||
options = { module.services.zram.enable = mkEnableOption ""; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
priority = 1000;
|
||||
algorithm = "zstd";
|
||||
swapDevices = 1;
|
||||
memoryPercent = 100;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in a new issue