From 094f2334f851518c47ead5f72f71aa17c34833f5 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 23 Nov 2020 16:47:17 +0000 Subject: [PATCH] ops/nixos/lib/home-manager: swap isDarwin for 'is external' check --- ops/nixos/lib/common.nix | 4 +++- ops/nixos/lib/home-manager/client.nix | 2 +- ops/nixos/lib/home-manager/common.nix | 4 +--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ops/nixos/lib/common.nix b/ops/nixos/lib/common.nix index 82ee56ca9d..dc02fa6923 100644 --- a/ops/nixos/lib/common.nix +++ b/ops/nixos/lib/common.nix @@ -139,7 +139,9 @@ in home-manager.users.lukegb = { pkgs, ... }: ({ imports = [ ({ - _module.args = args; + _module.args = args // { + configName = null; + }; })] ++ config.my.home-manager.imports ++ ( lib.optional (config.my.home-manager.system != null) config.my.home-manager.system ); diff --git a/ops/nixos/lib/home-manager/client.nix b/ops/nixos/lib/home-manager/client.nix index a6adfa475f..d51dcef2cd 100644 --- a/ops/nixos/lib/home-manager/client.nix +++ b/ops/nixos/lib/home-manager/client.nix @@ -5,7 +5,7 @@ in { imports = [ ./common.nix ]; - home.sessionVariables.GITHUB_TOKEN = depot.ops.secrets.githubToken; + home.sessionVariables.GITHUB_TOKEN = with depot.ops; if builtins.hasAttr "githubToken" secrets then secrets.githubToken else null; programs.git = { enable = true; package = pkgs.gitAndTools.gitFull; diff --git a/ops/nixos/lib/home-manager/common.nix b/ops/nixos/lib/home-manager/common.nix index f48ebcd4da..aea63493c6 100644 --- a/ops/nixos/lib/home-manager/common.nix +++ b/ops/nixos/lib/home-manager/common.nix @@ -3,8 +3,6 @@ let inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux; in { - programs.home-manager.enable = !isDarwin; - home.username = "lukegb"; home.homeDirectory = if isDarwin then "/Users/lukegb" else "/home/lukegb"; home.file = { @@ -75,7 +73,7 @@ in ripgrep whois dnsutils - ] ++ lib.optionals isDarwin [ + ] ++ lib.optionals (configName != null) [ (writeShellScriptBin "home-manager" '' #!/bin/sh exec "${home-manager}/bin/home-manager" -f "${config.home.homeDirectory}/depot/home-manager-ext.nix" -A "${configName}" "$@"