New Nix config
This commit is contained in:
@@ -4,24 +4,12 @@
|
||||
environment.shellAliases = {
|
||||
# Nix Commands
|
||||
"nix:rebuild" = "sudo nixos-rebuild switch";
|
||||
"nix:conf:edit" = "sudo nano ~/Developer/lavitz/configuration.nix";
|
||||
"nix:conf:sync" = "sudo rm -rf /etc/nixos/configuration.nix && sudo cp ~/Developer/lavitz/configuration.nix /etc/nixos/configuration.nix && sudo rm -rf /etc/nixos/modules && sudo cp -r ~/Developer/lavitz/modules /etc/nixos/";
|
||||
"nix:purge" = "sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
|
||||
"nix:update" = "sudo nixos-rebuild switch --upgrade";
|
||||
"nix:edit:boot" = "sudo nano ~/Developer/lavitz/modules/boot.nix";
|
||||
"nix:edit:net" = "sudo nano ~/Developer/lavitz/modules/networking.nix";
|
||||
"nix:edit:desktop" = "sudo nano ~/Developer/lavitz/modules/desktop.nix";
|
||||
"nix:edit:audio" = "sudo nano ~/Developer/lavitz/modules/audio.nix";
|
||||
"nix:edit:users" = "sudo nano ~/Developer/lavitz/modules/users.nix";
|
||||
"nix:edit:pkgs" = "sudo nano ~/Developer/lavitz/modules/packages.nix";
|
||||
"nix:edit:programs" = "sudo nano ~/Developer/lavitz/modules/programs.nix";
|
||||
"nix:edit:hardware" = "sudo nano ~/Developer/lavitz/modules/hardware.nix";
|
||||
"nix:edit:services" = "sudo nano ~/Developer/lavitz/modules/services.nix";
|
||||
"nix:edit:aliases" = "sudo nano ~/Developer/lavitz/modules/aliases.nix";
|
||||
"nix:conf:push" = "sudo rm -rf /etc/nixos/configuration.nix && sudo cp ~/Developer/lavitz/configuration.nix /etc/nixos/configuration.nix && sudo rm -rf /etc/nixos/modules && sudo cp -r ~/Developer/lavitz/modules /etc/nixos/ && cd ~/Developer/lavitz && git add -A && git commit -m \"$(date -u +%s)\" && git push";
|
||||
"nix:conf:pull" = "cd ~/Developer/lavitz && git pull && sudo rm -rf /etc/nixos/configuration.nix && sudo cp ~/Developer/lavitz/configuration.nix /etc/nixos/configuration.nix && sudo rm -rf /etc/nixos/modules && sudo cp -r ~/Developer/lavitz/modules /etc/nixos/";
|
||||
|
||||
# General Commands
|
||||
"nix:purge" = "sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
|
||||
"nix:edit" = "$EDITOR /etc/nixos";
|
||||
"nix:push" = "cd /etc/nixos && git add -A && git commit -m \"$(date -u +%s)\" && git push";
|
||||
"nix:pull" = "cd /etc/nixos && git pull";
|
||||
|
||||
"nf" = "neofetch";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Bootloader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Kernel
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelParams = [ "preempt=full" ];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
xdg.portal.config.common.default = [ "gnome" ];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvidia_drm" "nvidia_modeset" "nvidia" "nvidia_uvm"
|
||||
];
|
||||
|
||||
boot.kernelParams = [ "preempt=full" ];
|
||||
}
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable X11
|
||||
services.xserver.enable = true;
|
||||
|
||||
# Enable GNOME
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
};
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
# Configure XKB
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
# Enable CUPS for printing
|
||||
services.printing.enable = true;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable OpenGL
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Load nvidia driver for X and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
powerManagement.finegrained = false;
|
||||
gsp.enable = true;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
settings = import ../settings.nix;
|
||||
in
|
||||
{
|
||||
# Time zone
|
||||
time.timeZone = "America/Edmonton";
|
||||
time.timeZone = settings.timezone;
|
||||
|
||||
# Internationalization properties
|
||||
i18n.defaultLocale = "en_CA.UTF-8";
|
||||
i18n.defaultLocale = settings.locale;
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
settings = import ../settings.nix;
|
||||
in
|
||||
{
|
||||
networking.hostName = "lavitz";
|
||||
networking.hostName = settings.hostname;
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
@@ -91,4 +91,15 @@
|
||||
# GNOME extensions
|
||||
gnomeExtensions.appindicator
|
||||
];
|
||||
|
||||
# Programs with extra configuration
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
|
||||
programs.thunderbird.enable = true;
|
||||
programs.obs-studio.enable = true;
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Steam
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
|
||||
# Thunderbird
|
||||
programs.thunderbird.enable = true;
|
||||
|
||||
# OBS
|
||||
programs.obs-studio = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.obs-studio.package = (pkgs.obs-studio.override {
|
||||
cudaSupport = true;
|
||||
});
|
||||
}
|
||||
@@ -4,14 +4,6 @@
|
||||
# Enable the OpenSSH daemon
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Sleep config for NVIDIA
|
||||
systemd.sleep.extraConfig = ''
|
||||
AllowSuspend=yes
|
||||
AllowHibernation=no
|
||||
AllowHybridSleep=no
|
||||
AllowSuspendThenHibernate=no
|
||||
'';
|
||||
|
||||
# Tailscale
|
||||
services.tailscale.enable = true;
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
settings = import ../settings.nix;
|
||||
in
|
||||
{
|
||||
# Groups
|
||||
users.groups.plugdev = {
|
||||
gid = 69420;
|
||||
};
|
||||
users.groups.plugdev.gid = 69420;
|
||||
|
||||
# User Accounts
|
||||
users.users.atridad = {
|
||||
users.users.${settings.username} = {
|
||||
isNormalUser = true;
|
||||
description = "Atridad";
|
||||
extraGroups = [ "networkmanager" "wheel" "docker" "plugdev" ];
|
||||
description = settings.userDescription;
|
||||
extraGroups = settings.userGroups;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user