!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

617 Members
NixOS ❤️ systemd171 Servers

Load older messages


SenderMessageTime
29 Dec 2024
@elvishjerricco:matrix.orgElvishJerricco I wonder if the x-systemd.automount is messing with it somehow or something? 16:34:51
@gdamjan:spodeli.orggdamjanI'm gonna contribute a systemd service unit file for an upstream project, what would make it easier to use with NixOS? I'm gonna use DynamicUser=true, StateDirectory= and CacheDirectory= but there's one mandatory commandline argument to be specified and some optional environment variables that can configure the project19:52:30
@gdamjan:spodeli.orggdamjan
[Service]
DynamicUser=true
StateDirectory=rqbit
CacheDirectory=rqbit
Environment=XDG_CACHE_HOME=/var/cache/rqbit
Environment=XDG_DATA_HOME=/var/lib/rqbit
# default DOWNLOAD_DIR, can be overriden in /etc/default/rqbit
Environment=DOWNLOAD_DIR=/var/tmp
EnvironmentFile=-/etc/default/rqbit
ExecStart=/usr/bin/rqbit server start $DOWNLOAD_DIR
19:53:04
@dustee:matrix.orgdustee *

hi im getting an error while configuring a fileSystems.fsType = "sshfs". when i rebuild the nix host a second time i get a systemd error that doesnt go away until i reboot, commenting out the sshfs nix config doesnt help
EDIT: i think the error only happened when the sshfs connection failed

restarting sysinit-reactivation.target
Error: Failed to open unit file /nix/store/0brwavnsjwyi9pgx7zl82cr0gqndl2a1-nixos-system-nixos-blazp-cloud-serv-01-25.05.20241219.d70bd19/etc/systemd/system/mnt-remote-10.100.200.50-sshfs-4tb\x2dsata-torrents.mount

Caused by:
    No such file or directory (os error 2)
{
  config,
  domain,
  ...
}: let
  remote = "torrents@10.100.200.50:/"; # sftpgo user
  local = "/mnt/remote/10.100.200.50/sshfs/4tb-sata/torrents";
in {
  systemd.tmpfiles.rules = ["d '${local}' 0755 root root - -"];
  fileSystems = {
    "${local}" = {
      device = "${remote}";
      fsType = "sshfs";
      options = [
        # this is what im trying to do but the error appeared even with the most basic options

        # SSH options
        "Port=2022" # specific port to connect to
        "IdentityFile=/etc/ssh/ssh_host_ed25519_key" # private key auth
        "ServerAliveInterval=15" # keep connections alive
        "StrictHostKeyChecking=no" # accept host keys non-interactively, without setting up ssh host config
        "UserKnownHostsFile=/dev/null" # prevent storing host keys in the known_hosts file
        "reconnect" # handle connection drops

        # Filesystem options
        "allow_other" # for non-root access
        "_netdev" # this is a network fs
        "x-systemd.automount" # mount on demand

        # Filesystem options - additional/optional
        "noatime" # dont update access times for files, improves performance
        "nodev" # prevent users from accessing raw block device files through the mounted filesystem
      ];
    };
  };
}
20:47:50
@dustee:matrix.orgdustee *

hi im getting an error while configuring a fileSystems.fsType = "sshfs". when i rebuild the nix host a second time i get a systemd error that doesnt go away until i reboot, commenting out the sshfs nix config doesnt help
EDIT: i think the error only happened when the sshfs connection failed, and i tried to rebuild with a changed sshfs nix config

restarting sysinit-reactivation.target
Error: Failed to open unit file /nix/store/0brwavnsjwyi9pgx7zl82cr0gqndl2a1-nixos-system-nixos-blazp-cloud-serv-01-25.05.20241219.d70bd19/etc/systemd/system/mnt-remote-10.100.200.50-sshfs-4tb\x2dsata-torrents.mount

Caused by:
    No such file or directory (os error 2)
{
  config,
  domain,
  ...
}: let
  remote = "torrents@10.100.200.50:/"; # sftpgo user
  local = "/mnt/remote/10.100.200.50/sshfs/4tb-sata/torrents";
in {
  systemd.tmpfiles.rules = ["d '${local}' 0755 root root - -"];
  fileSystems = {
    "${local}" = {
      device = "${remote}";
      fsType = "sshfs";
      options = [
        # this is what im trying to do but the error appeared even with the most basic options

        # SSH options
        "Port=2022" # specific port to connect to
        "IdentityFile=/etc/ssh/ssh_host_ed25519_key" # private key auth
        "ServerAliveInterval=15" # keep connections alive
        "StrictHostKeyChecking=no" # accept host keys non-interactively, without setting up ssh host config
        "UserKnownHostsFile=/dev/null" # prevent storing host keys in the known_hosts file
        "reconnect" # handle connection drops

        # Filesystem options
        "allow_other" # for non-root access
        "_netdev" # this is a network fs
        "x-systemd.automount" # mount on demand

        # Filesystem options - additional/optional
        "noatime" # dont update access times for files, improves performance
        "nodev" # prevent users from accessing raw block device files through the mounted filesystem
      ];
    };
  };
}
20:48:47
@elvishjerricco:matrix.orgElvishJerricco gdamjan: do Environment and EnvironmentFile work like that? i.e. They can apply to the command line of an ExecStart? 21:14:32
@elvishjerricco:matrix.orgElvishJerriccoif so, that's pretty useful21:14:38
@gdamjan:spodeli.orggdamjanyes, that works22:16:40
30 Dec 2024
@raitobezarius:matrix.orgraitobezarius changed their display name from raitobezarius (DECT: 3538 / EPVPN 2681) to raitobezarius.16:29:51
@tommy:datenkollektiv.netTommy changed their display name from Tommy (3841) to Tommy.19:25:53
31 Dec 2024
@tilpner:tx0.cotilpner changed their display name from tilpner (38c3 3209) to tilpner.10:54:52
@arianvp:matrix.orgArian Why do we only install upstream wants for sysinit.target ?? 17:35:20
@arianvp:matrix.orgArian e.g. sockets.target seems to be missing or am I blind 17:35:30
@arianvp:matrix.orgArian(this is for the initrd )17:36:02
@phaer:matrix.orgphaer changed their display name from phaer (8650 at 38c3) to phaer.19:24:25
@elvishjerricco:matrix.orgElvishJerricco Arian: uh, good question :P 19:34:19
@elvishjerricco:matrix.orgElvishJerriccowe should probably do that19:34:25
@arianvp:matrix.orgArian Do we have a good way for doing overrides for things in systemd.mounts ? 21:55:47
@arianvp:matrix.orgArianit's a list. annoying21:55:50
@arianvp:matrix.orgArianwhy is it a list >:(21:56:10
@elvishjerricco:matrix.orgElvishJerricco because at one point someone thought that the what field should be the sole determining factor for the unit name 21:57:21
@elvishjerricco:matrix.orgElvishJerriccobecause, that's technically correct21:57:27
@arianvp:matrix.orgArianbut why not do21:57:43
@elvishjerricco:matrix.orgElvishJerriccobut like... could've just made the attrname irrelevant :P21:57:48
@arianvp:matrix.orgArian systemd.mounts."/nix/store".options = ["lol"] 21:57:52
@elvishjerricco:matrix.orgElvishJerricco * because at one point someone thought that the where field should be the sole determining factor for the unit name 21:58:02
@elvishjerricco:matrix.orgElvishJerriccoyea there were better ways to do it21:58:19
@arianvp:matrix.orgAriancan we fix this. I guess not21:58:30
@elvishjerricco:matrix.orgElvishJerricco I bet we could change it with a coercedTo type 21:59:14
@elvishjerricco:matrix.orgElvishJerricco er, maybe not. There's an assert in coercedTo that says the old type can't have submodules 22:00:39

Show newer messages


Back to Room ListRoom Version: 6