home: move hmActivationPackages to own output

Fixes `nix flake check` failure.
This commit is contained in:
Timothy DeHerrera 2021-02-01 19:48:59 -07:00
parent e7d9abfdcd
commit 8d0119d8e4
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
3 changed files with 16 additions and 18 deletions

View file

@ -97,19 +97,16 @@
pkgImport nixos overlays system; pkgImport nixos overlays system;
packages = packages =
let flattenTreeSystem system
packages' = flattenTreeSystem system
(genPackages { (genPackages {
inherit self pkgs; inherit self pkgs;
}); });
homeActivationPackages = genHomeActivationPackages
self.homeConfigurations;
in
recursiveUpdate packages' homeActivationPackages;
in in
{ {
inherit packages; inherit packages;
hmActivationPackages = genHomeActivationPackages
self.homeConfigurations;
devShell = import ./shell { devShell = import ./shell {
inherit pkgs nixos; inherit pkgs nixos;

View file

@ -73,14 +73,12 @@ in
(recursiveUpdate cachixAttrs modulesAttrs) (recursiveUpdate cachixAttrs modulesAttrs)
profilesAttrs; profilesAttrs;
genHomeActivationPackages = hmConfigs: { genHomeActivationPackages = hmConfigs:
hmActivationPackages = mapAttrs
builtins.mapAttrs (_: x: mapAttrs
(_: x: builtins.mapAttrs
(_: cfg: cfg.home.activationPackage) (_: cfg: cfg.home.activationPackage)
x) x)
hmConfigs; hmConfigs;
};
genPackages = { self, pkgs }: genPackages = { self, pkgs }:
let let

View file

@ -11,6 +11,9 @@ let
}).config.system.build; }).config.system.build;
flk = pkgs.writeShellScriptBin "flk" '' flk = pkgs.writeShellScriptBin "flk" ''
system=$(nix eval --impure --expr "builtins.currentSystem")
system=${"\${system//\\\"/"}}
if [[ -z "$1" ]]; then if [[ -z "$1" ]]; then
echo "Usage: $(basename "$0") [ iso | up | install {host} | {host} [switch|boot|test] | home {host} {user} [switch] ]" echo "Usage: $(basename "$0") [ iso | up | install {host} | {host} [switch|boot|test] | home {host} {user} [switch] ]"
elif [[ "$1" == "up" ]]; then elif [[ "$1" == "up" ]]; then
@ -28,7 +31,7 @@ let
elif [[ "$1" == "install" ]]; then elif [[ "$1" == "install" ]]; then
sudo nixos-install --flake "$DEVSHELL_ROOT#$2" "${"\${@:3}"}" sudo nixos-install --flake "$DEVSHELL_ROOT#$2" "${"\${@:3}"}"
elif [[ "$1" == "home" ]]; then elif [[ "$1" == "home" ]]; then
nix build ./#hmActivationPackages.$2.$3 nix build ./#hmActivationPackages."$system".$2.$3 "${"\${@:4}"}"
if [[ "$4" == "switch" ]]; then if [[ "$4" == "switch" ]]; then
./result/activate && unlink result ./result/activate && unlink result
fi fi