Compare commits

...

1 commit

Author SHA1 Message Date
Robert Helgesson f2f010e8ab
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.
2022-09-23 10:18:11 +02:00

View file

@ -36,6 +36,12 @@ in runCommand "home-manager-install" {
xdgVars="$xdgVars xdg.stateHome = \"$XDG_STATE_HOME\";$nl" xdgVars="$xdgVars xdg.stateHome = \"$XDG_STATE_HOME\";$nl"
fi fi
if [[ $OSTYPE == linux-* && ! -e /etc/NIXOS ]]; then
target=$'\n targets.genericLinux.enable = true;\n'
else
target=""
fi
mkdir -p "$(dirname "$confFile")" mkdir -p "$(dirname "$confFile")"
cat > $confFile <<EOF cat > $confFile <<EOF
{ config, pkgs, ... }: { config, pkgs, ... }:
@ -58,7 +64,7 @@ in runCommand "home-manager-install" {
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
} $target}
EOF EOF
fi fi