From e2623702ec9a6572e7ba1519b183f3be60b35bd0 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Thu, 29 Dec 2022 12:00:40 +0000 Subject: [PATCH] feat: add flake for python --- .envrc | 1 + .gitignore | 2 ++ flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 24 ++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b91777e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.direnv +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..902a7ca --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1671268780, + "narHash": "sha256-9Okbivo10bcXEGCtmAQNfJt1Zpk6B3tjkSQ2CIXmTCg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "80c24eeb9ff46aa99617844d0c4168659e35175f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d6823e5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,24 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem(system: + let + pkgs = import nixpkgs { + inherit system; + }; + inherit (pkgs) lib; + in + { + devShells.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + python3 + python310Packages.python-lsp-server + ]; + }; + } + ); +}