From 762dd2dd84659ead26416012b8f8b3232f52e798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 16 Jan 2026 15:28:20 +0100 Subject: [PATCH] move nixos module to external file Avoids anonymous imports which makes the module easier to find and reference. --- flake.nix | 28 +--------------------------- nixosModules/sidebus-vm.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 27 deletions(-) create mode 100644 nixosModules/sidebus-vm.nix diff --git a/flake.nix b/flake.nix index 4602239..7326859 100644 --- a/flake.nix +++ b/flake.nix @@ -55,33 +55,7 @@ }; flake = { - nixosModules.sidebus-vm = - { ... }: - { - environment.sessionVariables.DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/sidebus.sock"; - systemd.sockets.sidebus-agent = { - # SocketMode= is 0666 by default - listenStreams = [ "/run/sidebus.sock" ]; - wantedBy = [ "sockets.target" ]; - documentation = [ "https://git.clan.lol/valpackett/sidebus" ]; - }; - systemd.services.sidebus-agent = { - # TODO: confinement (can do a lot) - serviceConfig = { - ExecStart = throw "sidebus-vm module requires setting systemd.services.sidebus-agent.serviceConfig.ExecStart to a sidebus-agent package"; - ImportCredential = "sidebus.*"; - }; - documentation = [ "https://git.clan.lol/valpackett/sidebus" ]; - }; - systemd.mounts = [ - { - type = "virtiofs"; - what = "vm-doc-portal"; - where = "/run/vm-doc-portal"; - wantedBy = [ "multi-user.target" ]; - } - ]; - }; + nixosModules.sidebus-vm = ./nixosModules/sidebus-vm.nix; }; }; } diff --git a/nixosModules/sidebus-vm.nix b/nixosModules/sidebus-vm.nix new file mode 100644 index 0000000..215d2b1 --- /dev/null +++ b/nixosModules/sidebus-vm.nix @@ -0,0 +1,25 @@ +{ + environment.sessionVariables.DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/sidebus.sock"; + systemd.sockets.sidebus-agent = { + # SocketMode= is 0666 by default + listenStreams = [ "/run/sidebus.sock" ]; + wantedBy = [ "sockets.target" ]; + documentation = [ "https://git.clan.lol/valpackett/sidebus" ]; + }; + systemd.services.sidebus-agent = { + # TODO: confinement (can do a lot) + serviceConfig = { + ExecStart = throw "sidebus-vm module requires setting systemd.services.sidebus-agent.serviceConfig.ExecStart to a sidebus-agent package"; + ImportCredential = "sidebus.*"; + }; + documentation = [ "https://git.clan.lol/valpackett/sidebus" ]; + }; + systemd.mounts = [ + { + type = "virtiofs"; + what = "vm-doc-portal"; + where = "/run/vm-doc-portal"; + wantedBy = [ "multi-user.target" ]; + } + ]; +}