fork/home-manager
git clone https://git.julia.blue/fork/home-manager
3f3fa731
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . services . gnome-keyring ; 8 9in { 10meta . maintainers = [ maintainers . rycee ]; 11 12options = { 13services . gnome-keyring = { 14enable = mkEnableOption "GNOME Keyring" ; 15 16components = mkOption { 17type = types . listOf ( types . enum [ "pkcs11" "secrets" "ssh" ]); 18default = [ ]; 19description = '' 20The GNOME keyring components to start. If empty then the 21default set of components will be started. 22'' ; 23}; 24}; 25}; 26 27config = mkIf cfg . enable { 28assertions = [ 29( lib . hm . assertions . assertPlatform "services.gnome-keyring" pkgs 30lib . platforms . linux ) 31{ 32assertion = ! config . services . pass-secret-service . enable ; 33message = '' 34Only one secrets service per user can be enabled at a time. 35Other services enabled: 36- pass-secret-service 37'' ; 38} 39]; 40 41systemd . user . services . gnome-keyring = { 42Unit = { 43Description = "GNOME Keyring" ; 44PartOf = [ "graphical-session-pre.target" ]; 45}; 46 47Service = { 48ExecStart = let 49args = concatStringsSep " " ([ "--start" "--foreground" ] 50++ optional ( cfg . components != [ ]) 51( "--components=" + concatStringsSep "," cfg . components )); 52in " ${ pkgs . gnome . gnome-keyring } /bin/gnome-keyring-daemon ${ args } " ; 53Restart = "on-abort" ; 54}; 55 56Install = { WantedBy = [ "graphical-session-pre.target" ]; }; 57}; 58}; 59}