mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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`
This commit is contained in:
2
Makefile
2
Makefile
@@ -17,4 +17,4 @@ test-install:
|
|||||||
HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install
|
HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install
|
||||||
|
|
||||||
format:
|
format:
|
||||||
nix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run "treefmt --config-file ./treefmt.toml"
|
nix-shell -A dev --run treefmt
|
||||||
|
|||||||
14
default.nix
14
default.nix
@@ -8,6 +8,18 @@ let
|
|||||||
name = "home-manager-source";
|
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
|
in
|
||||||
rec {
|
rec {
|
||||||
docs =
|
docs =
|
||||||
@@ -32,5 +44,7 @@ rec {
|
|||||||
nixos = import ./nixos;
|
nixos = import ./nixos;
|
||||||
lib = import ./lib { inherit (pkgs) lib; };
|
lib = import ./lib { inherit (pkgs) lib; };
|
||||||
|
|
||||||
|
dev = nixpkgs.callPackage ./home-manager/devShell.nix { };
|
||||||
|
|
||||||
inherit path;
|
inherit path;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ but you should follow some basic guidelines:
|
|||||||
Alternatively, you can directly use the script:
|
Alternatively, you can directly use the script:
|
||||||
|
|
||||||
``` shell
|
``` 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
|
This will create a new file inside the `modules/misc/news` directory
|
||||||
|
|||||||
Reference in New Issue
Block a user