350 lines
8.7 KiB
Nix
350 lines
8.7 KiB
Nix
{ config, pkgs, ... }: {
|
||
imports = [
|
||
# Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
<home-manager/nixos>
|
||
];
|
||
|
||
boot = {
|
||
# Bootloader.
|
||
loader = {
|
||
grub = {
|
||
enable = true;
|
||
device = "/dev/sda";
|
||
};
|
||
#grub
|
||
};
|
||
kernelModules = [ "i2c-dev" "i2c-piix4" ];
|
||
};
|
||
|
||
networking = {
|
||
hostName = "nixos";
|
||
networkmanager.enable = true;
|
||
firewall.enable = false;
|
||
};
|
||
# Set your time zone.
|
||
time.timeZone = "America/Chicago";
|
||
|
||
# Select internationalisation properties.
|
||
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";
|
||
};
|
||
};
|
||
|
||
services = {
|
||
# Enable rgb controller
|
||
hardware.openrgb.enable = true;
|
||
# Enable CUPS to print documents.
|
||
|
||
# printing.enable = true;
|
||
|
||
# Enable sound with pipewire.
|
||
pipewire = {
|
||
enable = true;
|
||
alsa.enable = true;
|
||
alsa.support32Bit = true;
|
||
pulse.enable = true;
|
||
# If you want to use JACK applications, uncomment this
|
||
#jack.enable = true;
|
||
};
|
||
|
||
# Enable the X11 windowing system.
|
||
xserver = {
|
||
enable = true;
|
||
desktopManager.cinnamon.enable = true;
|
||
# desktopManager.xfce.enable = true;
|
||
|
||
videoDrivers = [ "nvidia" ];
|
||
|
||
# Enable touchpad support (enabled default in most desktopManager).
|
||
# libinput.enable = false;
|
||
|
||
# Configure keymap in X11
|
||
layout = "us";
|
||
xkbVariant = "";
|
||
|
||
# Auto log in
|
||
displayManager = {
|
||
lightdm.enable = true;
|
||
defaultSession = "cinnamon";
|
||
autoLogin = {
|
||
enable = true;
|
||
user = "able";
|
||
};
|
||
};
|
||
};
|
||
};
|
||
|
||
hardware = {
|
||
bluetooth.enable = true;
|
||
|
||
opengl.enable = true;
|
||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||
nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||
openrazer = {
|
||
enable = true;
|
||
users = [ "able" ];
|
||
};
|
||
pulseaudio.enable = false;
|
||
};
|
||
|
||
security.rtkit.enable = true;
|
||
|
||
sound.enable = true;
|
||
|
||
users.users.able = {
|
||
openssh.authorizedKeys.keys = [
|
||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE8hxhhfB2zomqQLw/o3MaFxHIhE9cfmuW55npfwVtOJ able@nixos"
|
||
];
|
||
|
||
isNormalUser = true;
|
||
description = "able";
|
||
extraGroups = [ "networkmanager" "wheel" ];
|
||
};
|
||
home-manager.users.able = { pkgs, ... }: {
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
# "https://rycee.gitlab.io/home-manager/options.html" # opt-dconf.settings
|
||
imports = [ ./dconf.nix ];
|
||
|
||
home.stateVersion = "22.11";
|
||
home.packages = with pkgs; [
|
||
cinnamon.nemo
|
||
|
||
dconf2nix
|
||
discord
|
||
|
||
flameshot
|
||
firefox
|
||
|
||
gimp
|
||
grapejuice
|
||
|
||
gzdoom
|
||
enyo-launcher
|
||
|
||
|
||
nixfmt
|
||
|
||
prismlauncher
|
||
|
||
llvmPackages_16.clangUseLLVM
|
||
|
||
obs-studio
|
||
openrgb
|
||
OVMFFull
|
||
|
||
qemu_full
|
||
rustup
|
||
steam
|
||
soundux
|
||
spotify
|
||
];
|
||
|
||
|
||
programs.bash = {
|
||
enable = true;
|
||
shellAliases = {
|
||
cinnaback = "dconf dump / | dconf2nix > dconf.nix";
|
||
rebuild = "sudo nixos-rebuild switch";
|
||
# Git commands
|
||
gcl = "git clone";
|
||
|
||
genpass = "strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo";
|
||
|
||
#################
|
||
# List Variants #
|
||
#################
|
||
la = "ls -a";
|
||
labc = "ls -lap --color";
|
||
|
||
};
|
||
|
||
initExtra = ''
|
||
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
|
||
up(){
|
||
local d=""
|
||
limit=$1
|
||
for ((i=1 ; i <= limit ; i++))
|
||
do
|
||
d=$d/..
|
||
done
|
||
d=$(echo $d | sed 's/^\///')
|
||
if [ -z "$d" ]; then
|
||
d=..
|
||
fi
|
||
cd $d
|
||
}
|
||
|
||
########
|
||
# ANSI #
|
||
########
|
||
RED="\[\e[0;38;5;196m\]"
|
||
GREEN="\[\e[0;92m\]"
|
||
BLUE="\[\e[0;38;5;51m\]"
|
||
GREY="\[\e[0;37m\]"
|
||
RESET="\[\e[0m\]"
|
||
|
||
#########
|
||
# PROMT #
|
||
#########
|
||
PROMPT="$RED~> $RESET"
|
||
LINE_ONE="[$GREEN\w$RESET]\n"
|
||
LINE_TWO="$GREEN\u$GREY@$BLUE\h $PROMPT"
|
||
PS1="$LINE_ONE$LINE_TWO"
|
||
PS2="$PROMPT"
|
||
|
||
#####################
|
||
# History managment #
|
||
#####################
|
||
# See: https://unix.stackexchange.com/questions/18212/bash-history-ignoredups-and-erasedups-setting-conflict-with-common-history
|
||
HISTCONTROL=ignoredboth:erasedups
|
||
shopt -s histappend
|
||
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
|
||
'';
|
||
|
||
};
|
||
programs.vscode = {
|
||
enable = true;
|
||
extensions = with pkgs.vscode-extensions; [
|
||
bbenoist.nix
|
||
b4dm4n.vscode-nixpkgs-fmt
|
||
eamodio.gitlens
|
||
mskelton.one-dark-theme
|
||
rust-lang.rust-analyzer
|
||
tamasfe.even-better-toml
|
||
mhutchie.git-graph
|
||
];
|
||
userSettings = {
|
||
rust-analyzer.check.command = "clippy";
|
||
files = {
|
||
autoSave = "off";
|
||
associations = {
|
||
"*.hbasm" = "asm-intel-x86-generic";
|
||
};
|
||
};
|
||
|
||
|
||
"[nix]".editor.tabSize = 2;
|
||
|
||
git.autofetch = true;
|
||
gitlens.showWelcomeOnInstall = false;
|
||
|
||
explorer.confirmDelete = false;
|
||
|
||
editor = {
|
||
multiCursorModifier = "ctrlCmd";
|
||
formatOnSave = true;
|
||
formatOnPaste = true;
|
||
find.addExtraSpaceOnTop = false;
|
||
tokenColorCustomizations = {
|
||
textMateRules = [
|
||
{
|
||
name = "One Dark italic";
|
||
scope = [
|
||
"comment"
|
||
"entity.other.attribute-name"
|
||
"keyword"
|
||
"markup.underline.link"
|
||
"storage.modifier"
|
||
"storage.type"
|
||
"string.url"
|
||
"variable.language.super"
|
||
"variable.language.this"
|
||
];
|
||
settings = {
|
||
fontStyle = "italic";
|
||
};
|
||
}
|
||
{
|
||
name = "One Dark italic reset";
|
||
scope = [
|
||
"keyword.operator"
|
||
"keyword.other.type"
|
||
"storage.modifier.import"
|
||
"storage.modifier.package"
|
||
"storage.type.built-in"
|
||
"storage.type.function.arrow"
|
||
"storage.type.generic"
|
||
"storage.type.java"
|
||
"storage.type.primitive"
|
||
];
|
||
settings = {
|
||
fontStyle = "";
|
||
};
|
||
}
|
||
];
|
||
};
|
||
};
|
||
window.zoomLevel = 2;
|
||
workbench.colorTheme = "One Dark";
|
||
|
||
};
|
||
};
|
||
|
||
programs.git = {
|
||
package = pkgs.gitAndTools.gitFull;
|
||
enable = true;
|
||
userName = "able";
|
||
userEmail = "abl3theabove@gmail.com";
|
||
signing = {
|
||
key = "";
|
||
signByDefault = false;
|
||
};
|
||
};
|
||
|
||
};
|
||
|
||
# Allow unfree packages
|
||
nixpkgs.config.allowUnfree = true;
|
||
# List packages installed in system profile. To search, run:
|
||
# $ nix search wget
|
||
environment.systemPackages = with pkgs;
|
||
[
|
||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||
# wget
|
||
];
|
||
|
||
# Some programs need SUID wrappers, can be configured further or are
|
||
# started in user sessions.
|
||
# programs.mtr.enable = true;
|
||
# programs.gnupg.agent = {
|
||
# enable = true;
|
||
# enableSSHSupport = true;
|
||
# };
|
||
|
||
# List services that you want to enable:
|
||
|
||
xdg.mime.defaultApplications = {
|
||
"application/pdf" = "firefox.desktop";
|
||
"inode/directory" = [ "nemo.desktop" "code.desktop" ];
|
||
};
|
||
|
||
# Enable the OpenSSH daemon.
|
||
# services.openssh.enable = true;
|
||
|
||
# Open ports in the firewall.
|
||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||
# Or disable the firewall altogether.
|
||
# networking.firewall.enable = false;
|
||
|
||
# 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. It‘s 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 = "22.11"; # Did you read the comment?
|
||
}
|