From 333f69f82b771c14a590f69b78d6deb2edead855 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Mar 2024 14:55:47 +0100 Subject: [PATCH] build: Update and simplify Nix dev shell --- .envrc | 8 +++----- flake.lock | 8 ++++---- flake.nix | 25 +++---------------------- 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/.envrc b/.envrc index b351dff3db..3af52d88ed 100644 --- a/.envrc +++ b/.envrc @@ -2,10 +2,8 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" fi -nix_direnv_watch_file devenv.nix -nix_direnv_watch_file devenv.lock -nix_direnv_watch_file devenv.yaml -if ! use flake . --impure -then +watch_file flake.nix +watch_file flake.lock +if ! use flake . --impure; then echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 fi diff --git a/flake.lock b/flake.lock index a591fcaeb5..b189f6f11b 100644 --- a/flake.lock +++ b/flake.lock @@ -220,16 +220,16 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1696374741, - "narHash": "sha256-gt8B3G0ryizT9HSB4cCO8QoxdbsHnrQH+/BdKxOwqF0=", + "lastModified": 1709703039, + "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8a4c17493e5c39769f79117937c79e1c88de6729", + "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index d73827ceb5..9730d4305f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; systems.url = "github:nix-systems/default"; devenv.url = "github:cachix/devenv"; nixpkgs-python.url = "github:cachix/nixpkgs-python"; @@ -35,26 +35,8 @@ { packages = with pkgs; [ pre-commit - (python3Packages.buildPythonPackage - (let - pname = "poethepoet"; - version = "0.24.1"; - in { - inherit pname version; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-OvpEtPxzJ98N2RLtoBJgSgcq8rtNJD+w5B6Oyo2r+e0="; - python = "py3"; - dist = "py3"; - format = "wheel"; - }; - format = "wheel"; - propagatedBuildInputs = [ - # Specify dependencies - pkgs.python3Packages.pastel - pkgs.python3Packages.tomli - ]; - })) + poethepoet + stdenv.cc.cc.lib ]; languages.python = { @@ -62,7 +44,6 @@ poetry = { enable = true; install.enable = true; - install.allExtras = true; install.groups = ["dev"]; }; version = "3.11";