13 pname = "resticprofile";
16 src = fetchFromGitHub {
17 owner = "creativeprojects";
18 repo = "resticprofile";
19 rev = "refs/tags/v${version}";
20 hash = "sha256-CUTDlSpP0ztr3sEKT0ppFnWx/bcVuY1oIKWJNZylDoM=";
24 substituteInPlace schedule_jobs.go \
25 --replace-fail "os.Executable()" "\"$out/bin/resticprofile\", nil"
27 substituteInPlace shell/command.go \
28 --replace-fail '"bash"' '"${lib.getExe bash}"'
30 substituteInPlace filesearch/filesearch.go \
31 --replace-fail 'paths := getSearchBinaryLocations()' 'return "${lib.getExe restic}", nil; paths := getSearchBinaryLocations()'
35 vendorHash = "sha256-t2R5uNsliSn+rIvRM0vT6lQJY62DhhozXnONiCJ9CMc=";
38 "-X main.commit=${src.rev}"
39 "-X main.date=unknown"
40 "-X main.builtBy=nixpkgs"
43 nativeBuildInputs = [ installShellFiles ];
46 rm battery_test.go # tries to get battery data
47 rm update_test.go # tries to use network
48 rm lock/lock_test.go # needs ping
49 rm preventsleep/caffeinate_test.go # tries to communicate with dbus
50 rm priority/ioprio_test.go # tries to set nice(2) IO priority
51 rm restic/downloader_test.go # tries to use network
52 rm schedule/schedule_test.go # tries to use systemctl
54 # `config/path_test.go` expects `$HOME` to be the same as `~nixbld` which is `$NIX_BUILD_TOP`
55 export HOME="$NIX_BUILD_TOP"
56 # `util/tempdir_test.go` expects `$HOME/.cache` to exist
63 install -Dm755 $GOPATH/bin/resticprofile -t $out/bin
65 installShellCompletion --cmd resticprofile \
66 --bash <($out/bin/resticprofile generate --bash-completion) \
67 --zsh <($out/bin/resticprofile generate --zsh-completion)
73 tests.version = testers.testVersion {
74 package = resticprofile;
75 command = "resticprofile version";
80 changelog = "https://github.com/creativeprojects/resticprofile/releases/tag/v${version}";
81 description = "Configuration profiles manager for restic backup";
82 homepage = "https://creativeprojects.github.io/resticprofile/";
83 license = with lib.licenses; [
85 lgpl3 # bash shell completion
87 mainProgram = "resticprofile";
88 maintainers = with lib.maintainers; [ tomasajt ];
89 platforms = lib.platforms.linux ++ lib.platforms.darwin;