diff --git a/README.md b/README.md index 69aa0c22..26d2a51f 100644 --- a/README.md +++ b/README.md @@ -73,9 +73,11 @@ Nix/NixOS采用了“包(Package)”的理念,将Linux内核、驱动、 * system.nix: 系统总体配置(nixos-rebuild的配置) * sys/cli.nix: 系统命令行配置 * sys/gui.nix: 系统图形配置 + * modules/: 系统模块 * home.nix: 用户总体配置(home-manager的配置) * usr/cli.nix: 用户命令行配置 * usr/gui.nix: 用户图形配置 + * modules/: 用户模块 * nix-on-droid.nix: 安卓总体配置(nix-on-droid的配置) * modules/: nixos/home-manager通用的模块 diff --git a/home.nix b/home.nix index 4ea7fffc..a3ae8f79 100644 --- a/home.nix +++ b/home.nix @@ -14,6 +14,7 @@ { imports = [ ./opt.nix + ./modules/cachix.nix ./usr/cli.nix # Q: how to use isGui here? # A: Not possible. diff --git a/usr/modules/cachix.nix b/usr/modules/cachix.nix new file mode 100644 index 00000000..d476701e --- /dev/null +++ b/usr/modules/cachix.nix @@ -0,0 +1,11 @@ +{ config, lib, ...}: + +{ + imports = [../../modules/cachix.nix]; + config = lib.mkIf ( + (builtins.pathExists config.cachix_dhall) && + (config.cachix_packages != []) + ) { + home.activation = lib.hm.dag.entryAfter ["writeBoundary"] config._cachix_push; + }; +}