{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/3702","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/3702/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/3702/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/3702/events","html_url":"https://github.com/NixOS/nixpkgs/issues/3702","id":40762878,"number":3702,"title":"Enabling persistent user instance systemd","user":{"login":"CMCDragonkai","id":640797,"avatar_url":"https://avatars.githubusercontent.com/u/640797?v=3","gravatar_id":"","url":"https://api.github.com/users/CMCDragonkai","html_url":"https://github.com/CMCDragonkai","followers_url":"https://api.github.com/users/CMCDragonkai/followers","following_url":"https://api.github.com/users/CMCDragonkai/following{/other_user}","gists_url":"https://api.github.com/users/CMCDragonkai/gists{/gist_id}","starred_url":"https://api.github.com/users/CMCDragonkai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CMCDragonkai/subscriptions","organizations_url":"https://api.github.com/users/CMCDragonkai/orgs","repos_url":"https://api.github.com/users/CMCDragonkai/repos","events_url":"https://api.github.com/users/CMCDragonkai/events{/privacy}","received_events_url":"https://api.github.com/users/CMCDragonkai/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/0.kind:%20enhancement","name":"0.kind: enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2014-08-21T00:54:47Z","updated_at":"2016-08-08T03:40:09Z","closed_at":"2016-08-03T12:11:26Z","body":"Apparently user specific systemd instances only exist while there is a session for a specific user. If the last session exits, then the user specific systemd instance exits as well.\r\n\r\nThere's a way to make a user specific systemd instance persistent, so that users can run unattended long running services: https://wiki.archlinux.org/index.php/Systemd/User#Automatic_start-up_of_systemd_user_instances\r\n\r\nBasically you need to activate this option: http://www.freedesktop.org/software/systemd/man/loginctl.html#enable-linger%20USER...\r\n\r\n```\r\nloginctl enable-linger username\r\n```\r\n\r\nHowever this option is not available in NixOS or NixPkgs, I searched the repo. Also the logind extraConfig doesn't cover it.\r\n\r\nI think there might need to be a new option as part of the user management that makes the user instance systemd persistent, and run the above command on bootup and the opposite if the setting changes?\r\n\r\nIt should of course only run once if it has already ran, even though it is idempotent. I wonder how you can do this?\r\n\r\nRight now I'm simply running it during when I pack the image."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/238135452","html_url":"https://github.com/NixOS/nixpkgs/issues/3702#issuecomment-238135452","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/3702","id":238135452,"user":{"login":"CMCDragonkai","id":640797,"avatar_url":"https://avatars.githubusercontent.com/u/640797?v=3","gravatar_id":"","url":"https://api.github.com/users/CMCDragonkai","html_url":"https://github.com/CMCDragonkai","followers_url":"https://api.github.com/users/CMCDragonkai/followers","following_url":"https://api.github.com/users/CMCDragonkai/following{/other_user}","gists_url":"https://api.github.com/users/CMCDragonkai/gists{/gist_id}","starred_url":"https://api.github.com/users/CMCDragonkai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CMCDragonkai/subscriptions","organizations_url":"https://api.github.com/users/CMCDragonkai/orgs","repos_url":"https://api.github.com/users/CMCDragonkai/repos","events_url":"https://api.github.com/users/CMCDragonkai/events{/privacy}","received_events_url":"https://api.github.com/users/CMCDragonkai/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T03:40:08Z","updated_at":"2016-08-08T03:40:08Z","body":"Is it possible to make the setting immutable after it is set using your method @michalrus"}}
{"actor":{"display_login":"CMCDragonkai"}}