{ 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"; 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; }; }; }