diff --git a/flake.nix b/flake.nix index ea046b7d..6f19b53f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,5 +35,27 @@ graphviz ]; }; + + nixosModules.default = { + config, + lib, + ... + }: let + # Shorter name to access final settings a + # user of hello.nix module HAS ACTUALLY SET. + # cfg is a typical convention. + cfg = config.services.tildefriends; + in { + options.services.tildefriends = { + enable = lib.mkEnableOption "Enable Tilde Friends"; + }; + + config = lib.mkIf cfg.enable { + systemd.services.tildefriends = { + wantedBy = ["multi-user.target"]; + serviceConfig.ExecStart = "${pkgs.tildefriends}/bin/tildefriends"; + }; + }; + }; }); }