aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/un
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-05-16 16:34:38 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-05-16 16:35:55 +0200
commit069df761e01a3473ceccf9fb20d2aeb25c814a27 (patch)
tree923f1e0facf52a3ff97d087c5788bcb59f7a63ad /modules/by-name/un
parentflake: Remove `ragenix` input (diff)
downloadnixos-config-069df761e01a3473ceccf9fb20d2aeb25c814a27.zip
flake: Remove the `shell_library` input and its dependencies
All the remaining uses of the `sysLib` have been migrated to `pkgs.writeShellApplication`.
Diffstat (limited to 'modules/by-name/un')
-rw-r--r--modules/by-name/un/unison/module.nix3
-rw-r--r--modules/by-name/un/unison/shellScript.nix29
2 files changed, 12 insertions, 20 deletions
diff --git a/modules/by-name/un/unison/module.nix b/modules/by-name/un/unison/module.nix
index ef1a4cc1..8d156b00 100644
--- a/modules/by-name/un/unison/module.nix
+++ b/modules/by-name/un/unison/module.nix
@@ -11,12 +11,11 @@
lib,
config,
pkgs,
- sysLib,
...
}: let
cfg = config.soispha.services.unison;
- script = import ./shellScript.nix {inherit sysLib lib pkgs cfg;};
+ script = import ./shellScript.nix {inherit lib pkgs cfg;};
in {
options.soispha.services.unison = let
homePath = lib.types.strMatching "^~.*";
diff --git a/modules/by-name/un/unison/shellScript.nix b/modules/by-name/un/unison/shellScript.nix
index a6916a52..df373805 100644
--- a/modules/by-name/un/unison/shellScript.nix
+++ b/modules/by-name/un/unison/shellScript.nix
@@ -8,7 +8,6 @@
# You should have received a copy of the License along with this program.
# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
- sysLib,
lib,
pkgs,
cfg,
@@ -69,7 +68,7 @@
lib.strings.concatStringsSep " " [
"unison"
"${serialiseArgs cfg.unisonOptions}"
- "$EXTRA_OPTIONS"
+ "\"$@\""
"${getIgnored cfg.pathsToIgnore path}"
"${esa path}"
(esa "ssh://${cfg.foreign.userName}@${cfg.foreign.address}/${path}")
@@ -77,24 +76,18 @@
script = lib.strings.concatStringsSep "\n" (builtins.map mkScriptLine cfg.pathsToSync);
in
- sysLib.writeShellScript {
+ pkgs.writeShellApplication {
name = "unison-sync";
- src = builtins.toFile "unison-backup" (''
- #!/usr/bin/env dash
+ text = script;
- # shellcheck source=/dev/null
- SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
- export UNISON=${esa cfg.dataDir};
-
- EXTRA_OPTIONS="$UNISON_EXTRA_OPTIONS $*"
- ''
- + script);
+ runtimeEnv = {
+ UNISON = cfg.dataDir;
+ };
- dependencies = with pkgs; [
- unison
- openssh # needed to connect to the other server
- less # needed to show diffs
- diffutils # needed to compute diffs
+ runtimeInputs = [
+ pkgs.unison
+ pkgs.openssh # needed to connect to the other server
+ pkgs.less # needed to show diffs
+ pkgs.diffutils # needed to compute diffs
];
}