Add sensible config at the expense of sanity.
This commit is contained in:
parent
f0a58a383c
commit
18276927d7
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
nvf-stuff
|
||||
config-nixvim
|
||||
result
|
@ -1,215 +0,0 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./cachix.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "nixos"; # 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;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Denver";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.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";
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
|
||||
# Enable the KDE Plasma Desktop Environment.
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
layout = "us";
|
||||
xkbVariant = "";
|
||||
};
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.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;
|
||||
};
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.xserver.libinput.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.nixxer = {
|
||||
isNormalUser = true;
|
||||
description = "nixxer";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [
|
||||
kate
|
||||
# thunderbird
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
# Install firefox.
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix _12_3search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
neovim
|
||||
fastfetch
|
||||
wget
|
||||
discord-canary
|
||||
pavucontrol
|
||||
cudaPackages_12.cudatoolkit
|
||||
python3
|
||||
|
||||
|
||||
# VSCode installation and extensions
|
||||
(vscode-with-extensions.override {
|
||||
vscodeExtensions = with vscode-extensions; [
|
||||
ms-vscode.cpptools
|
||||
bbenoist.nix
|
||||
ms-python.python
|
||||
ms-azuretools.vscode-docker
|
||||
ms-vscode-remote.remote-ssh
|
||||
vscode-extensions.vscodevim.vim
|
||||
vscode-extensions.enkia.tokyo-night
|
||||
|
||||
#vscode-extensions.hikarin522.glassit
|
||||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
name = "remote-ssh-edit";
|
||||
publisher = "ms-vscode-remote";
|
||||
version = "0.47.2";
|
||||
sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
|
||||
}
|
||||
{
|
||||
name = "glassit";
|
||||
publisher = "s-nlf-fh";
|
||||
version = "0.2.6";
|
||||
sha256 = "LcAomgK91hnJWqAW4I0FAgTOwr8Kwv7ZhvGCgkokKuY=";
|
||||
}
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
# NVIDIA stuff
|
||||
hardware.nvidia = {
|
||||
|
||||
# Modesetting is required.
|
||||
modesetting.enable = true;
|
||||
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
||||
# of just the bare essentials.
|
||||
powerManagement.enable = false;
|
||||
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
||||
open = false;
|
||||
|
||||
# Enable the Nvidia settings menu,
|
||||
# accessible via `nvidia-settings`.
|
||||
nvidiaSettings = true;
|
||||
|
||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
||||
hardware.pulseaudio.extraModules = [ pkgs.pulseaudio-modules-bt ];
|
||||
|
||||
# Nvidia driver for X
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
# 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:
|
||||
|
||||
# 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 = "23.11"; # Did you read the comment?
|
||||
|
||||
}
|
48
flake.lock
generated
Executable file
48
flake.lock
generated
Executable file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"nodes": {
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738275749,
|
||||
"narHash": "sha256-PM+cGduJ05EZ+YXulqAwUFjvfKpPmW080mcuN6R1POw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "a8159195bfaef3c64df75d3b1e6a68d49d392be9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1738142207,
|
||||
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
81
flake.nix
Executable file
81
flake.nix
Executable file
@ -0,0 +1,81 @@
|
||||
{
|
||||
description = "My system configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# nixvim = {
|
||||
# url = "github:xbazzi/nixvim";
|
||||
# };
|
||||
|
||||
# nvf = {
|
||||
# url = "github:notashelf/nvf";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# };
|
||||
|
||||
#stylix.url = "github:danth/stylix";
|
||||
|
||||
# nixvim = {
|
||||
# url = "github:xbazzi/nixvim-config";
|
||||
# };
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; };
|
||||
# configModule = {
|
||||
# # Add any custom options (and do feel free to upstream them!)
|
||||
# # options = { ... };
|
||||
|
||||
# # config.vim = {
|
||||
# # theme.enable = true;
|
||||
# # # and more options as you see fit...
|
||||
# # };
|
||||
# };
|
||||
|
||||
in
|
||||
{
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.neovim pkgs.vim
|
||||
];
|
||||
shellHook = ''
|
||||
echo "hello"
|
||||
'';
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
nixos = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./system/default.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"xbazzi@nixos" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./home/default.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
home-manager.users.xbazzi = {
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
#home.packages = [
|
||||
#];
|
||||
};
|
||||
#home-manager.extraSpecialArgs
|
||||
};
|
||||
}
|
17
home/bash.nix
Executable file
17
home/bash.nix
Executable file
@ -0,0 +1,17 @@
|
||||
{
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
shellAliases =
|
||||
let
|
||||
flakePath = "~/nixos-config";
|
||||
in {
|
||||
la = "ls -lath";
|
||||
lr = "ls -ltr";
|
||||
rebuild = "sudo nixos-rebuild switch --flake ${flakePath}";
|
||||
hms = "home-manager switch --flake ${flakePath}";
|
||||
vi = "vim";
|
||||
#config = "nvim ~/nix/configuration.nix";
|
||||
#homecfg = "nvim ~/nix/home.nix";
|
||||
};
|
||||
};
|
||||
}
|
17
home/default.nix
Executable file
17
home/default.nix
Executable file
@ -0,0 +1,17 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./home.nix
|
||||
./bash.nix
|
||||
./tmux.nix
|
||||
./starship.nix
|
||||
#./vscode.nix
|
||||
./packages.nix
|
||||
./git.nix
|
||||
./zsh.nix
|
||||
./variables.nix
|
||||
./kitty.nix
|
||||
./neovim.nix
|
||||
];
|
||||
}
|
15
home/git.nix
Normal file
15
home/git.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "xbazzi";
|
||||
userEmail = "codemaster@xbazzi.com";
|
||||
aliases = {
|
||||
gs = "status";
|
||||
pu = "push";
|
||||
co = "checkout";
|
||||
cm = "commit";
|
||||
};
|
||||
};
|
||||
}
|
34
home/home.nix
Executable file
34
home/home.nix
Executable file
@ -0,0 +1,34 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
home.username = "xbazzi";
|
||||
home.homeDirectory = "/home/xbazzi";
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme.name = "adw-gtk3";
|
||||
cursorTheme.name = "Bibata-Modern-Ice";
|
||||
iconTheme.name = "GruvboxPlus";
|
||||
};
|
||||
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||
# plain files is through 'home.file'.
|
||||
home.file = {
|
||||
#".p10k.zsh".text = builtins.readFile ./.p10k.zsh;
|
||||
|
||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||
# # symlink to the Nix store copy.
|
||||
# ".screenrc".source = dotfiles/screenrc;
|
||||
|
||||
# # You can also set the file content immediately.
|
||||
# ".gradle/gradle.properties".text = ''
|
||||
# org.gradle.console=verbose
|
||||
# org.gradle.daemon.idletimeout=3600000
|
||||
# '';
|
||||
};
|
||||
|
||||
home.stateVersion = "24.11"; # Please read the comment before changing.
|
||||
}
|
42
home/kitty.nix
Executable file
42
home/kitty.nix
Executable file
@ -0,0 +1,42 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.kitty = lib.mkForce {
|
||||
enable = true;
|
||||
shellIntegration.enableZshIntegration = true;
|
||||
settings = {
|
||||
confirm_os_window_close = 0;
|
||||
dynamic_background_opacity = true;
|
||||
enable_audio_bell = false;
|
||||
mouse_hide_wait = "-1.0";
|
||||
window_padding_width = 5;
|
||||
background_opacity = "0.8";
|
||||
background_blur = 0;
|
||||
themeFile = "Alucard";
|
||||
symbol_map =
|
||||
let
|
||||
mappings = [
|
||||
"U+23FB-U+23FE"
|
||||
"U+2B58"
|
||||
"U+E200-U+E2A9"
|
||||
"U+E0A0-U+E0A3"
|
||||
"U+E0B0-U+E0BF"
|
||||
"U+E0C0-U+E0C8"
|
||||
"U+E0CC-U+E0CF"
|
||||
"U+E0D0-U+E0D2"
|
||||
"U+E0D4"
|
||||
"U+E700-U+E7C5"
|
||||
"U+F000-U+F2E0"
|
||||
"U+2665"
|
||||
"U+26A1"
|
||||
"U+F400-U+F4A8"
|
||||
"U+F67C"
|
||||
"U+E000-U+E00A"
|
||||
"U+F300-U+F313"
|
||||
"U+E5FA-U+E62B"
|
||||
];
|
||||
in
|
||||
(builtins.concatStringsSep "," mappings) + " Symbols Nerd Font";
|
||||
};
|
||||
};
|
||||
}
|
28
home/neovim.nix
Executable file
28
home/neovim.nix
Executable file
@ -0,0 +1,28 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.neovim ={
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
#extraConfig = /home/nixxer/.config/nvim-javi/init.lua;
|
||||
# extraConfig = ''
|
||||
# set background=dark
|
||||
# set shiftwidth=4
|
||||
# set showmatch
|
||||
# set ignorecase
|
||||
# set smartcase
|
||||
# set incsearch
|
||||
# set hlsearch
|
||||
# set expandtab
|
||||
# set rnu nu
|
||||
# set tabstop=4
|
||||
# set mouse=a
|
||||
# set laststatus=2
|
||||
# set nobackup
|
||||
# set noswapfile
|
||||
# set undofile
|
||||
# let undodir=stdpath('data') .. '/undodir'
|
||||
# set clipboard=unnamedplus
|
||||
# '';
|
||||
};
|
||||
}
|
11
home/packages.nix
Executable file
11
home/packages.nix
Executable file
@ -0,0 +1,11 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
hello
|
||||
tmux
|
||||
|
||||
#zsh-powerlevel10k
|
||||
#inputs.nixvim.packages.${pkgs.system}.default
|
||||
];
|
||||
}
|
21
home/starship.nix
Executable file
21
home/starship.nix
Executable file
@ -0,0 +1,21 @@
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
username = {
|
||||
style_user = "blue bold";
|
||||
style_root = "red bold";
|
||||
format = "[$user]($style) ";
|
||||
disabled = false;
|
||||
show_always = true;
|
||||
};
|
||||
hostname = {
|
||||
ssh_only = false;
|
||||
ssh_symbol = "🌐 ";
|
||||
format = "on [$hostname](bold red) ";
|
||||
trim_at = ".local";
|
||||
disabled = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
39
home/tmux.nix
Executable file
39
home/tmux.nix
Executable file
@ -0,0 +1,39 @@
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
shortcut = "a";
|
||||
# aggressiveResize = true; -- Disabled to be iTerm-friendly
|
||||
baseIndex = 1;
|
||||
newSession = true;
|
||||
# Stop tmux+escape craziness.
|
||||
escapeTime = 0;
|
||||
# Force tmux to use /tmp for sockets (WSL2 compat)
|
||||
secureSocket = false;
|
||||
|
||||
plugins = with pkgs; [
|
||||
tmuxPlugins.better-mouse-mode
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
# https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/
|
||||
set -g default-terminal "xterm-256color"
|
||||
set -ga terminal-overrides ",*256col*:Tc"
|
||||
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
|
||||
set-environment -g COLORTERM "truecolor"
|
||||
|
||||
# Mouse works as expected
|
||||
set-option -g mouse on
|
||||
# easy-to-remember split pane commands
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
'';
|
||||
};
|
||||
|
||||
programs.tmate = {
|
||||
enable = true;
|
||||
# FIXME: This causes tmate to hang.
|
||||
# extraConfig = config.xdg.configFile."tmux/tmux.conf".text;
|
||||
};
|
||||
}
|
27
home/variables.nix
Executable file
27
home/variables.nix
Executable file
@ -0,0 +1,27 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
# Home Manager can also manage your environment variables through
|
||||
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
||||
# shell provided by Home Manager. If you don't want to manage your shell
|
||||
# through Home Manager then you have to manually source 'hm-session-vars.sh'
|
||||
# located at either
|
||||
#
|
||||
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
#
|
||||
# or
|
||||
#
|
||||
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
|
||||
#
|
||||
# or
|
||||
#
|
||||
# /etc/profiles/per-user/nixxer/etc/profile.d/hm-session-vars.sh
|
||||
#
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
home.sessionPath = [
|
||||
"$HOME/.local/bin"
|
||||
];
|
||||
}
|
26
home/vim.nix
Executable file
26
home/vim.nix
Executable file
@ -0,0 +1,26 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.vim = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
set background=dark
|
||||
set shiftwidth=4
|
||||
set showmatch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set incsearch
|
||||
set hlsearch
|
||||
set expandtab
|
||||
set rnu nu
|
||||
syntax on
|
||||
set tabstop=4
|
||||
set mouse=a
|
||||
set laststatus=2
|
||||
set nobackup
|
||||
set noswapfile
|
||||
set undofile
|
||||
set undodir=~/.vim/undodir
|
||||
'';
|
||||
};
|
||||
}
|
115
home/vscode.nix
Executable file
115
home/vscode.nix
Executable file
@ -0,0 +1,115 @@
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
#package = pkgs.vscode.fhs;
|
||||
enableUpdateCheck = false;
|
||||
enableExtensionUpdateCheck = false;
|
||||
mutableExtensionsDir = true;
|
||||
|
||||
# VSCode installation and extensions
|
||||
extensions = (with pkgs.vscode-extensions; [
|
||||
golang.go
|
||||
ms-vscode.cpptools
|
||||
ms-vsliveshare.vsliveshare
|
||||
bbenoist.nix
|
||||
ms-python.python
|
||||
laravel.vscode-laravel
|
||||
ms-azuretools.vscode-docker
|
||||
ms-vscode-remote.remote-ssh
|
||||
vscodevim.vim
|
||||
enkia.tokyo-night
|
||||
|
||||
]);
|
||||
|
||||
# Settings
|
||||
userSettings = {
|
||||
# General
|
||||
"editor.fontSize" = 13;
|
||||
#"editor.fontFamily" = "'Jetbrains Mono', 'monospace', monospace";
|
||||
"terminal.integrated.fontSize" = 14;
|
||||
"terminal.integrated.fontFamily" = "'JetBrainsMono Nerd Font', 'monospace', monospace";
|
||||
"window.zoomLevel" = 1;
|
||||
"editor.multiCursorModifier" = "ctrlCmd";
|
||||
"workbench.startupEditor" = "none";
|
||||
"explorer.compactFolders" = false;
|
||||
# Whitespace
|
||||
"files.trimTrailingWhitespace" = true;
|
||||
"files.trimFinalNewlines" = true;
|
||||
"files.insertFinalNewline" = true;
|
||||
"diffEditor.ignoreTrimWhitespace" = false;
|
||||
# Git
|
||||
"git.enableCommitSigning" = true;
|
||||
"git-graph.repository.sign.commits" = true;
|
||||
"git-graph.repository.sign.tags" = true;
|
||||
"git-graph.repository.commits.showSignatureStatus" = true;
|
||||
# Styling
|
||||
"window.autoDetectColorScheme" = true;
|
||||
"workbench.preferredDarkColorTheme" = "Default Dark Modern";
|
||||
"workbench.preferredLightColorTheme" = "Default Light Modern";
|
||||
"workbench.iconTheme" = "material-icon-theme";
|
||||
"material-icon-theme.activeIconPack" = "none";
|
||||
"material-icon-theme.folders.theme" = "classic";
|
||||
# Other
|
||||
"telemetry.telemetryLevel" = "off";
|
||||
"update.showReleaseNotes" = false;
|
||||
# # Gitmoji
|
||||
# "gitmoji.onlyUseCustomEmoji" = true;
|
||||
# "gitmoji.addCustomEmoji" = [
|
||||
# {
|
||||
# "emoji" = "📦 NEW:";
|
||||
# "code" = ":package: NEW:";
|
||||
# "description" = "... Add new code/feature";
|
||||
# }
|
||||
# {
|
||||
# "emoji" = "👌 IMPROVE:";
|
||||
# "code" = ":ok_hand: IMPROVE:";
|
||||
# "description" = "... Improve existing code/feature";
|
||||
# }
|
||||
# {
|
||||
# "emoji" = "❌ REMOVE:";
|
||||
# "code" = ":x: REMOVE:";
|
||||
# "description" = "... Remove existing code/feature";
|
||||
# }
|
||||
# {
|
||||
# "emoji" = "🐛 FIX:";
|
||||
# "code" = ":bug: FIX:";
|
||||
# "description" = "... Fix a bug";
|
||||
# }
|
||||
# {
|
||||
# "emoji" = "📑 DOC:";
|
||||
# "code" = ":bookmark_tabs: DOC:";
|
||||
# "description" = "... Anything related to documentation";
|
||||
# }
|
||||
# {
|
||||
# "emoji" = "🤖 TEST:";
|
||||
# "code" = ":robot: TEST:";
|
||||
# "description" = "... Anything realted to tests";
|
||||
# }
|
||||
# ];
|
||||
};
|
||||
# #vscode-extensions.hikarin522.glassit
|
||||
# ]
|
||||
# ++ pkgs.vscode-utils.extensionsfromvscodemarketplace [
|
||||
# {
|
||||
# name = "remote-ssh-edit";
|
||||
# publisher = "ms-vscode-remote";
|
||||
# version = "0.47.2";
|
||||
# sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
|
||||
# }
|
||||
# {
|
||||
# name = "vsliveshare";
|
||||
# publisher = "ms-vsliveshare";
|
||||
# version = "1.0.5948"; # replace with the latest version
|
||||
# sha256 = "kou9zf5l6mtlu8z/l4xbwrl2x3uie15yghezjrkshgy="; # replace with the calculated hash
|
||||
# }
|
||||
# {
|
||||
# name = "glassit";
|
||||
# publisher = "s-nlf-fh";
|
||||
# version = "0.2.6";
|
||||
# sha256 = "lcaomgk91hnjwqaw4i0fagtowr8kwv7zhvgcgkokkuy=";
|
||||
# }
|
||||
# ];
|
||||
};
|
||||
}
|
59
home/zsh.nix
Executable file
59
home/zsh.nix
Executable file
@ -0,0 +1,59 @@
|
||||
|
||||
{ inputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
initExtra = ''
|
||||
bindkey -e
|
||||
'';
|
||||
history.size = 10000;
|
||||
history.ignoreAllDups = true;
|
||||
history.path = "$HOME/.zsh_history";
|
||||
history.ignorePatterns = ["rm *" "pkill *" "cp *"];
|
||||
|
||||
shellAliases =
|
||||
let
|
||||
flakePath = "~/nix";
|
||||
in
|
||||
{
|
||||
ll = "ls -l";
|
||||
update = "sudo nixos-rebuild switch";
|
||||
la = "ls -lAth";
|
||||
lr = "ls -ltr";
|
||||
rebuild = "sudo nixos-rebuild switch --flake ${flakePath}";
|
||||
hms = "home-manager switch --flake ${flakePath}";
|
||||
config = "nvim ~/nix/configuration.nix";
|
||||
homecfg = "nvim ~/nix/home.nix";
|
||||
};
|
||||
# plugins = [
|
||||
# #{
|
||||
# # name = "powerlevel10k";
|
||||
# # src = pkgs.zsh-powerlevel10k;
|
||||
# # file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
|
||||
# #}
|
||||
# # {
|
||||
# # name = "powerlevel10k-config";
|
||||
# # src = ./p10k-config;
|
||||
# # file = ".p10k.zsh";
|
||||
# # }
|
||||
# ];
|
||||
|
||||
#histSize = 10000;
|
||||
# oh-my-zsh = {
|
||||
# enable = true;
|
||||
# plugins = [ "git" "thefuck" ];
|
||||
# theme = "";
|
||||
# };
|
||||
# zplug = {
|
||||
# enable = true;
|
||||
# plugins = [
|
||||
# { name = "zsh-users/zsh-autosuggestions"; } # Simple plugin installation
|
||||
# #{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } # Installations with additional options. For the list of options, please refer to Zplug README.
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
}
|
13
system/cachix.nix
Executable file
13
system/cachix.nix
Executable file
@ -0,0 +1,13 @@
|
||||
|
||||
# WARN: this file will get overwritten by $ cachix use <name>
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
folder = ./cachix;
|
||||
toImport = name: value: folder + ("/" + name);
|
||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
||||
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
|
||||
in {
|
||||
inherit imports;
|
||||
nix.settings.substituters = ["https://cache.nixos.org/"];
|
||||
}
|
13
system/cachix/cuda-maintainers.nix
Executable file
13
system/cachix/cuda-maintainers.nix
Executable file
@ -0,0 +1,13 @@
|
||||
|
||||
{
|
||||
nix = {
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://cuda-maintainers.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
115
system/configuration.nix
Executable file
115
system/configuration.nix
Executable file
@ -0,0 +1,115 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Denver";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.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";
|
||||
};
|
||||
|
||||
# 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;
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-emoji
|
||||
liberation_ttf
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
];
|
||||
|
||||
# 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;
|
||||
};
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
services.libinput.enable = false;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.xbazzi = {
|
||||
isNormalUser = true;
|
||||
description = "Xander Bazzi";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [
|
||||
# thunderbird
|
||||
];
|
||||
};
|
||||
|
||||
# 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:
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
# services.openssh.enable = true;
|
||||
|
||||
# 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 = "24.11"; # Did you read the comment?
|
||||
|
||||
}
|
13
system/default.nix
Executable file
13
system/default.nix
Executable file
@ -0,0 +1,13 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./configuration.nix
|
||||
./nvidia.nix
|
||||
./network.nix
|
||||
./net-drives.nix
|
||||
./packages.nix
|
||||
./services.nix
|
||||
];
|
||||
}
|
41
system/hardware-configuration.nix
Executable file
41
system/hardware-configuration.nix
Executable file
@ -0,0 +1,41 @@
|
||||
# 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" "usb_storage" "usbhid" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/d1210185-1181-47af-bebc-1b07ce66ad82";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/3438-182C";
|
||||
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.enp6s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp6s0d1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
36
system/net-drives.nix
Executable file
36
system/net-drives.nix
Executable file
@ -0,0 +1,36 @@
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# fileSystems."/mnt/media" = {
|
||||
# device = "nas.lan.xbazzi.com:/mnt/ALEXANDRIA/media";
|
||||
# fsType = "nfs";
|
||||
# };
|
||||
|
||||
fileSystems."/mnt/os-images" = {
|
||||
device = "nas.lan.xbazzi.com:/mnt/ALEXANDRIA/os-images";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"rw"
|
||||
"vers=4"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/media" = {
|
||||
device = "nas.lan.xbazzi.com:/mnt/ALEXANDRIA/media";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"rw"
|
||||
"vers=4"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/school" = {
|
||||
device = "nas.lan.xbazzi.com:/mnt/ALEXANDRIA/school";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"rw"
|
||||
"vers=4"
|
||||
];
|
||||
};
|
||||
}
|
43
system/network.nix
Executable file
43
system/network.nix
Executable file
@ -0,0 +1,43 @@
|
||||
{ inputs, config, pkgs, ... }:
|
||||
{
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
|
||||
systemd.services."NetworkManager-wait-online" = {
|
||||
serviceConfig.TimeoutStartSec = "20s";
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "nixos";
|
||||
wireless.enable = false;
|
||||
interfaces.enp6s0d1 = {
|
||||
ipv4.addresses = [{
|
||||
address = "10.29.90.110";
|
||||
prefixLength = 22;
|
||||
}];
|
||||
};
|
||||
nameservers = [ "10.29.90.1" "10.133.7.1" ];
|
||||
search = [ "lan.xbazzi.com" ];
|
||||
|
||||
defaultGateway = {
|
||||
address = "10.29.90.1";
|
||||
interface = "enp6s0d1";
|
||||
};
|
||||
|
||||
hosts = {
|
||||
"127.0.0.1" = [ "localhost" ];
|
||||
"10.29.90.110" = [ "nixos" "nixos.lan.xbazzi.com" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
}
|
39
system/nvidia.nix
Executable file
39
system/nvidia.nix
Executable file
@ -0,0 +1,39 @@
|
||||
{ inputs, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# NVIDIA stuff
|
||||
hardware.nvidia = {
|
||||
|
||||
# Modesetting is required.
|
||||
modesetting.enable = true;
|
||||
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
||||
# of just the bare essentials.
|
||||
powerManagement.enable = false;
|
||||
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
||||
open = false;
|
||||
|
||||
# Enable the Nvidia settings menu,
|
||||
# accessible via `nvidia-settings`.
|
||||
nvidiaSettings = true;
|
||||
|
||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
# Nvidia driver for X
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
}
|
33
system/packages.nix
Executable file
33
system/packages.nix
Executable file
@ -0,0 +1,33 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
wget
|
||||
xournalpp
|
||||
obsidian
|
||||
libreoffice-qt
|
||||
hunspell
|
||||
hunspellDicts.en_US
|
||||
kitty
|
||||
git
|
||||
fastfetch
|
||||
wget
|
||||
discord-canary
|
||||
cudaPackages_12.cudatoolkit
|
||||
python3
|
||||
gimp
|
||||
vlc
|
||||
xclip
|
||||
gparted
|
||||
htop
|
||||
];
|
||||
|
||||
# Install firefox.
|
||||
programs.noisetorch.enable = true;
|
||||
|
||||
# Install firefox.
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
}
|
7
system/services.nix
Executable file
7
system/services.nix
Executable file
@ -0,0 +1,7 @@
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable the OpenSSH daemon.
|
||||
#services.openssh.enable = true;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user