From 4c4fd4ed6beaf7ecd3ffbda0779413b116411072 Mon Sep 17 00:00:00 2001 From: teto <886074+teto@users.noreply.github.com> Date: Wed, 25 Feb 2026 09:42:47 +0100 Subject: [PATCH] feat: introduce development shell flakes are not stable yet, community is divided but maintaining both flake and a set of dependencies in our scripts is hard. So provide a nix-shell that fetches the nixpkgs recorded in the flake.lock to keep a single source of truth doc: updated the doc to advise `nix-shell -A dev` --- Makefile | 2 +- default.nix | 14 ++++++++++++++ docs/manual/contributing/news.md | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index daa34f06..7ab1bb77 100644 --- a/Makefile +++ b/Makefile @@ -17,4 +17,4 @@ test-install: HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install format: - nix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run "treefmt --config-file ./treefmt.toml" + nix-shell -A dev --run treefmt diff --git a/default.nix b/default.nix index a972c758..a889bb5d 100644 --- a/default.nix +++ b/default.nix @@ -8,6 +8,18 @@ let name = "home-manager-source"; }; + nixpkgs = ( + import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + n = lock.nodes.nixpkgs.locked; + in + fetchTarball { + url = "https://github.com/${n.owner}/${n.repo}/archive/${n.rev}.tar.gz"; + sha256 = n.narHash; + } + ) { } + ); in rec { docs = @@ -32,5 +44,7 @@ rec { nixos = import ./nixos; lib = import ./lib { inherit (pkgs) lib; }; + dev = nixpkgs.callPackage ./home-manager/devShell.nix { }; + inherit path; } diff --git a/docs/manual/contributing/news.md b/docs/manual/contributing/news.md index 1fc508f5..a6b8075b 100644 --- a/docs/manual/contributing/news.md +++ b/docs/manual/contributing/news.md @@ -19,7 +19,7 @@ but you should follow some basic guidelines: Alternatively, you can directly use the script: ``` shell - $ modules/misc/news/create-news-entry.sh + $ nix-shell -A dev --run modules/misc/news/create-news-entry.sh ``` This will create a new file inside the `modules/misc/news` directory