Skip to content

4a-42/fetchsmb.nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

ReadMe

The current Nixpkgs fetchers use curl under the hood. Curl only supports SMB version 1. https://www.man7.org/linux/man-pages/man1/curl.1.html

A typical Windows server will be using SMB2 or SMB3. This fetcher should allow downloading resources from such Windows servers. It uses samba smbclient under the hood to behave like fetchurl.

One goal for this derivation is for it to be compatible with fetchzip. Please open an issue if you want support for other integrations.

Example

let
    pkgs = import <nixpkgs> {};
    fetchsmb = import ./fetchsmb.nix {
        inherit pkgs;
    };
    fetchzip = pkgs.fetchzip.override {
        fetchurl = fetchsmb;
    };
in
    fetchzip {
        # TODO: consider whether to support url's in this format:
        # url = "//server-name/service-name/c/d/h.zip"
        url = "//server-name/service-name";
        directory = "c/d";
        filename = "h.zip";
        hash = pkgs.lib.fakeHash;
        # url points to service-name instead of the file,
        # so 'fetchzip' will always need the 'extension' field filled out.
        extension = "zip";
    }

About

A nix fetcher that downloads files via smbclient instead of cURL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages