From 8d0119d8e49ccf45641d7ced758c4f8892b894ec Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Mon, 1 Feb 2021 19:48:59 -0700 Subject: [PATCH] home: move hmActivationPackages to own output Fixes `nix flake check` failure. --- flake.nix | 15 ++++++--------- lib/default.nix | 14 ++++++-------- shell/default.nix | 5 ++++- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index a5bdcb51..8f0ec617 100644 --- a/flake.nix +++ b/flake.nix @@ -97,19 +97,16 @@ pkgImport nixos overlays system; packages = - let - packages' = flattenTreeSystem system - (genPackages { - inherit self pkgs; - }); + flattenTreeSystem system + (genPackages { + inherit self pkgs; + }); - homeActivationPackages = genHomeActivationPackages - self.homeConfigurations; - in - recursiveUpdate packages' homeActivationPackages; in { inherit packages; + hmActivationPackages = genHomeActivationPackages + self.homeConfigurations; devShell = import ./shell { inherit pkgs nixos; diff --git a/lib/default.nix b/lib/default.nix index f2f6a2b3..145a9362 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -73,14 +73,12 @@ in (recursiveUpdate cachixAttrs modulesAttrs) profilesAttrs; - genHomeActivationPackages = hmConfigs: { - hmActivationPackages = - builtins.mapAttrs - (_: x: builtins.mapAttrs - (_: cfg: cfg.home.activationPackage) - x) - hmConfigs; - }; + genHomeActivationPackages = hmConfigs: + mapAttrs + (_: x: mapAttrs + (_: cfg: cfg.home.activationPackage) + x) + hmConfigs; genPackages = { self, pkgs }: let diff --git a/shell/default.nix b/shell/default.nix index 770d2f67..52737a5e 100644 --- a/shell/default.nix +++ b/shell/default.nix @@ -11,6 +11,9 @@ let }).config.system.build; flk = pkgs.writeShellScriptBin "flk" '' + system=$(nix eval --impure --expr "builtins.currentSystem") + system=${"\${system//\\\"/"}} + if [[ -z "$1" ]]; then echo "Usage: $(basename "$0") [ iso | up | install {host} | {host} [switch|boot|test] | home {host} {user} [switch] ]" elif [[ "$1" == "up" ]]; then @@ -28,7 +31,7 @@ let elif [[ "$1" == "install" ]]; then sudo nixos-install --flake "$DEVSHELL_ROOT#$2" "${"\${@:3}"}" elif [[ "$1" == "home" ]]; then - nix build ./#hmActivationPackages.$2.$3 + nix build ./#hmActivationPackages."$system".$2.$3 "${"\${@:4}"}" if [[ "$4" == "switch" ]]; then ./result/activate && unlink result fi