From 55e2169571531b90443be37ff1dfacb25e37f4d6 Mon Sep 17 00:00:00 2001 From: Riley Apeldoorn Date: Tue, 23 May 2023 10:32:24 +0200 Subject: [PATCH] Fix home/nix module on non-nixos machines --- flake.nix | 5 ++++- shared/home/default.nix | 7 ++++++- shared/home/nix.nix | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 7f12e7e..97465b5 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,10 @@ config = { home-manager.users."riley" = a: lib.pipe a [ (import "${path}/home.nix") - (x: x // { imports = [ ./shared/home ]; }) + (x: x // { + imports = [ ./shared/home ]; + isNixos = true; + }) ]; }; }; diff --git a/shared/home/default.nix b/shared/home/default.nix index 55a5876..d940327 100644 --- a/shared/home/default.nix +++ b/shared/home/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, ... }: { @@ -12,6 +12,11 @@ ./gui ]; + options.isNixos = lib.mkOption { + type = lib.types.bool; + default = false; + }; + config.theme = import ../../themes/lean.nix; } \ No newline at end of file diff --git a/shared/home/nix.nix b/shared/home/nix.nix index 3a1df5f..39f5a27 100644 --- a/shared/home/nix.nix +++ b/shared/home/nix.nix @@ -1,6 +1,8 @@ -{ ... }: +{ lib, pkgs, config, ... }: -{ +(lib.mkIf (!config.isNixos) { + nix.package = pkgs.nix; +}) // { nix.settings = { experimental-features = [ "nix-command" "flakes" ];