chore: wizdesk -> desktop; wizlap -> laptop

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2024-09-17 11:30:34 -03:00
parent 5b0e693498
commit 9e271f8c52
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
13 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,71 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/1f7083ba-4271-486e-a85c-8386f6287b0a";
fsType = "btrfs";
options = [ "subvol=root" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/1f7083ba-4271-486e-a85c-8386f6287b0a";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/1f7083ba-4271-486e-a85c-8386f6287b0a";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/D4D7-CD5F";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/mnt/internal" =
{ device = "/dev/disk/by-uuid/b8541c0d-9146-4388-b217-431f196957cc";
fsType = "ext4";
};
fileSystems."/mnt/ssd" =
{ device = "/dev/disk/by-uuid/f27f2224-d351-46fd-89f5-991de36166ad";
fsType = "ext4";
};
fileSystems."/mnt/extra" =
{ device = "/dev/disk/by-uuid/0d4ef3e0-7e7a-4a70-bbbc-040fe7aa7c2a";
fsType = "ext4";
};
fileSystems."/mnt/media" =
{ device = "/dev/disk/by-uuid/52c17b8b-46c1-4870-b86c-c3b9f4bd4434";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,28 @@
{ pkgs, ... }:
{
# Enable Zenergy
boot.extraModulePackages = [
(pkgs.callPackage ../kernel/zenergy.nix { kernel = pkgs.linux_zen; })
];
# Enable openrazer for managing Razer products' configuration
hardware.openrazer = {
enable = true;
users = [ "wizardlink" ];
};
services.udev = {
# Vial udev rule for Monsgeek M1
extraRules = ''
# Monsgeek M1
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="fffe", ATTRS{idProduct}=="0005", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';
# WB32 DFU rules - needed for flashing
packages = [ (pkgs.callPackage ./services/udev/wb32dfu.nix { }) ];
};
# enable a better driver for wireless xbox controllers.
hardware.xpadneo.enable = true;
}

134
specific/desktop/nixos.nix Normal file
View file

@ -0,0 +1,134 @@
{ ... }:
{
imports = [
../../modules/nixos
./hardware-configuration.nix
./hardware.nix
./services.nix
];
#
# NIXOS #
#
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05";
#
# SYSTEM #
#
# Configure options for mounted volumes.
fileSystems = {
"/".options = [ "compress=zstd" ];
"/home".options = [ "compress=zstd" ];
"/nix".options = [
"compress=zstd"
"noatime"
];
"/mnt/extra".options = [ "nofail" ];
"/mnt/internal".options = [ "nofail" ];
"/mnt/media".options = [ "nofail" ];
"/mnt/ssd".options = [ "nofail" ];
};
# Enable btrf's auto scrubbing of volumes.
services.btrfs.autoScrub = {
enable = true;
interval = "weekly";
fileSystems = [ "/" ];
};
networking.hostName = "wizdesk"; # Define your hostname.
# Open ports in the firewall.
networking.firewall = {
allowedTCPPorts = [
443 # SSL
6567 # Mindustry
80 # HTTP
3979 # OpenTTD
];
allowedUDPPorts = [
2626 # Dolphin emulator
27015 # Source games
28910 # Heretic II
6567 # Mindustry
8211 # Palworld
3979 # OpenTTD
];
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
} # KDEConnect
];
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
} # KDEConnect
];
};
# Define a user account. Don't forget to set a password with passwd.
users.users.wizardlink = {
createHome = true;
description = "Alexandre Cavalheiro";
extraGroups = [
"docker"
"gamemode"
"libvirtd"
"networkmanager"
"openrazer"
"postgresql"
"wheel"
];
initialPassword = "wizardlink";
isNormalUser = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDdGOyRbu6IOw9yqotxE6m7wCif7oP/2D0tlREa5Q6uo Alexandre Cavalheiro S. Tiago da Silva <contact@thewizard.link>"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIISfCUsZrnCMZapdrvkUCrdRiX+1xuZBdGrynNRzDI2v" # SpaceEEC
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPInBFp7zBLhFluoww65CZzcnMdhndTawBv8QYJ5s/Xt david.alejandro.rubio@gmail.com" # Kodehawa
];
};
# Set your time zone.
time.timeZone = "America/Sao_Paulo";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [
"C.UTF-8/UTF-8"
"en_GB.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ja_JP.UTF-8/UTF-8"
"pt_BR.UTF-8/UTF-8"
];
extraLocaleSettings = {
LANGUAGE = "en_US.UTF-8";
LC_ADDRESS = "en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "pt_BR.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "pt_BR.UTF-8";
LC_PAPER = "pt_BR.UTF-8";
LC_TELEPHONE = "pt_BR.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
};
}

View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
imports = [
./services/archi.nix
./services/caddy.nix
./services/forgejo.nix
./services/jellyfin.nix
];
services.postgresql = {
enable = true;
initialScript = pkgs.writeText "backend-initScript" ''
CREATE ROLE wizardlink WITH LOGIN SUPERUSER PASSWORD 'wizardlink' CREATEDB CREATEROLE REPLICATION;
CREATE DATABASE wizardlink;
GRANT ALL PRIVILEGES ON DATABASE wizardlink TO wizardlink;
'';
};
}

View file

@ -0,0 +1,20 @@
{
services.archisteamfarm = {
enable = true;
web-ui.enable = true;
bots.wizardlink = {
enabled = true;
username = "master1891891";
settings = {
CustomGamePlayedWhileFarming = "In the fields";
};
};
bots.zak = {
enabled = true;
username = "matheuszak";
};
};
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
# Enable polkit,
security.polkit.enable = true;
# Install an agent to interface with it.
environment.systemPackages = with pkgs; [ polkit_gnome ];
# And enable GNOME keyring for registering keys.
services.gnome.gnome-keyring.enable = true;
}

View file

@ -0,0 +1,42 @@
{ ... }:
{
services.caddy = {
enable = true;
email = "contact@thewizard.link";
virtualHosts."thewizard.link".extraConfig = ''
redir https://github.com/wizardlink/
header Strict-Transport-Security "max-age=63072000; includeSubDomains"
'';
virtualHosts."jellyfin.thewizard.link".extraConfig = ''
encode gzip
reverse_proxy 127.0.0.1:8096 {
flush_interval -1
}
'';
virtualHosts."jellyseerr.thewizard.link".extraConfig = ''
reverse_proxy http://127.0.0.1:5055
'';
virtualHosts."foundry.thewizard.link".extraConfig = ''
reverse_proxy 127.0.0.1:30000 {
flush_interval -1
}
'';
virtualHosts."map.thewizard.link".extraConfig = ''
reverse_proxy 192.168.0.100:8123
'';
virtualHosts."git.thewizard.link".extraConfig = ''
reverse_proxy 127.0.0.1:3788
'';
virtualHosts."files.thewizard.link".extraConfig = ''
root * /srv/files
file_server
'';
};
}

View file

@ -0,0 +1,28 @@
{
services.forgejo = {
enable = true;
lfs.enable = true;
settings = {
server = {
HTTP_PORT = 3788;
LANDING_PAGE = "explore";
ROOT_URL = "https://git.thewizard.link";
};
ui = {
# HACK: Unfortunately we need to manually put files in /var/lib/forgejo/custom/public/assets/css
# so this will break in a new system.
DEFAULT_THEME = "catppuccin-frappe-lavender";
THEMES = "forgejo-auto,forgejo-light,forgejo-dark,gitea-auto,gitea-light,gitea-dark,forgejo-auto-deuteranopia-protanopia,forgejo-light-deuteranopia-protanopia,forgejo-dark-deuteranopia-protanopia,forgejo-auto-tritanopia,forgejo-light-tritanopia,forgejo-dark-tritanopia,catppuccin-latte-rosewater,catppuccin-latte-flamingo,catppuccin-latte-pink,catppuccin-latte-mauve,catppuccin-latte-red,catppuccin-latte-maroon,catppuccin-latte-peach,catppuccin-latte-yellow,catppuccin-latte-green,catppuccin-latte-teal,catppuccin-latte-sky,catppuccin-latte-sapphire,catppuccin-latte-blue,catppuccin-latte-lavender,catppuccin-frappe-rosewater,catppuccin-frappe-flamingo,catppuccin-frappe-pink,catppuccin-frappe-mauve,catppuccin-frappe-red,catppuccin-frappe-maroon,catppuccin-frappe-peach,catppuccin-frappe-yellow,catppuccin-frappe-green,catppuccin-frappe-teal,catppuccin-frappe-sky,catppuccin-frappe-sapphire,catppuccin-frappe-blue,catppuccin-frappe-lavender,catppuccin-macchiato-rosewater,catppuccin-macchiato-flamingo,catppuccin-macchiato-pink,catppuccin-macchiato-mauve,catppuccin-macchiato-red,catppuccin-macchiato-maroon,catppuccin-macchiato-peach,catppuccin-macchiato-yellow,catppuccin-macchiato-green,catppuccin-macchiato-teal,catppuccin-macchiato-sky,catppuccin-macchiato-sapphire,catppuccin-macchiato-blue,catppuccin-macchiato-lavender,catppuccin-mocha-rosewater,catppuccin-mocha-flamingo,catppuccin-mocha-pink,catppuccin-mocha-mauve,catppuccin-mocha-red,catppuccin-mocha-maroon,catppuccin-mocha-peach,catppuccin-mocha-yellow,catppuccin-mocha-green,catppuccin-mocha-teal,catppuccin-mocha-sky,catppuccin-mocha-sapphire,catppuccin-mocha-blue,catppuccin-mocha-lavender";
};
service = {
DISABLE_REGISTRATION = true;
ENABLE_REVERSE_PROXY_AUTHENTICATION = true;
ENABLE_REVERSE_PROXY_AUTHENTICATION_API = true;
};
};
};
}

View file

@ -0,0 +1,31 @@
{ pkgs, ... }:
{
services.jellyfin = {
enable = true;
openFirewall = true;
user = "wizardlink";
package = pkgs.jellyfin.override {
jellyfin-web = pkgs.jellyfin-web.overrideAttrs (
final: prev: {
installPhase = ''
runHook preInstall
# Inject the skip intro button script.
sed -i "s#</head>#<script src=\"configurationpage?name=skip-intro-button.js\"></script></head>#" dist/index.html
mkdir -p $out/share
cp -a dist $out/share/jellyfin-web
runHook postInstall
'';
}
);
};
};
services.jellyseerr = {
enable = true;
openFirewall = true;
};
}

View file

@ -0,0 +1,19 @@
{
stdenv,
}:
stdenv.mkDerivation {
pname = "wb32dfu-udev-rules";
version = "0-unstable-2024-09-15";
src = ./.;
dontBuild = true;
installPhase = ''
runHook preInstall
install -D wb32dfu.rules $out/lib/udev/rules.d/50-wb32dfu.rules
runHook postInstall
'';
}

View file

@ -0,0 +1,2 @@
# WB32 DFU
SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess"