mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01:00
home-manager: overrideable URLs in generated flake
When using the `init` sub-command, it is now possible to set the Home Manager and Nixpkgs input URLs. Note, for now these options are considered experimental.
This commit is contained in:
parent
5553c93889
commit
dbded8d0ec
1 changed files with 13 additions and 2 deletions
|
@ -258,6 +258,9 @@ function doInit() {
|
|||
withFlake=1
|
||||
fi
|
||||
|
||||
local homeManagerUrl="github:nix-community/home-manager"
|
||||
local nixpkgsUrl="github:nixos/nixpkgs/nixos-unstable"
|
||||
|
||||
while (( $# > 0 )); do
|
||||
local opt="$1"
|
||||
shift
|
||||
|
@ -269,6 +272,14 @@ function doInit() {
|
|||
--switch)
|
||||
switch=1
|
||||
;;
|
||||
--home-manager-url)
|
||||
homeManagerUrl="$1"
|
||||
shift
|
||||
;;
|
||||
--nixpkgs-url)
|
||||
nixpkgsUrl="$1"
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
_iError "%s: unknown option '%s'" "$0" "$opt" >&2
|
||||
exit 1
|
||||
|
@ -419,9 +430,9 @@ EOF
|
|||
|
||||
inputs = {
|
||||
# Specify the source of Home Manager and Nixpkgs.
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "$nixpkgsUrl";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
url = "$homeManagerUrl";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue