!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

609 Members
NixOS ❤️ systemd167 Servers

Load older messages


SenderMessageTime
14 Jun 2021
@roosemberth:orbstheorem.chRoosBut I don't think the NixOS module system uses shipped service units in any way.19:41:15
@arianvp:matrix.orgArian
In reply to @hpfr:matrix.org
if a package has a systemd service and a nixos module adding the package to systemd.packages, but then you write your own service in your system config, does NixOS use the .service.d/overrides.conf to handle this?
Yes we override as expected here
19:41:32
@hpfr:matrix.orghpfrthanks19:41:43
@arianvp:matrix.orgArianOnly place where this doesn't work is templated units19:42:07
@roosemberth:orbstheorem.chRoos How does it work, is nixpkgs parsing .service files? 19:42:31
@arianvp:matrix.orgArianNo but if we see a . service file with the same name we create an override.conf19:42:57
@roosemberth:orbstheorem.chRoosAt activation?19:43:09
@arianvp:matrix.orgArianNo at build time.19:43:17
@arianvp:matrix.orgArianAll service files in systemd.packages are known at build time19:43:34
@roosemberth:orbstheorem.chRoos I'm still not sure how that works. So you inspect all packages in systemd.packages for .service files when building the system closure and create overrides if they exists? 19:44:58
@roosemberth:orbstheorem.chRoos * I'm still not sure I understand how that works. So you inspect all packages in systemd.packages for .service files when building the system closure and create overrides if they exists? 19:45:20
@arianvp:matrix.orgArianYes19:45:37
@roosemberth:orbstheorem.chRoosOh, my bad then.19:46:07
@roosemberth:orbstheorem.chRoosThanks for the explaination ^^19:46:13
@hpfr:matrix.orghpfrI recently upgraded my server and the borgmatic service I wrote broke seemingly due to systemd-inhibit https://0x0.st/-LI7.txt, so I want to remove the systemd-inhibit call and just run borgmatic directly. I did that but I'm still getting the same error. Is the override not working or something? here's systemd cat: https://0x0.st/-Llq.txt19:48:44
@hpfr:matrix.orghpfras you can see in the cat, most of the overrides are redundant because I wrote the service before I realized there was a nixos module providing it19:49:23
@hpfr:matrix.orghpfr

and this is the ExecStart override:

  #!/nix/store/a4yw1svqqk4d8lhwinn9xp847zz9gfma-bash-4.4-p23/bin/bash -e
  borgmatic --syslog-verbosity 1 --stats
  if [ -f /mnt/pool/borgmatic/lock.exclusive ]; then
    echo "Skipping rclone, lock exists"
  else
    rclone -v --config /root/.config/rclone/rclone.conf \
      sync /mnt/pool/borgmatic/ odrv:borgmatic
  fi
  if [ -f /mnt/pool/borgmatic-container/lock.exclusive ]; then
    echo "Skipping rclone, lock exists"
  else
    rclone -v --config /root/.config/rclone/rclone.conf \
      sync /mnt/pool/borgmatic-container/ odrv:borgmatic-container
  fi
19:50:55
@hpfr:matrix.orghpfrso I don't know how systemd-inhibit is still getting involved since I removed the call to it from ExecStart, anyone see anything in the cat paste that I don't understand?19:51:34
@hpfr:matrix.orghpfrand running borgmatic manually still works so I'm pretty sure it's something with NixOS and the systemd upgrade19:52:33
@hpfr:matrix.orghpfruh oh20:11:11
@hpfr:matrix.orghpfr
Note how ExecStart must be cleared before being re-assigned [1]. The same holds for every item that can be specified multiple times, e.g. OnCalendar for timers.
20:11:29
@hpfr:matrix.orghpfr Nix does not seem to do this, so overriding script will not work 20:11:59
@hpfr:matrix.orghpfr * Nix does not seem to do this, so overriding systemd.services.<name>.script will not work 20:12:30
@hpfr:matrix.orghpfr Arian: can I force Nix to override the whole unit rather than doing the conf stuff? 20:15:12
@arianvp:matrix.orgArianYou can as a workaround do: ``` serviceConfig.ExecStart = [ "" "new executable"] ; ```20:15:36
@arianvp:matrix.orgArian* You can as a workaround do: ``` yourService.serviceConfig.ExecStart = [ "" "new executable"] ; ```20:16:04
@hpfr:matrix.orghpfr I currently have a multiline script, what's a good way to reference that 20:16:52
@hpfr:matrix.orghpfr I basically reimplemented the script option to get that working. so the workaround finally works at least, but I'm still confused what's wrong with systemd-inhibit on NixOS. guess I'll open an issue 20:43:30
@arianvp:matrix.orgArianYes please!20:46:45
16 Jun 2021
@andreas.schraegle:helsinki-systems.deajs124

Any ideas what I could be doing wrong if this is my .network file:

[Match]
Name=einsatz-10

[Network]
Bridge=br0
LinkLocalAddressing=no

but ip a s einsatz-10 tells me ```
12: einsatz-10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1358 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
link/ether 76:1a:54:e8:b1:76 brd ff:ff:ff:ff:ff:ff
inet 169.254.118.54/16 brd 169.254.255.255 scope global noprefixroute einsatz-10
valid_lft forever preferred_lft forever
inet6 fe80::741a:54ff:fee8:b176/64 scope link
valid_lft forever preferred_lft forever

12:44:16

Show newer messages


Back to Room ListRoom Version: 6