This commit is contained in:
4DBug
2025-03-10 22:51:01 -05:00
parent e2157c935d
commit 9c9d7eaae0
14 changed files with 198 additions and 278 deletions

View File

@@ -1,12 +1,11 @@
{ config, lib, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
../../home/bug/.config/nixos/main.nix
/home/bug/nix/main.nix
];
# nix os release version
system.stateVersion = "24.11";
}
}

20
etc/nixos/flake.nix Normal file
View File

@@ -0,0 +1,20 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
flatpaks.url = "github:gmodena/nix-flatpak/?ref=latest";
};
outputs = inputs@{ self, nixpkgs, home-manager, flatpaks, ... }:
let
system = "x86_64-linux";
in
{
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
flatpaks.nixosModules.nix-flatpak
./configuration.nix
];
};
};
}

View File

@@ -1,39 +0,0 @@
# 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 = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/199c2e37-2d04-4e18-b92c-a1b4a6313519";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3F2C-36CC";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
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;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,10 +0,0 @@
{ config, lib, pkgs, ... }:
{
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
}

View File

@@ -1,33 +0,0 @@
{ config, lib, pkgs, ... }:
{
environment = {
# env
sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
NIXOS_OZONE_WL = "1";
};
# packages
systemPackages = with pkgs; [
rofi-wayland
waybar
swww
kitty
ags
gammastep
fcitx5
hypridle
easyeffects
wl-clipboard
foot
cliphist
slurp
grim
swappy
tesseract
hyprpicker
libnotify
];
};
}

View File

@@ -1,21 +0,0 @@
{ config, lib, pkgs, ... }:
{
hardware = {
# open gl
graphics.enable = true;
# nvidia drivers
nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# pipewire
pulseaudio.enable = false;
};
}

View File

@@ -1,21 +0,0 @@
{ config, lib, pkgs, ... }:
{
time.timeZone = "America/Chicago";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
}

View File

@@ -1,16 +0,0 @@
{ config, lib, pkgs, ... }:
{
imports = [
./boot.nix
./environment.nix
./hardware.nix
./locale.nix
./misc.nix
./networking.nix
./programs.nix
./services.nix
./users.nix
];
}

View File

@@ -1,18 +0,0 @@
{ config, lib, pkgs, ... }:
{
# portal
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# gnome autologin workaround
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
# unfree packages
nixpkgs.config.allowUnfree = true;
# pipewire
security.rtkit.enable = true;
}

View File

@@ -1,16 +0,0 @@
{ config, lib, pkgs, ... }:
{
networking = {
hostName = "nix";
networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Open ports in the firewall.
# firewall.allowedTCPPorts = [ ... ];
# firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# firewall.enable = false;
};
}

View File

@@ -1,23 +0,0 @@
{ config, lib, pkgs, ... }:
{
programs = {
# firefox
firefox.enable = true;
# steam
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
# hyprland
hyprland = {
enable = true;
# nvidiaPatches = true;
xwayland.enable = true;
};
};
}

View File

@@ -1,50 +0,0 @@
{ config, lib, pkgs, ... }:
{
services = {
# touchpad
libinput.enable = true;
# openssh
openssh.enable = true;
# printing
printing.enable = true;
# sound
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# jack.enable = true;
};
# auto login
displayManager.autoLogin = {
enable = true;
user = "bug";
};
# x11
xserver = {
enable = true;
# enable nvidia drivers
videoDrivers = ["nvidia"];
# x11 keymap
xkb = {
layout = "us";
variant = "";
};
# gnome de
desktopManager.gnome.enable = true;
displayManager.gdm.enable = true;
};
# flatpak
flatpak.enable = true;
};
}

View File

@@ -1,28 +0,0 @@
{ config, lib, pkgs, ... }:
{
users.users.bug = {
isNormalUser = true;
description = "Bug";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
vscodium
neofetch
git
btop
nodejs
luau
luajit
luarocks
nicotine-plus
discord
zed-editor
blender
plasticity
obs-studio
kdenlive
furnace
obsidian
];
};
}

176
main.nix Normal file
View File

@@ -0,0 +1,176 @@
{ config, lib, pkgs, ... }:
{
users.users.bug = {
isNormalUser = true;
description = "Bug";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
vscode
neofetch
git
nodejs
luau
luajit
luarocks
nicotine-plus
vesktop
blender
plasticity
obsidian
ollama
gnome-tweaks
syncthing
wine
furnace
python3
tree
];
};
programs = {
firefox.enable = true;
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# vim
# wget
];
services = {
flatpak = {
enable = true;
remotes = lib.mkOptionDefault [{
name = "flathub-beta";
location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo";
}];
update.auto.enable = false;
uninstallUnmanaged = false;
packages = [
{ appId = "com.github.tchx84.Flatseal"; origin = "flathub"; }
{ flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; sha256 = "1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; }
"dev.qwery.AddWater"
"com.jeffser.Alpaca"
"org.vinegarhq.Vinegar"
"com.bambulab.BambuStudio"
"com.boxy_svg.BoxySVG"
"org.gabmus.gfeeds"
"org.gnome.Decibels"
];
};
xserver = {
enable = true;
videoDrivers = ["nvidia"];
desktopManager.gnome.enable = true;
displayManager = {
gdm.enable = true;
autoLogin = {
enable = true;
user = "bug";
};
};
xkb = {
layout = "us";
variant = "";
};
};
printing.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
syncthing = {
enable = true;
user = "bug";
group = "users";
};
};
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking = {
hostName = "nix";
networkmanager.enable = true;
};
time.timeZone = "America/Chicago";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
hardware = {
pulseaudio.enable = false;
graphics = {
enable = true;
};
nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
security.rtkit.enable = true;
systemd = {
services."getty@tty1".enable = false;
services."autovt@tty1".enable = false;
user.services.sync = {
description = "initiate syncthing";
serviceConfig.PassEnvironment = "DISPLAY";
script = ''
syncthing
'';
wantedBy = [ "multi-user.target" ];
};
};
}