outlook-oauth-hack/flake.nix

39 lines
1.2 KiB
Nix
Raw Normal View History

2024-04-05 18:13:16 -04:00
{
description = "Using OfflineIMAP with M365";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2024-04-05 18:47:33 -04:00
systems.url = "github:nix-systems/default";
2024-04-05 18:13:16 -04:00
};
2024-04-05 18:47:33 -04:00
outputs = { self, nixpkgs, flake-utils, systems, ... }:
let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
homeManagerModules.default = import ./nix/hm-module.nix self;
2024-04-05 18:13:16 -04:00
2024-04-05 18:47:33 -04:00
packages = eachSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
with pkgs.python3Packages; {
default = pkgs.stdenv.mkDerivation {
name = "o365-auth";
propagatedBuildInputs = [
(pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
2024-04-05 22:11:51 -04:00
msal python-gnupg
2024-04-05 18:47:33 -04:00
]))
];
dontUnpack = true;
installPhase = ''
install -Dm755 ${./get_token.py} $out/bin/o365-get-token
install -Dm755 ${./refresh_token.py} $out/bin/o365-refresh-token
install -Dm755 ${./config.py} $out/bin/config.py
2024-04-05 20:34:20 -04:00
install -Dm755 ${./config.py} $out/bin/o365-get-config
2024-04-05 18:47:33 -04:00
'';
};
});
};
2024-04-05 18:13:16 -04:00
}