From b37cc89cf2937c69b7f458e5e410dd046298bf72 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 21 Mar 2025 17:15:41 +0100 Subject: [PATCH] chore: add nix flake --- .envrc | 2 ++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..fe075fe --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +watch_file flake.lock +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..15173a3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1742069588, + "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..071b3d8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Dev shell"; + + # Flake inputs + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + # Flake outputs + outputs = { self, nixpkgs, ... }: + let + allSystems = [ + "x86_64-linux" # 64-bit Intel/AMD Linux + "aarch64-linux" # 64-bit ARM Linux + "x86_64-darwin" # 64-bit Intel macOS + "aarch64-darwin" # 64-bit ARM macOS + ]; + + forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); + in + { + devShells = forAllSystems ({ pkgs }: { + default = pkgs.mkShell { + packages = (with pkgs; [ + python313 + onefetch + uv + ruff + ]); + shellHook = '' + onefetch + uv sync + ''; + }; + }); + }; +}