Skip to content

Commit

Permalink
markcode: home.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Nov 24, 2023
1 parent 4c1d54e commit 0a93c23
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions home.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
#MC # home.nix
#MC
#MC This file is the entry point of home-manager's config.
#MC It imports my global options in `./opt.nix`,
#MC my CLI configs in `./usr/cli.nix`
#MC and my GUI configs in `./usr/gui.nix`.
#MC The environment variable `DISPLAY` is used to determine whether to enable the GUI configs.
{ config, pkgs, stdenv, lib, ... }:

{
imports = [
./opt.nix
./usr/cli.nix
# TODO: how to use isGui here?
] ++ (if (builtins.getEnv "DISPLAY")!=""
then [
# Q: how to use isGui here?
# A: Not possible.
# As isGui is evaluated after `imports` being evaluated,
# use config.isGui here cause infinite loop.
] ++ lib.optionals ((builtins.getEnv "DISPLAY")!="") [
./usr/gui.nix
] else []);
];

home.stateVersion = "18.09";
programs.home-manager.enable = true;
Expand Down

0 comments on commit 0a93c23

Please sign in to comment.