Config overhaul
This commit is contained in:
29
modules/aliases.nix
Normal file
29
modules/aliases.nix
Normal file
@ -0,0 +1,29 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.shellAliases = {
|
||||
# Help command - shows all available nix commands
|
||||
"nix:help" = "echo '\n🔧 NixOS Configuration Commands:\n\n📋 Basic Operations:\n nix:rebuild - Rebuild and switch to new configuration\n nix:conf:edit - Edit the main configuration file\n nix:conf:sync - Sync local config to /etc/nixos/ without rebuild\n\n📝 Module Editing:\n nix:edit:boot - Edit boot configuration\n nix:edit:net - Edit networking configuration\n nix:edit:desktop - Edit desktop configuration\n nix:edit:audio - Edit audio configuration\n nix:edit:users - Edit user configuration\n nix:edit:pkgs - Edit packages configuration\n nix:edit:programs - Edit programs configuration\n nix:edit:hardware - Edit hardware configuration\n nix:edit:services - Edit services configuration\n nix:edit:aliases - Edit aliases configuration\n\n🔄 Git Operations:\n nix:conf:push - Copy config to /etc/nixos/, commit changes, and push to remote\n nix:conf:pull - Pull latest changes from remote and sync to /etc/nixos/\n\n💡 Use nix:help to see this list anytime!\n'";
|
||||
|
||||
# Basic operations
|
||||
"nix:rebuild" = "sudo nixos-rebuild switch";
|
||||
"nix:conf:edit" = "sudo nano ~/Developer/nix/configuration.nix";
|
||||
"nix:conf:sync" = "sudo rm -rf /etc/nixos/configuration.nix && sudo cp ~/Developer/nix/configuration.nix /etc/nixos/configuration.nix && sudo rm -rf /etc/nixos/modules && sudo cp -r ~/Developer/nix/modules /etc/nixos/";
|
||||
|
||||
# Module editing shortcuts
|
||||
"nix:edit:boot" = "sudo nano ~/Developer/nix/modules/boot.nix";
|
||||
"nix:edit:net" = "sudo nano ~/Developer/nix/modules/networking.nix";
|
||||
"nix:edit:desktop" = "sudo nano ~/Developer/nix/modules/desktop.nix";
|
||||
"nix:edit:audio" = "sudo nano ~/Developer/nix/modules/audio.nix";
|
||||
"nix:edit:users" = "sudo nano ~/Developer/nix/modules/users.nix";
|
||||
"nix:edit:pkgs" = "sudo nano ~/Developer/nix/modules/packages.nix";
|
||||
"nix:edit:programs" = "sudo nano ~/Developer/nix/modules/programs.nix";
|
||||
"nix:edit:hardware" = "sudo nano ~/Developer/nix/modules/hardware.nix";
|
||||
"nix:edit:services" = "sudo nano ~/Developer/nix/modules/services.nix";
|
||||
"nix:edit:aliases" = "sudo nano ~/Developer/nix/modules/aliases.nix";
|
||||
|
||||
# Git operations
|
||||
"nix:conf:push" = "sudo rm -rf /etc/nixos/configuration.nix && sudo cp ~/Developer/nix/configuration.nix /etc/nixos/configuration.nix && sudo rm -rf /etc/nixos/modules && sudo cp -r ~/Developer/nix/modules /etc/nixos/ && cd ~/Developer/nix && git add -A && git commit -m \"$(date -u +%s)\" && git push";
|
||||
"nix:conf:pull" = "cd ~/Developer/nix && git pull && sudo rm -rf /etc/nixos/configuration.nix && sudo cp ~/Developer/nix/configuration.nix /etc/nixos/configuration.nix && sudo rm -rf /etc/nixos/modules && sudo cp -r ~/Developer/nix/modules /etc/nixos/";
|
||||
};
|
||||
}
|
19
modules/audio.nix
Normal file
19
modules/audio.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable sound with pipewire
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
}
|
10
modules/boot.nix
Normal file
10
modules/boot.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Bootloader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Use latest kernel
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
}
|
22
modules/desktop.nix
Normal file
22
modules/desktop.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable the X11 windowing system
|
||||
services.xserver.enable = true;
|
||||
|
||||
# Enable the GNOME Desktop Environment
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
# Enable CUPS to print documents
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager)
|
||||
# services.xserver.libinput.enable = true;
|
||||
}
|
21
modules/hardware.nix
Normal file
21
modules/hardware.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable OpenGL
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Load nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
powerManagement.finegrained = false;
|
||||
gsp.enable = true;
|
||||
open = true;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
};
|
||||
}
|
9
modules/locale.nix
Normal file
9
modules/locale.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Time zone
|
||||
time.timeZone = "America/Edmonton";
|
||||
|
||||
# Internationalization properties
|
||||
i18n.defaultLocale = "en_CA.UTF-8";
|
||||
}
|
20
modules/networking.nix
Normal file
20
modules/networking.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Networking configuration
|
||||
networking.hostName = "lavitz"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
}
|
32
modules/packages.nix
Normal file
32
modules/packages.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# System packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Browsers and communication
|
||||
vivaldi
|
||||
discord
|
||||
signal-desktop-bin
|
||||
|
||||
# Development tools
|
||||
zed-editor
|
||||
git
|
||||
go
|
||||
nodejs_24
|
||||
zig
|
||||
python3Full
|
||||
openssh
|
||||
|
||||
# Desktop applications
|
||||
bitwarden-desktop
|
||||
ghostty
|
||||
spotify
|
||||
vlc
|
||||
|
||||
# GNOME extensions
|
||||
gnomeExtensions.appindicator
|
||||
];
|
||||
}
|
11
modules/programs.nix
Normal file
11
modules/programs.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Steam
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
};
|
||||
}
|
14
modules/services.nix
Normal file
14
modules/services.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable the OpenSSH daemon
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Sleep configuration
|
||||
systemd.sleep.extraConfig = ''
|
||||
AllowSuspend=no
|
||||
AllowHibernation=no
|
||||
AllowHybridSleep=no
|
||||
AllowSuspendThenHibernate=no
|
||||
'';
|
||||
}
|
13
modules/users.nix
Normal file
13
modules/users.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
users.users.atridad = {
|
||||
isNormalUser = true;
|
||||
description = "Atridad";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [
|
||||
# thunderbird
|
||||
];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user