resticprofile build works
This commit is contained in:
48
homeManagerModules/restic/flake.nix
Normal file
48
homeManagerModules/restic/flake.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
description = "Flake packaging resticprofile with a Home Manager module for programs.resticprofile";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable"; # Use latest Nixpkgs for Go package build
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
# Define a function to build the resticprofile package for a given system:
|
||||
resticprofilePkg = { pkgs, lib, ... }:
|
||||
pkgs.buildGoModule rec {
|
||||
pname = "resticprofile";
|
||||
version = "0.31.0";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "creativeprojects";
|
||||
repo = "resticprofile";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-ezelvyroQG1EW3SU63OVHJ/T4qjN5DRllvPIXnei1Z4="; # source tarball hash
|
||||
};
|
||||
vendorHash = "sha256-M9S6F/Csz7HnOq8PSWjpENKm1704kVx9zDts1ieraTE="; # Correct vendor hash
|
||||
goPackagePath = "github.com/creativeprojects/resticprofile";
|
||||
# (Optional) Include restic in checkInputs if tests require it:
|
||||
# checkInputs = [ pkgs.restic ];
|
||||
doCheck = false; # Disable tests due to sandboxed build environment
|
||||
meta = with lib; {
|
||||
description = "Configuration profiles manager and scheduler for restic backup";
|
||||
homepage = "https://creativeprojects.github.io/resticprofile/";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = [ ]; # (Add yourself or skip)
|
||||
};
|
||||
};
|
||||
in {
|
||||
# Provide the package for all supported systems:
|
||||
packages = nixpkgs.lib.genAttrs systems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in { resticprofile = resticprofilePkg { inherit pkgs; lib = pkgs.lib; }; }
|
||||
);
|
||||
|
||||
# Provide the Home Manager module
|
||||
homeManagerModules = {
|
||||
resticprofile = import ./resticprofile.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user