mirror of
https://github.com/nix-community/home-manager
synced 2024-06-01 04:23:34 +02:00
Merge 39a3f73228
into 6e277d9566
This commit is contained in:
commit
0556a40907
|
@ -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'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
57
modules/programs/nix-init.nix
Normal file
57
modules/programs/nix-init.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user