1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 04:23:34 +02:00
This commit is contained in:
uncenter 2024-05-07 12:34:46 -04:00 committed by GitHub
commit 0556a40907
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 65 additions and 0 deletions

View File

@ -1607,6 +1607,13 @@ in {
between windows, and is also a widget engine.
'';
}
{
time = "2024-05-07T16:33:07+00:00";
message = ''
A new module is available: 'programs.nix-init'.
'';
}
];
};
}

View File

@ -169,6 +169,7 @@ let
./programs/newsboat.nix
./programs/nheko.nix
./programs/nix-index.nix
./programs/nix-init.nix
./programs/nnn.nix
./programs/noti.nix
./programs/notmuch.nix

View File

@ -0,0 +1,57 @@
{ config, lib, pkgs, ... }:
let tomlFormat = pkgs.formats.toml { };
in with lib; {
meta.maintainers = [ maintainers.uncenter ];
options.programs.nix-init = {
enable = mkEnableOption
"nix-init - Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more";
settings = mkOption {
type = tomlFormat.type;
default = { };
example = lib.literalExpression ''
{
maintainers = [
"figsoda"
];
nixpkgs = "<nixpkgs>";
commit = true;
access-tokens = {
github.com = "ghp_blahblahblah...";
gitlab.com = {
command = [
"secret-tool"
"or"
"whatever"
"you"
"use"
];
};
gitlab.gnome.org = {
file = "/path/to/api/token";
};
};
}
'';
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/nix-init/config.toml`.
See <https://github.com/nix-community/nix-init#configuration> for the full list
of options.
'';
};
package = lib.mkPackageOption pkgs "nix-init" { };
};
config = let cfg = config.programs.nix-init;
in mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."nix-init/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "config.toml" cfg.settings;
};
};
}