diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nixpkgs/default.nix | 10 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/default.nix | 5 | ||||
-rw-r--r-- | sys/nixpkgs/pkgs/snap-sync-forked/default.nix | 24 | ||||
-rwxr-xr-x | sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked (renamed from sys/svcs/backup/snap-sync-forked) | 0 | ||||
-rw-r--r-- | sys/svcs/backup/default.nix | 23 |
5 files changed, 38 insertions, 24 deletions
diff --git a/sys/nixpkgs/default.nix b/sys/nixpkgs/default.nix index c37d5582..da3a33e6 100644 --- a/sys/nixpkgs/default.nix +++ b/sys/nixpkgs/default.nix @@ -2,11 +2,17 @@ lib, system, overlays ? [], -}: { + sysLib, +}: let + additionalPackages = (import ./pkgs) {inherit sysLib;}; + complete_overlays = overlays ++ additionalPackages; +in { # TODO: inheriting system here is discouraged, localSystem or hostSystem should be inspected - inherit system overlays; + inherit system; + overlays = complete_overlays; config = { # TODO: this fails because of the root tempsize, which should be increased + #contentAddressedByDefault = true; allowUnfreePredicate = pkg: diff --git a/sys/nixpkgs/pkgs/default.nix b/sys/nixpkgs/pkgs/default.nix new file mode 100644 index 00000000..b057068c --- /dev/null +++ b/sys/nixpkgs/pkgs/default.nix @@ -0,0 +1,5 @@ +{sysLib}: let + snap-sync-forked = (import ./snap-sync-forked) {inherit sysLib;}; + overlays = [] ++ snap-sync-forked; +in + overlays diff --git a/sys/nixpkgs/pkgs/snap-sync-forked/default.nix b/sys/nixpkgs/pkgs/snap-sync-forked/default.nix new file mode 100644 index 00000000..55e2bd27 --- /dev/null +++ b/sys/nixpkgs/pkgs/snap-sync-forked/default.nix @@ -0,0 +1,24 @@ +{sysLib}: [ + (self: super: { + snap-sync-forked = sysLib.writeShellScriptWithLibrary { + name = "snap-sync-forked"; + src = ./snap-sync-forked; + dependencies = with self; [ + bash + btrfs-progs + coreutils + gawk + gnugrep + snapper + util-linux + + # optional: + libnotify + openssh + pv + rsync + sudo + ]; + }; + }) +] diff --git a/sys/svcs/backup/snap-sync-forked b/sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked index a66f31ae..a66f31ae 100755 --- a/sys/svcs/backup/snap-sync-forked +++ b/sys/nixpkgs/pkgs/snap-sync-forked/snap-sync-forked diff --git a/sys/svcs/backup/default.nix b/sys/svcs/backup/default.nix index 171f1043..91433bf9 100644 --- a/sys/svcs/backup/default.nix +++ b/sys/svcs/backup/default.nix @@ -1,33 +1,12 @@ { lib, - sysLib, pkgs, config, ... }: let - snap-sync-forked = sysLib.writeShellScriptWithLibrary { - name = "snap-sync-forked"; - src = ./snap-sync-forked; - dependencies = with pkgs; [ - bash - btrfs-progs - coreutils - gawk - gnugrep - snapper - util-linux - - # optional: - libnotify - openssh - pv - rsync - sudo - ]; - }; backup-script = pkgs.writeShellScriptBin "backsnap" '' ${pkgs.util-linux}/bin/mount --mkdir "/dev/disk/by-uuid/${cfg.backupDiskUuid}" "/run/media/${cfg.backupDiskUuid}"; - ${snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; + ${pkgs.snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; ''; cfg = config.soispha.fs.backup; |