From 4dc2b59670227c8d13f249bc4597e99242b3f1f6 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Tue, 13 Aug 2024 23:29:42 +0200 Subject: [PATCH] chore: remove redundant xdg.portal config in home --- SwarselSystems.org | 19 ++- index.html | 261 ++++++++++++++++++++++++-------- profiles/optional/home/work.nix | 10 -- 3 files changed, 211 insertions(+), 79 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 497d6e1..c6f61ad 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -495,6 +495,9 @@ Lastly I define some common module lists that I can simply load depending on the #+end_src *** General (outputs) +:PROPERTIES: +:CUSTOM_ID: h:54cd8f65-a3ba-43c3-ae37-5f04383fe720 +:END: In this section I am creating some attributes that define general concepts of my configuration: @@ -4355,6 +4358,9 @@ This utility checks if there are updated packages in nixpkgs-unstable. It does s #+end_src **** github-notifications +:PROPERTIES: +:CUSTOM_ID: h:a9398c4e-4d3b-4942-b03c-192f9c0517e5 +:END: This utility checks if there are updated packages in nixpkgs-unstable. It does so by fully building the most recent configuration, which I do not love, but it has its merits once I am willing to switch to the newer version. @@ -8068,6 +8074,9 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi #+end_src ***** yubikey-touch-detector +:PROPERTIES: +:CUSTOM_ID: h:1598c90b-f195-41a0-9132-94612edf3586 +:END: #+begin_src nix :tangle profiles/common/home/yubikey-touch-detector.nix { pkgs, ... }: @@ -8531,16 +8540,6 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]] }; }; - xdg.portal = { - enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-wlr ]; - config = { - common = { - default = "wlr"; - }; - }; - }; - xdg.desktopEntries = let terminal = false; diff --git a/index.html b/index.html index 6d4af23..ad0e931 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -219,7 +219,7 @@ @@ -412,7 +412,7 @@ system-configuration-options
---prefix=/nix/store/jpzmfjay3cyza16ay1fn550l8dhdqwgm-emacs-pgtk-20240717.0 --disable-build-details --with-modules --with-pgtk --with-compress-install --with-toolkit-scroll-bars --with-native-compilation --without-imagemagick --with-mailutils --without-small-ja-dic --with-tree-sitter --without-xinput2 --with-xwidgets --with-dbus --with-selinux
+--prefix=/nix/store/jh4xny0q3is65dfk9nfmiiipxfvqzl8p-emacs-pgtk-20240810.0 --disable-build-details --with-modules --with-pgtk --with-compress-install --with-toolkit-scroll-bars --with-native-compilation --without-imagemagick --with-mailutils --without-small-ja-dic --with-tree-sitter --without-xinput2 --with-xwidgets --with-dbus --with-selinux
 
@@ -940,9 +940,9 @@ mixedModules = [ -
-

2.3.3. General (outputs)

-
+
+

2.3.3. General (outputs)

+

In this section I am creating some attributes that define general concepts of my configuration:

@@ -2330,7 +2330,6 @@ My work machine. Built for more security, this is the gold standard of my config wallpaper = ../../wallpaper/lenovowp.png; hasBluetooth = true; hasFingerprint = true; - initialSetup = true; impermanence = false; isBtrfs = true; }; @@ -2392,12 +2391,10 @@ My work machine. Built for more security, this is the gold standard of my config inputs = { "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = { xkb_layout = "us"; - xkb_options = "grp:win_space_toggle"; xkb_variant = "altgr-intl"; }; "1133:45081:MX_Master_2S_Keyboard" = { xkb_layout = "us"; - xkb_options = "grp:win_space_toggle"; xkb_variant = "altgr-intl"; }; "2362:628:PIXA3854:00_093A:0274_Touchpad" = { @@ -2406,6 +2403,10 @@ My work machine. Built for more security, this is the gold standard of my config natural_scroll = "enabled"; middle_emulation = "enabled"; }; + "1133:50504:Logitech_USB_Receiver" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; }; keybindings = { "Mod4+Ctrl+p" = "exec wl-mirror eDP-2"; @@ -4557,6 +4558,7 @@ in opacitytoggle = callPackage ./opacitytoggle { }; fs-diff = callPackage ./fs-diff { }; update-checker = callPackage ./update-checker { }; + github-notifications = callPackage ./github-notifications { }; } @@ -5050,14 +5052,21 @@ This utility checks if there are updated packages in nixpkgs-unstable. It does s
-updates="$(cd ~/.dotfiles && nix flake lock --update-input nixpkgs && nix build .#nixosConfigurations."$HOSTNAME".config.system.build.toplevel && nvd diff /run/current-system ./result | grep -c '\[U')"
+updates="$( { cd /home/swarsel/.dotfiles && nix flake lock --update-input nixpkgs && nix build .#nixosConfigurations."$(eval hostname)".config.system.build.toplevel &&  nvd diff /run/current-system ./result | grep -c '\[U'; } || true)"
+
+alt="has-updates"
+if [[ $updates -eq 0 ]]; then
+    alt="updated"
+fi
 
 tooltip="System updated"
 if [[ $updates != 0 ]]; then
-  tooltip=$(cd ~/.dotfiles && nvd diff /run/current-system ./result | grep -e '\[U' | awk '{ for (i=3; i<NF; i++) printf $i " "; if (NF >= 3) print $NF; }' ORS='\\n' )
+    tooltip=$(cd ~/.dotfiles && nvd diff /run/current-system ./result | grep -e '\[U' | awk '{ for (i=3; i<NF; i++) printf $i " "; if (NF >= 3) print $NF; }' ORS='\\n' )
+    echo "{ \"text\":\"$updates\", \"alt\":\"$alt\", \"tooltip\":\"$tooltip\" }"
+else
+    echo "{ \"text\":\"\", \"alt\":\"$alt\", \"tooltip\":\"\" }"
 fi
 
-echo "{ \"text\":\"$updates\", \"tooltip\":\"$tooltip\" }"
 
 
@@ -5074,6 +5083,31 @@ writeShellApplication {
+
  • github-notifications
    +
    +

    +This utility checks if there are updated packages in nixpkgs-unstable. It does so by fully building the most recent configuration, which I do not love, but it has its merits once I am willing to switch to the newer version. +

    + + +
    +
    { writeShellApplication, jq }:
    +
    +writeShellApplication {
    +  name = "github-notifications";
    +  runtimeInputs = [ jq ];
    +  text = ''
    +       count=$(curl -u Swarsel:"$(cat /run/user/1000/secrets/github_notif)" https://api.github.com/notifications | jq '. | length')
    +
    +       if [[ "$count" != "0" ]]; then
    +           echo "{\"text\":\"$count\"}"
    +       fi
    +  '';
    +}
    +
    +
    +
    +
  • @@ -5525,8 +5559,8 @@ in type = types.listOf (types.attrsOf types.str); default = [ { command = "nextcloud --background"; } - { command = "vesktop --start-minimized"; } - { command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } + { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } + { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } { command = "ANKI_WAYLAND=1 anki"; } { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; } { command = "nm-applet"; } @@ -5633,7 +5667,6 @@ Also, the system state version is set here. No need to touch it. ./zsh.nix ./syncthing.nix ./blueman.nix - ./safeeyes.nix ./networkdevices.nix ./gvfs.nix ./interceptiontools.nix @@ -5647,6 +5680,8 @@ Also, the system state version is set here. No need to touch it. ./gnome-keyring.nix ./sway.nix ./xdg-portal.nix + # ./yubikey-touch-detector.nix + ./safeeyes.nix ]; nix = @@ -6328,6 +6363,7 @@ Mostly used to install some compilers and lsp's that I want to have available wh # pinentry dbus swaylock-effects + syncthingtray-minimal # secure boot sbctl @@ -6470,22 +6506,22 @@ _: folders = { "Default Folder" = { path = "/home/swarsel/Sync"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "default"; }; "Obsidian" = { path = "/home/swarsel/Nextcloud/Obsidian"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "yjvni-9eaa7"; }; "Org" = { path = "/home/swarsel/Nextcloud/Org"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "a7xnl-zjj3d"; }; "Vpn" = { path = "/home/swarsel/Vpn"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "hgp9s-fyq3p"; }; }; @@ -6520,21 +6556,6 @@ Enables the blueman service including the nice system tray icon.
    -
  • safeeyes
    -
    -

    -A friend of mine used this service and I used to make fun of him. But I have to admit this is actually a nice program. It forces you to look away from the screen from time to time, reducing eye strain. -

    - -
    -
    _:
    -{
    -  services.safeeyes.enable = true;
    -}
    -
    -
    -
    -
  • Network devices

    @@ -6913,6 +6934,8 @@ Normally, doing that also resets the lecture that happens on the first use of

  • +
  • safeeyes
    +
    +

    +A friend of mine used this service and I used to make fun of him. But I have to admit this is actually a nice program. It forces you to look away from the screen from time to time, reducing eye strain. +

    + +
    +
    _:
    +{
    +  services.safeeyes.enable = true;
    +}
    +
    +
    +
    +
  • @@ -7291,6 +7329,8 @@ This section sets up all the imports that are used in the home-manager section. ./sway.nix ./gpg-agent.nix ./gammastep.nix + # ./safeeyes.nix + ./yubikey-touch-detector.nix ]; nix = { @@ -7465,7 +7505,6 @@ This holds packages that I can use as provided, or with small modifications (as # gnome.gnome-clocks # wlogout # jdiskreport - syncthingtray # monitor #keychain @@ -7522,6 +7561,7 @@ This is just a separate container for derivations defined in @@ -8044,7 +8089,7 @@ Here I set up my git config, automatic signing of commits, useful aliases for my

    -
    _:
    +
    { lib, ... }:
     {
       programs.git = {
         enable = true;
    @@ -8065,8 +8110,8 @@ Here I set up my git config, automatic signing of commits, useful aliases for my
           key = "0x76FD3810215AE097";
           signByDefault = true;
         };
    -    userEmail = "leon.schwarzaeugl@gmail.com";
    -    userName = "Swarsel";
    +    userEmail = lib.mkDefault "leon.schwarzaeugl@gmail.com";
    +    userName = "Leon Schwarzäugl";
         difftastic.enable = true;
         lfs.enable = true;
         includes = [
    @@ -8567,7 +8612,7 @@ The rest of the related configuration is found here:
             layer = "top";
             position = "top";
             modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ];
    -        modules-center = [ "sway/mode" "custom/configwarn" "custom/nix-updates" ];
    +        modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ];
             "sway/mode" = {
               format = "<span style=\"italic\" font-weight=\"bold\">{}</span>";
             };
    @@ -8584,13 +8629,41 @@ The rest of the related configuration is found here:
               interval = 60;
             };
     
    +        "custom/scratchpad-indicator" = {
    +          interval = 3;
    +          exec = "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 1)'";
    +          format = "{} ";
    +          on-click = "swaymsg 'scratchpad show'";
    +          on-click-right = "swaymsg 'move scratchpad'";
    +        };
    +
    +        "custom/github" = {
    +          format = "{}  ";
    +          return-type = "json";
    +          interval = 60;
    +          exec = "github-notifications";
    +          on-click = "xdg-open https://github.com/notifications";
    +        };
    +
             "custom/nix-updates" = {
               exec = "update-checker";
               on-click = "update-checker && notify-send 'The system has been updated'";
               interval = 3600;
               tooltip = true;
               return-type = "json";
    -          format = "{} ";
    +          format = "{} {icon}";
    +          format-icon = {
    +            "has-updates" = "";
    +            "updated" = " ";
    +          };
    +        };
    +
    +        idle_inhibitor = {
    +          format = "{icon}";
    +          format-icons = {
    +            activated = "";
    +            deactivated = "";
    +          };
             };
     
             "group/hardware" = {
    @@ -8604,6 +8677,7 @@ The rest of the related configuration is found here:
                 "power-profiles-daemon"
                 "custom/left-arrow-light"
                 "custom/left-arrow-dark"
    +            "custom/scratchpad-indicator"
                 "custom/left-arrow-light"
                 "disk"
                 "custom/left-arrow-dark"
    @@ -8611,9 +8685,18 @@ The rest of the related configuration is found here:
                 "custom/left-arrow-light"
                 "cpu"
                 "custom/left-arrow-dark"
    +            "backlight/slider"
    +            "idle_inhibitor"
               ];
             };
     
    +        "backlight/slider" = {
    +          min = 0;
    +          max = 100;
    +          orientation = "horizontal";
    +          device = "intel_backlight";
    +        };
    +
             power-profiles-daemon = {
               format = "{icon}";
               tooltip-format = "Power profile: {profile}\nDriver: {driver}";
    @@ -8986,6 +9069,42 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi
     
    +
  • yubikey-touch-detector
    +
    +
    +
    { pkgs, ... }:
    +{
    +  systemd.user.services.yubikey-touch-detector = {
    +    Unit = {
    +      Description = "Detects when your YubiKey is waiting for a touch";
    +      Requires = [ "yubikey-touch-detector.socket" ];
    +    };
    +    Service = {
    +      ExecStart = "${pkgs.yubikey-touch-detector}/bin/yubikey-touch-detector --libnotify";
    +      EnvironmentFile = "-%E/yubikey-touch-detector/service.conf";
    +    };
    +    Install = {
    +      Also = [ "yubikey-touch-detector.socket" ];
    +      WantedBy = [ "default.target" ];
    +    };
    +  };
    +  systemd.user.sockets.yubikey-touch-detector = {
    +    Unit = {
    +      Description = "Unix socket activation for YubiKey touch detector service";
    +    };
    +    Socket = {
    +      ListenStream = "%t/yubikey-touch-detector.socket";
    +      RemoveOnStop = true;
    +    };
    +    Install = {
    +      WantedBy = [ "sockets.target" ];
    +    };
    +  };
    +}
    +
    +
    +
    +
  • Sway
    @@ -9097,9 +9216,12 @@ in "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${modifier}+r" = "mode resize"; "${modifier}+Return" = "exec kitty"; - "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; + # "XF86AudioRaiseVolume" = "exec pa 5%"; + "XF86AudioRaiseVolume" = "exec pamixer -i 5"; + # "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioLowerVolume" = "exec pamixer -d 5"; + # "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMute" = "exec pamixer -t"; "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; "XF86Display" = "exec wl-mirror eDP-1"; @@ -9274,7 +9396,7 @@ in } exec systemctl --user import-environment - + exec swayidle -w ${swayfxSettings} @@ -9641,15 +9763,36 @@ The rest of the settings is at @@ -13695,7 +13838,7 @@ This sets up the dashboard, which is really quite useless. But, it diff --git a/profiles/optional/home/work.nix b/profiles/optional/home/work.nix index 6c257b7..1258bb3 100644 --- a/profiles/optional/home/work.nix +++ b/profiles/optional/home/work.nix @@ -253,16 +253,6 @@ }; }; - xdg.portal = { - enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-wlr ]; - config = { - common = { - default = "wlr"; - }; - }; - }; - xdg.desktopEntries = let terminal = false;