ctucx.git: nixfiles

ctucx' nixfiles

commit bbad527fa5f617378fb782aef3a9faf886508722
parent 4131e84eda53222d43f7eb5dc332a2040ee74044
Author: Leah (ctucx) <leah@ctu.cx>
Date: Wed, 12 Jan 2022 17:02:47 +0100

programs/AusweisApp2: add program
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/configurations/desktop-sway.nix b/configurations/desktop-sway.nix
@@ -50,6 +50,7 @@
     ./programs/waybar
     ./programs/mako.nix
     ./programs/swaylock.nix
+    ./programs/AusweisApp2.nix
 
     ./programs/alacritty.nix
 
diff --git a/configurations/programs/AusweisApp2.nix b/configurations/programs/AusweisApp2.nix
@@ -0,0 +1,31 @@
+{ pkgs, ... }:
+
+{
+  home-manager.users.leah = {
+    home.packages = with pkgs; [
+      AusweisApp2
+    ];
+
+    systemd.user.services.AusweisApp2 = {
+      Unit = {
+        After  = [ "graphical-session-pre.target" ];
+        PartOf = [ "graphical-session.target" ];
+      };
+
+      Service = {
+        Environment = "PATH=/run/wrappers/bin:/home/leah/.nix-profile/bin:/etc/profiles/per-user/leah/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin";
+        ExecStart = "${pkgs.AusweisApp2}/bin/AusweisApp2";
+        Restart = "always";
+        RestartSec = 5;
+      };
+
+      Install = {
+        WantedBy = [ "graphical-session.target" ];
+      };
+    };
+
+    wayland.windowManager.sway.extraConfig = ''
+      exec_always 'systemctl --user restart AusweisApp2'
+    '';
+  };
+}