Skip to content

Commit

Permalink
Merge branch 'nix-community:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
joygnu authored Oct 11, 2024
2 parents 18f8d4d + 65ae9c1 commit bab6334
Show file tree
Hide file tree
Showing 19 changed files with 291 additions and 12 deletions.
2 changes: 2 additions & 0 deletions docs/home-manager-manual.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ in stdenv.mkDerivation {
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
'';

passthru = { inherit home-manager-options; };

meta = { maintainers = [ lib.maintainers.considerate ]; };
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions home-manager/po/hi.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-09-13 03:09+0000\n"
"Last-Translator: Jay Thomas <jay@gfax.ch>\n"
"PO-Revision-Date: 2024-10-09 14:31+0000\n"
"Last-Translator: Utkarsh Sharma <utkasharma19@gmail.com>\n"
"Language-Team: Hindi <https://hosted.weblate.org/projects/home-manager/cli/"
"hi/>\n"
"Language: hi\n"
Expand All @@ -22,11 +22,11 @@ msgstr ""
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: ‌%s के लिए कोई आर्ग्यूमेंट नहीं दिया"

#: home-manager/home-manager:64
msgid "No configuration file found at %s"
msgstr ""
msgstr "%s में कोई कन्फि़गरेशन फाइल नहीं मिली"

#. translators: The first '%s' specifier will be replaced by either
#. 'home.nix' or 'flake.nix'.
Expand Down
6 changes: 6 additions & 0 deletions modules/lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1

{
aabccd021 = {
name = "Muhamad Abdurahman";
email = "aabccd021@gmail.com";
github = "aabccd021";
githubId = 33031950;
};
abayomi185 = {
name = "Yomi";
email = "yomi+nix@yomitosh.com";
Expand Down
22 changes: 22 additions & 0 deletions modules/misc/news.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,28 @@ in {
add `-w` to your assignment of `services.swayidle.extraArgs`.
'';
}

{
time = "2024-10-09T06:16:23+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.snixembed'.
snixembed proxies StatusNotifierItems as XEmbedded systemtray-spec
icons. This is useful for some tools in some environments, e.g., Safe
Eyes in i3, lxde or mate.
'';
}

{
time = "2024-10-11T08:23:19+00:00";
message = ''
A new module is available: 'programs.vifm'.
Vifm is a curses based Vim-like file manager extended with some useful
ideas from mutt.
'';
}
];
};
}
8 changes: 8 additions & 0 deletions modules/misc/xdg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application caches.
Sets `XDG_CACHE_HOME` for the user if `xdg.enable` is set `true`.
'';
};

Expand All @@ -48,6 +50,8 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application configurations.
Sets `XDG_CONFIG_HOME` for the user if `xdg.enable` is set `true`.
'';
};

Expand All @@ -67,6 +71,8 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application data.
Sets `XDG_DATA_HOME` for the user if `xdg.enable` is set `true`.
'';
};

Expand All @@ -86,6 +92,8 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application states.
Sets `XDG_STATE_HOME` for the user if `xdg.enable` is set `true`.
'';
};
};
Expand Down
4 changes: 3 additions & 1 deletion modules/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ let
./programs/translate-shell.nix
./programs/urxvt.nix
./programs/vdirsyncer.nix
./programs/vim.nix
./programs/vifm.nix
./programs/vim-vint.nix
./programs/vim.nix
./programs/vscode.nix
./programs/vscode/haskell.nix
./programs/pywal.nix
Expand Down Expand Up @@ -362,6 +363,7 @@ let
./services/screen-locker.nix
./services/sctd.nix
./services/signaturepdf.nix
./services/snixembed.nix
./services/spotifyd.nix
./services/ssh-agent.nix
./services/stalonetray.nix
Expand Down
11 changes: 7 additions & 4 deletions modules/po/hi.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"PO-Revision-Date: 2024-10-09 14:31+0000\n"
"Last-Translator: Utkarsh Sharma <utkasharma19@gmail.com>\n"
"Language-Team: Hindi <https://hosted.weblate.org/projects/home-manager/"
"modules/hi/>\n"
"Language: hi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 5.8-dev\n"

#: modules/files.nix:191
msgid "Creating home file links in %s"
msgstr ""

#: modules/files.nix:204
msgid "Cleaning up orphan links from %s"
msgstr ""
msgstr "%s से ऑर्फे़न लिंक्स मिटाई जा रही है"

#: modules/files.nix:220
msgid "Creating profile generation %s"
Expand Down
77 changes: 77 additions & 0 deletions modules/programs/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,41 @@ in {
};
};

maintenance = {
enable = mkEnableOption "" // {
description = ''
Enable the automatic {command}`git maintenance`.
See <https://git-scm.com/docs/git-maintenance>.
'';
};

repositories = mkOption {
type = with types; listOf str;
default = [ ];
description = ''
Repositories on which {command}`git maintenance` should run.
Should be a list of absolute paths.
'';
};

timers = mkOption {
type = types.attrsOf types.str;
default = {
hourly = "*-*-* 1..23:53:00";
daily = "Tue..Sun *-*-* 0:53:00";
weekly = "Mon 0:53:00";
};
description = ''
Systemd timers to create for scheduled {command}`git maintenance`.
Key is passed to `--schedule` argument in {command}`git maintenance run`
and value is passed to `Timer.OnCalendar` in `systemd.user.timers`.
'';
};
};

diff-highlight = {
enable = mkEnableOption "" // {
description = ''
Expand Down Expand Up @@ -501,6 +536,48 @@ in {
};
})

(mkIf cfg.maintenance.enable {
programs.git.iniContent.maintenance.repo = cfg.maintenance.repositories;

systemd.user.services."git-maintenance@" = {
Unit = {
Description = "Optimize Git repositories data";
Documentation = [ "man:git-maintenance(1)" ];
};

Service = {
Type = "oneshot";
ExecStart = let exe = lib.getExe cfg.package;
in ''
"${exe}" --exec-path="${exe}" for-each-repo --config=maintenance.repo maintenance run --schedule=%i
'';
LockPersonality = "yes";
MemoryDenyWriteExecute = "yes";
NoNewPrivileges = "yes";
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_VSOCK";
RestrictNamespaces = "yes";
RestrictRealtime = "yes";
RestrictSUIDSGID = "yes";
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
};
};

systemd.user.timers = let
toSystemdTimer = name: time:
lib.attrsets.nameValuePair "git-maintenance@${name}" {
Unit.Description = "Optimize Git repositories data";

Timer = {
OnCalendar = time;
Persistent = true;
};

Install.WantedBy = [ "timers.target" ];
};
in lib.attrsets.mapAttrs' toSystemdTimer cfg.maintenance.timers;
})

(mkIf cfg.diff-highlight.enable {
programs.git.iniContent = let
dhCommand =
Expand Down
33 changes: 33 additions & 0 deletions modules/programs/vifm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:

let

inherit (lib) mkIf mkOption types;

cfg = config.programs.vifm;

in {
meta.maintainers = [ lib.hm.maintainers.aabccd021 ];

options.programs.vifm = {
enable = lib.mkEnableOption "vifm, a Vim-like file manager";

package = lib.mkPackageOption pkgs "vifm" { };

extraConfig = mkOption {
type = types.lines;
default = "";
example = "mark h ~/";
description = ''
Extra lines added to the {file}`$XDG_CONFIG_HOME/vifm/vifmrc` file.
'';
};
};

config = mkIf cfg.enable {
home.packages = [ cfg.package ];

xdg.configFile."vifm/vifmrc" =
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
};
}
50 changes: 50 additions & 0 deletions modules/services/snixembed.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{ config, lib, pkgs, ... }:

with lib;

let cfg = config.services.snixembed;
in {
meta.maintainers = [ maintainers.DamienCassou ];

options = {
services.snixembed = {
enable = mkEnableOption
"snixembed: proxy StatusNotifierItems as XEmbedded systemtray-spec icons";

package = mkPackageOption pkgs "snixembed" { };

beforeUnits = mkOption {
type = with types; listOf str;
default = [ ];
example = [ "safeeyes.service" ];
description = ''
List of other units that should be started after snixembed.
'';
};
};
};

config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.snixembed" pkgs platforms.linux)
];

systemd.user.services.snixembed = {
Install.WantedBy = [ "graphical-session.target" ];

Unit = {
Description = "snixembed";
PartOf = [ "graphical-session.target" ];
StartLimitIntervalSec = 100;
StartLimitBurst = 10;
Before = cfg.beforeUnits;
};

Service = {
ExecStart = getExe pkgs.snixembed;
Restart = "on-failure";
RestartSec = 3;
};
};
};
}
2 changes: 2 additions & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ in import nmtSrc {
./modules/programs/tmux
./modules/programs/topgrade
./modules/programs/translate-shell
./modules/programs/vifm
./modules/programs/vim-vint
./modules/programs/vscode
./modules/programs/watson
Expand Down Expand Up @@ -271,6 +272,7 @@ in import nmtSrc {
./modules/services/remmina
./modules/services/screen-locker
./modules/services/signaturepdf
./modules/services/snixembed
./modules/services/swayidle
./modules/services/swaync
./modules/services/swayosd
Expand Down
4 changes: 4 additions & 0 deletions tests/modules/programs/vifm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
vifm-example-settings = ./example-settings.nix;
vifm-empty-settings = ./empty-settings.nix;
}
11 changes: 11 additions & 0 deletions tests/modules/programs/vifm/empty-settings.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ ... }:

{
programs.vifm.enable = true;

test.stubs.vifm = { };

nmt.script = ''
assertPathNotExists home-files/.config/vifm
'';
}
Loading

0 comments on commit bab6334

Please sign in to comment.