feat: initialize repo with NixOS and Home Manager configs

- Add .gitignore for common languages, tools, and OS/editor artifacts
- Configure .gitattributes for Git LFS (fonts, images, archives, ISOs)
- Add README with repo description
- Add flake.nix defining inputs and outputs for NixOS, Home Manager, and related modules
- Introduce home-manager configs:
  - Base home.nix with packages, services, and programs
  - Hyprland WM configuration (waybar, fuzzel, keybindings, theming)
  - Vim (nixvim) setup with LSP and plugins
  - Zsh setup with aliases, Oh My Zsh, clipboard helpers
  - Systemd user services (e.g., librespot)
- Add scripts (GPU monitor, RAM build helper, install automation)
- Add host configurations:
  - Nixbook (Apple laptop) with hardware, disko, and install script
  - Nixstation (desktop) with firewall, virtualization, Btrfs scrub timer
  - Nixtest (test VM) with QEMU + Alpine-based install test harness
  - Common modules (network, NVIDIA, rclone, screen, keychron, users)
- Include statix config for linting
This commit is contained in:
Thiago Sposito 2025-08-20 21:55:46 -03:00 committed by Thiago Alexandria Sposito
commit 095e9f4f6b
34 changed files with 1954 additions and 0 deletions

View file

@ -0,0 +1,170 @@
{ pkgs
, ...
}:
{
imports = [
../common/default.nix
../common/keychron.nix
../common/network.nix
../common/nvidia/default.nix
../common/rclone.nix
../common/screen.nix
./hardware-configuration.nix
];
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
};
environment = {
systemPackages = with pkgs; [
act
btrfs-progs
cudatoolkit
networkmanagerapplet
];
variables = {
NIXOS_HOST = "nixstation";
NIXOS_DE = "wayland";
};
sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_SESSION_TYPE = "wayland";
QT_QPA_PLATFORM = "wayland";
GDK_BACKEND = "wayland";
};
};
hardware = {
sane.enable = true;
graphics.enable = true;
};
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "pt_BR.UTF-8";
LC_IDENTIFICATION = "pt_BR.UTF-8";
LC_MEASUREMENT = "pt_BR.UTF-8";
LC_MONETARY = "pt_BR.UTF-8";
LC_NAME = "pt_BR.UTF-8";
LC_NUMERIC = "pt_BR.UTF-8";
LC_PAPER = "pt_BR.UTF-8";
LC_TELEPHONE = "pt_BR.UTF-8";
LC_TIME = "pt_BR.UTF-8";
};
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
11434
8888
8000
8080
];
};
nix = {
settings = {
auto-optimise-store = true;
};
};
programs = {
# steam = {
# enable = true;
# remotePlay.openFirewall = true;
# dedicatedServer.openFirewall = true;
# localNetworkGameTransfers.openFirewall = true;
# };
dconf.enable = true;
hyprland = {
enable = true;
withUWSM = true;
xwayland.enable = true;
};
virt-manager.enable = true;
};
# security.pam.services.gdm.enableGnomeKeyring = true;
security.rtkit.enable = true;
services = {
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
extraConfig = ''
[server]
allow-interfaces=wlp7s0
'';
};
earlyoom = {
enable = true;
freeMemThreshold = 5;
freeSwapThreshold = 10;
};
flatpak.enable = true;
greetd = {
enable = true;
settings.default_session = {
command = "${pkgs.hyprland}/bin/Hyprland";
user = "thiago";
};
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
systemd = {
services."getty@tty1".enable = false;
services."autovt@tty1".enable = false;
};
systemd.timers.btrfs-scrub = {
description = "Run Btrfs Scrub Daily";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
systemd.services = {
btrfs-scrub = {
description = "Daily Btrfs Scrub";
serviceConfig = {
Type = "oneshot";
Nice = 19;
IOSchedulingClass = "idle";
ExecStart = "${pkgs.btrfs-progs}/bin/btrfs scrub start -n 2 -B / && ${pkgs.btrfs-progs}/bin/btrfs scrub start -n 2 -B /mnt/hdd0";
};
};
};
system.stateVersion = "24.05"; # keep it!
time.timeZone = "America/Sao_Paulo";
virtualisation = {
vmware.host.enable = false;
spiceUSBRedirection.enable = true;
libvirtd = {
enable = true;
qemu.ovmf.enable = true;
qemu.package = pkgs.qemu_full;
};
};
zramSwap = {
enable = true;
memoryPercent = 30;
algorithm = "zstd";
};
}

View file

@ -0,0 +1,65 @@
{ config
, lib
, modulesPath
, ...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
"ahci"
];
kernelParams = [ "amd_pstate=active" ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/df74093a-637d-41a5-8c6a-2bf2dccc1506";
fsType = "btrfs";
options = [ "subvol=@" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/E9BA-D1A3";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
"/mnt/hdd0" = {
device = "/dev/disk/by-uuid/940353dd-5774-4577-aba3-516d3f9c404d";
fsType = "btrfs";
options = [ "defaults" ];
};
};
swapDevices = [ ];
networking = {
useDHCP = lib.mkDefault true;
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware = {
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
enableRedistributableFirmware = true;
bluetooth.enable = true;
};
services.blueman.enable = true;
}

View file

@ -0,0 +1,14 @@
cat << 'EOF' > /etc/motd
▗▖ ▗▖▗▄▄▄▖▗▖ ▗▖ ▗▄▄▖▗▄▄▄▖▗▄▖▗▄▄▄▖▗▄▄▄▖ ▗▄▖ ▗▖ ▗▖
▐▛▚▖▐▌ █ ▝▚▞▘ ▐▌ █ ▐▌ ▐▌ █ █ ▐▌ ▐▌▐▛▚▖▐▌
▐▌ ▝▜▌ █ ▐▌ ▝▀▚▖ █ ▐▛▀▜▌ █ █ ▐▌ ▐▌▐▌ ▝▜▌
▐▌ ▐▌▗▄█▄▖▗▞▘▝▚▖▗▄▄▞▘ █ ▐▌ ▐▌ █ ▗▄█▄▖▝▚▄▞▘▐▌ ▐▌
[ Ryzen 7 5700G ]-[64 Gb ]-[ RTX 3090]
┏┳┓┓ • ┏┓ •
┃ ┣┓┓┏┓┏┓┏┓ ┗┓┏┓┏┓┏┓╋┏┓
┻ ┛┗┗┗┻┗┫┗┛ ┗┛┣┛┗┛┛┗┗┗┛
┛ ┛
EOF