diff options
Diffstat (limited to 'home')
29 files changed, 298 insertions, 218 deletions
| diff --git a/home/cez/home.nix b/home/cez/home.nix index 018c19c..f39ddff 100644 --- a/home/cez/home.nix +++ b/home/cez/home.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{    imports = [      ../pc/home.nix      ./modules/wayland.nix diff --git a/home/cez/modules/wayland.nix b/home/cez/modules/wayland.nix index bfba63e..1d63f76 100644 --- a/home/cez/modules/wayland.nix +++ b/home/cez/modules/wayland.nix @@ -1,7 +1,9 @@ -{ pkgs, ... }: let -  wayland-scripts = pkgs.callPackage ../../wayland/pkgs/wayland-scripts {}; +{ pkgs, ... }: +let +  wayland-scripts = pkgs.callPackage ../../wayland/pkgs/wayland-scripts { };    freezshot = "${wayland-scripts}/bin/freezshot"; -in { +in +{    wayland.windowManager.sway.settings = {      # vendor hardcoded screenshot key      bindsym."mod4+shift+s" = "exec ${freezshot}"; diff --git a/home/common/home.nix b/home/common/home.nix index 137a967..b2f4480 100644 --- a/home/common/home.nix +++ b/home/common/home.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: let +{ config, pkgs, ... }: +let    username = config.global.userdata.name; -in { +in +{    imports = [      ./modules/git.nix      ./modules/tmux.nix diff --git a/home/common/modules/git.nix b/home/common/modules/git.nix index 1f10da7..3f8a98e 100644 --- a/home/common/modules/git.nix +++ b/home/common/modules/git.nix @@ -1,7 +1,9 @@ -{ config, ... }: let +{ config, ... }: +let    userName = config.global.userdata.nameFq;    userEmail = config.global.userdata.email; -in { +in +{    programs.git = {      enable = true;      inherit userName; diff --git a/home/common/modules/mimeapps.nix b/home/common/modules/mimeapps.nix index 04e3bd9..8c128cf 100644 --- a/home/common/modules/mimeapps.nix +++ b/home/common/modules/mimeapps.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{    xdg.mimeApps = {      enable = true; diff --git a/home/common/modules/shell.nix b/home/common/modules/shell.nix index c1b31fd..02f188a 100644 --- a/home/common/modules/shell.nix +++ b/home/common/modules/shell.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{    programs.bash.enable = true;    home = { diff --git a/home/common/modules/ssh.nix b/home/common/modules/ssh.nix index 5c54f44..31df169 100644 --- a/home/common/modules/ssh.nix +++ b/home/common/modules/ssh.nix @@ -1,6 +1,8 @@ -{ config, ... }: let +{ config, ... }: +let    domain = config.global.userdata.domain; -in { +in +{    programs.ssh = {      enable = true;      compression = true; diff --git a/home/common/modules/tmux.nix b/home/common/modules/tmux.nix index 20fecd5..6705f38 100644 --- a/home/common/modules/tmux.nix +++ b/home/common/modules/tmux.nix @@ -1,8 +1,8 @@ -{ pkgs, lib, ... }: { +{ pkgs, lib, ... }: +{    home.packages = with pkgs; [ tmux ]; -  home.sessionVariables.TMUX_TMPDIR = -    ''''${XDG_RUNTIME_DIR:-"/run/user/$(id -u)"}''; +  home.sessionVariables.TMUX_TMPDIR = ''''${XDG_RUNTIME_DIR:-"/run/user/$(id -u)"}'';    programs.bash.initExtra = lib.mkOrder 2000 ''      if [ -z "$TMUX" ] &&        { [ -n "$WAYLAND_DISPLAY" ] || [ -n "$SSH_TTY" ]; }; then diff --git a/home/common/modules/xdg_ninja.nix b/home/common/modules/xdg_ninja.nix index 614454b..6bd4196 100644 --- a/home/common/modules/xdg_ninja.nix +++ b/home/common/modules/xdg_ninja.nix @@ -1,12 +1,13 @@ -{ config, lib, ... }: let +{ config, lib, ... }: +let    bashHistory = config.xdg.stateHome + "/bash/history"; -in { +in +{    home.activation.init = lib.hm.dag.entryAfter [ "writeBoundary" ] ''      run --silence mkdir -p ${builtins.dirOf bashHistory}    ''; -  gtk.gtk2.configLocation = -    config.xdg.configHome + "/gtk-2.0/gtkrc"; +  gtk.gtk2.configLocation = config.xdg.configHome + "/gtk-2.0/gtkrc";    home.sessionVariables = {      HISTFILE = bashHistory; diff --git a/home/common/modules/xdgdirs.nix b/home/common/modules/xdgdirs.nix index 3073a10..a2dce4f 100644 --- a/home/common/modules/xdgdirs.nix +++ b/home/common/modules/xdgdirs.nix @@ -1,9 +1,11 @@ -{ config, ... }: let +{ config, ... }: +let    home = config.home.homeDirectory;    etc = home + "/etc";    dl = home + "/dl"; -in { +in +{    xdg = {      enable = true; diff --git a/home/pc/home.nix b/home/pc/home.nix index cad5bd6..54a2e09 100644 --- a/home/pc/home.nix +++ b/home/pc/home.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{    imports = [      ./modules/pass.nix      ./modules/dev.nix diff --git a/home/pc/modules/dev.nix b/home/pc/modules/dev.nix index ee9e054..6488aa8 100644 --- a/home/pc/modules/dev.nix +++ b/home/pc/modules/dev.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{    home.packages = with pkgs; [      git      sops diff --git a/home/pc/modules/pass.nix b/home/pc/modules/pass.nix index 3387861..17122ec 100644 --- a/home/pc/modules/pass.nix +++ b/home/pc/modules/pass.nix @@ -1,7 +1,14 @@ -{ config, pkgs, lib, ... }: let +{ +  config, +  pkgs, +  lib, +  ... +}: +let    passStore = config.xdg.dataHome + "/pass";    GNUPGHome = config.xdg.dataHome + "/gnupg"; -in { +in +{    home = {      file."${GNUPGHome}/gpg-agent.conf".text = ''        pinentry-program ${lib.getExe pkgs.pinentry-bemenu} diff --git a/home/wayland/home.nix b/home/wayland/home.nix index bcea5f4..9c912f1 100644 --- a/home/wayland/home.nix +++ b/home/wayland/home.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{    imports = [      ../common/home.nix      ./modules/foot.nix diff --git a/home/wayland/modules/firefox.nix b/home/wayland/modules/firefox.nix index dac3fb5..4e69072 100644 --- a/home/wayland/modules/firefox.nix +++ b/home/wayland/modules/firefox.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{    programs.firefox = {      enable = true;      policies = { @@ -47,26 +48,22 @@          "uBlock0@raymondhill.net" = {            installation_mode = "force_installed";            default_area = "menupanel"; -          install_url = -            "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; +          install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";          };          "jid1-MnnxcxisBPnSXQ@jetpack" = {            installation_mode = "force_installed";            default_area = "menupanel"; -          install_url = -            "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; +          install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi";          };          "{21f1ba12-47e1-4a9b-ad4e-3a0260bbeb26}" = {            installation_mode = "force_installed";            default_area = "menupanel"; -          install_url = -            "https://addons.mozilla.org/firefox/downloads/latest/remove-youtube-s-suggestions/latest.xpi"; +          install_url = "https://addons.mozilla.org/firefox/downloads/latest/remove-youtube-s-suggestions/latest.xpi";          };          "tridactyl.vim@cmcaine.co.uk" = {            installation_mode = "force_installed";            default_area = "menupanel"; -          install_url = -            "https://addons.mozilla.org/firefox/downloads/latest/tridactyl-vim/latest.xpi"; +          install_url = "https://addons.mozilla.org/firefox/downloads/latest/tridactyl-vim/latest.xpi";          };        };      }; @@ -78,8 +75,8 @@          currentVersion = 1337;          placements = { -          widget-overflow-fixed-list = []; -          unified-extensions-area = []; +          widget-overflow-fixed-list = [ ]; +          unified-extensions-area = [ ];            nav-bar = [              "back-button"              "forward-button" diff --git a/home/wayland/modules/foot.nix b/home/wayland/modules/foot.nix index ad8531a..9c0e76d 100644 --- a/home/wayland/modules/foot.nix +++ b/home/wayland/modules/foot.nix @@ -1,10 +1,12 @@ -{ config, lib, ... }: let -  font = config.global.font.monospace.name -    + lib.optionalString (config.global.font.monospace.size != null) -      ":size=" + builtins.toString config.global.font.monospace.size; -in { -  home.sessionVariables.TERMINAL = -    lib.getExe config.programs.foot.package; +{ config, lib, ... }: +let +  font = +    config.global.font.monospace.name +    + lib.optionalString (config.global.font.monospace.size != null) ":size=" +    + builtins.toString config.global.font.monospace.size; +in +{ +  home.sessionVariables.TERMINAL = lib.getExe config.programs.foot.package;    programs.foot = {      enable = true; diff --git a/home/wayland/modules/mango.nix b/home/wayland/modules/mango.nix index 31cd7d6..4606b64 100644 --- a/home/wayland/modules/mango.nix +++ b/home/wayland/modules/mango.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{    programs.mangohud = {      enable = true; diff --git a/home/wayland/modules/mimeapps.nix b/home/wayland/modules/mimeapps.nix index 9050cfe..f8b656d 100644 --- a/home/wayland/modules/mimeapps.nix +++ b/home/wayland/modules/mimeapps.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{    xdg.mimeApps = {      enable = true;      defaultApplications = { diff --git a/home/wayland/modules/portal.nix b/home/wayland/modules/portal.nix index 5cb620c..d9a525f 100644 --- a/home/wayland/modules/portal.nix +++ b/home/wayland/modules/portal.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{    xdg.portal = {      enable = true; diff --git a/home/wayland/modules/sway/bemenu.nix b/home/wayland/modules/sway/bemenu.nix index ced6b2f..ed1094d 100644 --- a/home/wayland/modules/sway/bemenu.nix +++ b/home/wayland/modules/sway/bemenu.nix @@ -1,12 +1,15 @@ -{ config, lib, ... }: let +{ config, lib, ... }: +let    background = "#000000";    foreground = "#FFFFFF";    swayYellow = "#d79921"; -  font = config.global.font.sans.name -    + lib.optionalString (config.global.font.sans.size != null) -      " " + builtins.toString config.global.font.sans.size; -in { +  font = +    config.global.font.sans.name +    + lib.optionalString (config.global.font.sans.size != null) " " +    + builtins.toString config.global.font.sans.size; +in +{    programs.bemenu = {      enable = true; diff --git a/home/wayland/modules/sway/home.nix b/home/wayland/modules/sway/home.nix index 776d26c..7dc24c2 100644 --- a/home/wayland/modules/sway/home.nix +++ b/home/wayland/modules/sway/home.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, ... }: let +{ +  config, +  pkgs, +  lib, +  ... +}: +let    mod = "mod4";    left = "h";    right = "l"; @@ -6,7 +12,7 @@    up = "k";    background = "${config.xdg.dataHome}/wayland/desktop"; -  wayland-scripts = pkgs.callPackage ../../pkgs/wayland-scripts {}; +  wayland-scripts = pkgs.callPackage ../../pkgs/wayland-scripts { };    cwall = "${wayland-scripts}/bin/cwall";    daskpass = "${wayland-scripts}/bin/daskpass"; @@ -22,10 +28,12 @@    mako = lib.getExe config.services.mako.package;    firefox = lib.getExe config.programs.firefox.finalPackage; -  font = config.global.font.sans.name -    + lib.optionalString (config.global.font.sans.size != null) -      " " + builtins.toString config.global.font.sans.size; -in { +  font = +    config.global.font.sans.name +    + lib.optionalString (config.global.font.sans.size != null) " " +    + builtins.toString config.global.font.sans.size; +in +{    imports = [      ./mako.nix      ./theme.nix @@ -66,107 +74,107 @@ in {      settings = {        bar = { -	inherit font; -	position = "top"; -	status_command = i3status; -	colors = { -	  background = "#000000"; -	  focused_workspace = "#000000 #000000 #ffba08"; -	  inactive_workspace = "#000000 #000000 #cde4e6"; -	}; +        inherit font; +        position = "top"; +        status_command = i3status; +        colors = { +          background = "#000000"; +          focused_workspace = "#000000 #000000 #ffba08"; +          inactive_workspace = "#000000 #000000 #cde4e6"; +        };        };        bindgesture = { -	"swipe:left" = "workspace next"; -	"swipe:right" = "workspace prev"; -	"swipe:down" = "exec ${swaylock}"; -	"swipe:up" = "exec ${cwall}"; +        "swipe:left" = "workspace next"; +        "swipe:right" = "workspace prev"; +        "swipe:down" = "exec ${swaylock}"; +        "swipe:up" = "exec ${cwall}";        };        input = { -	"type:touchpad" = { -	  dwt = "enabled"; -	  tap = "enabled"; -	  natural_scroll = "enabled"; -	}; -	"type:keyboard" = { -	  repeat_rate = 100; -	  repeat_delay = 250; -	}; +        "type:touchpad" = { +          dwt = "enabled"; +          tap = "enabled"; +          natural_scroll = "enabled"; +        }; +        "type:keyboard" = { +          repeat_rate = 100; +          repeat_delay = 250; +        };        };        bindsym = { -	# basics -	"${mod}+q" = "kill"; -	"${mod}+shift+c" = "reload"; -	"${mod}+shift+e" = '' -	  exec swaynag -t warning -m 'Do you really want to exit sway?' \ -	      -B 'Yes, exit sway' 'swaymsg exit' -	''; - -	# workspaces -	"${mod}+1" = "workspace number 1"; -	"${mod}+2" = "workspace number 2"; -	"${mod}+3" = "workspace number 3"; -	"${mod}+4" = "workspace number 4"; -	"${mod}+5" = "workspace number 5"; -	"${mod}+6" = "workspace number 6"; -	"${mod}+7" = "workspace number 7"; -	"${mod}+8" = "workspace number 8"; -	"${mod}+9" = "workspace number 9"; -	"${mod}+tab" = "workspace back_and_forth"; -	"${mod}+shift+1" = "move container to workspace number 1"; -	"${mod}+shift+2" = "move container to workspace number 2"; -	"${mod}+shift+3" = "move container to workspace number 3"; -	"${mod}+shift+4" = "move container to workspace number 4"; -	"${mod}+shift+5" = "move container to workspace number 5"; -	"${mod}+shift+6" = "move container to workspace number 6"; -	"${mod}+shift+7" = "move container to workspace number 7"; -	"${mod}+shift+8" = "move container to workspace number 8"; -	"${mod}+shift+9" = "move container to workspace number 9"; -	"${mod}+c" = "splitv"; -	"${mod}+v" = "splith"; - -	# layout -	"${mod}+${left}" = "focus left"; -	"${mod}+${down}" = "focus down"; -	"${mod}+${up}" = "focus up"; -	"${mod}+${right}" = "focus right"; -	"${mod}+shift+${left}" = "move left"; -	"${mod}+shift+${right}" = "move right"; -	"${mod}+shift+${down}" = "move down"; -	"${mod}+shift+${up}" = "move up"; -	"${mod}+f" = "fullscreen"; -	"${mod}+s" = "layout stacking"; -	"${mod}+t" = "layout tabbed"; -	"${mod}+e" = "layout toggle split"; -	"${mod}+shift+space" = "floating toggle"; -	"${mod}+r" = "mode resize"; - -	# scratchpad -	"${mod}+shift+minus" = "move scratchpad"; -	"${mod}+minus" = "scratchpad show"; - -	# exec -	"print" = "exec ${freezshot}"; -	"${mod}+return" = "exec ${foot}"; -	"${mod}+o" = "exec ${bemenu}"; -	"${mod}+w" = "exec ${firefox}"; -	"${mod}+n" = "exec ${foot} -- ${nnn} -decC"; - -	XF86MonBrightnessDown = "exec ${brightnessctl} set 1%-"; -	XF86MonBrightnessUp = "exec ${brightnessctl} set 1%+"; -	XF86AudioLowerVolume = "exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-"; -	XF86AudioRaiseVolume = "exec ${wpctl} set-volume --limit 1.5 @DEFAULT_AUDIO_SINK@ 5%+"; -	XF86AudioMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"; -	XF86AudioMicMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; +        # basics +        "${mod}+q" = "kill"; +        "${mod}+shift+c" = "reload"; +        "${mod}+shift+e" = '' +          	  exec swaynag -t warning -m 'Do you really want to exit sway?' \ +          	      -B 'Yes, exit sway' 'swaymsg exit' +          	''; + +        # workspaces +        "${mod}+1" = "workspace number 1"; +        "${mod}+2" = "workspace number 2"; +        "${mod}+3" = "workspace number 3"; +        "${mod}+4" = "workspace number 4"; +        "${mod}+5" = "workspace number 5"; +        "${mod}+6" = "workspace number 6"; +        "${mod}+7" = "workspace number 7"; +        "${mod}+8" = "workspace number 8"; +        "${mod}+9" = "workspace number 9"; +        "${mod}+tab" = "workspace back_and_forth"; +        "${mod}+shift+1" = "move container to workspace number 1"; +        "${mod}+shift+2" = "move container to workspace number 2"; +        "${mod}+shift+3" = "move container to workspace number 3"; +        "${mod}+shift+4" = "move container to workspace number 4"; +        "${mod}+shift+5" = "move container to workspace number 5"; +        "${mod}+shift+6" = "move container to workspace number 6"; +        "${mod}+shift+7" = "move container to workspace number 7"; +        "${mod}+shift+8" = "move container to workspace number 8"; +        "${mod}+shift+9" = "move container to workspace number 9"; +        "${mod}+c" = "splitv"; +        "${mod}+v" = "splith"; + +        # layout +        "${mod}+${left}" = "focus left"; +        "${mod}+${down}" = "focus down"; +        "${mod}+${up}" = "focus up"; +        "${mod}+${right}" = "focus right"; +        "${mod}+shift+${left}" = "move left"; +        "${mod}+shift+${right}" = "move right"; +        "${mod}+shift+${down}" = "move down"; +        "${mod}+shift+${up}" = "move up"; +        "${mod}+f" = "fullscreen"; +        "${mod}+s" = "layout stacking"; +        "${mod}+t" = "layout tabbed"; +        "${mod}+e" = "layout toggle split"; +        "${mod}+shift+space" = "floating toggle"; +        "${mod}+r" = "mode resize"; + +        # scratchpad +        "${mod}+shift+minus" = "move scratchpad"; +        "${mod}+minus" = "scratchpad show"; + +        # exec +        "print" = "exec ${freezshot}"; +        "${mod}+return" = "exec ${foot}"; +        "${mod}+o" = "exec ${bemenu}"; +        "${mod}+w" = "exec ${firefox}"; +        "${mod}+n" = "exec ${foot} -- ${nnn} -decC"; + +        XF86MonBrightnessDown = "exec ${brightnessctl} set 1%-"; +        XF86MonBrightnessUp = "exec ${brightnessctl} set 1%+"; +        XF86AudioLowerVolume = "exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-"; +        XF86AudioRaiseVolume = "exec ${wpctl} set-volume --limit 1.5 @DEFAULT_AUDIO_SINK@ 5%+"; +        XF86AudioMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"; +        XF86AudioMicMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";        };        mode.resize.bindsym = { -	${left} = "resize shrink width 10px"; -	${right} = "resize grow width 10px"; -	${down} = "resize grow height 10px"; -	${up} = "resize shrink height 10px"; -	return = "mode default"; +        ${left} = "resize shrink width 10px"; +        ${right} = "resize grow width 10px"; +        ${down} = "resize grow height 10px"; +        ${up} = "resize shrink height 10px"; +        return = "mode default";        };        exec = [ mako ]; diff --git a/home/wayland/modules/sway/i3status.nix b/home/wayland/modules/sway/i3status.nix index a7e4075..dbc8671 100644 --- a/home/wayland/modules/sway/i3status.nix +++ b/home/wayland/modules/sway/i3status.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{    programs.i3status = {      enable = true;      enableDefault = false; @@ -56,7 +57,7 @@        };        "wireless _first_" = { -        position = 00; +        position = 0;          settings = {            format_up = "  %quality";            format_down = ""; diff --git a/home/wayland/modules/sway/mako.nix b/home/wayland/modules/sway/mako.nix index d545cd1..a0b4fc6 100644 --- a/home/wayland/modules/sway/mako.nix +++ b/home/wayland/modules/sway/mako.nix @@ -1,8 +1,16 @@ -{ config, pkgs, lib, ... }: let -  font = config.global.font.sans.name -    + lib.optionalString (config.global.font.sans.size != null) -      " " + builtins.toString config.global.font.sans.size; -in { +{ +  config, +  pkgs, +  lib, +  ... +}: +let +  font = +    config.global.font.sans.name +    + lib.optionalString (config.global.font.sans.size != null) " " +    + builtins.toString config.global.font.sans.size; +in +{    home.packages = with pkgs; [ libnotify ];    services.mako = { diff --git a/home/wayland/modules/sway/swayidle.nix b/home/wayland/modules/sway/swayidle.nix index fd23f41..d9ff473 100644 --- a/home/wayland/modules/sway/swayidle.nix +++ b/home/wayland/modules/sway/swayidle.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, ... }: let +{ +  config, +  lib, +  pkgs, +  ... +}: +let    swaylock = lib.getExe config.programs.swaylock.package;    brightnessctl = lib.getExe pkgs.brightnessctl;    swaymsg = "${pkgs.sway}/bin/swaymsg"; @@ -7,34 +13,42 @@    suspend_timeout = minute * 60;    suspend_on_battery = pkgs.writeShellApplication {      name = "suspend_on_battery"; -    runtimeInputs = with pkgs; [ gnugrep systemd sudo coreutils ]; -    text = let -      sudo = "/run/wrappers/bin/sudo"; -    in '' -      is_discharging() { -	  grep -qFx \ -	      'POWER_SUPPLY_STATUS=Discharging' \ -	      /sys/class/power_supply/*/uevent -      } +    runtimeInputs = with pkgs; [ +      gnugrep +      systemd +      sudo +      coreutils +    ]; +    text = +      let +        sudo = "/run/wrappers/bin/sudo"; +      in +      '' +              is_discharging() { +        	  grep -qFx \ +        	      'POWER_SUPPLY_STATUS=Discharging' \ +        	      /sys/class/power_supply/*/uevent +              } -      was_charging=false -      while true; do -	  if is_discharging; then -	      if [ $was_charging = true ]; then -		  sleep ${builtins.toString suspend_timeout} -	      fi +              was_charging=false +              while true; do +        	  if is_discharging; then +        	      if [ $was_charging = true ]; then +        		  sleep ${builtins.toString suspend_timeout} +        	      fi -	      if is_discharging; then -		  ${sudo} systemctl suspend-then-hibernate -	      fi -	  fi +        	      if is_discharging; then +        		  ${sudo} systemctl suspend-then-hibernate +        	      fi +        	  fi -	  was_charging=true -	  sleep 10 -      done -    ''; +        	  was_charging=true +        	  sleep 10 +              done +      '';    }; -in { +in +{    systemd.user.services.suspend_on_battery = {      Unit.Description = "Suspend on battery";      Service.ExecStart = lib.getExe suspend_on_battery; @@ -44,42 +58,40 @@ in {      enable = true;      systemdTarget = "sway-session.target"; -    events = [{ -      event = "before-sleep"; -      command = swaylock; -    }]; +    events = [ +      { +        event = "before-sleep"; +        command = swaylock; +      } +    ];      timeouts = [        { -	timeout = minute * 30; -	command = -	  "${brightnessctl} --save; " -	  + "${brightnessctl} set 10%-"; -	resumeCommand = "${brightnessctl} --restore"; +        timeout = minute * 30; +        command = "${brightnessctl} --save; " + "${brightnessctl} set 10%-"; +        resumeCommand = "${brightnessctl} --restore";        }        { -	timeout = minute * 31; -	command = swaylock; +        timeout = minute * 31; +        command = swaylock;        }        { -	timeout = minute * 32; -	command = -	  "${swaymsg} --type command 'output * dpms off'; " -	  + "${brightnessctl} -c leds -d platform::kbd_backlight --save; " -	  + "${brightnessctl} -c leds -d platform::kbd_backlight set 0"; -	resumeCommand = -	  "${brightnessctl} -c leds -d platform::kbd_backlight --restore; " -	  + "${swaymsg} --type command 'output * dpms on'"; +        timeout = minute * 32; +        command = +          "${swaymsg} --type command 'output * dpms off'; " +          + "${brightnessctl} -c leds -d platform::kbd_backlight --save; " +          + "${brightnessctl} -c leds -d platform::kbd_backlight set 0"; +        resumeCommand = +          "${brightnessctl} -c leds -d platform::kbd_backlight --restore; " +          + "${swaymsg} --type command 'output * dpms on'";        }        { -	timeout = suspend_timeout; -	command = -	  "${pkgs.systemd}/bin/systemctl --user start suspend_on_battery"; -	resumeCommand = -	  "${pkgs.systemd}/bin/systemctl --user stop suspend_on_battery"; +        timeout = suspend_timeout; +        command = "${pkgs.systemd}/bin/systemctl --user start suspend_on_battery"; +        resumeCommand = "${pkgs.systemd}/bin/systemctl --user stop suspend_on_battery";        }      ];    }; diff --git a/home/wayland/modules/sway/swaylock.nix b/home/wayland/modules/sway/swaylock.nix index 1d5a58f..d606167 100644 --- a/home/wayland/modules/sway/swaylock.nix +++ b/home/wayland/modules/sway/swaylock.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: let +{ config, pkgs, ... }: +let    background = "${config.xdg.dataHome}/wayland/lockscreen"; -in { +in +{    programs.swaylock = {      enable = true;      package = pkgs.swaylock-effects; diff --git a/home/wayland/modules/sway/theme.nix b/home/wayland/modules/sway/theme.nix index b1673da..57bb314 100644 --- a/home/wayland/modules/sway/theme.nix +++ b/home/wayland/modules/sway/theme.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{    dconf.enable = false;    gtk = { diff --git a/home/wayland/modules/ttyasrt.nix b/home/wayland/modules/ttyasrt.nix index ba9a2c5..399770b 100644 --- a/home/wayland/modules/ttyasrt.nix +++ b/home/wayland/modules/ttyasrt.nix @@ -1,7 +1,9 @@ -{ pkgs, ... }: let -  wayland-scripts = pkgs.callPackage ../pkgs/wayland-scripts {}; +{ pkgs, ... }: +let +  wayland-scripts = pkgs.callPackage ../pkgs/wayland-scripts { };    ttyasrt = "${wayland-scripts}/bin/ttyasrt"; -in { +in +{    home.packages = [ wayland-scripts ];    xdg.desktopEntries = { diff --git a/home/wayland/modules/zathura.nix b/home/wayland/modules/zathura.nix index faec245..68ba875 100644 --- a/home/wayland/modules/zathura.nix +++ b/home/wayland/modules/zathura.nix @@ -1,9 +1,12 @@ -{ config, lib, ... }: let -  font = config.global.font.sans.name -    + lib.optionalString (config.global.font.sans.size != null) -      " " + builtins.toString config.global.font.sans.size; -in { -    programs.zathura = { +{ config, lib, ... }: +let +  font = +    config.global.font.sans.name +    + lib.optionalString (config.global.font.sans.size != null) " " +    + builtins.toString config.global.font.sans.size; +in +{ +  programs.zathura = {      enable = true;      mappings = { diff --git a/home/wayland/pkgs/wayland-scripts/default.nix b/home/wayland/pkgs/wayland-scripts/default.nix index c96ad22..0e28487 100644 --- a/home/wayland/pkgs/wayland-scripts/default.nix +++ b/home/wayland/pkgs/wayland-scripts/default.nix @@ -37,13 +37,27 @@ stdenvNoCC.mkDerivation {    postInstall = ''      wrapProgram $out/bin/cwall \ -      --prefix PATH : ${lib.makeBinPath [ ffmpeg libnotify sway ]} +      --prefix PATH : ${ +        lib.makeBinPath [ +          ffmpeg +          libnotify +          sway +        ] +      }      wrapProgram $out/bin/daskpass \        --prefix PATH : ${lib.makeBinPath [ bemenu ]}      wrapProgram $out/bin/ttyasrt \        --prefix PATH : ${lib.makeBinPath [ libnotify ]}      wrapProgram $out/bin/freezshot \ -      --prefix PATH : ${lib.makeBinPath [ ffmpeg sway grim slurp imv ]} +      --prefix PATH : ${ +        lib.makeBinPath [ +          ffmpeg +          sway +          grim +          slurp +          imv +        ] +      }    '';    meta = { | 
