Skip to content

userActivationScripts do not run on login #113240

Closed

Description

@chkno

Describe the bug
Sometimes users find themselves in an environment where the userActivationScripts haven't run yet.

Unless you're doing unusual early boot stuff, the system activationScripts have always already run. It's a simple and useful invariant. This is implemented by having them run both at startup and on nixos-rebuild switch.

The user userActivationScripts currently only run at nixos-rebuild switch, so users often find themselves in an environment where their userActivationScripts haven't run yet — the time between system start-up and the first nixos-rebuild switch run — which is typically at least hours and can be indefinite.

userActivationScripts should have the same invariant as the system activationScripts: unless you're doing unusual early startup stuff, they have always already run. The same implementation method makes sense: run them both at startup and on nixos-rebuild switch. The user-analogy to startup is login, so userActivationScripts should run at login.

To Reproduce
Steps to reproduce the behavior:

  1. Configure a userActivationScript.
  2. Restart the machine.
  3. Log in.

Expected behavior
The userActivationScript has run.

Additional context

Notify maintainers
@peterhoeg

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
 - system/activation/activation-script.nix

Activity

  1. added
    0.kind: bug
    on Feb 15, 2021
  2. added
    6.topic: nixos
    on Feb 16, 2021
  3. stale commented on Aug 15, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  4. added
    2.status: stale
    on Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug2.status: stale6.topic: nixos

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions