From ad45372145b4820c70bfdc72032a34fc8f3eeb1e Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 1 Jul 2022 11:08:49 -0500 Subject: [PATCH] update nixos configuration before switching to arch --- .config/aliasrc | 9 ++++++- .config/nvim/init.vim | 3 +++ .config/rsync-exclude.conf | 15 +++++------ .local/installers/nixos/configuration.nix | 27 ++++++++++++++----- .../installers/nixos/gaming-configuration.nix | 12 +++++++++ .local/scripts/backup.sh | 3 +-- .local/scripts/compress.sh | 4 +-- .local/scripts/days_since.sh | 2 +- .profile | 11 ++++---- 9 files changed, 61 insertions(+), 25 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index 2310b8d..87ee5b0 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -46,11 +46,18 @@ alias yd='youtube-dl' alias config='git --git-dir=$HOME/.cfg/ --work-tree=$HOME' note() { - NOTEFILE="$HOME/docs/notes" + NOTEFILE="$HOME/.cache/notes" if [ "$#" -lt 1 ]; then cat "$NOTEFILE" elif [ "$1" = "-e" ]; then $EDITOR "$NOTEFILE" + elif [ "$1" = "-h" ]; then + echo " usage: note this is a note" + echo " the line: \"this is a note\" is stored as a line in the file $NOTEFILE" + echo "" + echo " run this without arguments to view the contents of $NOTEFILE" + echo " -e -> edit note file with \$EDITOR" + echo " -h -> print this help menu" else echo "$@" >> "$NOTEFILE" fi diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 3b89c7b..0db5725 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -12,6 +12,9 @@ call plug#begin('~/.local/share/nvim/plugged') Plug 'tpope/vim-fugitive' Plug 'dense-analysis/ale' Plug 'chriskempson/base16-vim' + + "language support + Plug 'tbastos/vim-lua' call plug#end() "enable ale completion diff --git a/.config/rsync-exclude.conf b/.config/rsync-exclude.conf index b10d0a8..2ebf98e 100644 --- a/.config/rsync-exclude.conf +++ b/.config/rsync-exclude.conf @@ -1,21 +1,20 @@ -HDDA .cfg .cache .steam .var .pki -scripts -wallpapers .ghc .stack .trash -.config +.nix-defexpr +.nix-profile +.factorio +.googleearth +.luarocks +.minecraft +.shared-ringdb .local/share .local/bin -.local/inits -.local/installers -.local/scripts -.local/src .local/state .local/README.md .local/LICENSE diff --git a/.local/installers/nixos/configuration.nix b/.local/installers/nixos/configuration.nix index 119bfa5..7b86827 100644 --- a/.local/installers/nixos/configuration.nix +++ b/.local/installers/nixos/configuration.nix @@ -21,17 +21,12 @@ # accidentally delete configuration.nix. system.copySystemConfiguration = true; - #enable nonfree packages - nixpkgs.config.allowUnfree = true; - - #enable automatic updates - system.autoUpgrade.enable = true; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "gabriel"; # Define your hostname. + networking.hostName = "bismarck"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. #networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. @@ -85,6 +80,18 @@ ]; }; + security.sudo.extraRules = [{ + runAs = "root"; + groups = [ "wheel" ]; + commands = [{ + command = "/run/current-system/sw/bin/poweroff"; + options = [ "NOPASSWD" ]; + } { + command = "/run/current-system/sw/bin/reboot"; + options = [ "NOPASSWD" ]; + }]; + }]; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. programs.mtr.enable = true; @@ -137,6 +144,14 @@ git shellcheck jq + monero-cli + bc + gnome.zenity + cura + udisks2 + udiskie + python3 + python3.pkgs.pip ]; #enable flatpak diff --git a/.local/installers/nixos/gaming-configuration.nix b/.local/installers/nixos/gaming-configuration.nix index dd05655..9db2d5c 100644 --- a/.local/installers/nixos/gaming-configuration.nix +++ b/.local/installers/nixos/gaming-configuration.nix @@ -1,5 +1,8 @@ { config, pkgs, lib, ... }: { + #enable nonfree packages + nixpkgs.config.allowUnfree = true; + environment.systemPackages = with pkgs; [ lutris radeontop @@ -8,6 +11,15 @@ #add 32bit support for graphics hardware.opengl.driSupport32Bit = true; + #nixpkgs.config.packageOverrides = pkgs: { + # steam = pkgs.steam.override { + # extraPkgs = pkgs: with pkgs; [ + # libgdiplus + # libpng + # ]; + # }; + #}; + programs.steam = { enable = false; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play diff --git a/.local/scripts/backup.sh b/.local/scripts/backup.sh index e497b61..68d1ecb 100755 --- a/.local/scripts/backup.sh +++ b/.local/scripts/backup.sh @@ -2,9 +2,8 @@ BACKUP_LOC="/media/SEAGATE/HOME_BACKUP/" DIR="$HOME/" EXCLUDE_CONF="$HOME/.config/rsync-exclude.conf" -INCLUDE_CONF="$HOME/.config/rsync-include.conf" -EXCL_INCL="--exclude-from=$EXCLUDE_CONF --include-from=$INCLUDE_CONF" +EXCL_INCL="--exclude-from=$EXCLUDE_CONF" if [ "$1" = "-r" ]; then notify-send "backup.sh" "restoring from backup" diff --git a/.local/scripts/compress.sh b/.local/scripts/compress.sh index 75938b7..7b0c979 100755 --- a/.local/scripts/compress.sh +++ b/.local/scripts/compress.sh @@ -72,8 +72,8 @@ help () { echo " -e [ file ] => extract input file to a subdirectory of the files name" } -#get all input except first 2 chars as input for compress/extract -ARGS="$( echo "$@" | sed '0,/^../{s/^..//}' )" +#get all input except first argument, if first argument has a '-' and save in ARGS +ARGS="$( echo "$@" | sed 's/^-.* //g' )" if [ "$1" = "-c" ]; then compress "$ARGS" diff --git a/.local/scripts/days_since.sh b/.local/scripts/days_since.sh index cf0c7aa..3dc1a88 100755 --- a/.local/scripts/days_since.sh +++ b/.local/scripts/days_since.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash help() { echo "\$1 -> file to update or compare against" diff --git a/.profile b/.profile index 177c1e2..697942a 100644 --- a/.profile +++ b/.profile @@ -60,11 +60,12 @@ export PATH="$HOME/.local/scripts:$PATH" export MANPATH="$MANPATH:/usr/local/man/" -export PATH="/opt/rocm/bin:$PATH" -export PATH="/opt/rocm/hip/bin:$PATH" -export PATH="/opt/rocm/opencl/bin:$PATH" -export PATH="/opt/rocm/rocfft/bin:$PATH" -export PATH="/opt/rocm/rocfft/bin:$PATH" +#add to path if installing rocm for amd +#export PATH="/opt/rocm/bin:$PATH" +#export PATH="/opt/rocm/hip/bin:$PATH" +#export PATH="/opt/rocm/opencl/bin:$PATH" +#export PATH="/opt/rocm/rocfft/bin:$PATH" +#export PATH="/opt/rocm/rocfft/bin:$PATH" #fix arduino ide issues