nixpkgs/pkgs/applications/networking/gns3/default.nix
2020-07-12 19:17:43 +02:00

50 lines
1.4 KiB
Nix

{ callPackage }:
let
stableVersion = "2.2.11";
previewVersion = stableVersion;
addVersion = args:
let version = if args.stable then stableVersion else previewVersion;
branch = if args.stable then "stable" else "preview";
in args // { inherit version branch; };
extraArgs = rec {
mkOverride = attrname: version: sha256:
self: super: {
${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: {
inherit version;
src = oldAttrs.src.override {
inherit version sha256;
};
});
};
commonOverrides = [
(mkOverride "psutil" "5.7.0"
"03jykdi3dgf1cdal9bv4fq9zjvzj9l9bs99gi5ar81sdl5nc2pk8")
(mkOverride "jsonschema" "3.2.0"
"0ykr61yiiizgvm3bzipa3l73rvj49wmrybbfwhvpgk3pscl5pa68")
];
};
mkGui = args: callPackage (import ./gui.nix (addVersion args // extraArgs)) { };
mkServer = args: callPackage (import ./server.nix (addVersion args // extraArgs)) { };
guiSrcHash = "1carwhp49l9zx2p6i3in03x6rjzn0x6ls2svwazd643rmrl4y7gn";
serverSrcHash = "0acbxay1pwq62yq9q67hid44byyi6rb6smz5wa8br3vka7z31iqf";
in {
guiStable = mkGui {
stable = true;
sha256Hash = guiSrcHash;
};
guiPreview = mkGui {
stable = false;
sha256Hash = guiSrcHash;
};
serverStable = mkServer {
stable = true;
sha256Hash = serverSrcHash;
};
serverPreview = mkServer {
stable = false;
sha256Hash = serverSrcHash;
};
}