Skip to content

nh os switch fails when automount file systems are changed #599

@girlpunk

Description

@girlpunk

I have confirmed that this is a bug related to nh

  • This is a bug, and not an user error or a support request. I understand that my issue will be closed if it is not a bug in NH.
  • I have checked the issues tab and confirmed that my issue has not yet been reported. I understand that my issue will be closed if it is a duplicate.

Description

When trying to make a change to an automount file system, such as reducing the timeout in the following configuration, nh tries to reload the automount unit, which failes.

{
  fileSystems."/media/stuff" = {
    device = "//server/Storage_stuff";
    fsType = "cifs";
    options = [
      "credentials=/etc/nixos/smb-secret"
      "x-systemd.automount"
      "noauto"
      "uid=1000"
      "gid=100"
      "x-systemd.idle-timeout=60,x-systemd.mount-timeout=5s"
    ];
  };
}
> Activating configuration
activating the configuration...
reloading user units for girlpunk...
restarting sysinit-reactivation.target
reloading the following units: media-stuff.automount
Failed to reload media-stuff.automount: Job type reload is not applicable for unit media-stuff.automount.
Error: 
   0: Activation (test) failed
   1: Activating configuration (exit status Exited(4))

Location:
   src/commands.rs:739

I believe this is the a similar issue being discussed in https://discourse.nixos.org/t/x-systemd-automount-makes-activation-fail/54589

Installation Method

Stable Release (nixpkgs, pkgs.nh from nixos-unstable or nixos-yy-mm)

Installation Method (Other)

No response

NH Version

nh 4.3.0

System Information

  • system: "x86_64-linux"
  • host os: Linux 6.12.76, NixOS, 25.11 (Xantusia), 25.11.20260316.48652e9
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.33.3
  • channels(root): "nixos-24.11"
  • nixpkgs: /nix/store/bxfbn4a6l0ji3pb6mzwsp3nybrpzrvv2-source

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogThis might be implemented at a future date. No focus yet.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions