Convert home-manager to flakes
Instead of calling the home manager directly in the user's list, we add a command for the user to invoke "hms" and have their environment setup in the way that Greg likes.
This commit is contained in:
@@ -8,4 +8,8 @@ self: super:
|
||||
xonsh = super.xonsh.overridePythonAttrs (old: rec{
|
||||
propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.xonsh-direnv ];
|
||||
});
|
||||
|
||||
hms = super.callPackage ./hms.nix {
|
||||
pkgs = self.pkgs;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
pkgs.writeShellScriptBin "hms" ''
|
||||
set -eo pipefail
|
||||
# Build different targets with GUI or not
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
target="nogui"
|
||||
else
|
||||
target="gui"
|
||||
fi
|
||||
|
||||
# Build and switch
|
||||
echo "Building $(uname -m)-$target"
|
||||
dest=$(mktemp -d)
|
||||
pushd "$dest" > /dev/null
|
||||
nix build --impure /etc/nixos#homeConfigurations.$(uname -m)-$target.activationPackage
|
||||
./result/activate
|
||||
popd > /dev/null
|
||||
rm -r "$dest"
|
||||
''
|
||||
Reference in New Issue
Block a user