From 3521d5da4b902bdae8dc51e3a82df4dbf422eddb Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 6 May 2022 11:39:51 -0500 Subject: [PATCH] adding nix configs --- awesome/rubato | 1 - ble.sh | 1 + configuration.nix | 183 ++++++++++++++++++++++++++++++++ fish/config.fish | 3 + home.nix | 192 ++++++++++++++++++++++++++++++++++ qutebrowser/autoconfig.yml | 2 +- qutebrowser/config.py | 4 +- qutebrowser/quickmarks | 1 + rbw/config.json | 1 + rofi/config.rasi | 16 +-- scripts/emacslof | 2 +- scripts/mem-plasma.2s.sh | 2 +- scripts/muunread-plasma.2s.sh | 2 +- scripts/qblof | 6 +- scripts/rofi-clip | 4 +- scripts/update-nix | 5 + scripts/ww | 2 +- scripts/yt | 2 +- 18 files changed, 408 insertions(+), 21 deletions(-) delete mode 160000 awesome/rubato create mode 160000 ble.sh create mode 100644 configuration.nix create mode 100644 home.nix create mode 100644 rbw/config.json create mode 100755 scripts/update-nix diff --git a/awesome/rubato b/awesome/rubato deleted file mode 160000 index 51b4f76..0000000 --- a/awesome/rubato +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 51b4f760c9601254f4817ac90441ccd1ad0a0616 diff --git a/ble.sh b/ble.sh new file mode 160000 index 0000000..d340233 --- /dev/null +++ b/ble.sh @@ -0,0 +1 @@ +Subproject commit d3402332b5715e56c9d32689337e4390fb4ab3ac diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..695e837 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,183 @@ +# 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 + ]; + + nix = { + extraOptions = "experimental-features = nix-command flakes"; + package = pkgs.nixFlakes; + }; + + # Use the systemd-boot EFI boot loader. + boot.kernelPackages = pkgs.linuxPackages_zen; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + nixpkgs.config.allowUnfree = true; + boot.kernelParams = [ "mem_sleep_default=deep" ]; + + networking.hostName = "syl"; # Define your hostname. + networking.networkmanager.enable = true; + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Set your time zone. + time.timeZone = "America/Chicago"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.wlp170s0.useDHCP = true; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + # Set default shell to be dash for speed + environment.binsh = "${pkgs.dash}/bin/dash"; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the Plasma 5 Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + + # Configure keymap in X11 + services.xserver.layout = "us"; + # services.xserver.xkbOptions = "eurosign:e"; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = [ pkgs.gutenprint pkgs.gutenprintBin pkgs.hplipWithPlugin ]; + + # Enabel fingerprint + services.fprintd.enable = true; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + }; + + # Needed for some pipewire progs + programs.dconf.enable = true; + + # Turn on flatpak + services.flatpak.enable = true; + + #NEWS!!! + # Some other things + services.thermald.enable = true; + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC="performance"; + CPU_SCALING_GOVERNOR_ON_BAT="powersave"; + START_CHARGE_THRESH_BAT1=70; + STOP_CHARGE_THRESH_BAT1=80; + }; + }; + + services.usbmuxd.enable = true; + services.fstrim.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + services.xserver.libinput.enable = true; + + programs.fish.enable = true; + programs.zsh.enable = true; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.chris = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" "input" ]; # Enable ‘sudo’ for the user. + shell = pkgs.zsh; + }; + + programs.partition-manager.enable = true; + programs.kdeconnect.enable = true; + + security.pam.services.kwallet = { + name = "kwallet"; + enableKwallet = true; + }; + security.pam.services.sddm.enableKwallet = true; + + virtualisation.waydroid.enable = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim + wget + killall + discover + lightly-qt + pinentry + pinentry-qt + unzip + unrar + p7zip + zip + gzip + usbutils + git + ark + kget + krename + kwallet-pam + plasma5Packages.kwallet + libimobiledevice + sddm-kcm + ydotool + bottles + ]; + + # EMACS + services.emacs.package = pkgs.emacsPgtkNativeComp; + nixpkgs.overlays = [ + (import (builtins.fetchTarball { + url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz; + })) + ]; + services.emacs.enable = true; + + # 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 = "21.11"; # Did you read the comment? + +} + diff --git a/fish/config.fish b/fish/config.fish index ae65072..a90db5d 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -210,10 +210,12 @@ alias yeet "paru -Rns" alias ls "exa -l" alias la "exa -la" alias mpf "mpv --profile=fast" +alias mps "mpv --profile=slow" alias suspend "systemctl suspend" alias ec "emacsclient -t" alias ecc "emacsclient -c" alias mkdir "mkdir -pv" +alias upnix "update-nix" ### Start X at login if status is-login @@ -231,3 +233,4 @@ macchina # end # fm6000 -r -c blue +any-nix-shell fish --info-right | source diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..483ba2a --- /dev/null +++ b/home.nix @@ -0,0 +1,192 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "chris"; + home.homeDirectory = "/home/chris"; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "22.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + programs.git = { + enable = true; + userName = "Chris Cochrun"; + userEmail = "chris@cochrun.xyz"; + }; + + home.packages = with pkgs; [ + exa mpv yt-dlp rofi-emoji + nerdfonts latte-dock bat + libsForQt5.bismuth bc libnotify + rofi-wayland ripgrep + sysstat procs papirus-icon-theme + phinger-cursors plasma-hud kde-cli-tools + macchina meson ninja cmake gnumake + extra-cmake-modules gcc gzip + htop btop firefox kate kdialog openlp + easyeffects libreoffice-fresh vlc + neochat haskellPackages.greenclip + pulsemixer any-nix-shell wtype + spotdl kdenlive ffmpeg + ]; + + programs.mu.enable = true; + + # services.emacs = { + # enable = true; + # package = pkgs.emacsPgtkGcc; + # defaultEditor = true; + # }; + + programs.mbsync.enable = true; + programs.msmtp.enable = true; + services.mbsync.enable = true; + home.file.".mbsyncrc" = { + source = ./.mbsyncrc; + }; + + services.nextcloud-client = { + enable = true; + startInBackground = true; + }; + + services.syncthing.enable = true; + services.kdeconnect.enable = true; + services.easyeffects.enable = true; + + services.espanso = { + enable = true; + settings = { + + matches = [ + { # dates + trigger = ":date"; + replace = "{{mydate}}"; + vars = [{ + + name = "mydate"; + type = "date"; + params = {format = "%m/%d/%Y";}; + }]; + } + { # Shell commands + trigger = ":shell"; + replace = "{{output}}"; + vars = [{ + name = "output"; + type = "shell"; + params = { cmd = "echo Hello from your shell";}; + }]; + } + { # simple text + trigger = ":gml"; + replace = "ccochrun21@gmail.com"; + } + { + trigger = ":otl"; + replace = "chris.cochrun@outlook.com"; + } + { + trigger = ":tfcml"; + replace = "chris@tfcconnection.org"; + } + { + trigger = ":name"; + replace = "Chris Cochrun"; + } + ]; + }; + }; + + home.file.".config/rofi" = { + source = ./rofi; + recursive = true; + }; + + programs.rbw.enable = true; + home.file.".config/rbw" = { + source = ./rbw; + recursive = true; + }; + + programs.fish.enable = true; + programs.fish.plugins = [ + # { + # name = "oh-my-fish"; + # src = pkgs.fetchFromGitHub { + # owner = "oh-my-fish"; + # repo = "oh-my-fish"; + # rev = "d428b723c8c18fef3b2a00b8b8b731177f483ad8"; + # sha256 = "msItKEPe7uSUpDAfCfdYZjt5NyfM3KtOrLUTO9NGqlg="; + # }; + # } + # { + # name = "plugin-foreign-env"; + # src = pkgs.fetchFromGitHub { + # owner = "oh-my-fish"; + # repo = "plugin-foreign-env"; + # rev = "b3dd471bcc885b597c3922e4de836e06415e52dd"; + # sha256 = "3h03WQrBZmTXZLkQh1oVyhv6zlyYsSDS7HTHr+7WjY8="; + # }; + # } + ]; + home.file.".config/fish" = { + source = ./fish; + recursive = true; + }; + + programs.qutebrowser.enable = true; + home.file.".config/qutebrowser" = { + source = ./qutebrowser; + recursive = true; + }; + + home.file.".config/mpv" = { + source = ./mpv; + recursive = true; + }; + + home.file.".config/macchina" = { + source = ./macchina; + recursive = true; + }; + + home.file."scripts" = { + source = ./scripts; + recursive = true; + }; + + programs.starship.enable = true; + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + autocd = true; + dotDir = ".config/zsh"; + shellAliases = { + ls = "exa -l"; + la = "exa -la"; + mpf = "mpv --profile=fast"; + mps = "mpv --profile=slow"; + ec = "emacsclient -t"; + ecc = "emacsclient -c"; + mkdir = "mkdir -pv"; + upnix = "update-nix"; + }; + initExtra = '' + macchina + ''; + }; +} diff --git a/qutebrowser/autoconfig.yml b/qutebrowser/autoconfig.yml index 44c6bb3..774f730 100644 --- a/qutebrowser/autoconfig.yml +++ b/qutebrowser/autoconfig.yml @@ -47,7 +47,7 @@ settings: scrolling.bar: global: overlay statusbar.show: - global: in-mode + global: always tabs.show: global: switching zoom.default: diff --git a/qutebrowser/config.py b/qutebrowser/config.py index 7a8efeb..9ea2b67 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -2129,10 +2129,10 @@ c.tabs.title.alignment = "center" ## qutebrowser`. ## Type: Dict c.url.searchengines = { - "DEFAULT": "https://search.brave.com/search?q={}", + "b": "https://search.brave.com/search?q={}", "vid": "https://search.brave.com/videos?q={}", "img": "https://search.brave.com/images?q={}", - "tfc": "https://search.tfcconnection.org/?q={}", + "DEFAULT": "https://search.tfcconnection.org/?q={}", "yt": "https://yewtu.be/search?q={}", "mel": "https://melpa.org/#/?q={}", "y": "https://www.youtube.com/results?search_query={}", diff --git a/qutebrowser/quickmarks b/qutebrowser/quickmarks index 20ee00b..e90f152 100644 --- a/qutebrowser/quickmarks +++ b/qutebrowser/quickmarks @@ -29,3 +29,4 @@ stbdocs https://api.seatable.io/#intro svg https://icon-sets.iconify.design/ icons https://icon-sets.iconify.design/ ai https://mastodon.online/web/getting-started +kde https://invent.kde.org/explore/groups?sort=name_asc diff --git a/rbw/config.json b/rbw/config.json new file mode 100644 index 0000000..f5f5bca --- /dev/null +++ b/rbw/config.json @@ -0,0 +1 @@ +{"email":"chris@tfcconnection.org","base_url":"https://bitwarden.tfcconnection.org","identity_url":null,"lock_timeout":9600,"pinentry":"pinentry-qt","device_id":"c22db167-6879-4317-ada4-3cba1ba9da2d"} \ No newline at end of file diff --git a/rofi/config.rasi b/rofi/config.rasi index 1e74ae3..fbf402b 100644 --- a/rofi/config.rasi +++ b/rofi/config.rasi @@ -58,7 +58,7 @@ configuration { } window { - background-color: @base00t; + background-color: @base00; text-color: @base05; /* transparency: "real"; */ border-radius: 20px; @@ -75,19 +75,19 @@ window { mainbox { border-radius: 16; /* background-color: @transparent; */ - background-color: @base00t; + background-color: @base00; text-color: @base05; transparency: "real"; } inputbar { /* background-color: @transparent; */ - background-color: @base00t; + background-color: @base00; text-color: @base05; expand: false; border-radius: 36px; margin: 0px 0px 0px 0px; - padding: 30px 6px 30px 6px; + padding: 20px 6px 20px 6px; position: north; } @@ -95,14 +95,15 @@ prompt { enabled: true; padding: 0px 6px 0px 5px; /* background-color: @transparent; */ - background-color: @base00t; + background-color: @base00; text-color: @base05; border: 0px; + font: "VictorMono Nerd Font 22.0"; } entry { /* background-color: @transparent; */ - background-color: @base00t; + background-color: @base00; placeholder-color: @base05; text-color: @base05; expand: true; @@ -111,6 +112,7 @@ entry { blink: true; border: 0px; padding: 0px 0px 0px 6px; + font: "VictorMono Nerd Font 22.0"; } case-indicator { @@ -126,7 +128,7 @@ sidebar { mainbox { /* background-color: @base00t; */ - background-color: @base00t; + background-color: @base00; text-color: @transparent; children: [ inputbar, listview, message ]; spacing: 5px; diff --git a/scripts/emacslof b/scripts/emacslof index 1a3656f..3e35220 100755 --- a/scripts/emacslof +++ b/scripts/emacslof @@ -17,7 +17,7 @@ if [ $(pgrep -c emacsclient) -gt 0 ]; then fi else if [ $KDE_FULL_SESSION = "true" ]; then - ww -f emacs -c emacsclient + /home/chris/scripts/ww -f emacs -c emacsclient exit else # WAYLAND diff --git a/scripts/mem-plasma.2s.sh b/scripts/mem-plasma.2s.sh index dee648f..5740f08 100755 --- a/scripts/mem-plasma.2s.sh +++ b/scripts/mem-plasma.2s.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/run/current-system/sw/bin/bash # Get the percentage of used memory and print it read used total <<< $(free -m | awk '/Mem/{printf $2" "$3}') diff --git a/scripts/muunread-plasma.2s.sh b/scripts/muunread-plasma.2s.sh index 644e769..981a3f9 100755 --- a/scripts/muunread-plasma.2s.sh +++ b/scripts/muunread-plasma.2s.sh @@ -1,5 +1,5 @@ #!/bin/sh muunread="$(mu find flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" | wc -l)" -echo " $muunread | color=#f3f99d font='VictorMono Nerd Font' size=11" +echo " $muunread | color=#f3f99d font='VictorMono Nerd Font' size=11" # echo " $muunread | color=#AF8700 font='VictorMono Nerd Font' size=11" diff --git a/scripts/qblof b/scripts/qblof index 796f596..e5065b9 100755 --- a/scripts/qblof +++ b/scripts/qblof @@ -1,7 +1,7 @@ #!/bin/sh -# Check to see if firefox is running -if pgrep -x qutebrowser > /dev/null; then +# Check to see if qb is running +if [ $(pgrep -c qutebrowser) -gt 0 ]; then echo "qb running" @@ -20,7 +20,7 @@ if pgrep -x qutebrowser > /dev/null; then fi else if [ $KDE_FULL_SESSION = "true" ]; then - ww -f org.qutebrowser.qutebrowser -c qutebrowser + /home/chris/scripts/ww -f org.qutebrowser.qutebrowser -c qutebrowser exit else echo "other wayland" diff --git a/scripts/rofi-clip b/scripts/rofi-clip index 0822970..bb8cbc9 100755 --- a/scripts/rofi-clip +++ b/scripts/rofi-clip @@ -14,7 +14,7 @@ else fi if [ $XDG_SESSION_TYPE = "x11" ]; then - rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' -theme ~/.config/rofi/launchers-git/$style-clipboard.rasi $@ & + rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' -theme ~/.config/rofi/launchers-git/$style.rasi $@ & c=0 while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do sleep .1 @@ -22,5 +22,5 @@ if [ $XDG_SESSION_TYPE = "x11" ]; then [[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds done else - rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' -theme ~/.config/rofi/launchers-git/$style-clipboard.rasi + rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' -theme ~/.config/rofi/launchers-git/$style.rasi fi diff --git a/scripts/update-nix b/scripts/update-nix new file mode 100755 index 0000000..c775e7f --- /dev/null +++ b/scripts/update-nix @@ -0,0 +1,5 @@ +#!/bin/sh +nix-channel --update +sudo nix-channel --update +home-manager switch +sudo nixos-rebuild switch \ No newline at end of file diff --git a/scripts/ww b/scripts/ww index 26e1e28..7659a72 100755 --- a/scripts/ww +++ b/scripts/ww @@ -1,4 +1,4 @@ -#!/bin/bash +#!/run/current-system/sw/bin/bash # Usage: ww -f "window class filter" -c "run if not found" # Usage: ww -fa "window title filter" -c "run if not found" diff --git a/scripts/yt b/scripts/yt index 0c418de..5cdf56a 100755 --- a/scripts/yt +++ b/scripts/yt @@ -17,7 +17,7 @@ fi defcmd="fzf" guicmd="rofi -no-lazy-grab -dmenu -i -theme launchers-git/"$style".rasi" #uncomment next line for dmenu #guicmd="dmenu -i -l 15" -promptcmd="$defcmd" +promptcmd="$guicmd" # if [ -z "$*" ]; then # echo -n "Search: " # read -r query