diff --git a/Baud/.zshrc b/Baud/.zshrc old mode 100644 new mode 100755 index 7a0efd7..db750d0 --- a/Baud/.zshrc +++ b/Baud/.zshrc @@ -2,35 +2,30 @@ # https://github.com/DeclanChidlow/dotfiles # https://vale.rocks -ZSH=/usr/share/oh-my-zsh/ - bindkey -v -setopt HIST_IGNORE_ALL_DUPS +setopt hist_ignore_all_dups +setopt hist_reduce_blanks +setopt inc_append_history +setopt share_history -macchina +echo "" +fastfetch -c ~/.config/fastfetch/info.jsonc +echo "" # Alias -alias ls="exa --classify --icons -a" -alias tree="exa --tree --icons -a" -alias vdir="exa --long --icons -a" -alias grep="grep --color=auto" +alias ls="eza --group-directories-first --icons -a" +alias tree="eza --tree --level=2 --icons -a" +alias vdir="eza --long --icons -a" +alias grep="ugrep" alias ping="ping -c 5" alias cat="bat" alias :q="exit" alias .zshrc="nvim ~/.zshrc" alias matrix="neo-matrix -D" -alias pipes="pipes.sh -p 3 -r 4500" - -# Eval -eval "$(thefuck --alias)" - -ZSH_THEME="bira" -plugins=(aliases colored-man-pages cp git systemd) - -ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh -if [[ ! -d $ZSH_CACHE_DIR ]]; then - mkdir $ZSH_CACHE_DIR -fi +alias pipes="pipes-rs -p 3 -r 0.5" +alias fetch="fastfetch" +alias kssh="kitty +kitten ssh" +alias nixconf="nvim /etc/nixos/configuration.nix" -source $ZSH/oh-my-zsh.sh +# Oh My ZSH is configured in the Nix config diff --git a/Baud/etc/nixos/configs/bootloader.nix b/Baud/etc/nixos/configs/bootloader.nix new file mode 100644 index 0000000..4f00d79 --- /dev/null +++ b/Baud/etc/nixos/configs/bootloader.nix @@ -0,0 +1,19 @@ +{ + # Setup bootloader + boot.loader = { + systemd-boot = { + enable = true; + editor = false; + memtest86 = { + enable = true; + entryFilename = "memtest86.conf"; + }; + netbootxyz = { + enable = true; + entryFilename = "netbootxyz.conf"; + }; + }; + timeout = 0; + efi.canTouchEfiVariables = true; + }; +} diff --git a/Baud/etc/nixos/configs/fonts.nix b/Baud/etc/nixos/configs/fonts.nix new file mode 100644 index 0000000..2351d86 --- /dev/null +++ b/Baud/etc/nixos/configs/fonts.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + fonts.packages = with pkgs; [ + lexend + (nerdfonts.override { fonts = ["FiraCode"]; }) + ]; +} diff --git a/Baud/etc/nixos/configs/garbage.nix b/Baud/etc/nixos/configs/garbage.nix new file mode 100644 index 0000000..fc21f7f --- /dev/null +++ b/Baud/etc/nixos/configs/garbage.nix @@ -0,0 +1,9 @@ +{ + # Optimise Disk + nix.settings.auto-optimise-store = true; + + # Clear old generations automatically + nix.gc.automatic = true; + nix.gc.dates = "daily"; + nix.gc.options = "--delete-older-than +5"; +} diff --git a/Baud/etc/nixos/configs/locale.nix b/Baud/etc/nixos/configs/locale.nix new file mode 100644 index 0000000..77f852e --- /dev/null +++ b/Baud/etc/nixos/configs/locale.nix @@ -0,0 +1,8 @@ +{ + # Locale + time.timeZone = "Australia/Perth"; + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + }; +} diff --git a/Baud/etc/nixos/configs/networking.nix b/Baud/etc/nixos/configs/networking.nix new file mode 100644 index 0000000..039badb --- /dev/null +++ b/Baud/etc/nixos/configs/networking.nix @@ -0,0 +1,5 @@ +{ + # Networking + networking.hostName = "baud"; + networking.networkmanager.enable = true; +} diff --git a/Baud/etc/nixos/configs/perprogram.nix b/Baud/etc/nixos/configs/perprogram.nix new file mode 100644 index 0000000..d60ae53 --- /dev/null +++ b/Baud/etc/nixos/configs/perprogram.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: + +{ + programs.zsh = { + enable = true; + ohMyZsh = { + enable = true; + theme = "bira"; + plugins = [ "gh" ]; + }; + }; + users.defaultUserShell = pkgs.zsh; + + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + }; + + programs.sway = { + enable = true; + }; + hardware.opengl.enable = true; + + programs.steam = { + enable = true; + }; +} diff --git a/Baud/etc/nixos/configs/power.nix b/Baud/etc/nixos/configs/power.nix new file mode 100644 index 0000000..0150960 --- /dev/null +++ b/Baud/etc/nixos/configs/power.nix @@ -0,0 +1,23 @@ +{ + # Better power button + services.logind.extraConfig = "HandlePowerKey=ignore"; + + # Improved performance and power management + powerManagement.enable = true; + services.thermald.enable = true; + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 80; + }; + }; +} diff --git a/Baud/etc/nixos/configs/services.nix b/Baud/etc/nixos/configs/services.nix new file mode 100644 index 0000000..b2828e7 --- /dev/null +++ b/Baud/etc/nixos/configs/services.nix @@ -0,0 +1,8 @@ +{ + # Auto mount drives + services.gvfs.enable = true; + services.udisks2.enable = true; + + # Enable CUPS to print documents. + services.printing.enable = true; +} diff --git a/Baud/etc/nixos/configs/sound.nix b/Baud/etc/nixos/configs/sound.nix new file mode 100644 index 0000000..d57d42d --- /dev/null +++ b/Baud/etc/nixos/configs/sound.nix @@ -0,0 +1,9 @@ +{ + # Enable sound. + sound.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; +} diff --git a/Baud/etc/nixos/configuration.nix b/Baud/etc/nixos/configuration.nix new file mode 100644 index 0000000..dec0c64 --- /dev/null +++ b/Baud/etc/nixos/configuration.nix @@ -0,0 +1,107 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ./configs/bootloader.nix + ./configs/fonts.nix + ./configs/garbage.nix + ./configs/locale.nix + ./configs/networking.nix + ./configs/perprogram.nix + ./configs/power.nix + ./configs/services.nix + ./configs/sound.nix + ]; + + nixpkgs.config.allowUnfree = true; + + # Packages that should always be available + environment.systemPackages = with pkgs; [ + zsh + zsh-completions + oh-my-zsh + eza + fzf + ugrep + bat + neovim + wget + curl + pulseaudio # Provides pactl + brightnessctl + ]; + + # Define a user account. + users.users.vale = { + isNormalUser = true; + extraGroups = [ "ftp" "games" "http" "rfkill" "uucp" "wheel"]; + packages = with pkgs; [ + # Desktop + sway + swaybg + swayidle + swaylock + yambar + bemenu + dunst + + # Utilities + kitty + vifm + firefox + btop + fastfetch + prusa-slicer + qalculate-gtk + + # Clipboard + wl-clipboard + cliphist + + # Manage drives + usbutils + udiskie + udisks + + # Dev + git + gh + # C + cmake + gcc + # Web + nodejs + + # Archives + + # Document Editing + libreoffice + hunspellDicts.en_AU + hyphen + mythes + languagetool + + # Multimedia + mpd + mpc-cli + ncmpcpp + mpv + pavucontrol + playerctl + imv + + # Gaming + steam + prismlauncher + heroic + + # Fun + pipes-rs + neo + ]; + }; + + system.stateVersion = "23.11"; +} diff --git a/Baud/etc/nixos/hardware-configuration.nix b/Baud/etc/nixos/hardware-configuration.nix new file mode 100644 index 0000000..99d8897 --- /dev/null +++ b/Baud/etc/nixos/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4fab6f83-5e2d-4b50-9adb-75e3fb8bcb6c"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/C383-1353"; + fsType = "vfat"; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp166s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}