Skip to content

Symlinks are not created #168

@Kazuto

Description

@Kazuto

I'm trying to automatically create symlinks so that I don't have to manually create them or copy files to ~/.config, but the symlinks just aren't created.

# modules/darwin/home/default.nix
{ options, config, lib, pkgs, inputs, ... }:

with lib;
with lib.shiro;
let
  cfg = config.shiro.home;
in
{
  options.shiro.home = with types; {
    file = mkOpt attrs { }
      "A set of files to be managed by home-manager's <option>home.file</option>.";
    configFile = mkOpt attrs { }
      "A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
    extraOptions = mkOpt attrs { } "Options to pass directly to home-manager.";
  };

  config = {
    shiro.home.extraOptions = {
      home.stateVersion = config.system.stateVersion;
      home.file = mkAliasDefinitions options.shiro.home.file;
      xdg.enable = true;
      xdg.configFile = mkAliasDefinitions options.shiro.home.configFile;
    };

    snowfallorg.users.${config.shiro.user.name}.home.config = mkAliasDefinitions options.shiro.home.extraOptions;

    home-manager = {
      useUserPackages = true;
      useGlobalPkgs = true;
    };
  };
}
# modules/darwin/tools/sketchybar/default.nix
{ options, config, lib, pkgs, ... }:

with lib;
with lib.shiro;
let
  cfg = config.shiro.tools.sketchybar;
in
{
  options.shiro.tools.sketchybar = with types; {
    enable = mkBoolOpt false "Whether or not to install sketchybar";
  };

  config = mkIf cfg.enable {
    environment.systemPackages = with pkgs; [ sketchybar ];

    shiro.home.configFile.sketchybar = {
          source = config.lib.file.mkOutOfStoreSymlink ./config;
          recursive = true;
          executable = true;
        };
      };
    };

    services.sketchybar = {
      enable = true;
      package = pkgs.sketchybar;
    };
  };
}

I've already tried

configFile.sketchybar = {
    source = config.lib.file.mkOutOfStoreSymlink "~/.nix/modules/darwin/tools/sketchybar/config"
}

configFile.sketchybar = {
    source = config.lib.file.mkOutOfStoreSymlink "./config"
}

configFile.sketchybar = {
    source = "./config"
}

and the same with file."$HOME/.config/sketchybar" = {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions