Compare commits

...

31 Commits

Author SHA1 Message Date
Lena Fuhrimann
cd6e96d56e hyprland: import XDG_SESSION_TYPE for systemd 2026-01-08 16:53:03 -05:00
Thierry Delafontaine
b1b1c68033 opencode: add custom tools support
Adds support for custom tools - user-defined functions that the LLM can
call during conversations. Custom tools work alongside opencode's built-in
tools and are configured through the new `tools` option.

The configuration follows the same pattern as other opencode settings like
`agents` and `commands`, supporting:
- Inline TypeScript content
- Individual file paths
- Bulk directory imports
2026-01-08 16:32:29 -05:00
Thierry Delafontaine
081234b704 opencode: support directory-based configuration for commands, agents, and themes
The `commands`, `agents`, and `themes` options now accept either an
attribute set (existing behavior) or a path to a directory containing
multiple files. When a directory path is provided, it is symlinked to
the appropriate `$XDG_CONFIG_HOME/opencode/` subdirectory.

This change aligns with the existing `skills` option implementation and
provides a more convenient way to manage multiple configuration files
without needing to define each one individually in Nix.
2026-01-08 16:32:29 -05:00
Austin Horstman
2be878259a makefile: add nixf-diagnose
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 16:30:04 -05:00
Austin Horstman
fa6de26b4d treewide: nixf-diagnose cleanup
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 16:30:04 -05:00
Austin Horstman
9fff37e6ff flake: add nixf-diagnose to treefmt
Start off conservative ignoring more things. Handle the simple auto-fix
things initially.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 16:30:04 -05:00
Austin Horstman
a2cc7b0bab less: migrate to lib.cli.toCommandLineGNU
Migrates from the deprecated toCommandLine to toCommandLineGNU.

This changes the output format to use GNU-style options with equals
(--wheel-lines=3). Both formats were verified to work correctly with less.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 14:56:14 -05:00
Benedikt Rips
37158e5267 vesktop: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
cd74467526 streamlink: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
72476602b9 sapling: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
e926e27968 rbw: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
db116ceb76 qutebrowser: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
f7b2bdf042 pueue: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
a1a11393d9 pistol: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
802ce0a7b1 mullvad-vpn: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
e69fbc243a lazygit: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
ebab435f3e lazydocker: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
bacad23b8c kubecolor: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
6067be4770 kitty: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Benedikt Rips
12a723df97 gurk-rs: deduplicate platform-dependent files 2026-01-08 14:49:34 -05:00
Austin Horstman
40deed4ffe ci: validate-maintainers all-maintainers update
Might as well, can't hurt.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 13:57:12 -05:00
Austin Horstman
9500721e96 maintainers: update all-maintainers
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 13:57:12 -05:00
Austin Horstman
db105fadc4 maintainers: rrvsh moved to nixpkgs
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 13:57:12 -05:00
Austin Horstman
609846bfd2 maintainers: nickthegroot moved to nixpkgs
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 13:57:12 -05:00
Austin Horstman
2db6bcc7ca ci: validate-maintainers on flake.lock update
Keep missing conflicts from nixpkgs updates.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 13:57:12 -05:00
Jure Varlec
a3ac4bb1f8 generic-linux-gpu: put systemd unit in lib/systemd
This is where unit files are expected to be, making GPU setup compatible
with things like selinux. Fixes #8438. The `resources/` directory was
kept because it is expected to be used in the future.
2026-01-08 13:15:31 -05:00
Xinyang Li
47db0fde35 ssh-agent: add allowedPKCS11Providers option 2026-01-08 13:10:56 -05:00
Michael Strobel
3351348827 sftpman: add missing options
- `authType` is missing the `authentication-agent` enum value
- `mountDestPath` is missing completely
2026-01-08 12:31:15 -05:00
NAHO
7688293f06 home-manager: update copyright year 2026-01-08 12:29:25 -05:00
Austin Horstman
92394f9dea difftastic: migrate to lib.cli.toCommandLineShellGNU
Migrates from the deprecated toCommandLineShell to toCommandLineShellGNU.

This changes the output format to use GNU-style concatenated options
(--color=always) with shell escaping for git config values. Both formats
were verified to work correctly with difftastic.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 11:44:04 -05:00
Austin Horstman
fb6a8404ee redshift-gammastep: migrate to lib.cli.toCommandLineShellGNU
Migrates from the deprecated toCommandLineShell to toCommandLineShellGNU.

This changes the output format from space-separated short options
(-c /path) to concatenated GNU-style options (-c/path). Both formats
were verified to work correctly with redshift and gammastep.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 11:21:16 -05:00
133 changed files with 883 additions and 462 deletions

View File

@@ -1,7 +1,10 @@
name: Validate maintainers.nix name: Validate maintainers.nix
on: on:
pull_request: pull_request:
paths: ["modules/lib/maintainers.nix"] paths:
- "modules/lib/maintainers.nix"
- "flake.lock"
- "all-maintainers.nix"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
run_tests: run_tests:

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2017-2025 Home Manager contributors Copyright (c) 2017-2026 Home Manager contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -17,4 +17,4 @@ test-install:
HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install
format: format:
nix-shell -p treefmt nixfmt deadnix keep-sorted --run "treefmt --config-file ./treefmt.toml" nix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run "treefmt --config-file ./treefmt.toml"

View File

@@ -19,6 +19,11 @@
email = "da157@voidq.com"; email = "da157@voidq.com";
github = "0xda157"; github = "0xda157";
githubId = 153149335; githubId = 153149335;
keys = [
{
fingerprint = "5A66 FF95 36DE B501 DDD2 1647 B7AC 1B10 365D 45FF";
}
];
matrix = "@da157:catgirl.cloud"; matrix = "@da157:catgirl.cloud";
name = "0xda157"; name = "0xda157";
source = "nixpkgs"; source = "nixpkgs";
@@ -65,14 +70,6 @@
name = "Alex"; name = "Alex";
source = "home-manager"; source = "home-manager";
}; };
AndersonTorres = {
email = "torres.anderson.85@protonmail.com";
github = "AndersonTorres";
githubId = 5954806;
matrix = "@anderson_torres:matrix.org";
name = "Anderson Torres";
source = "nixpkgs";
};
AndreasMager = { AndreasMager = {
email = "andreas@mager.eu"; email = "andreas@mager.eu";
github = "AndreasMager"; github = "AndreasMager";
@@ -1760,7 +1757,7 @@
github = "nickthegroot"; github = "nickthegroot";
githubId = 1966472; githubId = 1966472;
name = "Nick DeGroot"; name = "Nick DeGroot";
source = "home-manager"; source = "nixpkgs";
}; };
nikp123 = { nikp123 = {
email = "nikp123@users.noreply.github.com"; email = "nikp123@users.noreply.github.com";
@@ -2012,7 +2009,7 @@
github = "rrvsh"; github = "rrvsh";
githubId = 20300874; githubId = 20300874;
name = "Mohammad Rafiq"; name = "Mohammad Rafiq";
source = "home-manager"; source = "nixpkgs";
}; };
rszamszur = { rszamszur = {
email = "radoslawszamszur@gmail.com"; email = "radoslawszamszur@gmail.com";

View File

@@ -110,8 +110,7 @@ let
in in
pkgs.buildPackages.nixosOptionsDoc ( pkgs.buildPackages.nixosOptionsDoc (
{ {
options = options = if includeModuleSystemOptions then options else removeAttrs options [ "_module" ];
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
transformOptions = transformOptions =
opt: opt:
opt opt
@@ -133,7 +132,7 @@ let
) opt.declarations; ) opt.declarations;
}; };
} }
// builtins.removeAttrs args [ // removeAttrs args [
"modules" "modules"
"includeModuleSystemOptions" "includeModuleSystemOptions"
] ]

View File

@@ -57,6 +57,7 @@
nixfmt nixfmt
deadnix deadnix
keep-sorted keep-sorted
nixf-diagnose
]; ];
settings = pkgs.lib.importTOML ./treefmt.toml; settings = pkgs.lib.importTOML ./treefmt.toml;
} }

View File

@@ -31,7 +31,7 @@ let
modules = [ configuration ] ++ hmModules; modules = [ configuration ] ++ hmModules;
class = "homeManager"; class = "homeManager";
specialArgs = { specialArgs = {
modulesPath = builtins.toString ./.; modulesPath = toString ./.;
} }
// extraSpecialArgs; // extraSpecialArgs;
}; };

View File

@@ -192,7 +192,7 @@ in
++ lib.optionals (cfg.quickPhraseFiles != { }) [ ++ lib.optionals (cfg.quickPhraseFiles != { }) [
(pkgs.linkFarm "quickPhraseFiles" ( (pkgs.linkFarm "quickPhraseFiles" (
lib.mapAttrs' ( lib.mapAttrs' (
name: value: lib.nameValuePair ("share/fcitx5/data/quickphrase.d/${name}.mb") value name: value: lib.nameValuePair "share/fcitx5/data/quickphrase.d/${name}.mb" value
) cfg.quickPhraseFiles ) cfg.quickPhraseFiles
)) ))
]; ];

View File

@@ -13,12 +13,9 @@ let
mergeDefinitions mergeDefinitions
; ;
inherit (builtins) inherit (builtins)
map
filter filter
length length
deepSeq deepSeq
throw
toString
concatLists concatLists
; ;
inherit (lib.options) showDefs; inherit (lib.options) showDefs;

View File

@@ -423,12 +423,6 @@
github = "natecox"; github = "natecox";
githubId = 2782695; githubId = 2782695;
}; };
nickthegroot = {
name = "Nick DeGroot";
email = "nick@nickthegroot.com";
github = "nickthegroot";
githubId = 1966472;
};
nikp123 = { nikp123 = {
name = "nikp123"; name = "nikp123";
email = "nikp123@users.noreply.github.com"; email = "nikp123@users.noreply.github.com";
@@ -507,12 +501,6 @@
github = "Rosuavio"; github = "Rosuavio";
githubId = 7164552; githubId = 7164552;
}; };
rrvsh = {
name = "Mohammad Rafiq";
email = "rafiq@rrv.sh";
github = "rrvsh";
githubId = 20300874;
};
rszamszur = { rszamszur = {
name = "Radosław Szamszur"; name = "Radosław Szamszur";
email = "radoslawszamszur@gmail.com"; email = "radoslawszamszur@gmail.com";

View File

@@ -278,7 +278,7 @@ in
else if builtins.isString value then else if builtins.isString value then
"<const>${value}</const>" "<const>${value}</const>"
else else
throw ("expected bool or string but got ${builtins.typeOf value}: ${toString value}"); throw "expected bool or string but got ${builtins.typeOf value}: ${toString value}";
in in
'' ''
<match target="font"> <match target="font">
@@ -338,7 +338,7 @@ in
xdg.configFile = lib.mapAttrs' ( xdg.configFile = lib.mapAttrs' (
name: config: name: config:
lib.nameValuePair "fontconfig/conf.d/${builtins.toString config.priority}-hm-${config.label}.conf" { lib.nameValuePair "fontconfig/conf.d/${toString config.priority}-hm-${config.label}.conf" {
inherit (config) enable text; inherit (config) enable text;
source = lib.mkIf (config.source != null) config.source; source = lib.mkIf (config.source != null) config.source;
} }

View File

@@ -72,7 +72,7 @@ let
fileList ++ subdirFiles; fileList ++ subdirFiles;
newsFiles = collectNixFiles ./news; newsFiles = collectNixFiles ./news;
newsEntries = builtins.map ( newsEntries = map (
newsFile: newsFile:
let let
imported = import newsFile; imported = import newsFile;

View File

@@ -47,9 +47,9 @@ in
desktop: terminals: desktop: terminals:
# Map desktop name such as GNOME to `.config/gnome-xdg-terminals.list`, # Map desktop name such as GNOME to `.config/gnome-xdg-terminals.list`,
# default to `.config/xdg-terminals.list`. # default to `.config/xdg-terminals.list`.
lib.nameValuePair ( lib.nameValuePair "${
"${if desktop == "default" then "" else "${lib.toLower desktop}-"}xdg-terminals.list" if desktop == "default" then "" else "${lib.toLower desktop}-"
) { text = lib.concatLines terminals; } }xdg-terminals.list" { text = lib.concatLines terminals; }
) cfg.settings; ) cfg.settings;
}; };
} }

View File

@@ -104,7 +104,7 @@ in
}; };
stylesets = mkOption { stylesets = mkOption {
type = with types; attrsOf (sectionsOrLines); type = with types; attrsOf sectionsOrLines;
default = { }; default = { };
example = literalExpression '' example = literalExpression ''
{ default = { ui = { "tab.selected.reverse" = "toggle"; }; }; }; { default = { ui = { "tab.selected.reverse" = "toggle"; }; }; };

View File

@@ -6,9 +6,7 @@
}: }:
let let
inherit (builtins) inherit (builtins)
map
toJSON toJSON
toString
substring substring
stringLength stringLength
; ;

View File

@@ -281,7 +281,7 @@ in
) supportedBrowsers; ) supportedBrowsers;
config = lib.mkMerge ( config = lib.mkMerge (
builtins.map (browser: browserConfig browser config.programs.${browser}) ( map (browser: browserConfig browser config.programs.${browser}) (
builtins.attrNames supportedBrowsers builtins.attrNames supportedBrowsers
) )
); );

View File

@@ -129,7 +129,7 @@ in
enable = lib.mkDefault true; enable = lib.mkDefault true;
iniContent = iniContent =
let let
difftCommand = "${lib.getExe cfg.package} ${lib.cli.toGNUCommandLineShell { } cfg.options}"; difftCommand = "${lib.getExe cfg.package} ${lib.cli.toCommandLineShellGNU { } cfg.options}";
in in
mkMerge [ mkMerge [
{ {

View File

@@ -16,8 +16,7 @@ let
generateConfig = lib.generators.toKeyValue { generateConfig = lib.generators.toKeyValue {
mkKeyValue = mkKeyValue =
name: value: name: value: if lib.isString value then ''${name}="${value}"'' else "${name}=${toString value}";
if lib.isString value then ''${name}="${value}"'' else "${name}=${builtins.toString value}";
}; };
iniFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; }; iniFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; };

View File

@@ -103,7 +103,7 @@ in
{ {
name = path; name = path;
value = { value = {
source = jsonFormat.generate "config.json" (ctx); source = jsonFormat.generate "config.json" ctx;
}; };
} }
) cfg.contexts; ) cfg.contexts;

View File

@@ -471,7 +471,7 @@ in
order = mkOption { order = mkOption {
type = with types; uniq (listOf str); type = with types; uniq (listOf str);
apply = builtins.map migrateEngineNameToIdV7; apply = map migrateEngineNameToIdV7;
default = [ ]; default = [ ];
example = [ example = [
"ddg" "ddg"

View File

@@ -627,7 +627,7 @@ in
package package
] ]
++ lib.filter (p: p != null) ( ++ lib.filter (p: p != null) (
builtins.map (outName: package.${outName} or null) config.home.extraOutputsToInstall map (outName: package.${outName} or null) config.home.extraOutputsToInstall
); );
nativeBuildInputs = [ pkgs.python3 ]; nativeBuildInputs = [ pkgs.python3 ];
buildInputs = [ cfg.package ]; buildInputs = [ cfg.package ];

View File

@@ -11,7 +11,7 @@ let
tomlFormat = pkgs.formats.toml { }; tomlFormat = pkgs.formats.toml { };
in in
{ {
meta.maintainers = [ lib.hm.maintainers.rrvsh ]; meta.maintainers = [ lib.maintainers.rrvsh ];
options.programs.gemini-cli = { options.programs.gemini-cli = {
enable = lib.mkEnableOption "gemini-cli"; enable = lib.mkEnableOption "gemini-cli";

View File

@@ -204,7 +204,7 @@ in
xdg.dataFile."gh/extensions" = mkIf (cfg.extensions != [ ]) { xdg.dataFile."gh/extensions" = mkIf (cfg.extensions != [ ]) {
source = pkgs.linkFarm "gh-extensions" ( source = pkgs.linkFarm "gh-extensions" (
builtins.map (p: { map (p: {
name = p.pname; name = p.pname;
path = "${p}/bin"; path = "${p}/bin";
}) cfg.extensions }) cfg.extensions

View File

@@ -7,6 +7,8 @@
let let
tomlFormat = pkgs.formats.toml { }; tomlFormat = pkgs.formats.toml { };
cfg = config.programs.gurk-rs; cfg = config.programs.gurk-rs;
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
in in
{ {
meta.maintainers = [ lib.maintainers.da157 ]; meta.maintainers = [ lib.maintainers.da157 ];
@@ -46,9 +48,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file."${ home.file."${configDir}/gurk/gurk.toml" = lib.mkIf (cfg.settings != { }) {
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome source = tomlFormat.generate "gurk-config" cfg.settings;
}/gurk/gurk.toml".source = };
lib.mkIf (cfg.settings != { }) (tomlFormat.generate "gurk-config" cfg.settings);
}; };
} }

View File

@@ -9,7 +9,7 @@ let
iniFormat = pkgs.formats.ini { }; iniFormat = pkgs.formats.ini { };
in in
{ {
meta.maintainers = with lib.maintainers; [ ]; meta.maintainers = [ ];
options.programs.havoc = { options.programs.havoc = {
enable = lib.mkEnableOption "Havoc terminal"; enable = lib.mkEnableOption "Havoc terminal";

View File

@@ -70,7 +70,7 @@ in
"mako" "mako"
]; ];
in in
builtins.map (name: { map (name: {
assertion = !config.services.${name}.enable; assertion = !config.services.${name}.enable;
message = '' message = ''
Only one notification daemon can be enabled at once. You have enabled Only one notification daemon can be enabled at once. You have enabled

View File

@@ -139,7 +139,7 @@ in
in in
lib.hm.dag.entryAfter [ "linkGeneration" ] '' lib.hm.dag.entryAfter [ "linkGeneration" ] ''
# Ensure that settings.json exists. # Ensure that settings.json exists.
mkdir -p ${builtins.dirOf configPath} mkdir -p ${dirOf configPath}
touch ${configPath} touch ${configPath}
# Config has to be written to temporary variable because jq cannot edit files in place. # Config has to be written to temporary variable because jq cannot edit files in place.
config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})" config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})"

View File

@@ -14,7 +14,7 @@ let
renderSettings = renderSettings =
with lib.generators; with lib.generators;
toINI { toINI {
mkKeyValue = mkKeyValueDefault rec { mkKeyValue = mkKeyValueDefault {
mkValueString = mkValueString =
v: v:
if lib.isList v then if lib.isList v then
@@ -139,7 +139,7 @@ in
let let
makePath = makePath =
baseDir: subDir: baseDir: subDir:
builtins.toString ( toString (
/. /.
+ lib.concatStringsSep "/" [ + lib.concatStringsSep "/" [
baseDir baseDir

View File

@@ -341,16 +341,13 @@ in
# See https://sw.kovidgoyal.net/kitty/conf.html # See https://sw.kovidgoyal.net/kitty/conf.html
${cfg.extraConfig} ${cfg.extraConfig}
''; '';
} onChange =
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { let
onChange = '' prefix = if pkgs.stdenv.hostPlatform.isDarwin then "/usr" else pkgs.procps;
${pkgs.procps}/bin/pkill -USR1 -u $USER kitty || true in
''; ''
} ${prefix}/bin/pkill -USR1 -u $USER kitty || true
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin { '';
onChange = ''
/usr/bin/pkill -USR1 -u $USER kitty || true
'';
}; };
xdg.configFile."kitty/quick-access-terminal.conf" = mkIf (cfg.quickAccessTerminalConfig != { }) { xdg.configFile."kitty/quick-access-terminal.conf" = mkIf (cfg.quickAccessTerminalConfig != { }) {

View File

@@ -9,7 +9,6 @@ let
cfg = config.programs.kubecolor; cfg = config.programs.kubecolor;
yamlFormat = pkgs.formats.yaml { }; yamlFormat = pkgs.formats.yaml { };
inherit (pkgs.stdenv.hostPlatform) isDarwin;
in in
{ {
@@ -50,18 +49,20 @@ in
config = config =
let let
preferXdgDirectories = config.home.preferXdgDirectories && (!isDarwin || config.xdg.enable); preferXdgDirectories =
config.home.preferXdgDirectories && (!pkgs.stdenv.hostPlatform.isDarwin || config.xdg.enable);
configDir =
if preferXdgDirectories then
"${config.xdg.configHome}/kube"
else if pkgs.stdenv.hostPlatform.isDarwin then
"Library/Application Support/kube"
else
".kube";
# https://github.com/kubecolor/kubecolor/pull/145 # https://github.com/kubecolor/kubecolor/pull/145
configPathSuffix = configPathSuffix = lib.optionalString (
if cfg.package.pname == "kubecolor" && lib.versionOlder (lib.getVersion cfg.package) "0.4"
cfg.package.pname == "kubecolor" ) "color.yaml";
&& lib.strings.toInt (lib.versions.major cfg.package.version) == 0
&& lib.strings.toInt (lib.versions.minor cfg.package.version) < 4
then
"kube/"
else
"kube/color.yaml";
in in
mkIf cfg.enable { mkIf cfg.enable {
@@ -73,31 +74,10 @@ in
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.sessionVariables = home.sessionVariables.KUBECOLOR_CONFIG = "${configDir}/${configPathSuffix}";
if preferXdgDirectories then
{
KUBECOLOR_CONFIG = "${config.xdg.configHome}/${configPathSuffix}";
}
else if isDarwin then
{
KUBECOLOR_CONFIG = "${config.home.homeDirectory}/Library/Application Support/${configPathSuffix}";
}
else
{ };
xdg.configFile = mkIf preferXdgDirectories { home.file."${configDir}/color.yaml" = mkIf (cfg.settings != { }) {
"kube/color.yaml" = mkIf (cfg.settings != { }) { source = yamlFormat.generate "kubecolor-settings" cfg.settings;
source = yamlFormat.generate "kubecolor-settings" cfg.settings;
};
};
home.file = mkIf (!preferXdgDirectories) {
"Library/Application Support/kube/color.yaml" = mkIf (isDarwin && cfg.settings != { }) {
source = yamlFormat.generate "kubecolor-settings" cfg.settings;
};
".kube/color.yaml" = mkIf (!isDarwin && cfg.settings != { }) {
source = yamlFormat.generate "kubecolor-settings" cfg.settings;
};
}; };
home.shellAliases = lib.mkIf (cfg.enableAlias && (cfg.package != null)) { home.shellAliases = lib.mkIf (cfg.enableAlias && (cfg.package != null)) {

View File

@@ -201,7 +201,7 @@ let
plugins: plugins:
pkgs.linkFarm "lapce-plugins" ( pkgs.linkFarm "lapce-plugins" (
builtins.listToAttrs ( builtins.listToAttrs (
builtins.map ( map (
{ {
author, author,
name, name,

View File

@@ -11,7 +11,11 @@ let
yamlFormat = pkgs.formats.yaml { }; yamlFormat = pkgs.formats.yaml { };
inherit (pkgs.stdenv.hostPlatform) isDarwin; configDir =
if pkgs.stdenv.hostPlatform.isDarwin && !config.xdg.enable then
"Library/Application Support/jesseduffield"
else
config.xdg.configHome;
in in
{ {
@@ -51,16 +55,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file."Library/Application Support/jesseduffield/lazydocker/config.yml" = home.file."${configDir}/lazydocker/config.yml" = lib.mkIf (cfg.settings != { }) {
lib.mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable)) source = yamlFormat.generate "lazydocker-config" cfg.settings;
{ };
source = yamlFormat.generate "lazydocker-config" cfg.settings;
};
xdg.configFile."lazydocker/config.yml" =
lib.mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable))
{
source = yamlFormat.generate "lazydocker-config" cfg.settings;
};
}; };
} }

View File

@@ -11,8 +11,11 @@ let
yamlFormat = pkgs.formats.yaml { }; yamlFormat = pkgs.formats.yaml { };
inherit (pkgs.stdenv.hostPlatform) isDarwin; configDir =
if pkgs.stdenv.hostPlatform.isDarwin && !config.xdg.enable then
"Library/Application Support"
else
config.xdg.configHome;
in in
{ {
meta.maintainers = [ meta.maintainers = [
@@ -71,17 +74,10 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ]; home.packages = mkIf (cfg.package != null) [ cfg.package ];
home.file."Library/Application Support/lazygit/config.yml" = home.file."${configDir}/lazygit/config.yml" = {
mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable)) enable = cfg.settings != { };
{ source = yamlFormat.generate "lazygit-config" cfg.settings;
source = yamlFormat.generate "lazygit-config" cfg.settings; };
};
xdg.configFile."lazygit/config.yml" =
mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable))
{
source = yamlFormat.generate "lazygit-config" cfg.settings;
};
programs = programs =
let let

View File

@@ -45,7 +45,7 @@ in
]; ];
attrs = attrsOf (either scalar (listOf scalar)); attrs = attrsOf (either scalar (listOf scalar));
in in
coercedTo attrs (lib.cli.toGNUCommandLine { }) (listOf str); coercedTo attrs (lib.cli.toCommandLineGNU { }) (listOf str);
default = [ ]; default = [ ];
description = "Options to be set via {env}`$LESS`."; description = "Options to be set via {env}`$LESS`.";
example = { example = {

View File

@@ -82,7 +82,7 @@ in
package = lib.mkPackageOption pkgs "meli" { }; package = lib.mkPackageOption pkgs "meli" { };
includes = mkOption { includes = mkOption {
type = with types; listOf (str); type = with types; listOf str;
description = "Paths of the various meli configuration files to include."; description = "Paths of the various meli configuration files to include.";
default = [ ]; default = [ ];
}; };

View File

@@ -7,6 +7,8 @@
let let
cfg = config.programs.mullvad-vpn; cfg = config.programs.mullvad-vpn;
jsonFormat = pkgs.formats.json { }; jsonFormat = pkgs.formats.json { };
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
in in
{ {
meta.maintainers = [ lib.maintainers.da157 ]; meta.maintainers = [ lib.maintainers.da157 ];
@@ -42,11 +44,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file."${ home.file."${configDir}/Mullvad VPN/gui_settings.json" = lib.mkIf (cfg.settings != { }) {
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome source = jsonFormat.generate "mullvad-gui-settings" cfg.settings;
}/Mullvad VPN/gui_settings.json" = };
lib.mkIf (cfg.settings != { }) {
source = jsonFormat.generate "mullvad-gui-settings" cfg.settings;
};
}; };
} }

View File

@@ -13,7 +13,7 @@ let
renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings); renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings);
pluginModule = types.submodule ({ pluginModule = types.submodule {
options = { options = {
src = mkOption { src = mkOption {
type = with types; nullOr path; type = with types; nullOr path;
@@ -46,7 +46,7 @@ let
''; '';
}; };
}; };
}); };
in in
{ {
meta.maintainers = with lib.maintainers; [ thiagokokada ]; meta.maintainers = with lib.maintainers; [ thiagokokada ];

View File

@@ -254,7 +254,7 @@ in
cssSnippets = cssSnippets =
let let
checkCssPath = path: lib.filesystem.pathIsRegularFile path && lib.strings.hasSuffix ".css" path; checkCssPath = path: lib.filesystem.pathIsRegularFile path && lib.strings.hasSuffix ".css" path;
toCssName = path: lib.strings.removeSuffix ".css" (builtins.baseNameOf path); toCssName = path: lib.strings.removeSuffix ".css" (baseNameOf path);
cssSnippetsOptions = cssSnippetsOptions =
{ config, ... }: { config, ... }:
{ {
@@ -423,7 +423,7 @@ in
source = (pkgs.formats.json { }).generate "appearance.json" ( source = (pkgs.formats.json { }).generate "appearance.json" (
vault.settings.appearance vault.settings.appearance
// { // {
enabledCssSnippets = builtins.map (snippet: snippet.name) enabledCssSnippets; enabledCssSnippets = map (snippet: snippet.name) enabledCssSnippets;
} }
// lib.attrsets.optionalAttrs (activeTheme != null) { // lib.attrsets.optionalAttrs (activeTheme != null) {
cssTheme = getManifest activeTheme; cssTheme = getManifest activeTheme;
@@ -438,14 +438,14 @@ in
{ {
name = "${vault.target}/.obsidian/core-plugins.json"; name = "${vault.target}/.obsidian/core-plugins.json";
value.source = (pkgs.formats.json { }).generate "core-plugins.json" ( value.source = (pkgs.formats.json { }).generate "core-plugins.json" (
builtins.map (plugin: plugin.name) vault.settings.corePlugins map (plugin: plugin.name) vault.settings.corePlugins
); );
} }
{ {
name = "${vault.target}/.obsidian/core-plugins-migration.json"; name = "${vault.target}/.obsidian/core-plugins-migration.json";
value.source = (pkgs.formats.json { }).generate "core-plugins-migration.json" ( value.source = (pkgs.formats.json { }).generate "core-plugins-migration.json" (
builtins.listToAttrs ( builtins.listToAttrs (
builtins.map (name: { map (name: {
inherit name; inherit name;
value = builtins.any (plugin: name == plugin.name && plugin.enable) vault.settings.corePlugins; value = builtins.any (plugin: name == plugin.name && plugin.enable) vault.settings.corePlugins;
}) corePlugins }) corePlugins
@@ -453,7 +453,7 @@ in
); );
} }
] ]
++ builtins.map (plugin: { ++ map (plugin: {
name = "${vault.target}/.obsidian/${plugin.name}.json"; name = "${vault.target}/.obsidian/${plugin.name}.json";
value.source = (pkgs.formats.json { }).generate "${plugin.name}.json" plugin.settings; value.source = (pkgs.formats.json { }).generate "${plugin.name}.json" plugin.settings;
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.corePlugins); }) (builtins.filter (plugin: plugin.settings != { }) vault.settings.corePlugins);
@@ -464,25 +464,25 @@ in
{ {
name = "${vault.target}/.obsidian/community-plugins.json"; name = "${vault.target}/.obsidian/community-plugins.json";
value.source = (pkgs.formats.json { }).generate "community-plugins.json" ( value.source = (pkgs.formats.json { }).generate "community-plugins.json" (
builtins.map getManifest (builtins.filter (plugin: plugin.enable) vault.settings.communityPlugins) map getManifest (builtins.filter (plugin: plugin.enable) vault.settings.communityPlugins)
); );
} }
] ]
++ builtins.map (plugin: { ++ map (plugin: {
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}"; name = "${vault.target}/.obsidian/plugins/${getManifest plugin}";
value = { value = {
source = plugin.pkg; source = plugin.pkg;
recursive = true; recursive = true;
}; };
}) vault.settings.communityPlugins }) vault.settings.communityPlugins
++ builtins.map (plugin: { ++ map (plugin: {
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/data.json"; name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/data.json";
value.source = (pkgs.formats.json { }).generate "data.json" plugin.settings; value.source = (pkgs.formats.json { }).generate "data.json" plugin.settings;
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.communityPlugins); }) (builtins.filter (plugin: plugin.settings != { }) vault.settings.communityPlugins);
mkCssSnippets = mkCssSnippets =
vault: vault:
builtins.map (snippet: { map (snippet: {
name = "${vault.target}/.obsidian/snippets/${snippet.name}.css"; name = "${vault.target}/.obsidian/snippets/${snippet.name}.css";
value = value =
if snippet.source != null then if snippet.source != null then
@@ -497,7 +497,7 @@ in
mkThemes = mkThemes =
vault: vault:
builtins.map (theme: { map (theme: {
name = "${vault.target}/.obsidian/themes/${getManifest theme}"; name = "${vault.target}/.obsidian/themes/${getManifest theme}";
value.source = theme.pkg; value.source = theme.pkg;
}) vault.settings.themes; }) vault.settings.themes;
@@ -509,7 +509,7 @@ in
mkExtraFiles = mkExtraFiles =
vault: vault:
builtins.map (file: { map (file: {
name = "${vault.target}/.obsidian/${file.target}"; name = "${vault.target}/.obsidian/${file.target}";
value = value =
if file.source != null then if file.source != null then
@@ -524,7 +524,7 @@ in
in in
builtins.listToAttrs ( builtins.listToAttrs (
lib.lists.flatten ( lib.lists.flatten (
builtins.map (vault: [ map (vault: [
(mkApp vault) (mkApp vault)
(mkAppearance vault) (mkAppearance vault)
(mkCorePlugins vault) (mkCorePlugins vault)
@@ -540,7 +540,7 @@ in
xdg.configFile."obsidian/obsidian.json".source = (pkgs.formats.json { }).generate "obsidian.json" { xdg.configFile."obsidian/obsidian.json".source = (pkgs.formats.json { }).generate "obsidian.json" {
vaults = builtins.listToAttrs ( vaults = builtins.listToAttrs (
builtins.map (vault: { map (vault: {
name = builtins.hashString "md5" vault.target; name = builtins.hashString "md5" vault.target;
value = { value = {
path = "${config.home.homeDirectory}/${vault.target}"; path = "${config.home.homeDirectory}/${vault.target}";

View File

@@ -126,14 +126,22 @@ in
}; };
commands = lib.mkOption { commands = lib.mkOption {
type = lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path); type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
default = { }; default = { };
description = '' description = ''
Custom commands for opencode. Custom commands for opencode.
The attribute name becomes the command filename, and the value is either:
- Inline content as a string This option can either be:
- A path to a file containing the command content - An attribute set defining commands
Commands are stored in {file}`$XDG_CONFIG_HOME/opencode/command/` directory. - A path to a directory containing multiple command files
If an attribute set is used, the attribute name becomes the command filename,
and the value is either:
- Inline content as a string (creates `opencode/command/<name>.md`)
- A path to a file (creates `opencode/command/<name>.md`)
If a path is used, it is expected to contain command files.
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/command/`.
''; '';
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
@@ -155,14 +163,22 @@ in
}; };
agents = lib.mkOption { agents = lib.mkOption {
type = lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path); type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
default = { }; default = { };
description = '' description = ''
Custom agents for opencode. Custom agents for opencode.
The attribute name becomes the agent filename, and the value is either:
- Inline content as a string This option can either be:
- A path to a file containing the agent content - An attribute set defining agents
Agents are stored in {file}`$XDG_CONFIG_HOME/opencode/agent/` directory. - A path to a directory containing multiple agent files
If an attribute set is used, the attribute name becomes the agent filename,
and the value is either:
- Inline content as a string (creates `opencode/agent/<name>.md`)
- A path to a file (creates `opencode/agent/<name>.md`)
If a path is used, it is expected to contain agent files.
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/agent/`.
''; '';
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
@@ -227,26 +243,94 @@ in
}; };
themes = mkOption { themes = mkOption {
type = lib.types.attrsOf (lib.types.either jsonFormat.type lib.types.path); type = lib.types.either (lib.types.attrsOf (lib.types.either jsonFormat.type lib.types.path)) lib.types.path;
default = { }; default = { };
description = '' description = ''
Custom themes for opencode. The attribute name becomes the theme Custom themes for opencode.
filename, and the value is either:
- An attribute set, that is converted to a json This option can either be:
- A path to a file containing the content - An attribute set defining themes
Themes are stored in {file}`$XDG_CONFIG_HOME/opencode/themes/` directory. - A path to a directory containing multiple theme files
If an attribute set is used, the attribute name becomes the theme filename,
and the value is either:
- An attribute set that is converted to a JSON file (creates `opencode/themes/<name>.json`)
- A path to a file (creates `opencode/themes/<name>.json`)
If a path is used, it is expected to contain theme files.
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/themes/`.
Set `programs.opencode.settings.theme` to enable the custom theme. Set `programs.opencode.settings.theme` to enable the custom theme.
See <https://opencode.ai/docs/themes/> for the documentation. See <https://opencode.ai/docs/themes/> for the documentation.
''; '';
}; };
tools = lib.mkOption {
type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
default = { };
description = ''
Custom tools for opencode.
This option can either be:
- An attribute set defining tools
- A path to a directory containing multiple tool files
If an attribute set is used, the attribute name becomes the tool filename,
and the value is either:
- Inline content as a string (creates `opencode/tool/<name>.ts`)
- A path to a file (creates `opencode/tool/<name>.ts` or `opencode/tool/<name>.js`)
If a path is used, it is expected to contain tool files.
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/tool/`.
See <https://opencode.ai/docs/tools/> for the documentation.
'';
example = lib.literalExpression ''
{
database-query = '''
import { tool } from "@opencode-ai/plugin"
export default tool({
description: "Query the project database",
args: {
query: tool.schema.string().describe("SQL query to execute"),
},
async execute(args) {
// Your database logic here
return `Executed query: ''${args.query}`
},
})
''';
# Or reference an existing file
api-client = ./tools/api-client.ts;
}
'';
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [ assertions = [
{
assertion = !lib.isPath cfg.commands || lib.pathIsDirectory cfg.commands;
message = "`programs.opencode.commands` must be a directory when set to a path";
}
{
assertion = !lib.isPath cfg.agents || lib.pathIsDirectory cfg.agents;
message = "`programs.opencode.agents` must be a directory when set to a path";
}
{
assertion = !lib.isPath cfg.tools || lib.pathIsDirectory cfg.tools;
message = "`programs.opencode.tools` must be a directory when set to a path";
}
{ {
assertion = !lib.isPath cfg.skills || lib.pathIsDirectory cfg.skills; assertion = !lib.isPath cfg.skills || lib.pathIsDirectory cfg.skills;
message = "`programs.opencode.skills` must be a directory when set to a path"; message = "`programs.opencode.skills` must be a directory when set to a path";
} }
{
assertion = !lib.isPath cfg.themes || lib.pathIsDirectory cfg.themes;
message = "`programs.opencode.themes` must be a directory when set to a path";
}
]; ];
home.packages = mkIf (cfg.package != null) [ cfg.package ]; home.packages = mkIf (cfg.package != null) [ cfg.package ];
@@ -278,23 +362,55 @@ in
}) })
); );
"opencode/command" = mkIf (lib.isPath cfg.commands) {
source = cfg.commands;
recursive = true;
};
"opencode/agent" = mkIf (lib.isPath cfg.agents) {
source = cfg.agents;
recursive = true;
};
"opencode/tool" = mkIf (lib.isPath cfg.tools) {
source = cfg.tools;
recursive = true;
};
"opencode/skill" = mkIf (lib.isPath cfg.skills) { "opencode/skill" = mkIf (lib.isPath cfg.skills) {
source = cfg.skills; source = cfg.skills;
recursive = true; recursive = true;
}; };
"opencode/themes" = mkIf (lib.isPath cfg.themes) {
source = cfg.themes;
recursive = true;
};
} }
// lib.mapAttrs' ( // lib.optionalAttrs (builtins.isAttrs cfg.commands) (
name: content: lib.mapAttrs' (
lib.nameValuePair "opencode/command/${name}.md" ( name: content:
if lib.isPath content then { source = content; } else { text = content; } lib.nameValuePair "opencode/command/${name}.md" (
) if lib.isPath content then { source = content; } else { text = content; }
) cfg.commands )
// lib.mapAttrs' ( ) cfg.commands
name: content: )
lib.nameValuePair "opencode/agent/${name}.md" ( // lib.optionalAttrs (builtins.isAttrs cfg.agents) (
if lib.isPath content then { source = content; } else { text = content; } lib.mapAttrs' (
) name: content:
) cfg.agents lib.nameValuePair "opencode/agent/${name}.md" (
if lib.isPath content then { source = content; } else { text = content; }
)
) cfg.agents
)
// lib.optionalAttrs (builtins.isAttrs cfg.tools) (
lib.mapAttrs' (
name: content:
lib.nameValuePair "opencode/tool/${name}.ts" (
if lib.isPath content then { source = content; } else { text = content; }
)
) cfg.tools
)
// lib.mapAttrs' ( // lib.mapAttrs' (
name: content: name: content:
if lib.isPath content && lib.pathIsDirectory content then if lib.isPath content && lib.pathIsDirectory content then
@@ -307,23 +423,25 @@ in
if lib.isPath content then { source = content; } else { text = content; } if lib.isPath content then { source = content; } else { text = content; }
) )
) (if builtins.isAttrs cfg.skills then cfg.skills else { }) ) (if builtins.isAttrs cfg.skills then cfg.skills else { })
// lib.mapAttrs' ( // lib.optionalAttrs (builtins.isAttrs cfg.themes) (
name: content: lib.mapAttrs' (
lib.nameValuePair "opencode/themes/${name}.json" ( name: content:
if lib.isPath content then lib.nameValuePair "opencode/themes/${name}.json" (
{ if lib.isPath content then
source = content; {
} source = content;
else }
{ else
source = jsonFormat.generate "opencode-${name}.json" ( {
{ source = jsonFormat.generate "opencode-${name}.json" (
"$schema" = "https://opencode.ai/theme.json"; {
} "$schema" = "https://opencode.ai/theme.json";
// content }
); // content
} );
) }
) cfg.themes; )
) cfg.themes
);
}; };
} }

View File

@@ -19,7 +19,7 @@ let
in in
{ {
meta.maintainers = [ lib.hm.maintainers.nickthegroot ]; meta.maintainers = [ lib.maintainers.nickthegroot ];
options.programs.pgcli = { options.programs.pgcli = {
enable = mkEnableOption "pgcli"; enable = mkEnableOption "pgcli";

View File

@@ -9,6 +9,9 @@ let
cfg = config.programs.pistol; cfg = config.programs.pistol;
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Preferences" else config.xdg.configHome;
configFile = lib.concatStringsSep "\n" ( configFile = lib.concatStringsSep "\n" (
map ( map (
{ {
@@ -74,31 +77,23 @@ in
}; };
config = mkIf cfg.enable ( config = mkIf cfg.enable {
lib.mkMerge [ assertions = [
{ {
assertions = [ assertion = lib.all (
{ { fpath, mime, ... }: (fpath != "" && mime == "") || (fpath == "" && mime != "")
assertion = lib.all ( ) cfg.associations;
{ fpath, mime, ... }: (fpath != "" && mime == "") || (fpath == "" && mime != "") message = ''
) cfg.associations; Each entry in programs.pistol.associations must contain exactly one
message = '' of fpath or mime.
Each entry in programs.pistol.associations must contain exactly one '';
of fpath or mime.
'';
}
];
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
} }
];
(mkIf (cfg.associations != [ ] && pkgs.stdenv.hostPlatform.isDarwin) { home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file."Library/Preferences/pistol/pistol.conf".text = configFile;
})
(mkIf (cfg.associations != [ ] && !pkgs.stdenv.hostPlatform.isDarwin) { home.file."${configDir}/pistol/pistol.conf" = mkIf (cfg.associations != [ ]) {
xdg.configFile."pistol/pistol.conf".text = configFile; text = configFile;
}) };
] };
);
} }

View File

@@ -19,11 +19,11 @@ let
valueToString = valueToString =
value: value:
if builtins.isList value then if builtins.isList value then
builtins.concatStringsSep "," (builtins.map valueToString value) builtins.concatStringsSep "," (map valueToString value)
else if builtins.isAttrs value then else if builtins.isAttrs value then
valueToString (lib.mapAttrsToList (key: val: "${valueToString key}=${valueToString val}") value) valueToString (lib.mapAttrsToList (key: val: "${valueToString key}=${valueToString val}") value)
else else
builtins.toString value; toString value;
modulesArgument = optionalString (cfg.modules != null) " -modules ${valueToString cfg.modules}"; modulesArgument = optionalString (cfg.modules != null) " -modules ${valueToString cfg.modules}";

View File

@@ -27,7 +27,7 @@ let
else if builtins.isList v then else if builtins.isList v then
"[${concatStringsSep ", " (map pythonize v)}]" "[${concatStringsSep ", " (map pythonize v)}]"
else else
builtins.toString v; toString v;
formatDictLine = formatDictLine =
o: n: v: o: n: v:
@@ -336,22 +336,20 @@ in
greasemonkeyDir = lib.optionals ( greasemonkeyDir = lib.optionals (
cfg.greasemonkey != [ ] cfg.greasemonkey != [ ]
) pkgs.linkFarmFromDrvs "greasemonkey-userscripts" cfg.greasemonkey; ) pkgs.linkFarmFromDrvs "greasemonkey-userscripts" cfg.greasemonkey;
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then
".qutebrowser"
else
"${config.xdg.configHome}/qutebrowser";
in in
mkIf cfg.enable { mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file.".qutebrowser/config.py" = mkIf pkgs.stdenv.hostPlatform.isDarwin { home.file."${configDir}/config.py" = {
text = qutebrowserConfig;
};
home.file.".qutebrowser/quickmarks" =
mkIf (cfg.quickmarks != { } && pkgs.stdenv.hostPlatform.isDarwin)
{
text = quickmarksFile;
};
xdg.configFile."qutebrowser/config.py" = mkIf pkgs.stdenv.hostPlatform.isLinux {
text = qutebrowserConfig; text = qutebrowserConfig;
}
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
onChange = '' onChange = ''
hash="$(echo -n "$USER" | md5sum | cut -d' ' -f1)" hash="$(echo -n "$USER" | md5sum | cut -d' ' -f1)"
socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash" socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash"
@@ -371,22 +369,12 @@ in
''; '';
}; };
xdg.configFile."qutebrowser/quickmarks" = home.file."${configDir}/quickmarks" = mkIf (cfg.quickmarks != { }) {
mkIf (cfg.quickmarks != { } && pkgs.stdenv.hostPlatform.isLinux) text = quickmarksFile;
{ };
text = quickmarksFile;
};
home.file.".qutebrowser/greasemonkey" = home.file."${configDir}/greasemonkey" = mkIf (cfg.greasemonkey != [ ]) {
mkIf (cfg.greasemonkey != [ ] && pkgs.stdenv.hostPlatform.isDarwin) source = greasemonkeyDir;
{ };
source = greasemonkeyDir;
};
xdg.configFile."qutebrowser/greasemonkey" =
mkIf (cfg.greasemonkey != [ ] && pkgs.stdenv.hostPlatform.isLinux)
{
source = greasemonkeyDir;
};
}; };
} }

View File

@@ -168,7 +168,7 @@ in
} }
{ {
assertion = cfg.uri.web-rad.enable -> cfg.uri.web-rad.browser != null; assertion = cfg.uri.web-rad.enable -> cfg.uri.web-rad.browser != null;
message = "Could not detect preferred browser. Please set `${builtins.toString opt.uri.web-rad.browser}`."; message = "Could not detect preferred browser. Please set `${toString opt.uri.web-rad.browser}`.";
} }
{ {
assertion = assertion =

View File

@@ -71,7 +71,7 @@ in
home.file.".rbenv/plugins" = mkIf (cfg.plugins != [ ]) { home.file.".rbenv/plugins" = mkIf (cfg.plugins != [ ]) {
source = pkgs.linkFarm "rbenv-plugins" ( source = pkgs.linkFarm "rbenv-plugins" (
builtins.map (p: { map (p: {
name = p.name; name = p.name;
path = p.src; path = p.src;
}) cfg.plugins }) cfg.plugins

View File

@@ -10,7 +10,6 @@ let
jsonFormat = pkgs.formats.json { }; jsonFormat = pkgs.formats.json { };
inherit (lib) mkOption types; inherit (lib) mkOption types;
inherit (pkgs.stdenv.hostPlatform) isDarwin;
settingsModule = types.submodule { settingsModule = types.submodule {
freeformType = jsonFormat.type; freeformType = jsonFormat.type;
@@ -62,6 +61,9 @@ let
}; };
}; };
}; };
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
in in
{ {
meta.maintainers = with lib.maintainers; [ ambroisie ]; meta.maintainers = with lib.maintainers; [ ambroisie ];
@@ -93,21 +95,11 @@ in
}; };
}; };
config = lib.mkIf cfg.enable ( config = lib.mkIf cfg.enable {
lib.mkMerge [ home.packages = [ cfg.package ];
{
home.packages = [ cfg.package ];
}
# Only manage configuration if not empty home.file."${configDir}/rbw/config.json" = lib.mkIf (cfg.settings != null) {
(lib.mkIf (cfg.settings != null && !isDarwin) { source = jsonFormat.generate "rbw-config.json" cfg.settings;
xdg.configFile."rbw/config.json".source = jsonFormat.generate "rbw-config.json" cfg.settings; };
}) };
(lib.mkIf (cfg.settings != null && isDarwin) {
home.file."Library/Application Support/rbw/config.json".source =
jsonFormat.generate "rbw-config.json" cfg.settings;
})
]
);
} }

View File

@@ -135,7 +135,7 @@ let
modes = map (mode: if isString mode then mode else "${mode.name}:${mode.path}") cfg.modes; modes = map (mode: if isString mode then mode else "${mode.name}:${mode.path}") cfg.modes;
in in
{ {
meta.maintainers = with lib.maintainers; [ ]; meta.maintainers = [ ];
options.programs.rofi = { options.programs.rofi = {
enable = lib.mkEnableOption "Rofi: A window switcher, application launcher and dmenu replacement"; enable = lib.mkEnableOption "Rofi: A window switcher, application launcher and dmenu replacement";

View File

@@ -11,6 +11,9 @@ let
iniFormat = pkgs.formats.ini { }; iniFormat = pkgs.formats.ini { };
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Preferences" else config.xdg.configHome;
in in
{ {
meta.maintainers = [ lib.maintainers.pbar ]; meta.maintainers = [ lib.maintainers.pbar ];
@@ -55,32 +58,22 @@ in
{ {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
programs.sapling.iniContent.ui = { programs.sapling.iniContent = {
username = cfg.userName + " <" + cfg.userEmail + ">"; alias = mkIf (cfg.aliases != { }) cfg.aliases;
ui.username = cfg.userName + " <" + cfg.userEmail + ">";
};
home.file."${configDir}/sapling/sapling.conf" = mkIf (cfg.iniContent != { }) {
source = iniFormat.generate "sapling.conf" cfg.iniContent;
}; };
} }
(mkIf (!pkgs.stdenv.isDarwin) {
xdg.configFile."sapling/sapling.conf".source = iniFormat.generate "sapling.conf" cfg.iniContent;
})
(mkIf (pkgs.stdenv.isDarwin) {
home.file."Library/Preferences/sapling/sapling.conf".source =
iniFormat.generate "sapling.conf" cfg.iniContent;
})
(mkIf (cfg.aliases != { }) {
programs.sapling.iniContent.alias = cfg.aliases;
})
(mkIf (lib.isAttrs cfg.extraConfig) { (mkIf (lib.isAttrs cfg.extraConfig) {
programs.sapling.iniContent = cfg.extraConfig; programs.sapling.iniContent = cfg.extraConfig;
}) })
(mkIf (lib.isString cfg.extraConfig && !pkgs.stdenv.isDarwin) { (mkIf (lib.isString cfg.extraConfig) {
xdg.configFile."sapling/sapling.conf".text = cfg.extraConfig; home.file."${configDir}/sapling/sapling.conf".text = cfg.extraConfig;
})
(mkIf (lib.isString cfg.extraConfig && pkgs.stdenv.isDarwin) {
home.file."Library/Preferences/sapling/sapling.conf".text = cfg.extraConfig;
}) })
] ]
); );

View File

@@ -40,6 +40,12 @@ let
description = "The remote path to mount."; description = "The remote path to mount.";
}; };
mountDestPath = mkOption {
type = types.nullOr types.str;
default = null;
description = "The path on the current machine where the remote path would be mounted.";
};
authType = mkOption { authType = mkOption {
type = types.enum [ type = types.enum [
"password" "password"
@@ -47,6 +53,7 @@ let
"hostbased" "hostbased"
"keyboard-interactive" "keyboard-interactive"
"gssapi-with-mic" "gssapi-with-mic"
"authentication-agent"
]; ];
default = "publickey"; default = "publickey";
description = "The authentication method to use."; description = "The authentication method to use.";

View File

@@ -158,7 +158,7 @@ in
prjConf = prjConf =
lib.attrsets.mapAttrs' ( lib.attrsets.mapAttrs' (
name: value: name: value:
(lib.attrsets.nameValuePair (if name == "beforeStart" then "before_start" else name) (value)) (lib.attrsets.nameValuePair (if name == "beforeStart" then "before_start" else name) value)
) v ) v
// { // {
session = k; session = k;

View File

@@ -9,6 +9,11 @@ let
cfg = config.programs.streamlink; cfg = config.programs.streamlink;
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
dataDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.dataHome;
renderSettings = renderSettings =
settings: settings:
lib.concatLines ( lib.concatLines (
@@ -18,9 +23,9 @@ let
if (builtins.isBool value) then if (builtins.isBool value) then
if value then name else "" if value then name else ""
else if (builtins.isList value) then else if (builtins.isList value) then
lib.concatStringsSep "\n" (builtins.map (item: "${name}=${builtins.toString item}") value) lib.concatStringsSep "\n" (map (item: "${name}=${toString item}") value)
else else
"${name}=${builtins.toString value}" "${name}=${toString value}"
) settings ) settings
) )
); );
@@ -130,72 +135,36 @@ in
}; };
}; };
config = lib.mkIf cfg.enable ( config = lib.mkIf cfg.enable {
lib.mkMerge [ home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
{ home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; }
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux { home.file = {
xdg.configFile = { "${configDir}/streamlink/config" = lib.mkIf (cfg.settings != { }) {
"streamlink/config" = lib.mkIf (cfg.settings != { }) { text = renderSettings cfg.settings;
text = renderSettings cfg.settings; };
}; }
// (lib.mapAttrs' (
name: value:
lib.nameValuePair "${configDir}/streamlink/config.${name}" (
lib.mkIf (value.settings != { }) {
text = renderSettings value.settings;
} }
// (lib.mapAttrs' ( )
name: value: ) cfg.plugins)
lib.nameValuePair "streamlink/config.${name}" ( // (lib.mapAttrs' (
lib.mkIf (value.settings != { }) { name: value:
text = renderSettings value.settings; lib.nameValuePair "${dataDir}/streamlink/plugins/${name}.py" (
lib.mkIf (value.src != null) (
if (builtins.isPath value.src) then
{
source = value.src;
} }
) else
) cfg.plugins); {
text = value.src;
xdg.dataFile = lib.mapAttrs' (
name: value:
lib.nameValuePair "streamlink/plugins/${name}.py" (
lib.mkIf (value.src != null) (
if (builtins.isPath value.src) then
{
source = value.src;
}
else
{
text = value.src;
}
)
)
) cfg.plugins;
})
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
home.file = {
"Library/Application Support/streamlink/config" = lib.mkIf (cfg.settings != { }) {
text = renderSettings cfg.settings;
};
}
// (lib.mapAttrs' (
name: value:
lib.nameValuePair "Library/Application Support/streamlink/config.${name}" (
lib.mkIf (value.settings != { }) {
text = renderSettings value.settings;
} }
) )
) cfg.plugins) )
// (lib.mapAttrs' ( ) cfg.plugins);
name: value: };
lib.nameValuePair "Library/Application Support/streamlink/plugins/${name}.py" (
lib.mkIf (value.src != null) (
if (builtins.isPath value.src) then
{
source = value.src;
}
else
{
text = value.src;
}
)
)
) cfg.plugins);
})
]
);
} }

View File

@@ -85,8 +85,7 @@ in
if v == false then if v == false then
"" ""
else else
(if v == true then n else n + "=" + (if builtins.isPath v then "${v}" else builtins.toString v)) (if v == true then n else n + "=" + (if builtins.isPath v then "${v}" else toString v)) + "\n"
+ "\n"
) cfg.settings ) cfg.settings
); );
}; };

View File

@@ -183,14 +183,12 @@ let
3; 3;
"mail.smtpserver.smtp_${id}.username" = account.userName; "mail.smtpserver.smtp_${id}.username" = account.userName;
} }
// builtins.foldl' (a: b: a // b) { } ( // builtins.foldl' (a: b: a // b) { } (map (address: toThunderbirdSMTP account address) addresses)
builtins.map (address: toThunderbirdSMTP account address) addresses
)
// optionalAttrs (account.smtp != null && account.primary) { // optionalAttrs (account.smtp != null && account.primary) {
"mail.smtp.defaultserver" = "smtp_${id}"; "mail.smtp.defaultserver" = "smtp_${id}";
} }
// builtins.foldl' (a: b: a // b) { } ( // builtins.foldl' (a: b: a // b) { } (
builtins.map (address: toThunderbirdIdentity account address) addresses map (address: toThunderbirdIdentity account address) addresses
) )
// account.thunderbird.settings id; // account.thunderbird.settings id;

View File

@@ -69,7 +69,7 @@ in
let let
conf = conf =
optional (cfg.host != null) ''set -g tmate-server-host "${cfg.host}"'' optional (cfg.host != null) ''set -g tmate-server-host "${cfg.host}"''
++ optional (cfg.port != null) "set -g tmate-server-port ${builtins.toString cfg.port}" ++ optional (cfg.port != null) "set -g tmate-server-port ${toString cfg.port}"
++ optional ( ++ optional (
cfg.dsaFingerprint != null cfg.dsaFingerprint != null
) ''set -g tmate-server-ed25519-fingerprint "${cfg.dsaFingerprint}"'' ) ''set -g tmate-server-ed25519-fingerprint "${cfg.dsaFingerprint}"''

View File

@@ -92,9 +92,12 @@ in
}; };
}; };
config = lib.mkIf cfg.enable ( config =
let let
config = configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
configFiles =
lib.attrsets.unionOfDisjoint lib.attrsets.unionOfDisjoint
{ {
"vesktop/settings.json" = lib.mkIf (cfg.settings != { }) { "vesktop/settings.json" = lib.mkIf (cfg.settings != { }) {
@@ -117,16 +120,11 @@ in
) cfg.vencord.themes ) cfg.vencord.themes
); );
in in
lib.mkMerge [ lib.mkIf cfg.enable {
{ home.packages = [
home.packages = [ (cfg.package.override { withSystemVencord = cfg.vencord.useSystem; })
(cfg.package.override { withSystemVencord = cfg.vencord.useSystem; }) ];
];
} home.file = lib.mapAttrs' (n: lib.nameValuePair "${configDir}/${n}") configFiles;
(lib.mkIf (!pkgs.stdenv.hostPlatform.isDarwin) { xdg.configFile = config; }) };
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
home.file = lib.mapAttrs' (n: v: lib.nameValuePair "Library/Application Support/${n}" v) config;
})
]
);
} }

View File

@@ -240,7 +240,7 @@ in
dataFile = dataFile =
builtins.listToAttrs ( builtins.listToAttrs (
builtins.map (item: { map (item: {
name = "vicinae/extensions/${item.name}"; name = "vicinae/extensions/${item.name}";
value.source = item; value.source = item;
}) cfg.extensions }) cfg.extensions
@@ -263,7 +263,7 @@ in
KillMode = "process"; KillMode = "process";
EnvironmentFile = lib.mkIf (!versionPost0_17) ( EnvironmentFile = lib.mkIf (!versionPost0_17) (
pkgs.writeText "vicinae-env" '' pkgs.writeText "vicinae-env" ''
USE_LAYER_SHELL=${if cfg.useLayerShell then builtins.toString 1 else builtins.toString 0} USE_LAYER_SHELL=${if cfg.useLayerShell then toString 1 else toString 0}
'' ''
); );
}; };

View File

@@ -517,7 +517,7 @@ in
else else
{ }; { };
# Merge MCP servers: transformed servers + user servers, with user servers taking precedence # Merge MCP servers: transformed servers + user servers, with user servers taking precedence
mergedServers = transformedMcpServers // ((v.userMcp.servers or { })); mergedServers = transformedMcpServers // (v.userMcp.servers or { });
# Merge all MCP config # Merge all MCP config
mergedMcpConfig = mergedMcpConfig =
v.userMcp // (lib.optionalAttrs (mergedServers != { }) { servers = mergedServers; }); v.userMcp // (lib.optionalAttrs (mergedServers != { }) { servers = mergedServers; });

View File

@@ -301,7 +301,7 @@ in
{ {
assertions = [ assertions = [
(lib.hm.assertions.assertPlatform "programs.waybar" pkgs lib.platforms.linux) (lib.hm.assertions.assertPlatform "programs.waybar" pkgs lib.platforms.linux)
({ {
assertion = assertion =
if lib.versionAtLeast config.home.stateVersion "22.05" then if lib.versionAtLeast config.home.stateVersion "22.05" then
all (x: !hasAttr "modules" x || x.modules == null) settings all (x: !hasAttr "modules" x || x.modules == null) settings
@@ -311,7 +311,7 @@ in
The `programs.waybar.settings.[].modules` option has been removed. The `programs.waybar.settings.[].modules` option has been removed.
It is now possible to declare modules in the configuration without nesting them under the `modules` option. It is now possible to declare modules in the configuration without nesting them under the `modules` option.
''; '';
}) }
]; ];
home.packages = [ cfg.package ]; home.packages = [ cfg.package ];

View File

@@ -58,7 +58,7 @@ in
xdg.configFile."waylogout/config" = lib.mkIf (cfg.settings != { }) { xdg.configFile."waylogout/config" = lib.mkIf (cfg.settings != { }) {
text = lib.concatStrings ( text = lib.concatStrings (
lib.mapAttrsToList ( lib.mapAttrsToList (
n: v: if v == false then "" else (if v == true then n else n + "=" + builtins.toString v) + "\n" n: v: if v == false then "" else (if v == true then n else n + "=" + toString v) + "\n"
) cfg.settings ) cfg.settings
); );
}; };

View File

@@ -35,7 +35,7 @@ let
''; '';
} }
else else
builtins.dirOf value; dirOf value;
makePluginSearchPath = p: "${p}/?/init.lua;${p}/?.lua"; makePluginSearchPath = p: "${p}/?/init.lua;${p}/?.lua";
@@ -46,9 +46,9 @@ let
searchPaths = map makePluginSearchPath wrappedPlugins; searchPaths = map makePluginSearchPath wrappedPlugins;
pluginSearchPath = lib.concatStringsSep ";" searchPaths; pluginSearchPath = lib.concatStringsSep ";" searchPaths;
in in
('' ''
package.path = "${pluginSearchPath};" .. package.path package.path = "${pluginSearchPath};" .. package.path
'') ''
else else
"\n"; "\n";

View File

@@ -127,7 +127,7 @@ in
}; };
Service = { Service = {
Environment = with pkgs; "PATH=${makeBinPath cfg.extraPackages}"; Environment = "PATH=${makeBinPath cfg.extraPackages}";
ExecStart = "${cfg.package}/bin/fusuma"; ExecStart = "${cfg.package}/bin/fusuma";
}; };

View File

@@ -168,7 +168,7 @@ in
packages = [ cfg.package ]; packages = [ cfg.package ];
sessionVariables = mkIf cfg.enableSessionVariables ( sessionVariables = mkIf cfg.enableSessionVariables (
{ {
MPD_PORT = builtins.toString cfg.network.port; MPD_PORT = toString cfg.network.port;
} }
// lib.optionalAttrs (cfg.network.listenAddress != "any") { // lib.optionalAttrs (cfg.network.listenAddress != "any") {
MPD_HOST = cfg.network.listenAddress; MPD_HOST = cfg.network.listenAddress;

View File

@@ -23,9 +23,9 @@ let
${k}='' (mapAttrsToList normalizeKeyValue v)) ${k}='' (mapAttrsToList normalizeKeyValue v))
else else
builtins.toString v; toString v;
in in
if builtins.isNull v then "" else "${k}=${v'}"; if isNull v then "" else "${k}=${v'}";
primitiveAttrs = with types; attrsOf (either primitive (listOf primitive)); primitiveAttrs = with types; attrsOf (either primitive (listOf primitive));
primitiveList = with types; listOf primitive; primitiveList = with types; listOf primitive;

View File

@@ -15,7 +15,7 @@ let
''} ''}
USE_BACKUP="${if cfg.useBackup then "yes" else "no"}" USE_BACKUP="${if cfg.useBackup then "yes" else "no"}"
BACKUP_LIMIT=${builtins.toString cfg.backupLimit} BACKUP_LIMIT=${toString cfg.backupLimit}
''; '';
in in
{ {

View File

@@ -7,6 +7,8 @@
let let
cfg = config.services.pueue; cfg = config.services.pueue;
yamlFormat = pkgs.formats.yaml { }; yamlFormat = pkgs.formats.yaml { };
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
configFile = yamlFormat.generate "pueue.yaml" ({ shared = { }; } // cfg.settings); configFile = yamlFormat.generate "pueue.yaml" ({ shared = { }; } // cfg.settings);
pueuedBin = "${cfg.package}/bin/pueued"; pueuedBin = "${cfg.package}/bin/pueued";
in in
@@ -38,7 +40,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."pueue/pueue.yml" = lib.mkIf pkgs.stdenv.isLinux { source = configFile; }; home.file."${configDir}/pueue/pueue.yml".source = configFile;
systemd.user = lib.mkIf (cfg.package != null) { systemd.user = lib.mkIf (cfg.package != null) {
services.pueued = { services.pueued = {
@@ -55,12 +57,6 @@ in
}; };
}; };
# This is the default configuration file location for pueue on
# darwin (https://github.com/Nukesor/pueue/wiki/Configuration)
home.file."Library/Application Support/pueue/pueue.yml" = lib.mkIf pkgs.stdenv.isDarwin {
source = configFile;
};
launchd.agents.pueued = lib.mkIf (cfg.package != null) { launchd.agents.pueued = lib.mkIf (cfg.package != null) {
enable = true; enable = true;

View File

@@ -103,7 +103,7 @@ in
StopWhenUnneeded = cfg.node.lazy.enable; StopWhenUnneeded = cfg.node.lazy.enable;
ConditionPathExists = radicleKeyPair; ConditionPathExists = radicleKeyPair;
}; };
Service = mkMerge ([ Service = mkMerge [
{ {
Slice = "session.slice"; Slice = "session.slice";
ExecStart = "${getExe' cfg.node.package "radicle-node"} ${cfg.node.args}"; ExecStart = "${getExe' cfg.node.package "radicle-node"} ${cfg.node.args}";
@@ -182,7 +182,7 @@ in
"~@setuid" "~@setuid"
]; ];
} }
]); ];
}; };
"radicle-node-proxy" = mkIf cfg.node.lazy.enable { "radicle-node-proxy" = mkIf cfg.node.lazy.enable {
Unit = { Unit = {

View File

@@ -239,7 +239,7 @@ in
configFullPath = config.xdg.configHome + "/${xdgConfigFilePath}"; configFullPath = config.xdg.configHome + "/${xdgConfigFilePath}";
in in
"${cfg.package}/bin/${command} " "${cfg.package}/bin/${command} "
+ lib.cli.toGNUCommandLineShell { } { + lib.cli.toCommandLineShellGNU { } {
v = cfg.enableVerboseLogging; v = cfg.enableVerboseLogging;
c = configFullPath; c = configFullPath;
}; };

View File

@@ -37,6 +37,17 @@ in
''; '';
}; };
pkcs11Whitelist = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = lib.literalExpression ''[ "''${pkgs.tpm2-pkcs11}/lib/*" ]'';
description = ''
Specify a list of approved path patterns for PKCS#11 and FIDO authenticator middleware libraries. When using the -s or -S options with {manpage}`ssh-add(1)`, only libraries matching these patterns will be accepted.
See {manpage}`ssh-agent(1)`.
'';
};
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; }; enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; };
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; }; enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
@@ -101,6 +112,10 @@ in
lib.optionalString ( lib.optionalString (
cfg.defaultMaximumIdentityLifetime != null cfg.defaultMaximumIdentityLifetime != null
) " -t ${toString cfg.defaultMaximumIdentityLifetime}" ) " -t ${toString cfg.defaultMaximumIdentityLifetime}"
}${
lib.optionalString (
cfg.pkcs11Whitelist != [ ]
) " -P '${lib.concatStringsSep "," cfg.pkcs11Whitelist}'"
}"; }";
}; };
@@ -114,6 +129,10 @@ in
lib.optionalString ( lib.optionalString (
cfg.defaultMaximumIdentityLifetime != null cfg.defaultMaximumIdentityLifetime != null
) " -t ${toString cfg.defaultMaximumIdentityLifetime}" ) " -t ${toString cfg.defaultMaximumIdentityLifetime}"
}${
lib.optionalString (
cfg.pkcs11Whitelist != [ ]
) " -P '${lib.concatStringsSep "," cfg.pkcs11Whitelist}'"
}'' }''
]; ];
KeepAlive = { KeepAlive = {
@@ -124,7 +143,5 @@ in
RunAtLoad = true; RunAtLoad = true;
}; };
}; };
}; };
} }

View File

@@ -130,6 +130,7 @@ in
- `HYPRLAND_INSTANCE_SIGNATURE` - `HYPRLAND_INSTANCE_SIGNATURE`
- `WAYLAND_DISPLAY` - `WAYLAND_DISPLAY`
- `XDG_CURRENT_DESKTOP` - `XDG_CURRENT_DESKTOP`
- `XDG_SESSION_TYPE`
''; '';
}; };
@@ -140,6 +141,7 @@ in
"HYPRLAND_INSTANCE_SIGNATURE" "HYPRLAND_INSTANCE_SIGNATURE"
"WAYLAND_DISPLAY" "WAYLAND_DISPLAY"
"XDG_CURRENT_DESKTOP" "XDG_CURRENT_DESKTOP"
"XDG_SESSION_TYPE"
]; ];
example = [ "--all" ]; example = [ "--all" ];
description = '' description = ''
@@ -359,7 +361,7 @@ in
) cfg.submaps; ) cfg.submaps;
submapWarnings = lib.mapAttrsToList (submapName: nonBinds: '' submapWarnings = lib.mapAttrsToList (submapName: nonBinds: ''
wayland.windowManager.hyprland.submaps."${submapName}".settings: found non-bind entries: [${builtins.toString nonBinds}], which will have no effect in a submap wayland.windowManager.hyprland.submaps."${submapName}".settings: found non-bind entries: [${toString nonBinds}], which will have no effect in a submap
'') (lib.filterAttrs (n: v: v != [ ]) submapWarningsAttrset); '') (lib.filterAttrs (n: v: v != [ ]) submapWarningsAttrset);
in in
submapWarnings ++ lib.optional inconsistent warning; submapWarnings ++ lib.optional inconsistent warning;

View File

@@ -98,7 +98,7 @@ let
attrName = builtins.substring 1 999 k; # Remove "@" prefix attrName = builtins.substring 1 999 k; # Remove "@" prefix
attrValue = value.${k}; attrValue = value.${k};
in in
" ${attrName}=\"${escape (builtins.toString attrValue)}\"" " ${attrName}=\"${escape (toString attrValue)}\""
) attrKeys ) attrKeys
); );
@@ -125,7 +125,7 @@ let
# All other primitive values: wrap in start/end tag # All other primitive values: wrap in start/end tag
else else
"<${name}>${escape (builtins.toString value)}</${name}>"; "<${name}>${escape (toString value)}</${name}>";
generateXML = name: config: extraConfig: '' generateXML = name: config: extraConfig: ''
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@@ -139,7 +139,7 @@ let
else if name == "labwc_config" then else if name == "labwc_config" then
lib.mapAttrsToList generateRc lib.mapAttrsToList generateRc
else else
builtins.throw "error ${name} is neither openbox_menu nor labwc_config" throw "error ${name} is neither openbox_menu nor labwc_config"
) )
config config
) )

View File

@@ -75,7 +75,7 @@ let
buildServices = buildServices =
style: serviceCfgs: lib.concatLists (lib.mapAttrsToList (buildService style) serviceCfgs); style: serviceCfgs: lib.concatLists (lib.mapAttrsToList (buildService style) serviceCfgs);
servicesStartTimeoutMs = builtins.toString cfg.servicesStartTimeoutMs; servicesStartTimeoutMs = toString cfg.servicesStartTimeoutMs;
unitBaseType = unitBaseType =
unitKind: mod: unitKind: mod:

View File

@@ -18,13 +18,14 @@ stdenv.mkDerivation {
src = ./.; src = ./.;
patchPhase = '' patchPhase = ''
substituteInPlace non-nixos-gpu* \ substituteInPlace non-nixos-gpu* \
--replace '@@resources@@' "$out/resources" \ --replace-quiet '@@resources@@' "$out/resources" \
--replace '@@statedir@@' '${nixStateDirectory}' \ --replace-quiet '@@statedir@@' '${nixStateDirectory}' \
--replace '@@env@@' "${nonNixosGpuEnv}" --replace-quiet '@@systemddir@@' "$out/lib/systemd/system" \
--replace-quiet '@@env@@' "${nonNixosGpuEnv}"
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/{bin,resources} mkdir -p $out/{bin,resources,lib/systemd/system}
cp non-nixos-gpu-setup $out/bin cp non-nixos-gpu-setup $out/bin
cp non-nixos-gpu.service $out/resources cp non-nixos-gpu.service $out/lib/systemd/system
''; '';
} }

View File

@@ -5,7 +5,7 @@ set -e
# Install the systemd service file and ensure that the store path won't be # Install the systemd service file and ensure that the store path won't be
# garbage-collected as long as it's installed. # garbage-collected as long as it's installed.
unit_path=/etc/systemd/system/non-nixos-gpu.service unit_path=/etc/systemd/system/non-nixos-gpu.service
ln -sf @@resources@@/non-nixos-gpu.service "$unit_path" ln -sf @@systemddir@@/non-nixos-gpu.service "$unit_path"
ln -sf "$unit_path" "@@statedir@@"/gcroots/non-nixos-gpu.service ln -sf "$unit_path" "@@statedir@@"/gcroots/non-nixos-gpu.service
systemctl daemon-reload systemctl daemon-reload

View File

@@ -211,7 +211,7 @@ in
makePackageWrapper = makePackageWrapper =
vendor: environment: pkg: vendor: environment: pkg:
if builtins.isNull cfg.packages then if isNull cfg.packages then
pkg pkg
else else
# Wrap the package's binaries with nixGL, while preserving the rest of # Wrap the package's binaries with nixGL, while preserving the rest of

View File

@@ -29,7 +29,7 @@ let
lib = extendedLib; lib = extendedLib;
osConfig = config; osConfig = config;
osClass = _class; osClass = _class;
modulesPath = builtins.toString ../modules; modulesPath = toString ../modules;
} }
// cfg.extraSpecialArgs; // cfg.extraSpecialArgs;

View File

@@ -24,7 +24,7 @@ let
''; '';
xdgRuntimeDir = "/run/user/${builtins.toString config.nodes.machine.users.users.alice.uid}"; xdgRuntimeDir = "/run/user/${toString config.nodes.machine.users.users.alice.uid}";
httpHeadersSecret = pkgs.writeText "http-headers" "Cookie,secret_password=aliceiscool"; httpHeadersSecret = pkgs.writeText "http-headers" "Cookie,secret_password=aliceiscool";
shellVar = mkHttpModule "\\\${XDG_RUNTIME_DIR}/http-headers"; shellVar = mkHttpModule "\\\${XDG_RUNTIME_DIR}/http-headers";

View File

@@ -26,6 +26,6 @@
# Git config should contain difftastic configuration (backward compatibility) # Git config should contain difftastic configuration (backward compatibility)
assertFileExists home-files/.config/git/config assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[diff]' assertFileContains home-files/.config/git/config '[diff]'
assertFileRegex home-files/.config/git/config 'external = .*/difft.*--color.*--display' assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side'\""
''; '';
} }

View File

@@ -17,9 +17,9 @@
assertFileExists home-files/.config/git/config assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[diff]' assertFileContains home-files/.config/git/config '[diff]'
# Should have BOTH diff.external AND difftool config when diffToolMode is true # Should have BOTH diff.external AND difftool config when diffToolMode is true
assertFileRegex home-files/.config/git/config 'external = .*/difft.*--color.*--display' assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side'\""
assertFileRegex home-files/.config/git/config 'tool = "difftastic"' assertFileContains home-files/.config/git/config 'tool = "difftastic"'
assertFileContains home-files/.config/git/config '[difftool "difftastic"]' assertFileContains home-files/.config/git/config '[difftool "difftastic"]'
assertFileRegex home-files/.config/git/config 'cmd = .*/difft.*--color.*--display.*\$LOCAL \$REMOTE' assertFileContains home-files/.config/git/config "cmd = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side' \$LOCAL \$REMOTE\""
''; '';
} }

View File

@@ -17,7 +17,7 @@
assertFileExists home-files/.config/git/config assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[diff]' assertFileContains home-files/.config/git/config '[diff]'
# Should have diff.external set # Should have diff.external set
assertFileRegex home-files/.config/git/config 'external = .*/difft.*--color.*--display' assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side'\""
# Should NOT have difftool config when diffToolMode is explicitly false # Should NOT have difftool config when diffToolMode is explicitly false
assertFileNotRegex home-files/.config/git/config 'tool = "difftastic"' assertFileNotRegex home-files/.config/git/config 'tool = "difftastic"'
assertFileNotRegex home-files/.config/git/config '\[difftool "difftastic"\]' assertFileNotRegex home-files/.config/git/config '\[difftool "difftastic"\]'

View File

@@ -14,7 +14,7 @@
assertFileExists home-files/.config/git/config assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[diff]' assertFileContains home-files/.config/git/config '[diff]'
# Should have diff.external set # Should have diff.external set
assertFileRegex home-files/.config/git/config 'external = .*/difft.*--color.*--display' assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side'\""
# Should NOT have difftool config since diffToolMode is false # Should NOT have difftool config since diffToolMode is false
assertFileNotRegex home-files/.config/git/config 'tool = "difftastic"' assertFileNotRegex home-files/.config/git/config 'tool = "difftastic"'
assertFileNotRegex home-files/.config/git/config '\[difftool "difftastic"\]' assertFileNotRegex home-files/.config/git/config '\[difftool "difftastic"\]'

View File

@@ -17,7 +17,7 @@
}; };
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: rec { (self: super: {
openshift = config.lib.test.mkStubPackage { openshift = config.lib.test.mkStubPackage {
name = "openshift"; name = "openshift";
version = "4.16.0"; version = "4.16.0";

View File

@@ -24,7 +24,7 @@
assertFileExists home-files/.config/lesskey assertFileExists home-files/.config/lesskey
assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" '' assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" ''
#env #env
LESS = --quiet --use-color --color HkK --color Mkb --prompt s%f LESS = --quiet --use-color --color=HkK --color=Mkb --prompt=s%f
''} ''}
''; '';
} }

View File

@@ -23,7 +23,7 @@ in
assertFileExists home-files/.config/lesskey assertFileExists home-files/.config/lesskey
assertFileContent home-files/.config/lesskey ${builtins.toFile "less.expected" '' assertFileContent home-files/.config/lesskey ${builtins.toFile "less.expected" ''
#env #env
LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines 3 --wheel-lines 1 LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines=3 --wheel-lines=1
${config}''} ${config}''}
''; '';

View File

@@ -15,7 +15,7 @@
assertFileExists home-files/.config/lesskey assertFileExists home-files/.config/lesskey
assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" '' assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" ''
#env #env
LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines 3 --wheel-lines 1 LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines=3 --wheel-lines=1
''} ''}
''; '';
} }

View File

@@ -20,7 +20,7 @@
# plugins without associated config should not trigger the creation of init.vim # plugins without associated config should not trigger the creation of init.vim
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
vim-fugitive vim-fugitive
({ plugin = vim-sensible; }) { plugin = vim-sensible; }
]; ];
}; };
nmt.script = '' nmt.script = ''

View File

@@ -0,0 +1,15 @@
{
programs.opencode = {
enable = true;
agents = ./agents-bulk;
};
nmt.script = ''
assertFileExists home-files/.config/opencode/agent/code-reviewer.md
assertFileExists home-files/.config/opencode/agent/documentation.md
assertFileContent home-files/.config/opencode/agent/code-reviewer.md \
${./agents-bulk/code-reviewer.md}
assertFileContent home-files/.config/opencode/agent/documentation.md \
${./agents-bulk/documentation.md}
'';
}

View File

@@ -0,0 +1,4 @@
# Code Reviewer Agent
You are a senior software engineer specializing in code reviews.
Focus on code quality, security, and maintainability.

View File

@@ -0,0 +1,3 @@
# Documentation Agent
You are a technical writer specializing in creating clear, comprehensive documentation.

View File

@@ -12,7 +12,8 @@
- Review for potential bugs and edge cases - Review for potential bugs and edge cases
- Check for security vulnerabilities - Check for security vulnerabilities
- Ensure code follows best practices - Ensure code follows best practices
- Suggest improvements for readability and performance''; - Suggest improvements for readability and performance
'';
documentation = '' documentation = ''
# Documentation Agent # Documentation Agent
@@ -23,7 +24,8 @@
- Write clear, concise documentation - Write clear, concise documentation
- Include practical examples - Include practical examples
- Use proper formatting and structure - Use proper formatting and structure
- Consider the target audience''; - Consider the target audience
'';
}; };
}; };
nmt.script = '' nmt.script = ''

View File

@@ -0,0 +1,12 @@
import { tool } from "@opencode-ai/plugin"
export default tool({
description: "Make API requests to external services",
args: {
endpoint: tool.schema.string().describe("API endpoint to call"),
method: tool.schema.string().describe("HTTP method"),
},
async execute(args) {
return `Called ${args.method} ${args.endpoint}`
},
})

View File

@@ -1,4 +1,4 @@
# Update Changelog Command # Update Changelog Command
Update CHANGELOG.md with a new entry for the specified version. Update CHANGELOG.md with a new entry for the specified version.
Usage: /changelog [version] [change-type] [message] Usage: /changelog [version] [change-type] [message]

View File

@@ -7,4 +7,4 @@ Focus on code quality, security, and maintainability.
- Review for potential bugs and edge cases - Review for potential bugs and edge cases
- Check for security vulnerabilities - Check for security vulnerabilities
- Ensure code follows best practices - Ensure code follows best practices
- Suggest improvements for readability and performance - Suggest improvements for readability and performance

View File

@@ -0,0 +1,15 @@
{
programs.opencode = {
enable = true;
commands = ./commands-bulk;
};
nmt.script = ''
assertFileExists home-files/.config/opencode/command/changelog.md
assertFileExists home-files/.config/opencode/command/commit.md
assertFileContent home-files/.config/opencode/command/changelog.md \
${./commands-bulk/changelog.md}
assertFileContent home-files/.config/opencode/command/commit.md \
${./commands-bulk/commit.md}
'';
}

View File

@@ -0,0 +1,4 @@
# Update Changelog Command
Update CHANGELOG.md with a new entry for the specified version.
Usage: /changelog [version] [change-type] [message]

View File

@@ -0,0 +1,4 @@
# Commit Command
Create a git commit with proper message formatting.
Usage: /commit [message]

View File

@@ -6,12 +6,14 @@
# Update Changelog Command # Update Changelog Command
Update CHANGELOG.md with a new entry for the specified version. Update CHANGELOG.md with a new entry for the specified version.
Usage: /changelog [version] [change-type] [message]''; Usage: /changelog [version] [change-type] [message]
'';
commit = '' commit = ''
# Commit Command # Commit Command
Create a git commit with proper message formatting. Create a git commit with proper message formatting.
Usage: /commit [message]''; Usage: /commit [message]
'';
}; };
}; };
nmt.script = '' nmt.script = ''

View File

@@ -1,4 +1,4 @@
# Commit Command # Commit Command
Create a git commit with proper message formatting. Create a git commit with proper message formatting.
Usage: /commit [message] Usage: /commit [message]

View File

@@ -0,0 +1,11 @@
import { tool } from "@opencode-ai/plugin"
export default tool({
description: "Query the project database",
args: {
query: tool.schema.string().describe("SQL query to execute"),
},
async execute(args) {
return `Executed query: ${args.query}`
},
})

View File

@@ -8,6 +8,11 @@
opencode-commands-inline = ./commands-inline.nix; opencode-commands-inline = ./commands-inline.nix;
opencode-agents-path = ./agents-path.nix; opencode-agents-path = ./agents-path.nix;
opencode-commands-path = ./commands-path.nix; opencode-commands-path = ./commands-path.nix;
opencode-agents-bulk-directory = ./agents-bulk-directory.nix;
opencode-commands-bulk-directory = ./commands-bulk-directory.nix;
opencode-tools-inline = ./tools-inline.nix;
opencode-tools-path = ./tools-path.nix;
opencode-tools-bulk-directory = ./tools-bulk-directory.nix;
opencode-mixed-content = ./mixed-content.nix; opencode-mixed-content = ./mixed-content.nix;
opencode-skills-inline = ./skills-inline.nix; opencode-skills-inline = ./skills-inline.nix;
opencode-skills-path = ./skills-path.nix; opencode-skills-path = ./skills-path.nix;
@@ -15,6 +20,7 @@
opencode-skills-bulk-directory = ./skills-bulk-directory.nix; opencode-skills-bulk-directory = ./skills-bulk-directory.nix;
opencode-themes-inline = ./themes-inline.nix; opencode-themes-inline = ./themes-inline.nix;
opencode-themes-path = ./themes-path.nix; opencode-themes-path = ./themes-path.nix;
opencode-themes-bulk-directory = ./themes-bulk-directory.nix;
opencode-mcp-integration = ./mcp-integration.nix; opencode-mcp-integration = ./mcp-integration.nix;
opencode-mcp-integration-with-override = ./mcp-integration-with-override.nix; opencode-mcp-integration-with-override = ./mcp-integration-with-override.nix;
} }

View File

@@ -7,4 +7,4 @@ Focus on user-friendly explanations and examples.
- Write clear, concise documentation - Write clear, concise documentation
- Include practical examples - Include practical examples
- Use proper formatting and structure - Use proper formatting and structure
- Consider the target audience - Consider the target audience

Some files were not shown because too many files have changed in this diff Show More