mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
home-manager: format home-manager/default.nix
This commit is contained in:
parent
3a16ebdf72
commit
7fcfd9b565
2 changed files with 27 additions and 34 deletions
1
format
1
format
|
@ -18,7 +18,6 @@ esac
|
||||||
find . -name '*.nix' \
|
find . -name '*.nix' \
|
||||||
! -path ./modules/programs/irssi.nix \
|
! -path ./modules/programs/irssi.nix \
|
||||||
\
|
\
|
||||||
! -path ./home-manager/default.nix \
|
|
||||||
! -path ./home-manager/home-manager.nix \
|
! -path ./home-manager/home-manager.nix \
|
||||||
! -path ./modules/default.nix \
|
! -path ./modules/default.nix \
|
||||||
! -path ./modules/files.nix \
|
! -path ./modules/files.nix \
|
||||||
|
|
|
@ -1,42 +1,36 @@
|
||||||
{ runCommand, lib, bash, coreutils, findutils, gnused, less
|
{ runCommand, lib, bash, coreutils, findutils, gnused, less
|
||||||
|
|
||||||
# Extra path to Home Manager. If set then this path will be tried
|
# Extra path to Home Manager. If set then this path will be tried
|
||||||
# before `$HOME/.config/nixpkgs/home-manager` and
|
# before `$HOME/.config/nixpkgs/home-manager` and
|
||||||
# `$HOME/.nixpkgs/home-manager`.
|
# `$HOME/.nixpkgs/home-manager`.
|
||||||
, path ? null
|
, path ? null }:
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
pathStr = if path == null then "" else path;
|
pathStr = if path == null then "" else path;
|
||||||
|
|
||||||
in
|
in runCommand "home-manager" {
|
||||||
|
preferLocalBuild = true;
|
||||||
|
allowSubstitutes = false;
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A user environment configurator";
|
||||||
|
maintainers = [ maintainers.rycee ];
|
||||||
|
platforms = platforms.unix;
|
||||||
|
license = licenses.mit;
|
||||||
|
};
|
||||||
|
} ''
|
||||||
|
install -v -D -m755 ${./home-manager} $out/bin/home-manager
|
||||||
|
|
||||||
runCommand
|
substituteInPlace $out/bin/home-manager \
|
||||||
"home-manager"
|
--subst-var-by bash "${bash}" \
|
||||||
{
|
--subst-var-by coreutils "${coreutils}" \
|
||||||
preferLocalBuild = true;
|
--subst-var-by findutils "${findutils}" \
|
||||||
allowSubstitutes = false;
|
--subst-var-by gnused "${gnused}" \
|
||||||
meta = with lib; {
|
--subst-var-by less "${less}" \
|
||||||
description = "A user environment configurator";
|
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
|
||||||
maintainers = [ maintainers.rycee ];
|
|
||||||
platforms = platforms.unix;
|
|
||||||
license = licenses.mit;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
''
|
|
||||||
install -v -D -m755 ${./home-manager} $out/bin/home-manager
|
|
||||||
|
|
||||||
substituteInPlace $out/bin/home-manager \
|
install -D -m755 ${./completion.bash} \
|
||||||
--subst-var-by bash "${bash}" \
|
$out/share/bash-completion/completions/home-manager
|
||||||
--subst-var-by coreutils "${coreutils}" \
|
install -D -m755 ${./completion.zsh} \
|
||||||
--subst-var-by findutils "${findutils}" \
|
$out/share/zsh/site-functions/_home-manager
|
||||||
--subst-var-by gnused "${gnused}" \
|
''
|
||||||
--subst-var-by less "${less}" \
|
|
||||||
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
|
|
||||||
|
|
||||||
install -D -m755 ${./completion.bash} \
|
|
||||||
$out/share/bash-completion/completions/home-manager
|
|
||||||
install -D -m755 ${./completion.zsh} \
|
|
||||||
$out/share/zsh/site-functions/_home-manager
|
|
||||||
''
|
|
||||||
|
|
Loading…
Reference in a new issue