diff --git a/hosts/alpheratz/configuration.nix b/hosts/alpheratz/configuration.nix new file mode 100644 index 0000000..3583c86 --- /dev/null +++ b/hosts/alpheratz/configuration.nix @@ -0,0 +1,162 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + + imports = [ + ./hardware-configuration.nix + ]; + + nixpkgs = { + overlays = []; + config = { + allowUnfree = true; + }; + }; + + nix = { + settings = { + experimental-features = "nix-command flakes"; + }; + }; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.xbootldrMountPoint = "/boot"; + boot.loader.efi.efiSysMountPoint = "/efi"; + boot.loader.efi.canTouchEfiVariables = true; + + powerManagement.powertop.enable = true; + + fileSystems = { + "/".options = [ "compress=zstd" ]; + "/home".options = [ "compress=zstd" ]; + "/nix".options = [ "compress=zstd" "noatime" ]; + }; + + networking.hostName = "alpheratz"; + networking.networkmanager.enable = true; + networking.nameservers = [ "192.168.0.100" ]; + networking.firewall = { + allowedUDPPorts = [ 51820 ]; + }; + networking.wg-quick.interfaces = { + wg0 = { + address = [ "10.6.0.5" ]; + listenPort = 51820; + privateKeyFile = "/root/wireguard-keys/wg0/private"; + dns = [ "10.2.0.100" ]; + + peers = [ + { + publicKey = "pEWHugUnnhWXkJzCIhXryRRZMoCAuvAITDeP4ItenQk="; + presharedKeyFile = "/root/wireguard-keys/wg0/preshared"; + allowedIPs = [ "10.2.0.0/24" "192.168.0.0/24" ]; + endpoint = "jellyfin.simmer505.com:51820"; + persistentKeepalive = 25; + } + ]; + }; + }; + + # Set your time zone. + time.timeZone = "America/Chicago"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + services.xserver.xkb.layout = "us"; + services.xserver.xkb.options = "caps:escape"; + + fonts.packages = with pkgs; [ + font-awesome + ]; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # List packages installed in system profile. To search, run: + environment.systemPackages = with pkgs; with outputs.packages.x86_64-linux; [ + wget + curl + ldns + git + killall + vim + wl-clipboard + grim + slurp + waybar + alacritty + kickoff + firefox + bottom + eza + ripgrep + fzf + mpv + wireguard-tools + pulseaudio + eza + pavucontrol + kickoff-dot-desktop + ]; + + programs.sway.enable = true; + programs.fish.enable = true; + programs.thunar.enable = true; + programs.light.enable = true; + + programs.neovim = { + enable = true; + defaultEditor = true; + }; + + xdg.portal.wlr.enable = true; + + # Define a user account. + users.users.eesim = { + isNormalUser = true; + extraGroups = [ "wheel" "video" "audo" "networkmanager" ]; + packages = with pkgs; []; + shell = pkgs.fish; + }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # sound.enable = true; + # hardware.pulseaudio.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "23.11"; # Did you read the comment? + +} + diff --git a/hosts/alpheratz/dotfiles/fish/config.fish b/hosts/alpheratz/dotfiles/fish/config.fish new file mode 100644 index 0000000..d3d2101 --- /dev/null +++ b/hosts/alpheratz/dotfiles/fish/config.fish @@ -0,0 +1,47 @@ +if status is-interactive + ### Local environment variables + + set -g fish_greeting + set -g fish_cursor_default block + set -g fish_cursor_insert line + set -g fish_cursor_replace_one underscore + set -g fish_cursor_replace underscore + set -g fish_cursor_external line + set -g fish_cursor_visual block + +end + +if test (tty) = "/dev/tty1" + sway +end + +if status is-login + + ### Environment Variables + + # Set nvim to default editor + set -x SUDO_EDITOR = "/usr/bin/nvim" + + # Set R library location + set -x R_LIBS_USER = "/home/eesim/.local/lib/R" + + # Disable GTK portal + set -x GTK_USE_PORTAL=0 + + # Wayland environment variables + set -x XDG_CURRENT_DESKTOP = "sway" + set -x XDG_CURRENT_SESSION = "sway" + set -x XDG_SESSION_TYPE = "wayland" + set -x ELECTRON_OZONE_PLATFORM_HINT = "auto" + set -x QT_QPA_PLATFORM = "wayland;xcb" + set -x SDL_VIDEODRIVER = "wayland,x11" + + # Java fix + set -x _JAVA_AWT_WM_NONREPARENTING = "1" + + ### Themes + set -x QT_QPA_PLATFORMTHEME = "qt5ct" + + ### Start fish + exec fish +end diff --git a/hosts/alpheratz/dotfiles/nvim/init.lua b/hosts/alpheratz/dotfiles/nvim/init.lua new file mode 100644 index 0000000..c6978cf --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/init.lua @@ -0,0 +1,9 @@ +require('config/keymaps') +require('config/settings') +require('config/plugins') +require('config/plugins/lualine') +require('config/plugins/lspconfig') + +local vimscriptpath = vim.fn.stdpath("config") .. "/lua/config/vimscript/" + +vim.cmd('source' .. vimscriptpath .. 'init.vim') diff --git a/hosts/alpheratz/dotfiles/nvim/lazy-lock.json b/hosts/alpheratz/dotfiles/nvim/lazy-lock.json new file mode 100644 index 0000000..b51de3c --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/lazy-lock.json @@ -0,0 +1,15 @@ +{ + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "fzf-lua": { "branch": "main", "commit": "b442569ab827f72e344236c598b02cb9dc754e9f" }, + "kanagawa.nvim": { "branch": "master", "commit": "860e4f80df71221d18bf2cd9ef1deb4d364274d2" }, + "lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, + "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "nvim-lspconfig": { "branch": "master", "commit": "b972e7154bc94ab4ecdbb38c8edbccac36f83996" }, + "nvim-surround": { "branch": "main", "commit": "79aaa42da1f698ed31bcbe7f83081f69dca7ba17" }, + "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, + "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, + "typst.vim": { "branch": "main", "commit": "d9a7650e76c85f8ba437e056d08dd43b01b8bfd6" } +} \ No newline at end of file diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/keymaps.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..ad99733 --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/lua/config/keymaps.lua @@ -0,0 +1,15 @@ +vim.g.mapleader=',' +vim.g.maplocalleader=',' + +vim.keymap.set('n', '', 'h') +vim.keymap.set('n', '', 'j') +vim.keymap.set('n', '', 'k') +vim.keymap.set('n', '', 'l') + +vim.keymap.set('n', 'ff', ':FzfLua files') +vim.keymap.set('n', 'fb', ':FzfLua buffers') +vim.keymap.set('n', 'rg', ':FzfLua grep') + +vim.keymap.set('i', '', '') + +vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/init.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/init.lua new file mode 100644 index 0000000..0e86f8c --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/init.lua @@ -0,0 +1,50 @@ +local plugins = { + 'rebelot/kanagawa.nvim', + + 'nvim-lualine/lualine.nvim', + 'kyazdani42/nvim-web-devicons', + + 'kylechui/nvim-surround', + + { + 'ibhagwan/fzf-lua', + config = function() + require('fzf-lua').setup({'skim'}) + end + }, + + 'neovim/nvim-lspconfig', + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', + + 'rust-lang/rust.vim', + + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + opts={}, + }, + + { + 'kaarmu/typst.vim', + ft = 'typst', + lazy = false, + }, + +} + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup(plugins, opts) diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lspconfig.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lspconfig.lua new file mode 100644 index 0000000..b3e4bd3 --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lspconfig.lua @@ -0,0 +1,59 @@ +local capabilities = require('cmp_nvim_lsp').default_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = false; + +local lspconfig = require('lspconfig') + +lspconfig.rust_analyzer.setup { + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + }, + imports = { + group = { + enable = false, + }, + }, + completion = { + postfix = { + enable = false, + }, + }, + }, + }, +} + +local servers = {'ccls', 'typst_lsp'} + +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + capabilities = capabilities + } +end + +local cmp = require 'cmp' + +cmp.setup { + preselect = cmp.PreselectMode.None, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { 'i', 's' }), + }), + sources = { + { name = 'nvim_lsp' }, + { name = 'path' }, + }, +} diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lualine.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lualine.lua new file mode 100644 index 0000000..9ae6243 --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lualine.lua @@ -0,0 +1,36 @@ +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'wombat', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = {}, + always_divide_middle = true, + globalstatus = true, + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = { + lualine_a = {'buffers'}, + lualine_b = {'branch'}, + lualine_c = {'filename'}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {'tabs'} + }, + extensions = {} +} diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/settings.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/settings.lua new file mode 100644 index 0000000..b3e9269 --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/lua/config/settings.lua @@ -0,0 +1,40 @@ +vim.opt.cursorline=true +vim.opt.relativenumber=true +vim.opt.number=true + +vim.opt.scrolloff=10 + +vim.opt.autoindent=true +vim.opt.expandtab=true +vim.opt.softtabstop=4 +vim.opt.shiftwidth=4 +vim.opt.shiftround=true + +vim.opt.backspace={'indent','eol','start'} +vim.opt.hidden=true +vim.opt.laststatus=2 +vim.opt.display='lastline' + +vim.opt.showmode=true +vim.opt.showcmd=true + +vim.opt.incsearch=true +vim.opt.ignorecase=true +vim.opt.smartcase=true + +vim.opt.ttyfast=true +vim.opt.updatetime=300 + +vim.opt.splitright=true + +vim.opt.wrapscan=true +vim.opt.report=0 + +vim.opt.list=true +vim.opt.completeopt=menuone,noselect + +vim.opt.undofile=true + + +vim.g['loaded_perl_provider']=0 +vim.g['python3_host_prog']='/usr/bin/python' diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/vimscript/init.vim b/hosts/alpheratz/dotfiles/nvim/lua/config/vimscript/init.vim new file mode 100644 index 0000000..2426d07 --- /dev/null +++ b/hosts/alpheratz/dotfiles/nvim/lua/config/vimscript/init.vim @@ -0,0 +1,9 @@ +filetype plugin indent on +syntax on +colorscheme kanagawa + +if has('multi_byte') && &encoding ==# 'utf-8' + let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' +else + let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' +endif diff --git a/hosts/alpheratz/dotfiles/waybar/config b/hosts/alpheratz/dotfiles/waybar/config new file mode 100644 index 0000000..91e5d54 --- /dev/null +++ b/hosts/alpheratz/dotfiles/waybar/config @@ -0,0 +1,80 @@ +{ + "layer": "top", // Waybar at top layer + "output": "eDP-1", + "position": "top", // Waybar position (top|bottom|left|right) + "height": 30, // Waybar height (to be removed for auto height) + "spacing": 4, // Gaps between modules (4px) + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad"], + "modules-center": ["sway/window"], + "modules-right": ["idle_inhibitor", "pulseaudio", "cpu", "memory", "battery", "clock"], + // Modules configuration + "sway/workspaces": { + "disable-scroll": true, + "all-outputs": false, + "format": "{name}: {icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "urgent": "", + "focused": "", + "default": "" + } + }, + "sway/mode": { + "format": "{}" + }, + "sway/scratchpad": { + "format": "{icon} {count}", + "show-empty": false, + "format-icons": ["", ""], + "tooltip": true, + "tooltip-format": "{app}: {title}" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + // "timezone": "America/New_York", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": "{:%I:%M %p}", + "format-alt": "{:%Y-%m-%d}" + }, + "battery": { + "format": "{capacity}% " + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% {icon}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + }, +} diff --git a/hosts/alpheratz/dotfiles/waybar/style.css b/hosts/alpheratz/dotfiles/waybar/style.css new file mode 100644 index 0000000..25c10bb --- /dev/null +++ b/hosts/alpheratz/dotfiles/waybar/style.css @@ -0,0 +1,102 @@ +* { + border: none; + border-radius: 0; + font-family: "Ubuntu Nerd Font"; + font-size: 16px; + min-height: 0; +} + +window#waybar { + background: rgba(0, 0, 0, 0.2); + color: white; +} + +#window { + font-weight: bold; + font-family: "Ubuntu"; +} +/* +#workspaces { + padding: 0 5px; +} +*/ + +#workspaces button { + padding: 0 5px; + background: transparent; + color: white; + border-top: 2px solid transparent; +} + +#workspaces button.focused { + color: #c9545d; + border-top: 2px solid #c9545d; +} + +#mode { + background: #64727D; + border-bottom: 3px solid white; +} + +#clock, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode, #idle_inhibitor { + padding: 0 8px; + margin: 0 3px; +} + +#clock { + font-weight: bold; +} + +#battery { +} + +#battery icon { + color: red; +} + +#battery.charging { +} + +@keyframes blink { + to { + background-color: #ffffff; + color: black; + } +} + +#battery.warning:not(.charging) { + color: white; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#cpu { +} + +#memory { +} + +#network { +} + +#network.disconnected { + background: #f53c3c; +} + +#pulseaudio { +} + +#pulseaudio.muted { +} + +#custom-spotify { + color: rgb(102, 220, 105); +} + +#tray { +} + + diff --git a/hosts/alpheratz/hardware-configuration.nix b/hosts/alpheratz/hardware-configuration.nix new file mode 100644 index 0000000..954266b --- /dev/null +++ b/hosts/alpheratz/hardware-configuration.nix @@ -0,0 +1,45 @@ +# 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/ad45b094-608d-4850-b5ba-0f3917947629"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/ad45b094-608d-4850-b5ba-0f3917947629"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/ad45b094-608d-4850-b5ba-0f3917947629"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; + + 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.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/alpheratz/home.nix b/hosts/alpheratz/home.nix new file mode 100644 index 0000000..69d6043 --- /dev/null +++ b/hosts/alpheratz/home.nix @@ -0,0 +1,58 @@ +{ + config, + pkgs, + ... +}: +{ + + imports = []; + + home = { + username = "eesim"; + homeDirectory = "/home/eesim"; + }; + + home.file.".config/sway/config".source = ./dotfiles/sway/config; + home.file.".config/nvim".source = ./dotfiles/nvim; + home.file.".config/waybar".source = ./dotfiles/waybar; + home.file.".config/fish/config.fish".source = ./dotfiles/fish/config.fish; + + programs.git = { + enable = true; + userName = "Ethan Simmons"; + userEmail = "eesimmons9105@gmail.com"; + extraConfig = { + core.sshCommand = "'ssh -i /home/eesim/.ssh/id_ed25519'"; + }; + }; + + programs.direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; + + programs.home-manager.enable = true; + + gtk = { + enable = true; + cursorTheme = { + name = "phinger-cursors-dark"; + package = pkgs.phinger-cursors; + }; + theme = { + name = "adw-gtk3-dark"; + package = pkgs.adw-gtk3; + }; + }; + + qt = { + style = { + name = "adwaita-dark"; + package = pkgs.adwaita-qt; + }; + }; + + + home.stateVersion = "23.11"; +}