diff options
author | Vincent Ambo <mail@tazj.in> | 2022-01-30T16·06+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-01-31T16·11+0000 |
commit | aa122cbae78ce97d60c0c98ba14df753d97e40b1 (patch) | |
tree | 12b98d85c4b18fe870feb26de70db9ba61837bd7 /users/grfn/system/home/modules | |
parent | 2d10d60fac0fd00a71b65cfdcb9fba0477b2086c (diff) |
style: format entire depot with nixpkgs-fmt r/3723
This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'users/grfn/system/home/modules')
-rw-r--r-- | users/grfn/system/home/modules/alsi.nix | 46 | ||||
-rw-r--r-- | users/grfn/system/home/modules/common.nix | 3 | ||||
-rw-r--r-- | users/grfn/system/home/modules/development.nix | 18 | ||||
-rw-r--r-- | users/grfn/system/home/modules/development/kube.nix | 2 | ||||
-rw-r--r-- | users/grfn/system/home/modules/emacs.nix | 21 | ||||
-rw-r--r-- | users/grfn/system/home/modules/email.nix | 64 | ||||
-rw-r--r-- | users/grfn/system/home/modules/games.nix | 9 | ||||
-rw-r--r-- | users/grfn/system/home/modules/i3.nix | 324 | ||||
-rw-r--r-- | users/grfn/system/home/modules/lib/cloneRepo.nix | 96 | ||||
-rw-r--r-- | users/grfn/system/home/modules/lib/zshFunctions.nix | 14 | ||||
-rw-r--r-- | users/grfn/system/home/modules/obs.nix | 4 | ||||
-rw-r--r-- | users/grfn/system/home/modules/rtlsdr.nix | 14 | ||||
-rw-r--r-- | users/grfn/system/home/modules/shell.nix | 5 | ||||
-rw-r--r-- | users/grfn/system/home/modules/tarsnap.nix | 80 |
14 files changed, 365 insertions, 335 deletions
diff --git a/users/grfn/system/home/modules/alsi.nix b/users/grfn/system/home/modules/alsi.nix index c4a14e683c39..204f9c8e1428 100644 --- a/users/grfn/system/home/modules/alsi.nix +++ b/users/grfn/system/home/modules/alsi.nix @@ -10,30 +10,30 @@ xdg.configFile."alsi/alsi.conf" = { force = true; text = '' - #!${pkgs.perl}/bin/perl + #!${pkgs.perl}/bin/perl - scalar { - ALSI_VERSION => "0.4.8", - COLORS_FILE => "/home/grfn/.config/alsi/alsi.colors", - DE_FILE => "/home/grfn/.config/alsi/alsi.de", - DEFAULT_COLOR_BOLD => "blue", - DEFAULT_COLOR_NORMAL => "blue", - DF_COMMAND => "df -Th -x sys -x tmpfs -x devtmpfs &>/dev/stdout", - GTK2_RC_FILE => "/home/grfn/.gtkrc-2.0", - GTK3_RC_FILE => "/home/grfn/.config/gtk-3.0/settings.ini", - LOGO_FILE => "/home/grfn/.config/alsi/alsi.logo", - OUTPUT_FILE => "/home/grfn/.config/alsi/alsi.output", - # PACKAGES_PATH => "/var/lib/pacman/local/", - PS_COMMAND => "ps -A", - USAGE_COLORS => 0, - USAGE_COLORS_BOLD => 0, - USAGE_PRECENT_GREEN => 50, - USAGE_PRECENT_RED => 100, - USAGE_PRECENT_YELLOW => 85, - USE_LOGO_FROM_FILE => 1, - USE_VALUES_COLOR => 0, - WM_FILE => "/home/grfn/.config/alsi/alsi.wm", - } + scalar { + ALSI_VERSION => "0.4.8", + COLORS_FILE => "/home/grfn/.config/alsi/alsi.colors", + DE_FILE => "/home/grfn/.config/alsi/alsi.de", + DEFAULT_COLOR_BOLD => "blue", + DEFAULT_COLOR_NORMAL => "blue", + DF_COMMAND => "df -Th -x sys -x tmpfs -x devtmpfs &>/dev/stdout", + GTK2_RC_FILE => "/home/grfn/.gtkrc-2.0", + GTK3_RC_FILE => "/home/grfn/.config/gtk-3.0/settings.ini", + LOGO_FILE => "/home/grfn/.config/alsi/alsi.logo", + OUTPUT_FILE => "/home/grfn/.config/alsi/alsi.output", + # PACKAGES_PATH => "/var/lib/pacman/local/", + PS_COMMAND => "ps -A", + USAGE_COLORS => 0, + USAGE_COLORS_BOLD => 0, + USAGE_PRECENT_GREEN => 50, + USAGE_PRECENT_RED => 100, + USAGE_PRECENT_YELLOW => 85, + USE_LOGO_FROM_FILE => 1, + USE_VALUES_COLOR => 0, + WM_FILE => "/home/grfn/.config/alsi/alsi.wm", + } ''; }; diff --git a/users/grfn/system/home/modules/common.nix b/users/grfn/system/home/modules/common.nix index 6871cadda1cf..a31e1718192e 100644 --- a/users/grfn/system/home/modules/common.nix +++ b/users/grfn/system/home/modules/common.nix @@ -28,7 +28,8 @@ htop killall bind - zip unzip + zip + unzip tree ncat bc diff --git a/users/grfn/system/home/modules/development.nix b/users/grfn/system/home/modules/development.nix index 653ce5d83ae1..d60e6ba60759 100644 --- a/users/grfn/system/home/modules/development.nix +++ b/users/grfn/system/home/modules/development.nix @@ -2,12 +2,14 @@ let - clj2nix = pkgs.callPackage (pkgs.fetchFromGitHub { - owner = "hlolli"; - repo = "clj2nix"; - rev = "3ab3480a25e850b35d1f532a5e4e7b3202232383"; - sha256 = "1lry026mlpxp1j563qs13nhxf37i2zpl7lh0lgfdwc44afybqka6"; - }) {}; + clj2nix = pkgs.callPackage + (pkgs.fetchFromGitHub { + owner = "hlolli"; + repo = "clj2nix"; + rev = "3ab3480a25e850b35d1f532a5e4e7b3202232383"; + sha256 = "1lry026mlpxp1j563qs13nhxf37i2zpl7lh0lgfdwc44afybqka6"; + }) + { }; pg-dump-upsert = pkgs.buildGoModule rec { pname = "pg-dump-upsert"; @@ -87,7 +89,7 @@ with lib; enable = true; package = pkgs.gitFull; userEmail = "root@gws.fyi"; - userName = "Griffin Smith"; + userName = "Griffin Smith"; ignores = [ "*.sw*" ".classpath" @@ -206,7 +208,7 @@ with lib; functions = { gdelmerged = '' - git branch --merged | egrep -v 'master' | tr -d '+ ' | xargs git branch -d + git branch --merged | egrep -v 'master' | tr -d '+ ' | xargs git branch -d ''; }; }; diff --git a/users/grfn/system/home/modules/development/kube.nix b/users/grfn/system/home/modules/development/kube.nix index 97ae4760d43b..876b0c08df1d 100644 --- a/users/grfn/system/home/modules/development/kube.nix +++ b/users/grfn/system/home/modules/development/kube.nix @@ -16,7 +16,7 @@ "kpa" = "kubectl get pods --all-namespaces"; "klf" = "kubectl logs -f"; "kdep" = "kubectl get deployments"; - "ked" = "kubectl edit deployment"; + "ked" = "kubectl edit deployment"; "kpw" = "kubectl get pods -w"; "kew" = "kubectl get events -w"; "kdel" = "kubectl delete"; diff --git a/users/grfn/system/home/modules/emacs.nix b/users/grfn/system/home/modules/emacs.nix index 6cc38bc7ab05..c65d88aacf6f 100644 --- a/users/grfn/system/home/modules/emacs.nix +++ b/users/grfn/system/home/modules/emacs.nix @@ -3,16 +3,17 @@ with lib; let - # doom-emacs = pkgs.callPackage (builtins.fetchTarball { - # url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz; - # }) { - # doomPrivateDir = ./doom.d; # Directory containing your config.el init.el - # # and packages.el files - # }; + # doom-emacs = pkgs.callPackage (builtins.fetchTarball { + # url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz; + # }) { + # doomPrivateDir = ./doom.d; # Directory containing your config.el init.el + # # and packages.el files + # }; depot = config.lib.depot; -in { +in +{ imports = [ ./lib/cloneRepo.nix ]; @@ -47,7 +48,7 @@ in { upquote varwidth wrapfig - ; + ; }) ispell @@ -82,14 +83,14 @@ in { doomEmacs = { github = "hlissner/doom-emacs"; path = ".emacs.d"; - after = ["emacs.d"]; + after = [ "emacs.d" ]; onClone = "bin/doom install"; }; "emacs.d" = { github = "glittershark/emacs.d"; path = ".doom.d"; - after = ["orgClubhouse"]; + after = [ "orgClubhouse" ]; }; }; diff --git a/users/grfn/system/home/modules/email.nix b/users/grfn/system/home/modules/email.nix index 0a3e58205ba6..63dfeeb6f480 100644 --- a/users/grfn/system/home/modules/email.nix +++ b/users/grfn/system/home/modules/email.nix @@ -9,7 +9,8 @@ let let good = upperChars ++ lowerChars ++ stringToCharacters "0123456789-_"; subst = c: if any (x: x == c) good then c else "-"; - in stringAsChars subst name; + in + stringAsChars subst name; accounts = { personal = { @@ -26,7 +27,8 @@ let }; -in { +in +{ programs.lieer.enable = true; programs.notmuch.enable = true; services.lieer.enable = true; @@ -37,16 +39,18 @@ in { msmtp ]; - systemd.user.services = mapAttrs' (name: account: { - name = escapeUnitName "lieer-${name}"; - value.Service = { - ExecStart = mkForce "${pkgs.writeShellScript "sync-${name}" '' + systemd.user.services = mapAttrs' + (name: account: { + name = escapeUnitName "lieer-${name}"; + value.Service = { + ExecStart = mkForce "${pkgs.writeShellScript "sync-${name}" '' ${pkgs.gmailieer}/bin/gmi sync --path ~/mail/${name} ''}"; - Environment = "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}"; - }; + Environment = "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}"; + }; - }) accounts; + }) + accounts; # xdg.configFile."notifymuch/notifymuch.cfg".text = generators.toINI {} { # notifymuch = { @@ -58,30 +62,32 @@ in { # }; accounts.email.maildirBasePath = "mail"; - accounts.email.accounts = mapAttrs (_: params@{ passEntry, ... }: { - realName = "Griffin Smith"; - passwordCommand = "pass ${passEntry}"; + accounts.email.accounts = mapAttrs + (_: params@{ passEntry, ... }: { + realName = "Griffin Smith"; + passwordCommand = "pass ${passEntry}"; - flavor = "gmail.com"; + flavor = "gmail.com"; - imapnotify = { - enable = true; - boxes = [ "Inbox" ]; - }; + imapnotify = { + enable = true; + boxes = [ "Inbox" ]; + }; - gpg = { - key = "0F11A989879E8BBBFDC1E23644EF5B5E861C09A7"; - signByDefault = true; - }; + gpg = { + key = "0F11A989879E8BBBFDC1E23644EF5B5E861C09A7"; + signByDefault = true; + }; - notmuch.enable = true; - lieer = { - enable = true; - sync = { + notmuch.enable = true; + lieer = { enable = true; - frequency = "*:*"; + sync = { + enable = true; + frequency = "*:*"; + }; }; - }; - msmtp.enable = true; - } // builtins.removeAttrs params ["passEntry"]) accounts; + msmtp.enable = true; + } // builtins.removeAttrs params [ "passEntry" ]) + accounts; } diff --git a/users/grfn/system/home/modules/games.nix b/users/grfn/system/home/modules/games.nix index 26dc9d31f37a..8067caf65fb1 100644 --- a/users/grfn/system/home/modules/games.nix +++ b/users/grfn/system/home/modules/games.nix @@ -13,14 +13,14 @@ let enableFPS = true; }); - init = runCommand "init.txt" {} '' + init = runCommand "init.txt" { } '' substitute "${df-orig}/data/init/init.txt" $out \ --replace "[INTRO:YES]" "[INTRO:NO]" \ --replace "[VOLUME:255]" "[VOLUME:0]" \ --replace "[FPS:NO]" "[FPS:YES]" ''; - d_init = runCommand "d_init.txt" {} '' + d_init = runCommand "d_init.txt" { } '' substitute "${df-orig}/data/init/d_init.txt" $out \ --replace "[AUTOSAVE:NONE]" "[AUTOSAVE:SEASONAL]" \ --replace "[AUTOSAVE_PAUSE:NO]" "[AUTOSAVE_PAUSE:YES]" \ @@ -30,7 +30,7 @@ let --replace "[SHOW_FLOW_AMOUNTS:NO]" "[SHOW_FLOW_AMOUNTS:YES]" ''; - df = runCommand "dwarf-fortress" {} '' + df = runCommand "dwarf-fortress" { } '' mkdir -p $out/bin sed \ -e '4icp -f ${init} "$DF_DIR/data/init/init.txt"' \ @@ -43,7 +43,8 @@ let chmod +x $out/bin/dwarf-fortress ''; -in mkMerge [ +in +mkMerge [ { home.packages = [ crawl diff --git a/users/grfn/system/home/modules/i3.nix b/users/grfn/system/home/modules/i3.nix index 111f2a08c225..7bd371e117d1 100644 --- a/users/grfn/system/home/modules/i3.nix +++ b/users/grfn/system/home/modules/i3.nix @@ -20,7 +20,8 @@ let inherit (builtins) map; inherit (lib) mkMerge range; -in { +in +{ options = with lib; { system.machine.wirelessInterface = mkOption { description = '' @@ -77,50 +78,51 @@ in { "move container to workspace ${toString n}"; }) (range 0 9)) - ++ [(rec { - "${mod}+h" = "focus left"; - "${mod}+j" = "focus down"; - "${mod}+k" = "focus up"; - "${mod}+l" = "focus right"; - "${mod}+semicolon" = "focus parent"; + ++ [ + (rec { + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; + "${mod}+semicolon" = "focus parent"; - "${mod}+Shift+h" = "move left"; - "${mod}+Shift+j" = "move down"; - "${mod}+Shift+k" = "move up"; - "${mod}+Shift+l" = "move right"; + "${mod}+Shift+h" = "move left"; + "${mod}+Shift+j" = "move down"; + "${mod}+Shift+k" = "move up"; + "${mod}+Shift+l" = "move right"; - "${mod}+Shift+x" = "kill"; + "${mod}+Shift+x" = "kill"; - "${mod}+Return" = "exec alacritty"; + "${mod}+Return" = "exec alacritty"; - "${mod}+Shift+s" = "split h"; - "${mod}+Shift+v" = "split v"; - "${mod}+e" = "layout toggle split"; - "${mod}+w" = "layout tabbed"; - "${mod}+s" = "layout stacking"; + "${mod}+Shift+s" = "split h"; + "${mod}+Shift+v" = "split v"; + "${mod}+e" = "layout toggle split"; + "${mod}+w" = "layout tabbed"; + "${mod}+s" = "layout stacking"; - "${mod}+f" = "fullscreen"; + "${mod}+f" = "fullscreen"; - "${mod}+Shift+r" = "restart"; + "${mod}+Shift+r" = "restart"; - "${mod}+r" = "mode resize"; + "${mod}+r" = "mode resize"; - # Marks - "${mod}+Shift+m" = ''exec i3-input -F "mark %s" -l 1 -P 'Mark: ' ''; - "${mod}+m" = ''exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Go to: ' ''; + # Marks + "${mod}+Shift+m" = ''exec i3-input -F "mark %s" -l 1 -P 'Mark: ' ''; + "${mod}+m" = ''exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Go to: ' ''; - # Screenshots - "${mod}+q" = "exec \"maim | xclip -selection clipboard -t image/png\""; - "${mod}+Shift+q" = "exec \"maim -s | xclip -selection clipboard -t image/png\""; - "${mod}+Ctrl+q" = "exec ${pkgs.writeShellScript "peek.sh" '' + # Screenshots + "${mod}+q" = "exec \"maim | xclip -selection clipboard -t image/png\""; + "${mod}+Shift+q" = "exec \"maim -s | xclip -selection clipboard -t image/png\""; + "${mod}+Ctrl+q" = "exec ${pkgs.writeShellScript "peek.sh" '' ${pkgs.picom}/bin/picom & picom_pid=$! ${pkgs.peek}/bin/peek || true kill -SIGINT $picom_pid ''}"; - # Launching applications - "${mod}+u" = "exec ${pkgs.writeShellScript "rofi" '' + # Launching applications + "${mod}+u" = "exec ${pkgs.writeShellScript "rofi" '' rofi \ -modi 'combi' \ -combi-modi "window,drun,ssh,run" \ @@ -128,49 +130,51 @@ in { -show combi ''}"; - # Passwords - "${mod}+p" = "exec rofi-pass -font '${decorationFont}'"; - - # Media - "XF86AudioPlay" = "exec playerctl play-pause"; - "XF86AudioNext" = "exec playerctl next"; - "XF86AudioPrev" = "exec playerctl previous"; - "XF86AudioRaiseVolume" = "exec pulseaudio-ctl up"; - "XF86AudioLowerVolume" = "exec pulseaudio-ctl down"; - "XF86AudioMute" = "exec pulseaudio-ctl mute"; - - # Lock - Pause = "exec lock"; - - # Brightness - "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%-"; - "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%+"; - - # Sleep/hibernate - # "${mod}+Escape" = "exec systemctl suspend"; - # "${mod}+Shift+Escape" = "exec systemctl hibernate"; - - # Scratch buffer - "${mod}+minus" = "scratchpad show"; - "${mod}+Shift+minus" = "move scratchpad"; - "${mod}+space" = "focus mode_toggle"; - "${mod}+Shift+space" = "floating toggle"; - - # Screen Layout - "${mod}+Shift+t" = "exec xrandr --auto"; - "${mod}+t" = "exec ${screenlayout.home}"; - "${mod}+Ctrl+t" = "exec ${pkgs.writeShellScript "fix_term.sh" '' + # Passwords + "${mod}+p" = "exec rofi-pass -font '${decorationFont}'"; + + # Media + "XF86AudioPlay" = "exec playerctl play-pause"; + "XF86AudioNext" = "exec playerctl next"; + "XF86AudioPrev" = "exec playerctl previous"; + "XF86AudioRaiseVolume" = "exec pulseaudio-ctl up"; + "XF86AudioLowerVolume" = "exec pulseaudio-ctl down"; + "XF86AudioMute" = "exec pulseaudio-ctl mute"; + + # Lock + Pause = "exec lock"; + + # Brightness + "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%-"; + "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q s 5%+"; + + # Sleep/hibernate + # "${mod}+Escape" = "exec systemctl suspend"; + # "${mod}+Shift+Escape" = "exec systemctl hibernate"; + + # Scratch buffer + "${mod}+minus" = "scratchpad show"; + "${mod}+Shift+minus" = "move scratchpad"; + "${mod}+space" = "focus mode_toggle"; + "${mod}+Shift+space" = "floating toggle"; + + # Screen Layout + "${mod}+Shift+t" = "exec xrandr --auto"; + "${mod}+t" = "exec ${screenlayout.home}"; + "${mod}+Ctrl+t" = "exec ${pkgs.writeShellScript "fix_term.sh" '' xrandr --output eDP-1 --off && ${screenlayout.home} ''}"; - # Notifications - "${mod}+Shift+n" = "exec killall -SIGUSR1 .dunst-wrapped"; - "${mod}+n" = "exec killall -SIGUSR2 .dunst-wrapped"; - "Control+space" = "exec ${pkgs.dunst}/bin/dunstctl close"; - "Control+Shift+space" = "exec ${pkgs.dunst}/bin/dunstctl close-all"; - "Control+grave" = "exec ${pkgs.dunst}/bin/dunstctl history-pop"; - "Control+Shift+period" = "exec ${pkgs.dunst}/bin/dunstctl action"; - })]); + # Notifications + "${mod}+Shift+n" = "exec killall -SIGUSR1 .dunst-wrapped"; + "${mod}+n" = "exec killall -SIGUSR2 .dunst-wrapped"; + "Control+space" = "exec ${pkgs.dunst}/bin/dunstctl close"; + "Control+Shift+space" = "exec ${pkgs.dunst}/bin/dunstctl close-all"; + "Control+grave" = "exec ${pkgs.dunst}/bin/dunstctl history-pop"; + "Control+Shift+period" = "exec ${pkgs.dunst}/bin/dunstctl action"; + }) + ] + ); fonts = [ decorationFont ]; @@ -202,94 +206,96 @@ in { bars = [{ statusCommand = - let i3status-conf = pkgs.writeText "i3status.conf" '' - general { - output_format = i3bar - colors = true - color_good = "#859900" - - interval = 1 - } - - order += "external_script current_task" - order += "external_script inbox" - order += "spotify" - order += "volume_status" - order += "wireless ${config.system.machine.wirelessInterface}" - # order += "ethernet enp3s0f0" - order += "cpu_usage" - order += "battery 0" - # order += "volume master" - order += "time" - order += "tztime utc" - - mpd { - format = "%artist - %album - %title" - } - - wireless ${config.system.machine.wirelessInterface} { - format_up = "W: (%quality - %essid - %bitrate) %ip" - format_down = "W: -" - } - - ethernet enp3s0f0 { - format_up = "E: %ip" - format_down = "E: -" - } - - battery 0 { - format = "%status %percentage" - path = "/sys/class/power_supply/BAT%d/uevent" - low_threshold = 10 - } - - cpu_usage { - format = "CPU: %usage" - } - - load { - format = "%5min" - } - - time { - format = " %a %h %d ⌚ %I:%M " - } - - spotify { - color_playing = "#fdf6e3" - color_paused = "#93a1a1" - format_stopped = "" - format_down = "" - format = "{title} - {artist} ({album})" - } - - external_script inbox { - script_path = '${emacsclient "(grfn/num-inbox-items-message)"}' - format = 'Inbox: {output}' - cache_timeout = 120 - color = "#93a1a1" - } - - external_script current_task { - script_path = '${emacsclient "(grfn/org-current-clocked-in-task-message)"}' - # format = '{output}' - cache_timeout = 60 - color = "#93a1a1" - } - - tztime utc { - timezone = "UTC" - format = " %H·%M " - } - - volume_status { - format = "☊ {percentage}" - format_muted = "☊ X" - # device = "default" - # mixer_idx = 0 - } - ''; - in "py3status -c ${i3status-conf}"; + let + i3status-conf = pkgs.writeText "i3status.conf" '' + general { + output_format = i3bar + colors = true + color_good = "#859900" + + interval = 1 + } + + order += "external_script current_task" + order += "external_script inbox" + order += "spotify" + order += "volume_status" + order += "wireless ${config.system.machine.wirelessInterface}" + # order += "ethernet enp3s0f0" + order += "cpu_usage" + order += "battery 0" + # order += "volume master" + order += "time" + order += "tztime utc" + + mpd { + format = "%artist - %album - %title" + } + + wireless ${config.system.machine.wirelessInterface} { + format_up = "W: (%quality - %essid - %bitrate) %ip" + format_down = "W: -" + } + + ethernet enp3s0f0 { + format_up = "E: %ip" + format_down = "E: -" + } + + battery 0 { + format = "%status %percentage" + path = "/sys/class/power_supply/BAT%d/uevent" + low_threshold = 10 + } + + cpu_usage { + format = "CPU: %usage" + } + + load { + format = "%5min" + } + + time { + format = " %a %h %d ⌚ %I:%M " + } + + spotify { + color_playing = "#fdf6e3" + color_paused = "#93a1a1" + format_stopped = "" + format_down = "" + format = "{title} - {artist} ({album})" + } + + external_script inbox { + script_path = '${emacsclient "(grfn/num-inbox-items-message)"}' + format = 'Inbox: {output}' + cache_timeout = 120 + color = "#93a1a1" + } + + external_script current_task { + script_path = '${emacsclient "(grfn/org-current-clocked-in-task-message)"}' + # format = '{output}' + cache_timeout = 60 + color = "#93a1a1" + } + + tztime utc { + timezone = "UTC" + format = " %H·%M " + } + + volume_status { + format = "☊ {percentage}" + format_muted = "☊ X" + # device = "default" + # mixer_idx = 0 + } + ''; + in + "py3status -c ${i3status-conf}"; fonts = [ decorationFont ]; position = "top"; colors = with solarized; rec { @@ -362,5 +368,5 @@ in { iconTheme.name = "Adwaita"; theme.name = "Adwaita"; }; - }; + }; } diff --git a/users/grfn/system/home/modules/lib/cloneRepo.nix b/users/grfn/system/home/modules/lib/cloneRepo.nix index dc487dc6bd05..54992bd69bae 100644 --- a/users/grfn/system/home/modules/lib/cloneRepo.nix +++ b/users/grfn/system/home/modules/lib/cloneRepo.nix @@ -4,44 +4,46 @@ with lib; options = { grfn.impure.clonedRepos = mkOption { description = "Repositories to clone"; - default = {}; + default = { }; type = with types; loaOf ( - let sm = submodule { - options = { - url = mkOption { - type = nullOr str; - description = "URL of repository to clone"; - default = null; - }; + let + sm = submodule { + options = { + url = mkOption { + type = nullOr str; + description = "URL of repository to clone"; + default = null; + }; - github = mkOption { - type = nullOr str; - description = "Github owner/repo of repository to clone"; - default = null; - }; + github = mkOption { + type = nullOr str; + description = "Github owner/repo of repository to clone"; + default = null; + }; - path = mkOption { - type = str; - description = "Path to clone to"; - }; + path = mkOption { + type = str; + description = "Path to clone to"; + }; - onClone = mkOption { - type = str; - description = '' - Shell command to run after cloning the repo for the first time. - Runs inside the repo itself. - ''; - default = ""; - }; + onClone = mkOption { + type = str; + description = '' + Shell command to run after cloning the repo for the first time. + Runs inside the repo itself. + ''; + default = ""; + }; - after = mkOption { - type = listOf str; - description = "Activation hooks that this repository must be cloned after"; - default = []; + after = mkOption { + type = listOf str; + description = "Activation hooks that this repository must be cloned after"; + default = [ ]; + }; }; }; - }; - in addCheck sm (cr: (! isNull cr.url || ! isNull cr.github)) + in + addCheck sm (cr: (! isNull cr.url || ! isNull cr.github)) ); }; }; @@ -49,19 +51,23 @@ with lib; config = { home.activation = mapAttrs - (_: { - url, path, github, onClone, after, ... - }: - let repoURL = if isNull url then "git@github.com:${github}" else url; - in hm.dag.entryAfter (["writeBoundary"] ++ after) '' - $DRY_RUN_CMD mkdir -p $(dirname "${path}") - if [[ ! -d ${path} ]]; then - $DRY_RUN_CMD git clone "${repoURL}" "${path}" - pushd ${path} - $DRY_RUN_CMD ${onClone} - popd - fi - '') - config.grfn.impure.clonedRepos; + (_: { url + , path + , github + , onClone + , after + , ... + }: + let repoURL = if isNull url then "git@github.com:${github}" else url; + in hm.dag.entryAfter ([ "writeBoundary" ] ++ after) '' + $DRY_RUN_CMD mkdir -p $(dirname "${path}") + if [[ ! -d ${path} ]]; then + $DRY_RUN_CMD git clone "${repoURL}" "${path}" + pushd ${path} + $DRY_RUN_CMD ${onClone} + popd + fi + '') + config.grfn.impure.clonedRepos; }; } diff --git a/users/grfn/system/home/modules/lib/zshFunctions.nix b/users/grfn/system/home/modules/lib/zshFunctions.nix index 7c39b3478cfd..228dc6379fd6 100644 --- a/users/grfn/system/home/modules/lib/zshFunctions.nix +++ b/users/grfn/system/home/modules/lib/zshFunctions.nix @@ -6,16 +6,18 @@ with lib; options = { programs.zsh.functions = mkOption { description = "An attribute set that maps function names to their source"; - default = {}; + default = { }; type = with types; attrsOf (either str path); }; }; config.programs.zsh.initExtra = concatStringsSep "\n" ( - mapAttrsToList (name: funSrc: '' - function ${name}() { - ${funSrc} - } - '') config.programs.zsh.functions + mapAttrsToList + (name: funSrc: '' + function ${name}() { + ${funSrc} + } + '') + config.programs.zsh.functions ); } diff --git a/users/grfn/system/home/modules/obs.nix b/users/grfn/system/home/modules/obs.nix index d1dade477ccc..39d57d712a46 100644 --- a/users/grfn/system/home/modules/obs.nix +++ b/users/grfn/system/home/modules/obs.nix @@ -19,7 +19,9 @@ let nativeBuildInputs = [ pkg-config ]; buildInputs = [ - libtool autoconf automake + libtool + autoconf + automake x11 xorg.libXtst xorg.libXinerama diff --git a/users/grfn/system/home/modules/rtlsdr.nix b/users/grfn/system/home/modules/rtlsdr.nix index a1c717617a62..c8a404a1f49e 100644 --- a/users/grfn/system/home/modules/rtlsdr.nix +++ b/users/grfn/system/home/modules/rtlsdr.nix @@ -2,12 +2,14 @@ let - nixpkgs-gnuradio = import (pkgs.fetchFromGitHub { - owner = "doronbehar"; - repo = "nixpkgs"; - rev = "712561aa5f10bfe6112a1726a912585612a70d1f"; - sha256 = "04yqflbwjcfl9vlplphpj82csqqz9k6m3nj1ybhwgmsc4by7vivl"; - }) {}; + nixpkgs-gnuradio = import + (pkgs.fetchFromGitHub { + owner = "doronbehar"; + repo = "nixpkgs"; + rev = "712561aa5f10bfe6112a1726a912585612a70d1f"; + sha256 = "04yqflbwjcfl9vlplphpj82csqqz9k6m3nj1ybhwgmsc4by7vivl"; + }) + { }; in diff --git a/users/grfn/system/home/modules/shell.nix b/users/grfn/system/home/modules/shell.nix index 088fe9238c69..ed82292b0aab 100644 --- a/users/grfn/system/home/modules/shell.nix +++ b/users/grfn/system/home/modules/shell.nix @@ -30,7 +30,7 @@ let # Directories stck = "dirs -v"; - b= "cd ~1"; + b = "cd ~1"; ".." = "cd .."; "..." = "cd ../.."; "...." = "cd ../../.."; @@ -63,7 +63,8 @@ let "ll" = "ls -al"; "la" = "ls -a"; }; -in { +in +{ home.packages = with pkgs; [ zsh autojump diff --git a/users/grfn/system/home/modules/tarsnap.nix b/users/grfn/system/home/modules/tarsnap.nix index 4bff19910f05..87002610cbcf 100644 --- a/users/grfn/system/home/modules/tarsnap.nix +++ b/users/grfn/system/home/modules/tarsnap.nix @@ -6,59 +6,59 @@ ]; home.file.".tarsnaprc".text = '' - ### Recommended options + ### Recommended options - # Tarsnap cache directory - cachedir /home/grfn/.cache/tarsnap + # Tarsnap cache directory + cachedir /home/grfn/.cache/tarsnap - # Tarsnap key file - keyfile /home/grfn/.private/tarsnap.key + # Tarsnap key file + keyfile /home/grfn/.private/tarsnap.key - # Don't archive files which have the nodump flag set. - nodump + # Don't archive files which have the nodump flag set. + nodump - # Print statistics when creating or deleting archives. - print-stats + # Print statistics when creating or deleting archives. + print-stats - # Create a checkpoint once per GB of uploaded data. - checkpoint-bytes 1G + # Create a checkpoint once per GB of uploaded data. + checkpoint-bytes 1G - ### Commonly useful options + ### Commonly useful options - # Use SI prefixes to make numbers printed by --print-stats more readable. - humanize-numbers + # Use SI prefixes to make numbers printed by --print-stats more readable. + humanize-numbers - ### Other options, not applicable to most systems + ### Other options, not applicable to most systems - # Aggressive network behaviour: Use multiple TCP connections when - # writing archives. Use of this option is recommended only in - # cases where TCP congestion control is known to be the limiting - # factor in upload performance. - #aggressive-networking + # Aggressive network behaviour: Use multiple TCP connections when + # writing archives. Use of this option is recommended only in + # cases where TCP congestion control is known to be the limiting + # factor in upload performance. + #aggressive-networking - # Exclude files and directories matching specified patterns. - # Only one file or directory per command; multiple "exclude" - # commands may be given. - #exclude + # Exclude files and directories matching specified patterns. + # Only one file or directory per command; multiple "exclude" + # commands may be given. + #exclude - # Include only files and directories matching specified patterns. - # Only one file or directory per command; multiple "include" - # commands may be given. - #include + # Include only files and directories matching specified patterns. + # Only one file or directory per command; multiple "include" + # commands may be given. + #include - # Attempt to reduce tarsnap memory consumption. This option - # will slow down the process of creating archives, but may help - # on systems where the average size of files being backed up is - # less than 1 MB. - #lowmem + # Attempt to reduce tarsnap memory consumption. This option + # will slow down the process of creating archives, but may help + # on systems where the average size of files being backed up is + # less than 1 MB. + #lowmem - # Try even harder to reduce tarsnap memory consumption. This can - # significantly slow down tarsnap, but reduces its memory usage - # by an additional factor of 2 beyond what the lowmem option does. - #verylowmem + # Try even harder to reduce tarsnap memory consumption. This can + # significantly slow down tarsnap, but reduces its memory usage + # by an additional factor of 2 beyond what the lowmem option does. + #verylowmem - # Snapshot time. Use this option if you are backing up files - # from a filesystem snapshot rather than from a "live" filesystem. - #snaptime <file> + # Snapshot time. Use this option if you are backing up files + # from a filesystem snapshot rather than from a "live" filesystem. + #snaptime <file> ''; } |