website/content/posts/2023-03-24-managing-mutable-files-in-nixos/assets/fetch-mutable-files-skeleton.nix

32 lines
789 B
Nix
Raw Normal View History

{ config, options, lib, pkgs, ... }:
let
cfg = config.home.mutableFiles;
2023-05-02 04:06:49 +00:00
file = { config, name, ... }: { };
in
{
options.home.mutableFile = lib.mkOption {
type = with lib.types; attrsOf (submodule file);
default = { };
description = lib.mkDoc ''
An attribute set of mutable files and directories to be fetched into the home
directory.
'';
example = lib.literalExpression ''
"''${config.xdg.userDirs.documents}/dotfiles" = {
url = "https://github.com/foo-dogsquared/dotfiles.git";
type = "git";
};
"''${config.xdg.userDirs.documents}/top-secret" = {
url = "https://example.com/file.zip";
type = "fetch";
};
'';
};
config = {
2023-05-02 04:06:49 +00:00
systemd.user.services.fetch-mutable-files = { };
};
}