mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
home-manager: add target to generated configuration
When we detect that the installation is on a non-NixOS GNU/Linux distribution then we enable the generic Linux module.
This commit is contained in:
@@ -36,6 +36,12 @@ in runCommand "home-manager-install" {
|
||||
xdgVars="$xdgVars xdg.stateHome = \"$XDG_STATE_HOME\";$nl"
|
||||
fi
|
||||
|
||||
if [[ $OSTYPE == linux-* && ! -e /etc/NIXOS ]]; then
|
||||
target=$'\n targets.genericLinux.enable = true;\n'
|
||||
else
|
||||
target=""
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$confFile")"
|
||||
cat > $confFile <<EOF
|
||||
{ config, pkgs, ... }:
|
||||
@@ -58,7 +64,7 @@ in runCommand "home-manager-install" {
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
$target}
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user