From b0e773addea36d76de4ec077d303eff409067731 Mon Sep 17 00:00:00 2001 From: ChaosAttractor <46527539+LostAttractor@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:17:59 +0800 Subject: [PATCH] nixos/sharing: init Co-Authored-By: fee1-dead --- .../from_md/release-notes/rl-2305.section.xml | 9 +++++++++ .../manual/release-notes/rl-2305.section.md | 2 ++ nixos/modules/module-list.nix | 1 + nixos/modules/programs/sharing.nix | 19 +++++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 nixos/modules/programs/sharing.nix diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml index 2fd0d01abefa..c9f09e4049ee 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml @@ -152,6 +152,15 @@ are met, or not met. + + + sharing, + a command-line tool to share directories and files from the + CLI to iOS and Android devices without the need of an extra + client app. Available as + programs.sharing. + +
diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index 01e2ff01f290..7c32057dcda0 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -48,6 +48,8 @@ In addition to numerous new and upgraded packages, this release has the followin - [autosuspend](https://github.com/languitar/autosuspend), a python daemon that suspends a system if certain conditions are met, or not met. +- [sharing](https://github.com/parvardegr/sharing), a command-line tool to share directories and files from the CLI to iOS and Android devices without the need of an extra client app. Available as [programs.sharing](#opt-programs.sharing.enable). + ## Backward Incompatibilities {#sec-release-23.05-incompatibilities} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 111eee47480f..1a2d75307496 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -223,6 +223,7 @@ ./programs/seahorse.nix ./programs/sedutil.nix ./programs/shadow.nix + ./programs/sharing.nix ./programs/singularity.nix ./programs/skim.nix ./programs/slock.nix diff --git a/nixos/modules/programs/sharing.nix b/nixos/modules/programs/sharing.nix new file mode 100644 index 000000000000..9ab51859dc51 --- /dev/null +++ b/nixos/modules/programs/sharing.nix @@ -0,0 +1,19 @@ +{ config, pkgs, lib, ... }: +with lib; +{ + options.programs.sharing = { + enable = mkEnableOption (lib.mdDoc '' + sharing, a CLI tool for sharing files. + + Note that it will opens the 7478 port for TCP in the firewall, which is needed for it to function properly + ''); + }; + config = + let + cfg = config.programs.sharing; + in + mkIf cfg.enable { + environment.systemPackages = [ pkgs.sharing ]; + networking.firewall.allowedTCPPorts = [ 7478 ]; + }; +}