commit 22973a01ed948189d5a57d700bc22077c4a45807 Author: altffour Date: Tue May 4 08:04:24 2021 +0300 add hp-14-bp1xx configuration file diff --git a/dotfiles/emacs/config.org b/dotfiles/emacs/config.org new file mode 100644 index 0000000..ac91775 --- /dev/null +++ b/dotfiles/emacs/config.org @@ -0,0 +1,325 @@ +#+TITLE: EMACS Configuration. +#+AUTHOR: Ayham Mamoun +#+EMAIL: ayhamaboualfadl@gmail.com +#+OPTIONS: toc:nil num:nil + +* Configure =use-package= + +Always compile the packages, and use the newest version available. + +#+BEGIN_SRC emacs-lisp + (require 'use-package-ensure) + (setq use-package-always-ensure t) +#+END_SRC + +Workaround for a bug in EMACS 26. Where there is an issue installing some packages. + +#+BEGIN_SRC emacs-lisp + (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") +#+END_SRC + +* Load Scripts + +Load the typing-speed script. + +#+BEGIN_SRC emacs-lisp + (load-file (concat user-emacs-directory "scripts/typing_speed.el")) +#+END_SRC + +* UI Prefrences +** Tweak EMACS' window + +Disable menu, scrollbar and minibuffer scrollbar. + +#+BEGIN_SRC emacs-lisp + (tool-bar-mode -1) + (menu-bar-mode -1) + (scroll-bar-mode -1) + (set-window-scroll-bars (minibuffer-window) nil nil) +#+END_SRC + +Bind frame title to the name of the current project. + +#+BEGIN_SRC emacs-lisp +(setq frame-title-format '((:eval (projectile-project-name)))) +#+END_SRC + +** Load theme + +Use 'monokai' theme. + +#+BEGIN_SRC emacs-lisp + (defun apply-theme () + "Make frames just slightly transparent." + (interactive) + (load-theme 'monokai t)) + + (use-package monokai-theme + :config + (apply-theme)) + (setq ;; foreground and background + monokai-foreground "#ABB2BF" + monokai-background "#282C34" + ;; highlights and comments + monokai-comments "#F8F8F0" + monokai-emphasis "#282C34" + monokai-highlight "#FFB269" + monokai-highlight-alt "#1B1D1E" + monokai-highlight-line "#1B1D1E" + monokai-line-number "#F8F8F0" + ;; colours + monokai-blue "#61AFEF" + monokai-cyan "#56B6C2" + monokai-green "#98C379" + monokai-gray "#3E4451" + monokai-violet "#C678DD" + monokai-red "#E06C75" + monokai-orange "#D19A66" + monokai-yellow "#E5C07B") + (setq monokai-height-minus-1 0.8 + monokai-height-plus-1 1.1 + monokai-height-plus-2 1.15 + monokai-height-plus-3 1.2 + monokai-height-plus-4 1.3) +#+END_SRC + +** Configure packages that modify the look +*** =powerline= + +Install and use EMACS' =powerline= + +#+BEGIN_SRC emacs-lisp +(use-package powerline) +(powerline-default-theme) +#+END_SRC + +** Environment specific configuration +*** =ORG-mode= Environment + +Replace =ORG-mode= ellipsis with a downward arrow. + +#+BEGIN_SRC emacs-lisp +(setq org-ellipsis "↲") +#+END_SRC + +* Basic Configuration + +Increase the garbage collector threshold, to speed up some operations. + +#+BEGIN_SRC emacs-lisp + (setq gc-cons-threshold 20000000) +#+END_SRC + +Treat CamelCaseSubWords as seperate words. +Note: Check if this suits me. + +#+BEGIN_SRC emacs-lisp + (add-hook 'prog-mode-hook 'subword-mode) +#+END_SRC + +If a file starts with #!, make it executable. + +#+BEGIN_SRC emacs-lisp + (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) +#+END_SRC + +If saving a file in a directory doesn't exist, offer to create the parent directories recursively. + +#+BEGIN_SRC emacs-lisp + (add-hook 'before-save-hook + (lambda () + (when buffer-file-name + (let ((dir (file-name-directory buffer-file-name))) + (when (and (not (file-exists-p dir)) y-or-n-p (format "Directory %s does not exist, Create it?" dir)) + (make-directory dir t )))))) +#+END_SRC + +Require having a new line. + +#+BEGIN_SRC emacs-lisp + (setq require-final-newline t) +#+END_SRC + +Make file sizes human-readable to dired buffers. + +#+BEGIN_SRC emacs-lisp + (setq-default dired-listing-switches "-alh") +#+END_SRC + +Refresh buffer when the file is changed, stoping buffers and file getting out of sync. + +#+BEGIN_SRC emacs-lisp +(global-auto-revert-mode t) +#+END_SRC + +When pressing the middle mouse button, paste where the curser is rather than where the mouse is. + +#+BEGIN_SRC emacs-lisp +(setq mouse-yank-at-point 1) +#+END_SRC + +Better increase and decrease text scale. + +#+BEGIN_SRC emacs-lisp +(global-set-key (kbd "C-+") 'text-scale-increase) +(global-set-key (kbd "C--") 'text-scale-decrease) +#+END_SRC + +Enable visual parantheses matching. + +#+BEGIN_SRC emacs-lisp +(show-paren-mode 1) +#+END_SRC + +Enable Line numberings. + +#+BEGIN_SRC emacs-lisp +(global-display-line-numbers-mode) +#+END_SRC + +Store backups and temperory files in =temporary-file-directory=. +=/tmp= on Unix. Warning: =/tmp= on most Unix-like systems is VOLATILE, IN-MEMORY storage. + +#+BEGIN_SRC emacs-lisp +(setq backup-directory-alist `((".*" . ,temporary-file-directory))) +(setq auto-save-file-name-transforms `((".*", temporary-file-directory t))) +#+END_SRC + +* Packages Configuration +** =ag= + +Set up =ag= on startup. + +#+BEGIN_SRC emacs-lisp + (use-package ag) +#+END_SRC + +** =company= + +Enable =company-mode= everywhere. + +#+BEGIN_SRC emacs-lisp + (use-package company) + (add-hook 'after-init-hook 'global-company-mode) +#+END_SRC + +Use =M-/= for completion. + +#+BEGIN_SRC emacs-lisp + (global-set-key (kbd "M-/") 'company-complete-common) +#+END_SRC + +** =flycheck= + +Install flycheck. + +#+BEGIN_SRC emacs-lisp + (use-package flycheck) +#+END_SRC + +** =magit= + +Use magit for git repos managment. + +#+BEGIN_SRC emacs-lisp + (use-package magit + :bind ("C-x g" . magit-status)) +#+END_SRC + +** =projectile= + +Use projectile for useful funcationality for project management. + +#+BEGIN_SRC emacs-lisp + (use-package projectile) +#+END_SRC + +** =undo-tree= + +Use =undo-tree=. + +#+BEGIN_SRC emacs-lisp + (use-package undo-tree) +#+END_SRC + +** Environment Specific Packages. +*** =Lisp= Environment + +Use =paredit=. + +#+BEGIN_SRC emacs-lisp + (use-package paredit) +#+END_SRC + +Use =rainbow-delimiters=. + +#+BEGIN_SRC emacs-lisp + (use-package rainbow-delimiters) +#+END_SRC + +* Programming Environments Configuration + +Use 4-spaced characters for tabs by default. + +#+BEGIN_SRC emacs-lisp + (setq-default tab-width 4) +#+END_SRC + +Use subword mode. + +#+BEGIN_SRC emacs-lisp + (use-package subword + :config (global-subword-mode 1)) +#+END_SRC + +** =C/C++= Environment + +Set the tab width when using C/C++ mode. + +#+BEGIN_SRC emacs-lisp + (setq-default c-basic-offset 4) +#+END_SRC + +** =Lisp= Environment + +Uses lisp packages when lisp languages are enabled. + +#+BEGIN_SRC emacs-lisp + (setq lispy-mode-hooks + '(emacs-lisp-hook lisp-mode-hook)) + + (dolist (hook lispy-mode-hooks) + (add-hook hook (lambda() + (setq show-paren-style 'expression) + (paredit-mode) + (rainbow-delimeters-mode)))) +#+END_SRC + +Set tab with + +** =ORG-mode= Environment +This might not be a programming environment, but making a seperate section is an overkill. + +Enable indentation in =org= source blocks. + +#+BEGIN_SRC emacs-lisp + (setq org-src-tab-acts-natively t) +#+END_SRC + +** =sh= Environment + +Indent with 4 spaces. + +#+BEGIN_SRC emacs-lisp + (add-hook 'sh-mode-hook + (lambda () + (setq sh-basic-offset 4 + sh-indentation 4))) +#+END_SRC +* Misc Configuration + +Install =speed-type= for typing practice. + +#+BEGIN_SRC emacs-lisp + (use-package speed-type) +#+END_SRC diff --git a/dotfiles/emacs/init.el b/dotfiles/emacs/init.el new file mode 100644 index 0000000..066fee4 --- /dev/null +++ b/dotfiles/emacs/init.el @@ -0,0 +1,26 @@ +;; Configure package.el to include MELPA. +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t) +(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) +(package-initialize) + +;; Ensure that use-package is installed. +(when (not (package-installed-p 'use-package)) + (package-refresh-contents) + (package-install 'use-package)) + (require 'use-package) + +(org-babel-load-file (concat user-emacs-directory "config.org")) +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages (quote (monokai-theme use-package magit)))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/dotfiles/nixpkgs/config.nix b/dotfiles/nixpkgs/config.nix new file mode 100644 index 0000000..97b4216 --- /dev/null +++ b/dotfiles/nixpkgs/config.nix @@ -0,0 +1,7 @@ +{ + packageOverrides = pkgs: { + nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { + inherit pkgs; + }; + }; +} diff --git a/dotfiles/sway/config b/dotfiles/sway/config new file mode 100644 index 0000000..0b79a74 --- /dev/null +++ b/dotfiles/sway/config @@ -0,0 +1,8 @@ +# Brightness +bindsym XF86MonBrightnessDown exec "brightnessctl set 2%-" +bindsym XF86MonBrightnessUp exec "brightnessctl set +2%" + +# Volume +bindsym XF86AudioRaiseVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%' +bindsym XF86AudioLowerVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%' +bindsym XF86AudioMute exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle' diff --git a/dotfiles/waybar/config b/dotfiles/waybar/config new file mode 100644 index 0000000..f3c0a77 --- /dev/null +++ b/dotfiles/waybar/config @@ -0,0 +1,147 @@ +{ + // "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + "height": 30, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], + "modules-center": ["sway/window"], + "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "sway/language", "battery", "battery#bat2", "clock", "tray"], + // Modules configuration + // "sway/workspaces": { + // "disable-scroll": true, + // "all-outputs": true, + // "format": "{name}: {icon}", + // "format-icons": { + // "1": "", + // "2": "", + // "3": "", + // "4": "", + // "5": "", + // "urgent": "", + // "focused": "", + // "default": "" + // } + // }, + "sway/mode": { + "format": "{}" + }, + "mpd": { + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ ", + "format-disconnected": "Disconnected ", + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", + "unknown-tag": "N/A", + "interval": 2, + "consume-icons": { + "on": " " + }, + "random-icons": { + "off": " ", + "on": " " + }, + "repeat-icons": { + "on": " " + }, + "single-icons": { + "on": "1 " + }, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "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-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% {icon} {format_source}", + "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": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + } +} diff --git a/dotfiles/waybar/style.css b/dotfiles/waybar/style.css new file mode 100644 index 0000000..63ea871 --- /dev/null +++ b/dotfiles/waybar/style.css @@ -0,0 +1,230 @@ +* { + border: none; + border-radius: 0; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; + min-height: 0; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 10px; + margin: 0 4px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} diff --git a/machines/hp-14-bp1xx/configuration.nix b/machines/hp-14-bp1xx/configuration.nix new file mode 100644 index 0000000..e41bee8 --- /dev/null +++ b/machines/hp-14-bp1xx/configuration.nix @@ -0,0 +1,48 @@ +{ config, pkgs, ... }: + +{ + imports = [ + /etc/nixos/hardware-configuration.nix + ../../profiles/desktop.nix + ../../profiles/communication.nix + ../../profiles/development.nix + ../../profiles/notebook.nix + ../../profiles/hardware.nix + ../../profiles/security.nix + ../../profiles/personal.nix + ]; + + # Use GRUB 2 boot loader + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.efiSupport = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.enableCryptodisk = true; + boot.loader.eif.canTouchEfiVariables = true; + boot.loader.eif.efiSysMountPoint = "/boot/efi"; + boot.initrd.availableKernelModuels = [ + "aes_x86_64" + "aesni_intel" + "cryptd" + ]; + + # networking + networking = { + hostName = "thehill"; + + wireless.enable = true; + useDHCP = true; + }; + + # video drivers + hardware.opengl.enable = true; + hardware.opengl.extraPackages = [ + amdvlk + pkgs.vaapiIntel + pkgs.libvdpau-va-gl + pkgs.vaapiVdpau + pkgs.intel-ocl + ]; + environment.variables.VK_ICD_FILENAMES = + "/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json"; +} diff --git a/profiles/common.nix b/profiles/common.nix new file mode 100644 index 0000000..e4ae47a --- /dev/null +++ b/profiles/common.nix @@ -0,0 +1,55 @@ +{ config, pkgs, libs, ... }: + +{ + imports = [ + "../services/grub.nix" + "../services/ntp.nix" + "../services/dns.nix" + "../services/localization.nix" + ]; + + # mount tmpfs on /tmp + boot.tmpOnTmpfs = lib.mkDefault true; + + # show IP on login screen + environment.etc."issue.d/ip.issue".text = "\\4\n"; + networking.dhcpcd.runHook = "${pkgs.utillinux}/bin/agetty --reload"; + + # common user configuration + users.mutableUsers = false; + + # install basic packages + environment.systemPackages = with pkgs; [ + htop + iotop + iftop + wget + curl + tcpdump + telnet + whois + file + lsof + inotify-tools + strace + gdb + xz + lz4 + zip + unzip + rsync + tealdeer + cheat + tmux + tree + dfc + pwgen + mkpasswd + jq + gitAndTools.gitFull + ]; + + programs.bash.enableCompletion = true; + + system.copySystemConfiguration = true; +} diff --git a/profiles/communication.nix b/profiles/communication.nix new file mode 100644 index 0000000..ca7ff75 --- /dev/null +++ b/profiles/communication.nix @@ -0,0 +1,63 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + # irc + irssi + # matrix + #element-desktop + # messengers + discord + # gnupg + gpa + # rss + newsboat + # video + mpv + youtube-dl + ]; + + # setup newsboat + programs.newsboat = { + enable = true; + autoReload = yes; + reloadThreads = 4; + extraConfig = $''' + bind-key j down feedlist + bind-key k up feedlist + bind-key j next articlelist + bind-key k prev articlelist + bind-key J next-feed articlelist + bind-key K prev-feed articlelist + bind-key j down article + bind-key k up article + + macro m set browser "mpv --ytdl %u --profile=360p > /dev/null &"; open-in-browser ; set browser "lynx -nocolor" + macro a set browser "echo %u | xclip -sel clip"; open-in-browser ; set browser "lynx -nocolor" + macro v set browser "curl %u | feh - &"; open-in-browser ; set browser "lynx -nocolor" + + delete-played-files no + download-path "~/dox/pod/%h/%n" + max-downloads 4 + player "nvlc" + color listfocus white black bold + color listfocus_unread white black bold + color info white black bold + + unbind-key C feedlist + confirm-exit no + cleanup-on-quit no + $'''; + urls = [ + { tags = [ "XKCD" ]; url = "https://xkcd.com/atom.xml"; } + { tags = [ "Linux Journal" ]; url = + "https://www.linuxjournal.com/news.rss"; } + { tags = [ "ItsFOSS" ]; url = "https://itsfoss.com/feed"; } + { tags = [ "Opensource News" ]; url = + "https://opensource.org/news.xml"; } + { tags = [ "WeLiveSecurity" ]; url = + "https://www.welivesecurity.com/feed"; } + { tags = [ "ItsFOSS" ]; url = "https://itsfoss.com/feed"; } + ]; + }; +} diff --git a/profiles/desktop.nix b/profiles/desktop.nix new file mode 100644 index 0000000..459e7a8 --- /dev/null +++ b/profiles/desktop.nix @@ -0,0 +1,363 @@ +{ config= pkgs, lib, ... }: + +{ + imports = [ + "./common.nix" + "../services/fonts" + "../users/sisyphus/base.nix" + ]; + + # set up NUR + nixpkgs.config.packageOverrides = pkgs: { + nur = import (builtins.fetchTarball + "https://github.com/nix-community/NUR/archive/master.tar.gz") { + inherit pkgs; + }; + }; + + # enable boot splash + boot.plymouth.enable = true; + + # setup sway + wayland.windowManager.sway.enable = true; + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + extraPackages = with pkgs; [ + swaylock + swayidle + wl-clipboard + mako + alacritty + bemenu + wf-recorder + flashfocus + autotiling + waybar + kanshi + xwayland + ]; + extraOptions = [ + "--my-next-gpu-wont-be-nvidia" + ]; + extraSessionCommands = '' + export SDL_VIDEODRIVER=wayland + # needs qt5.qtwayland in systemPackages + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + # Fix for some Java AWT applications (e.g. Android Studio), + # use this if they aren't displayed properly: + export _JAVA_AWT_WM_NONREPARENTING=1 + ''; + }; + environment.systemPackages = with pkgs; [ wl-clipboard ]; + environment.systemPackages = with pkgs; [ + gtk-engine-murrine + gtk_engines + gsettings-desktop-schemas + lxappearance + ]; + programs.qt5ct.enable = true; + systemd.user.services.swayidle = { + description = "Idle Manager for Wayland"; + documentation = [ "man:swayidle(1)" ]; + wantedBy = [ "sway-session.target" ]; + partOf = [ "graphical-session.target" ]; + path = [ pkgs.bash ]; + serviceConfig = { + ExecStart = '' ${pkgs.swayidle}/bin/swayidle -w -d \ + timeout 300 '${pkgs.sway}/bin/swaymsg "output * dpms off"' \ + resume '${pkgs.sway}/bin/swaymsg "output * dpms on"' + ''; + }; + }; + # Here we but a shell script into path, which lets us start sway.service (after importing the environment of the login shell). + environment.systemPackages = with pkgs; [ + ( + pkgs.writeTextFile { + name = "startsway"; + destination = "/bin/startsway"; + executable = true; + text = '' + #! ${pkgs.bash}/bin/bash + + # first import environment variables from the login manager + systemctl --user import-environment + # then start the service + exec systemctl --user start sway.service + ''; + } + ) + ]; + systemd.user.targets.sway-session = { + description = "Sway compositor session"; + documentation = [ "man:systemd.special(7)" ]; + bindsTo = [ "graphical-session.target" ]; + wants = [ "graphical-session-pre.target" ]; + after = [ "graphical-session-pre.target" ]; + }; + systemd.user.services.sway = { + description = "Sway - Wayland window manager"; + documentation = [ "man:sway(5)" ]; + bindsTo = [ "graphical-session.target" ]; + wants = [ "graphical-session-pre.target" ]; + after = [ "graphical-session-pre.target" ]; + # We explicitly unset PATH here, as we want it to be set by + # systemctl --user import-environment in startsway + environment.PATH = lib.mkForce null; + serviceConfig = { + Type = "simple"; + ExecStart = '' + ${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug + ''; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + services.redshift = { + enable = true; + # Redshift with wayland support isn't present in nixos-19.09 atm. You have to cherry-pick the commit from https://github.com/NixOS/nixpkgs/pull/68285 to do that. + package = pkgs.redshift-wlr; + }; + + programs.waybar.enable = true; + + systemd.user.services.kanshi = { + description = "Kanshi output autoconfig "; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + serviceConfig = { + # kanshi doesn't have an option to specifiy config file yet, so it looks + # at .config/kanshi/config + ExecStart = '' + ${pkgs.kanshi}/bin/kanshi + ''; + RestartSec = 5; + Restart = "always"; + }; + }; + + + # setup firefox + program.firefox = { + enable = true; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + privacy-badger + CookieAutoDelete + CanvasBlocker + uBlock + https-everywhere + cookiemaster + vimium-c + darkreader + treestyletab + ]; + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + forceWayland = true; + profiles.sisyphus = { + id = 0; + isDefault = true; + name = "sisyphus"; + settings = { + "app.normandy.api_url" = ""; + "app.normandy.enabled" = false; + "app.shield.optoutstudies.enabled" = false; + "app.update.auto" = false; + "beacon.enabled" = false; + "breakpad.reportURL" = ""; + "browser.aboutConfig.showWarning" = false; + "browser.cache.offline.enable" = false; + "browser.crashReports.unsubmittedCheck.autoSubmit" = false; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; + "browser.crashReports.unsubmittedCheck.enabled" = false; + "browser.disableResetPrompt" = true; + "browser.newtab.preload" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.enabled" = false; + "browser.newtabpage.enhanced" = false; + "browser.newtabpage.introShown" = true; + "browser.safebrowsing.appRepURL" = ""; + "browser.safebrowsing.blockedURIs.enabled" = false; + "browser.safebrowsing.downloads.enabled" = false; + "browser.safebrowsing.downloads.remote.enabled" = false; + "browser.safebrowsing.downloads.remote.url" = ""; + "browser.safebrowsing.enabled" = false; + "browser.safebrowsing.malware.enabled" = false; + "browser.safebrowsing.phishing.enabled" = false; + "browser.search.suggest.enabled" = false; + "browser.selfsupport.url" = ""; + "browser.send_pings" = false; + "browser.sessionstore.privacy_level" = 2; + "browser.shell.checkDefaultBrowser" = false; + "browser.startup.homepage_override.mstone" = "ignore"; + "browser.tabs.crashReporting.sendReport" = false; + "browser.urlbar.speculativeConnect.enabled" = false; + "browser.urlbar.trimURLs" = false; + "datareporting.healthreport.service.enabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "device.sensors.ambientLight.enabled" = false; + "device.sensors.enabled" = false; + "device.sensors.motion.enabled" = false; + "device.sensors.orientation.enabled" = false; + "device.sensors.proximity.enabled" = false; + "dom.battery.enabled" = false; + "dom.event.clipboardevents.enabled" = false; + "dom.webaudio.enabled" = false; + "experiments.activeExperiment" = false; + "experiments.enabled" = false; + "experiments.manifest.uri" = ""; + "experiments.supported" = false; + "extensions.CanvasBlocker@kkapsner.de.whiteList" = ""; + "extensions.ClearURLs@kevinr.whiteList" = ""; + "extensions.Decentraleyes@ThomasRientjes.whiteList" = ""; + "extensions.TemporaryContainers@stoically.whiteList" = ""; + "extensions.autoDisableScopes" = 14; + "extensions.getAddons.cache.enabled" = false; + "extensions.getAddons.showPane" = false; + "extensions.greasemonkey.stats.optedin" = false; + "extensions.greasemonkey.stats.url" = ""; + "extensions.pocket.enabled" = false; + "extensions.shield-recipe-client.api_url" = ""; + "extensions.shield-recipe-client.enabled" = false; + "extensions.webservice.discoverURL" = ""; + "media.autoplay.default" = 1; + "media.autoplay.enabled" = false; + "media.eme.enabled" = false; + "media.gmp-widevinecdm.enabled" = false; + "media.navigator.enabled" = false; + "media.peerconnection.enabled" = false; + "media.video_stats.enabled" = false; + "network.allow-experiments" = false; + "network.captive-portal-service.enabled" = false; + "network.cookie.cookieBehavior" = 1; + "network.dns.disablePrefetch" = true; + "network.dns.disablePrefetchFromHTTPS" = true; + "network.http.referer.spoofSource" = true; + "network.http.speculative-parallel-limit" = 0; + "network.predictor.enable-prefetch" = false; + "network.predictor.enabled" = false; + "network.prefetch-next" = false; + "network.trr.mode" = 5; + "privacy.donottrackheader.enabled" = true; + "privacy.donottrackheader.value" = 1; + "privacy.firstparty.isolate" = true; + "privacy.resistFingerprinting" = true; + "privacy.trackingprotection.cryptomining.enabled" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.fingerprinting.enabled" = true; + "privacy.trackingprotection.pbmode.enabled" = true; + "privacy.usercontext.about_newtab_segregation.enabled" = true; + "security.ssl.disable_session_identifiers" = true; + "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = false; + "signon.autofillForms" = false; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.cachedClientID" = ""; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.hybridContent.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.prompted" = 2; + "toolkit.telemetry.rejected" = true; + "toolkit.telemetry.reportingpolicy.firstRun" = false; + "toolkit.telemetry.server" = ""; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.unifiedIsOptIn" = false; + "toolkit.telemetry.updatePing.enabled" = false; + "webgl.disabled" = true; + "webgl.renderer-string-override" = " "; + "webgl.vendor-string-override" = " "; + }; + }; + }; + }; + services.pipewire.enable = true; + environment.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + XDG_CURRENT_DESKTOP = "sway"; + }; + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = 1; + XDG_CURRENT_DESKTOP = "sway"; + }; + xdg = { + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + ]; + gtkUsePortal = true; + }; + }; + + programs.chromium = { + enable = true; + extensions = [ + "cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin + "gcbommkclmclpchllfjekcdonpmejbdp" # HTTPS Everywhere + ]; + extraOpts = { + "BrowserSignin" = 0; + "SyncDisabled" = true; + "PasswordManagerEnabled" = false; + "AutofillAddressEnabled" = false; + "AutofillCreditCardEnabled" = false; + "BuiltInDnsClientEnabled" = ffalse; + "MetricsReportingEnabled" = false; + "SearchSuggestEnabled" = false; + "AlternateErrorPagesEnabled" = false; + "SpellcheckEnabled" = true; + "SpellcheckLanguage" = [ "en-US" ] + "CloudPrintSubmitEnabled" = false; + }; + }; + + # setup zathura + programs.zathura.enable = true; + programs.zathura.options = { + default-bg = "#000000"; + default-fg = "#FFFFFF"; + }; + + # setup fish + programs.fish.enable = true; + + # setup tmux + programs.tmux.enable = true; + programs.tmux.extraConfig = " + unbind C-b + set-option -g prefix C-a + bind-key C-a send-prefix + + bind | split-window -h + bind - split-window -v + unbind '\"' + unbind % + + bind -n M-h select-pane -L + bind -n M-l select-pane -R + bind -n M-k select-pane -U + bind -n M-j select-pane -D + + set -g mouse on + + set-option -g allow-rename on + + bind-key r command-prompt -I \"#W\" "rename-window '%%'" + + set -g default-terminal \"screen-256color\""; + + enviornment.systemPackges = with pkgs; [ + chromium + firefox + libreoffice + neofetch + flameshot + zathura + fish + ]; +} diff --git a/profiles/development.nix b/profiles/development.nix new file mode 100644 index 0000000..64d693c --- /dev/null +++ b/profiles/development.nix @@ -0,0 +1,85 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + pipenv + python + gcc + rustup + cargo + + emacs + neovim + ]; + + # setup htop + programs.htop.enable = true; + programs.htop.enableMouse = true; + programs.htop.hideThreads = true; + programs.htop.shadowOtherUsers = true; + programs.htop.showCpuFrequency = true; + programs.htop.treeView = true; + programs.htop.vimMode = true; + + # setup emacs + programs.emacs.enable = true; + programs.emacs.package = "emacs"; + programs.emacs.extraPackages = "epkgs: [ epkgs.use-package ]" + + # setup neovim + programs.neovim.enable = true; + programs.neovim.viAlias = true; + programs.neovim.vimAlias = true; + programs.neovim.vimdiffAlias = true; + programs.neovim.configure = { + customRC = $''' + filetype plugin indent on + + set t_Co =256 + filetype plugin indent on + + " Setup theme. + set t_Co=256 + "colorscheme wal + let g:airline_themes='onedark' + + " General + set textwidth=80 + let mapleader = " " + set clipboard+=unnamed + set autoread + set backspace=indent,eol,start + set ignorecase + set smartcase + set incsearch + set magic + + " Appearance + set number + set nowrap + set showbreak=↪ + " toggle invisible characters + set list + "set listchars=tab:→\ ,eol:¬ + "set listchars=tab:→\ ,eol:¬,trail:⋅,extends:❯,precedes:❮,space:· + set list + set ttyfast + + " Leader keys + map e :bufdo e! + nnoremap :WhichKey '' + + " Custom settings. + set mouse=a + set encoding=utf-8 + set backspace=indent,eol,start + set timeoutlen=50 + syntax on + set rnu + + $'''; + packages.myVimPackage = with pkgs.vimPlugins; { + start = [ ctrlp vimwiki vim-startify auto-pairs ]; + }; + }; +} diff --git a/profiles/hardware.nix b/profiles/hardware.nix new file mode 100644 index 0000000..a606b57 --- /dev/null +++ b/profiles/hardware.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + lshw + usbutils + pciutils + pactl + ]; + programs.light.enable = true; +} diff --git a/profiles/notebook.nix b/profiles/notebook.nix new file mode 100644 index 0000000..3b745a9 --- /dev/null +++ b/profiles/notebook.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + powerManagement.enable = true; +} diff --git a/profiles/personal.nix b/profiles/personal.nix new file mode 100644 index 0000000..0819a9e --- /dev/null +++ b/profiles/personal.nix @@ -0,0 +1,16 @@ +{ config, pkgs, libs, ... }: + +{ + imports = [ "../users/sisyphus/personal.nix" ]; + + environment.systemPackages = with pkgs; [ + virtmanager + ] + + virtualisation.docker.enable = true; + + virtualisation.libvirtd = { + enable = true; + qemuPackage = pkgs.qemu_kvm; + }; +} diff --git a/profiles/security.nix b/profiles/security.nix new file mode 100644 index 0000000..3c922a0 --- /dev/null +++ b/profiles/security.nix @@ -0,0 +1,64 @@ +{ config, pkgs, libs, ... }: + +{ + # Setup firewall + networking.firewall.enable = mkDefault true; + networking.firewall.package = mkDefault "pkgs.ufw"; + networking.firewall.allowPing = mkDefault false; + + # Apparmor + security.apparmor.enable = mkDefault true; + security.apparmor.confineSUIDApplications = mkDefault true; + security.audit.enable = mkDefault true; + security.auditd.enable = mkDefault true; + security.chromiumSuidSandbox.enable = mkDefault true; + + # General Hardening + security.forcePageTableIsolation = mkDefault true; + security.hideProcessInformation = mkDefault true; + security.sudo.enable = mkDefault true; + + # Kernel Hardening + boot.kernelPackages = mkDefault pkgs.linuxPackages_hardened; + security.protectKernelImage = mkDefault true; + nix.allowedUsers = mkDefault [ "@users" ]; + environment.memoryAllocator.provider = mkDefault "scudo"; + environment.variables.SCUDO_OPTIONS = mkDefault "ZeroContents=1"; + security.lockKernelModules = mkDefault true; + # This is required by podman to run containers in rootless mode. + security.unprivilegedUsernsClone = mkDefault config.virtualisation.containers.enable; + security.virtualisation.flushL1DataCache = mkDefault "always"; + boot.kernelParams = [ + "slub_debug=FZP" + "page_poison=1" + "page_alloc.shuffle=1" + ]; + boot.kernel.sysctl."kernel.yama.ptrace_scope" = mkOverride 500 1; + boot.kernel.sysctl."kernel.kptr_restrict" = mkOverride 500 2; + boot.kernel.sysctl."net.core.bpf_jit_enable" = mkDefault false; + boot.kernel.sysctl."kernel.ftrace_enabled" = mkDefault false; + # Enable strict reverse path filtering (that is, do not attempt to route + # packets that "obviously" do not belong to the iface's network; dropped + # packets are logged as martians). + boot.kernel.sysctl."net.ipv4.conf.all.log_martians" = mkDefault true; + boot.kernel.sysctl."net.ipv4.conf.all.rp_filter" = mkDefault "1"; + boot.kernel.sysctl."net.ipv4.conf.default.log_martians" = mkDefault true; + boot.kernel.sysctl."net.ipv4.conf.default.rp_filter" = mkDefault "1"; + # Ignore broadcast ICMP (mitigate SMURF) + boot.kernel.sysctl."net.ipv4.icmp_echo_ignore_broadcasts" = mkDefault true; + # Ignore incoming ICMP redirects (note: default is needed to ensure that the + # setting is applied to interfaces added after the sysctls are set) + boot.kernel.sysctl."net.ipv4.conf.all.accept_redirects" = mkDefault false; + boot.kernel.sysctl."net.ipv4.conf.all.secure_redirects" = mkDefault false; + boot.kernel.sysctl."net.ipv4.conf.default.accept_redirects" = mkDefault false; + boot.kernel.sysctl."net.ipv4.conf.default.secure_redirects" = mkDefault false; + boot.kernel.sysctl."net.ipv6.conf.all.accept_redirects" = mkDefault false; + boot.kernel.sysctl."net.ipv6.conf.default.accept_redirects" = mkDefault false; + + # Ignore outgoing ICMP redirects (this is ipv4 only) + boot.kernel.sysctl."net.ipv4.conf.all.send_redirects" = mkDefault false; + boot.kernel.sysctl."net.ipv4.conf.default.send_redirects" = mkDefault false; + + # Sandboxing + programs.firejail.enable = true; +} diff --git a/services/dns.nix b/services/dns.nix new file mode 100644 index 0000000..7a61854 --- /dev/null +++ b/services/dns.nix @@ -0,0 +1,7 @@ +{ config, ... }: + +{ + networking.extraHosts = fetchurl { + url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts"; + }; +} diff --git a/services/dotfiles.nix b/services/dotfiles.nix new file mode 100644 index 0000000..05f6ee3 --- /dev/null +++ b/services/dotfiles.nix @@ -0,0 +1,17 @@ +{ config, ... }: + +{ + imports = [ "../users/sisyphus/base.nix" ]; + xdg.configFile."sway/config".source = environment.variables.DOTFILES_LOC + + "sway/config"; + + xdg.configFile."emacs".source = environment.variables.DOTFILES_LOC + + "emacs"; + + xdg.configFile = { + "xdg/waybar/config".source = environment.variables.DOTFILES_LOC + + "waybar/config"; + "xdg/waybar/style.css".source = environment.variables.DOTFILES_LOC + + "waybar/style.css"; + }; +} diff --git a/services/fonts/default.nix b/services/fonts/default.nix new file mode 100644 index 0000000..63ecbad --- /dev/null +++ b/services/fonts/default.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +{ + fonts = { + enableDefaultFonts = true; + enableFontDir = true; + + fonts = with pkgs; [ + fira-mono + libertine + open-sans + twemoji-color-font + liberation_ttf + ]; + + fontconfig = { + enable = true; + antialias = true; + defaultFonts = { + monospace = [ "Fira Mono" ]; + serif = [ "Linux Libertine" ]; + sansSerif = [ "Open Sans" ]; + emoji = [ "Twitter Color Emoji" ]; + } + } + } +} diff --git a/services/grub.nix b/services/grub.nix new file mode 100644 index 0000000..d94e447 --- /dev/null +++ b/services/grub.nix @@ -0,0 +1,7 @@ +{ config, lib, ... }: +{ + boot.loader.grub.enable = lib.mkDefault true; + boot.loader.grub.version = lib.mkDefault 2; + boot.loader.grub.memtest86.enable = lib.mkDefault false; + boot.loader.timeout = lib.mkDefault 2; +} diff --git a/services/localization.nix b/services/localization.nix new file mode 100644 index 0000000..adf4910 --- /dev/null +++ b/services/localization.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + i18n.defaultlocale = "en_US.UTF-8"; + + console = { + keyMap = "us"; + font = "Lat2-Terminus16"; + }; + + time.timeZone = "Asia/Riyadh"; +} diff --git a/services/nix.nix b/services/nix.nix new file mode 100644 index 0000000..06b3642 --- /dev/null +++ b/services/nix.nix @@ -0,0 +1,11 @@ +{ config, ... }: + +{ + nix = { + useSandbox = true; + trustedUsers = [ + "root" + "@wheel" + ]; + }; +} diff --git a/services/ntp.nix b/services/ntp.nix new file mode 100644 index 0000000..11bf8e3 --- /dev/null +++ b/services/ntp.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: + +{ + services.ntp.enable = true; + + services.timesyncd = { + enable = lib.mkDefault true; + servers = [ + "0.asia.pool.ntp.org" + "1.asia.pool.ntp.org" + "2.asia.pool.ntp.org" + "3.asia.pool.ntp.org" + ]; + }; +} diff --git a/users/sisyphus/base.nix b/users/sisyphus/base.nix new file mode 100644 index 0000000..a10bb96 --- /dev/null +++ b/users/sisyphus/base.nix @@ -0,0 +1,94 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ]; + + users.users.sisyphus = { + isNormalUser = true; + home = "/home/sisyphus"; + description = ""; + extraGroups = [ "wheel" "networkmanager" "audio" "video" "docker" "libvirtd" ]; + hashedPassword = + "$6$UElxymiLttxtbHbX$Jt.lWxlWc29MvJNYa97lB57iiMQdhhtDMpXXlRyP.3oFlkgfihhNHy9MRFdvMDCgKo.rXenSamIZyC.mEb/o20"; + }; + + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + + home-manager.users.sisyphus = { pkgs, ... }: { + programs = { + bash = { + enable = true; + historyControl = [ "ignoredups" "ignorespace" ]; + }; + + ssh.enable = true; + + git.enable = true; + }; + } + + # set up xdg variables + xdg.enable = true; + xdg.configHome = "~/.config"; + xdg.dataHome = "~/.local/share"; + xdg.cacheHome = "~/.cache"; + + xdg.userDirs.enable = true; + xdg.userDirs.createDirectories = true; + xdg.userDirs.desktop = "\$HOME/desk"; + xdg.userDirs.documents = "\$HOME/dox"; + xdg.userDirs.download = "\$HOME/dl"; + xdg.userDirs.extraConfig = "\$HOME/misc"; + xdg.userDirs.music = "\$HOME/muz"; + xdg.userDirs.pictures = "\$HOME/pix"; + xdg.userDirs.publicShare = "\$HOME/pub"; + xdg.userDirs.templates = "\$HOME/templ"; + xdg.userDirs.videos = "\$HOME/vidz"; + + # ~/ clean-up & generic env vars + environment = let config_loc = "~/.config/" in { + variables.EDITOR="/usr/share/dotfiles"; + variables = { + EDITOR = "nvim"; + VISUAL = "emacs"; + TERMINAL = "alacritty"; + BROWSER = "firefox"; + + LESSHISTFILE = "-"; + WGETRC = config_loc + "wgetrc"; + PASSWORD_STORE_DIR = config_loc + "pass"; + GNUPGHOME = config_loc + "gnupg"; + + DOTFILES_LOC = "/usr/share/dotfiles/"; + }; + }; + + # aliases + home-manager.users.sisyphus = { pkgs, ... }: { + programs.bash.shellAliases = { + config = "git --git-dir=$HOME/.config/dotfiles + --work-tree=$HOME"; + myip = "curl ipinfo.io/ip"; + cp = "cp -iv"; + rm = "rm -iv"; + ll = "ls -lhA"; + g = "g"; + e = "$EDITOR"; + v = "$VISUAL"; + ".." = "cd .."; + }; + programs.fish.shellAliases = { + config = "git --git-dir=$HOME/.config/dotfiles + --work-tree=$HOME"; + myip = "curl ipinfo.io/ip"; + cp = "cp -iv"; + rm = "rm -iv"; + ll = "ls -lhA"; + g = "g"; + e = "$EDITOR"; + v = "$VISUAL"; + ".." = "cd .."; + }; + }; +} diff --git a/users/sisyphus/personal.nix b/users/sisyphus/personal.nix new file mode 100644 index 0000000..6c41ae1 --- /dev/null +++ b/users/sisyphus/personal.nix @@ -0,0 +1,24 @@ +{ config, pkgs, lib, ... }: { + imports = [ ]; + + home-manager.users.sisyphus = { pkgs, ... }: { + programs = { + obs-studio = { + enable = true; + plugins = with pkgs; [ obs-v4l2sink ]; + }; + + git = { + userName = "ayham"; + userEmail = "altffour@protonmail.com"; + signing.key = "B4ADFA86EDF5CCE9"; + } + } + } + + # GPG + programs.gnupg.package = "pkgs.gnupg"; + programs.gnupg.agent.enable = true; + programs.gnupg.agent.pinentryFlavor = "qt"; + programs.gnupg.dirmngr.enable = true; +}