Skip to content

Commit

Permalink
feat: Add nix flake with python and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtz-j committed Aug 5, 2024
1 parent 84c9370 commit 9ac4b41
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
description = "Masterblaser Flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};

outputs = {
self,
nixpkgs,
}: let
# Helpers for producing system-specific outputs
supportedSystems = ["x86_64-linux" "aarch64-darwin"];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs {inherit system;};
});
in {
# Development environments
devShells = forEachSupportedSystem ({pkgs}: {
default = pkgs.mkShell {
# Pinned packages available in the environment
packages = with pkgs; [
python311
(with python311Packages; [
aiohttp
dateutils
])
];

# Environment variables
env = {
ACCESS_TOKEN = "";
ORG_ID = "";
ORG_NAME = "";
MB_BASE_URL = "https://app.bedriftsligaen.no/api";
NUMBER_OF_MEMBERS = "";
TEAM_NAME = "";
};

# A hook run every time you enter the environment
# Can load variables from `.env` file
shellHook = ''
set -a; source .env; set +a
'';
};
});
};
}

0 comments on commit 9ac4b41

Please sign in to comment.