diff --git a/home/users/benson.nix b/home/users/benson.nix index 038f384..789b91e 100644 --- a/home/users/benson.nix +++ b/home/users/benson.nix @@ -1,4 +1,4 @@ -{ inputs, config, pkgs, lib, ... }: +{ inputs, config, pkgs, lib, ... }@args: let my-emacs = ((pkgs.emacsPackagesFor pkgs.emacs-unstable) .emacsWithPackages (epkgs: with epkgs; [ @@ -17,6 +17,8 @@ in { my.beets-config.enable = true; + my.flakeLocation = lib.mkIf (builtins.hasAttr "osConfig" args) args.osConfig.my.flakeLocation; + # Home Manager needs a bit of information about you and the paths it should # manage. home = { diff --git a/submodules/default.nix b/submodules/default.nix index 41b9613..4bde0be 100644 --- a/submodules/default.nix +++ b/submodules/default.nix @@ -1,20 +1,25 @@ -{ inputs, config, pkgs, lib, ... }: +{ inputs, config, pkgs, lib, ... }@args: let beets-cfg = config.my.beets-config; in { options = { + my.flakeLocation = lib.mkOption { + default = "/home/${config.home.username}/nixos-config"; + description = "Location of nixos flake for config"; + type = lib.types.path; + }; my.beets-config.enable = lib.mkEnableOption "Enable beets configuration file"; }; config = lib.mkIf beets-cfg.enable { # xdg.configFile."beets/config.yaml".source = ./beets-config/config.yaml; - home = { file = { ".config/beets/config.yaml" = { - source = config.lib.file.mkOutOfStoreSymlink ./. + "submodules/beets-config/config.yaml"; + source = config.lib.file.mkOutOfStoreSymlink + "${config.my.flakeLocation}/submodules/beets-config/config.yaml"; # recursive = true; }; };