diff --git a/infra/libkookie/home-manager/.github/CODEOWNERS b/infra/libkookie/home-manager/.github/CODEOWNERS index 43ed4e4c16d..4636712415f 100644 --- a/infra/libkookie/home-manager/.github/CODEOWNERS +++ b/infra/libkookie/home-manager/.github/CODEOWNERS @@ -16,6 +16,8 @@ /modules/misc/gtk.nix @rycee +/modules/config/home-cursor.nix @polykernel @league + /modules/config/i18n.nix @midchildan /tests/modules/config/i18n @midchildan @@ -245,6 +247,11 @@ /modules/programs/starship.nix @marsam +/modules/programs/swaylock.nix @rcerc +/tests/modules/programs/swaylock @rcerc + +/modules/programs/tealdeer.nix @marsam + /modules/programs/terminator.nix @chisui /modules/programs/texlive.nix @rycee @@ -342,6 +349,9 @@ /modules/services/mbsync.nix @pjones +/modules/services/mopidy.nix @foo-dogsquared +/tests/modules/services/mopidy @foo-dogsquared + /modules/services/mpdris2.nix @pjones /modules/services/mpd-discord-rpc.nix @Kranzes @@ -438,8 +448,6 @@ /modules/systemd.nix @rycee -/modules/xcursor.nix @league - /modules/xresources.nix @rycee /modules/xsession.nix @rycee diff --git a/infra/libkookie/home-manager/.gitignore b/infra/libkookie/home-manager/.gitignore index 3526db71892..d6944e3ddc1 100644 --- a/infra/libkookie/home-manager/.gitignore +++ b/infra/libkookie/home-manager/.gitignore @@ -1,2 +1 @@ -/flake.lock /result* diff --git a/infra/libkookie/home-manager/LICENSE b/infra/libkookie/home-manager/LICENSE index 2db3938bbeb..97c93528183 100644 --- a/infra/libkookie/home-manager/LICENSE +++ b/infra/libkookie/home-manager/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2020 Home Manager contributors +Copyright (c) 2017-2022 Home Manager contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/infra/libkookie/home-manager/README.md b/infra/libkookie/home-manager/README.md index 585f337b68c..095effcd3a2 100644 --- a/infra/libkookie/home-manager/README.md +++ b/infra/libkookie/home-manager/README.md @@ -6,11 +6,16 @@ using the [Nix][] package manager together with the Nix libraries found in [Nixpkgs][]. It allows declarative configuration of user specific (non global) packages and dotfiles. +Usage +----- + Before attempting to use Home Manager please read the warning below. -For a more systematic overview of Home Manager and its available -options, please see the Home Manager [manual][manual] and -[options][configuration options]. +For a systematic overview of Home Manager and its available options, +please see + +- the [Home Manager manual][manual] and +- the [Home Manager configuration options][configuration options]. If you would like to contribute to Home Manager then please have a look at the [contributing][] chapter of the manual. @@ -36,7 +41,7 @@ will write to your dconf store and cannot tell whether a configuration that it is about to be overwritten was from a previous Home Manager generation or from manual configuration. -Home Manager targets [NixOS][] unstable and NixOS version 21.11 (the +Home Manager targets [NixOS][] unstable and NixOS version 22.05 (the current stable version), it may or may not work on other Linux distributions and NixOS versions. @@ -101,7 +106,7 @@ Home Manager is developed against `nixpkgs-unstable` branch, which often causes it to contain tweaks for changes/packages not yet released in stable NixOS. To avoid breaking users' configurations, Home Manager is released in branches corresponding to NixOS releases -(e.g. `release-21.11`). These branches get fixes, but usually not new +(e.g. `release-22.05`). These branches get fixes, but usually not new modules. If you need a module to be backported, then feel free to open an issue. @@ -110,18 +115,18 @@ License This project is licensed under the terms of the [MIT license](LICENSE). -[Nix]: https://nixos.org/nix/ +[Nix]: https://nixos.org/explore.html [NixOS]: https://nixos.org/ -[Nixpkgs]: https://nixos.org/nixpkgs/ -[manual]: https://nix-community.github.io/home-manager/ +[Nixpkgs]: https://github.com/NixOS/nixpkgs +[manual]: https://nix-community.github.io/home-manager/index.html [contributing]: https://nix-community.github.io/home-manager/#ch-contributing [manual usage]: https://nix-community.github.io/home-manager/#ch-usage [configuration options]: https://nix-community.github.io/home-manager/options.html [#home-manager]: https://webchat.oftc.net/?channels=home-manager [OFTC]: https://oftc.net/ -[Nix Pills]: https://nixos.org/nixos/nix-pills/ +[Nix Pills]: https://nixos.org/guides/nix-pills/ [Nix Flakes]: https://nixos.wiki/wiki/Flakes -[nix-darwin]: https://github.com/LnL7/nix-darwin/ +[nix-darwin]: https://github.com/LnL7/nix-darwin [manual standalone install]: https://nix-community.github.io/home-manager/index.html#sec-install-standalone [manual nixos install]: https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module [manual nix-darwin install]: https://nix-community.github.io/home-manager/index.html#sec-install-nix-darwin-module diff --git a/infra/libkookie/home-manager/default.nix b/infra/libkookie/home-manager/default.nix index b665b7a66fc..f57919fea3d 100644 --- a/infra/libkookie/home-manager/default.nix +++ b/infra/libkookie/home-manager/default.nix @@ -1,6 +1,16 @@ { pkgs ? import { } }: -rec { +let + + flake = (import + (let lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in fetchTarball { + url = + "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + }) { src = ./.; }).defaultNix; + +in rec { docs = with import ./docs { inherit pkgs; }; { html = manual.html; manPages = manPages; @@ -16,4 +26,6 @@ rec { nixos = import ./nixos; path = ./.; + + inherit (flake) inputs; } diff --git a/infra/libkookie/home-manager/docs/default.nix b/infra/libkookie/home-manager/docs/default.nix index 72ea0b37fdd..10988d15805 100644 --- a/infra/libkookie/home-manager/docs/default.nix +++ b/infra/libkookie/home-manager/docs/default.nix @@ -1,18 +1,10 @@ -{ pkgs +{ pkgs, nmdSrc ? (import ./.. { }).inputs.nmd -# Note, this should be "the standard library" + HM extensions. + # Note, this should be "the standard library" + HM extensions. , lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }: let - nmdSrc = pkgs.fetchFromGitLab { - name = "nmd"; - owner = "rycee"; - repo = "nmd"; - rev = "de522bdd533350b3afb41e1ce9b3afb72922fba2"; - sha256 = "1ji4q7b48nnicgpnnl6yb9xb9zfkmmzkch4yifinphw3ag38qrmd"; - }; - nmd = import nmdSrc { inherit lib pkgs; }; # Make sure the used package is scrubbed to avoid actually @@ -89,6 +81,7 @@ let docs = nmd.buildDocBookDocs { pathName = "home-manager"; + projectName = "Home Manager"; modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ]; documentsDirectory = ./.; documentType = "book"; diff --git a/infra/libkookie/home-manager/docs/installation.adoc b/infra/libkookie/home-manager/docs/installation.adoc index 5044c384b0d..f35fcf64558 100644 --- a/infra/libkookie/home-manager/docs/installation.adoc +++ b/infra/libkookie/home-manager/docs/installation.adoc @@ -54,11 +54,11 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master $ nix-channel --update ---- + -and if you follow a Nixpkgs version 21.11 channel you can run +and if you follow a Nixpkgs version 22.05 channel you can run + [source,console] ---- -$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager +$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager $ nix-channel --update ---- + @@ -136,11 +136,11 @@ or an unstable channel, you can run # nix-channel --update ---- -and if you follow a Nixpkgs version 21.11 channel, you can run +and if you follow a Nixpkgs version 22.05 channel, you can run [source,console] ---- -# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager +# nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager # nix-channel --update ---- @@ -247,11 +247,11 @@ or an unstable channel, you can run # nix-channel --update ---- -and if you follow a Nixpkgs version 21.11 channel, you can run +and if you follow a Nixpkgs version 22.05 channel, you can run [source,console] ---- -# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager +# nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager # nix-channel --update ---- diff --git a/infra/libkookie/home-manager/docs/man-pages.xml b/infra/libkookie/home-manager/docs/man-pages.xml index bb484ae019b..a68b0e60d77 100644 --- a/infra/libkookie/home-manager/docs/man-pages.xml +++ b/infra/libkookie/home-manager/docs/man-pages.xml @@ -4,7 +4,7 @@ Home Manager Reference Pages Home Manager contributors - 2017–2020Home Manager contributors + 2017–2022Home Manager contributors diff --git a/infra/libkookie/home-manager/docs/nix-flakes.adoc b/infra/libkookie/home-manager/docs/nix-flakes.adoc index 2c1bb099cfe..a979552e350 100644 --- a/infra/libkookie/home-manager/docs/nix-flakes.adoc +++ b/infra/libkookie/home-manager/docs/nix-flakes.adoc @@ -72,7 +72,7 @@ Remove the line containing `home.stateVersion` in the example. # Update the state version as needed. # See the changelog here: # https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05 - stateVersion = "21.11"; + stateVersion = "22.05"; # Optionally use extraSpecialArgs # to pass through arguments to home.nix @@ -85,9 +85,9 @@ Remove the line containing `home.stateVersion` in the example. ==== * The above example tracks the master branch of Home Manager and nixos-unstable branch of Nixpkgs. -If you would like to use the `release-21.11` branch, -change the `home-manager` input url to `github:nix-community/home-manager/release-21.11` -and `nixpkgs` url to `github:NixOS/nixpkgs/nixos-21.11`. +If you would like to use the `release-22.05` branch, +change the `home-manager` input url to `github:nix-community/home-manager/release-22.05` +and `nixpkgs` url to `github:NixOS/nixpkgs/nixos-22.05`. Make sure to also update to the `stateVersion` option accordingly. * The Home Manager library is exported by the flake under diff --git a/infra/libkookie/home-manager/docs/release-notes/release-notes.adoc b/infra/libkookie/home-manager/docs/release-notes/release-notes.adoc index 56bfa20b620..b5f607aee04 100644 --- a/infra/libkookie/home-manager/docs/release-notes/release-notes.adoc +++ b/infra/libkookie/home-manager/docs/release-notes/release-notes.adoc @@ -6,6 +6,8 @@ This section lists the release notes for stable versions of Home Manager and the :leveloffset: 1 +include::rl-2211.adoc[] + include::rl-2205.adoc[] include::rl-2111.adoc[] diff --git a/infra/libkookie/home-manager/docs/release-notes/rl-2205.adoc b/infra/libkookie/home-manager/docs/release-notes/rl-2205.adoc index 48482ddf5e1..f600640e4f4 100644 --- a/infra/libkookie/home-manager/docs/release-notes/rl-2205.adoc +++ b/infra/libkookie/home-manager/docs/release-notes/rl-2205.adoc @@ -1,7 +1,7 @@ [[sec-release-22.05]] == Release 22.05 -This is the current unstable branch and the information in this section is therefore not final. +The 22.05 release branch became the stable branch in May, 2022. [[sec-release-22.05-highlights]] === Highlights diff --git a/infra/libkookie/home-manager/docs/release-notes/rl-2211.adoc b/infra/libkookie/home-manager/docs/release-notes/rl-2211.adoc new file mode 100644 index 00000000000..dc33db07768 --- /dev/null +++ b/infra/libkookie/home-manager/docs/release-notes/rl-2211.adoc @@ -0,0 +1,19 @@ +[[sec-release-22.11]] +== Release 22.11 + +This is the current unstable branch and the information in this section is therefore not final. + +[[sec-release-22.11-highlights]] +=== Highlights + +This release has the following notable changes: + +* No changes. + +[[sec-release-22.11-state-version-changes]] +=== State Version Changes + +The state version in this release includes the changes below. +These changes are only active if the `home.stateVersion` option is set to "22.11" or later. + +* No changes. diff --git a/infra/libkookie/home-manager/flake.lock b/infra/libkookie/home-manager/flake.lock new file mode 100644 index 00000000000..89b1ebafc6b --- /dev/null +++ b/infra/libkookie/home-manager/flake.lock @@ -0,0 +1,94 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1654230545, + "narHash": "sha256-8Vlwf0x8ow6pPOK2a04bT+pxIeRnM1+O0Xv9/CuDzRs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "236cc2971ac72acd90f0ae3a797f9f83098b17ec", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1653339422, + "narHash": "sha256-8nc7lcYOgih3YEmRMlBwZaLLJYpLPYKBlewqHqx8ieg=", + "owner": "rycee", + "repo": "nmd", + "rev": "9e7a20e6ee3f6751f699f79c0b299390f81f7bcd", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" + } + }, + "root": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "nmd": "nmd", + "nmt": "nmt", + "utils": "utils" + } + }, + "utils": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/infra/libkookie/home-manager/flake.nix b/infra/libkookie/home-manager/flake.nix index a5e073173a2..1187ad8078e 100644 --- a/infra/libkookie/home-manager/flake.nix +++ b/infra/libkookie/home-manager/flake.nix @@ -1,43 +1,31 @@ { description = "Home Manager for Nix"; - outputs = { self, nixpkgs }: - let - # List of systems supported by home-manager binary - supportedSystems = with nixpkgs.lib.platforms; linux ++ darwin; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + inputs.nmd.url = "gitlab:rycee/nmd"; + inputs.nmd.flake = false; + inputs.nmt.url = "gitlab:rycee/nmt"; + inputs.nmt.flake = false; - # Function to generate a set based on supported systems - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + inputs.utils.url = "github:numtide/flake-utils"; + inputs.flake-compat.url = "github:edolstra/flake-compat"; + inputs.flake-compat.flake = false; - nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); - in rec { - nixosModules.home-manager = import ./nixos; - nixosModule = self.nixosModules.home-manager; - - darwinModules.home-manager = import ./nix-darwin; - darwinModule = self.darwinModules.home-manager; - - packages = forAllSystems (system: - let docs = import ./docs { pkgs = nixpkgsFor.${system}; }; - in { - home-manager = nixpkgsFor.${system}.callPackage ./home-manager { }; - docs-html = docs.manual.html; - docs-manpages = docs.manPages; - docs-json = docs.options.json; - default = self.packages.${system}.home-manager; - }); - - # defaultPackage is deprecated as of Nix 2.7.0 - defaultPackage = forAllSystems (system: self.packages.${system}.default); - - apps = forAllSystems (system: { - home-manager = { - type = "app"; - program = "${defaultPackage.${system}}/bin/home-manager"; - }; - }); + outputs = { self, nixpkgs, nmd, utils, ... }: + { + nixosModules = rec { + home-manager = import ./nixos; + default = home-manager; + }; + # deprecated in Nix 2.8 + nixosModule = self.nixosModules.default; - defaultApp = forAllSystems (system: apps.${system}.home-manager); + darwinModules = rec { + home-manager = import ./nix-darwin; + default = home-manager; + }; + # unofficial; deprecated in Nix 2.8 + darwinModule = self.darwinModules.default; lib = { hm = import ./modules/lib { lib = nixpkgs.lib; }; @@ -56,5 +44,22 @@ }; }; }; - }; + } // utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + docs = import ./docs { + inherit pkgs; + nmdSrc = nmd; + }; + in { + packages = rec { + home-manager = pkgs.callPackage ./home-manager { }; + docs-html = docs.manual.html; + docs-manpages = docs.manPages; + docs-json = docs.options.json; + default = home-manager; + }; + # deprecated in Nix 2.7 + defaultPackage = self.packages.${system}.default; + }); } diff --git a/infra/libkookie/home-manager/format b/infra/libkookie/home-manager/format index 8bf78064523..b875c6b7224 100755 --- a/infra/libkookie/home-manager/format +++ b/infra/libkookie/home-manager/format @@ -27,6 +27,5 @@ find . -name '*.nix' \ ! -path ./modules/programs/bash.nix \ ! -path ./modules/programs/ssh.nix \ ! -path ./modules/programs/zsh.nix \ - ! -path ./nix-darwin/default.nix \ ! -path ./tests/default.nix \ -exec nixfmt $CHECK_ARG {} + diff --git a/infra/libkookie/home-manager/home-manager/default.nix b/infra/libkookie/home-manager/home-manager/default.nix index 4bb55904ae0..e0127cdd4ff 100644 --- a/infra/libkookie/home-manager/home-manager/default.nix +++ b/infra/libkookie/home-manager/home-manager/default.nix @@ -19,6 +19,7 @@ in runCommand "home-manager" { preferLocalBuild = true; nativeBuildInputs = [ gettext ]; meta = with lib; { + mainProgram = "home-manager"; description = "A user environment configurator"; maintainers = [ maintainers.rycee ]; platforms = platforms.unix; diff --git a/infra/libkookie/home-manager/integration-common.nix b/infra/libkookie/home-manager/integration-common.nix new file mode 100644 index 00000000000..ff833828c6e --- /dev/null +++ b/infra/libkookie/home-manager/integration-common.nix @@ -0,0 +1,124 @@ +# This module is the common base for the NixOS and nix-darwin modules. +# For OS-specific configuration, please edit nixos/default.nix or nix-darwin/default.nix instead. + +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.home-manager; + + extendedLib = import ./modules/lib/stdlib-extended.nix pkgs.lib; + + hmModule' = types.submoduleWith { + specialArgs = { + lib = extendedLib; + osConfig = config; + modulesPath = builtins.toString ./modules; + } // cfg.extraSpecialArgs; + modules = [ + ({ name, ... }: { + imports = import ./modules/modules.nix { + inherit pkgs; + lib = extendedLib; + useNixpkgsModule = !cfg.useGlobalPkgs; + }; + + config = { + submoduleSupport.enable = true; + submoduleSupport.externalPackageInstall = cfg.useUserPackages; + + home.username = config.users.users.${name}.name; + home.homeDirectory = config.users.users.${name}.home; + + # Make activation script use same version of Nix as system as a whole. + # This avoids problems with Nix not being in PATH. + home.extraActivationPath = [ config.nix.package ]; + }; + }) + ] ++ cfg.sharedModules; + } // { + description = "Home Manager module"; + }; + + # TODO: hack until https://github.com/NixOS/nixpkgs/pull/173621 lands + hmModule = hmModule' // { + substSubModules = m: + hmModule'.substSubModules m // { + inherit (hmModule') description; + }; + }; + +in { + options.home-manager = { + useUserPackages = mkEnableOption '' + installation of user packages through the + option + ''; + + useGlobalPkgs = mkEnableOption '' + using the system configuration's pkgs + argument in Home Manager. This disables the Home Manager + options + ''; + + backupFileExtension = mkOption { + type = types.nullOr types.str; + default = null; + example = "backup"; + description = '' + On activation move existing files by appending the given + file extension rather than exiting with an error. + ''; + }; + + extraSpecialArgs = mkOption { + type = types.attrs; + default = { }; + example = literalExpression "{ inherit emacs-overlay; }"; + description = '' + Extra specialArgs passed to Home Manager. This + option can be used to pass additional arguments to all modules. + ''; + }; + + sharedModules = mkOption { + type = with types; listOf raw; + default = [ ]; + example = literalExpression "[ { home.packages = [ nixpkgs-fmt ]; } ]"; + description = '' + Extra modules added to all users. + ''; + }; + + verbose = mkEnableOption "verbose output on activation"; + + users = mkOption { + type = types.attrsOf hmModule; + default = { }; + # Prevent the entire submodule being included in the documentation. + visible = "shallow"; + description = '' + Per-user Home Manager configuration. + ''; + }; + }; + + config = mkIf (cfg.users != { }) { + warnings = flatten (flip mapAttrsToList cfg.users (user: config: + flip map config.warnings (warning: "${user} profile: ${warning}"))); + + assertions = flatten (flip mapAttrsToList cfg.users (user: config: + flip map config.assertions (assertion: { + inherit (assertion) assertion; + message = "${user} profile: ${assertion.message}"; + }))); + + users.users = mkIf cfg.useUserPackages + (mapAttrs (username: usercfg: { packages = [ usercfg.home.path ]; }) + cfg.users); + + environment.pathsToLink = mkIf cfg.useUserPackages [ "/etc/profile.d" ]; + }; +} diff --git a/infra/libkookie/home-manager/modules/accounts/email.nix b/infra/libkookie/home-manager/modules/accounts/email.nix index e48024e023c..72eb538b2ba 100644 --- a/infra/libkookie/home-manager/modules/accounts/email.nix +++ b/infra/libkookie/home-manager/modules/accounts/email.nix @@ -44,6 +44,15 @@ let ''; }; + command = mkOption { + type = with types; nullOr path; + default = null; + example = literalExpression '' + pkgs.writeScript "signature" "echo This is my signature" + ''; + description = "A command that generates a signature."; + }; + showSignature = mkOption { type = types.enum [ "append" "attach" "none" ]; default = "none"; diff --git a/infra/libkookie/home-manager/modules/config/home-cursor.nix b/infra/libkookie/home-manager/modules/config/home-cursor.nix new file mode 100644 index 00000000000..e2d26a5ba23 --- /dev/null +++ b/infra/libkookie/home-manager/modules/config/home-cursor.nix @@ -0,0 +1,156 @@ +{ config, options, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.home.pointerCursor; + + pointerCursorModule = types.submodule { + options = { + package = mkOption { + type = types.package; + example = literalExpression "pkgs.vanilla-dmz"; + description = "Package providing the cursor theme."; + }; + + name = mkOption { + type = types.str; + example = "Vanilla-DMZ"; + description = "The cursor name within the package."; + }; + + size = mkOption { + type = types.int; + default = 32; + example = 64; + description = "The cursor size."; + }; + + x11 = { + enable = mkEnableOption '' + x11 config generation for + ''; + + defaultCursor = mkOption { + type = types.str; + default = "left_ptr"; + example = "X_cursor"; + description = "The default cursor file to use within the package."; + }; + }; + + gtk = { + enable = mkEnableOption '' + gtk config generation for + ''; + }; + }; + }; + + cursorPath = "${cfg.package}/share/icons/${escapeShellArg cfg.name}/cursors/${ + escapeShellArg cfg.x11.defaultCursor + }"; + +in { + meta.maintainers = [ maintainers.polykernel maintainers.league ]; + + imports = [ + (mkAliasOptionModule [ "xsession" "pointerCursor" "package" ] [ + "home" + "pointerCursor" + "package" + ]) + (mkAliasOptionModule [ "xsession" "pointerCursor" "name" ] [ + "home" + "pointerCursor" + "name" + ]) + (mkAliasOptionModule [ "xsession" "pointerCursor" "size" ] [ + "home" + "pointerCursor" + "size" + ]) + (mkAliasOptionModule [ "xsession" "pointerCursor" "defaultCursor" ] [ + "home" + "pointerCursor" + "x11" + "defaultCursor" + ]) + + ({ ... }: { + warnings = optional (any (x: + getAttrFromPath + ([ "xsession" "pointerCursor" ] ++ [ x ] ++ [ "isDefined" ]) + options) [ "package" "name" "size" "defaultCursor" ]) '' + The option `xsession.pointerCursor` has been merged into `home.pointerCursor` and will be removed + in the future. Please change to set `home.pointerCursor` directly and enable `home.pointerCursor.x11.enable` + to generate x11 specific cursor configurations. You can refer to the documentation for more details. + ''; + }) + ]; + + options = { + home.pointerCursor = mkOption { + type = types.nullOr pointerCursorModule; + default = null; + description = '' + Cursor configuration. Set to null to disable. + + Top-level options declared under this submodule are backend indepedent + options. Options declared under namespaces such as x11 + are backend specific options. By default, only backend independent cursor + configurations are generated. If you need configurations for specific + backends, you can toggle them via the enable option. For example, + home.pointerCursor.x11.enable + will enable x11 cursor configurations. + ''; + }; + }; + + config = mkIf (cfg != null) (mkMerge [ + { + assertions = [ + (hm.assertions.assertPlatform "home.pointerCursor" pkgs platforms.linux) + ]; + + home.packages = [ cfg.package ]; + + # Set name in icons theme, for compatibility with AwesomeWM etc. See: + # https://github.com/nix-community/home-manager/issues/2081 + # https://wiki.archlinux.org/title/Cursor_themes#XDG_specification + home.file.".icons/default/index.theme".text = '' + [icon theme] + Name=Default + Comment=Default Cursor Theme + Inherits=${cfg.name} + ''; + + # Set directory to look for cursors in, needed for some applications + # that are unable to find cursors otherwise. See: + # https://github.com/nix-community/home-manager/issues/2812 + # https://wiki.archlinux.org/title/Cursor_themes#Environment_variable + home.sessionVariables = { + XCURSOR_PATH = "$XCURSOR_PATH\${XCURSOR_PATH:+:}" + + "${config.home.profileDirectory}/share/icons"; + }; + } + + (mkIf cfg.x11.enable { + xsession.initExtra = '' + ${pkgs.xorg.xsetroot}/bin/xsetroot -xcf ${cursorPath} ${ + toString cfg.size + } + ''; + + xresources.properties = { + "Xcursor.theme" = cfg.name; + "Xcursor.size" = cfg.size; + }; + }) + + (mkIf cfg.gtk.enable { + gtk.cursorTheme = mkDefault { inherit (cfg) package name size; }; + }) + ]); +} diff --git a/infra/libkookie/home-manager/modules/lib/maintainers.nix b/infra/libkookie/home-manager/modules/lib/maintainers.nix index 07acce2d51d..17fc440768c 100644 --- a/infra/libkookie/home-manager/modules/lib/maintainers.nix +++ b/infra/libkookie/home-manager/modules/lib/maintainers.nix @@ -55,6 +55,12 @@ github = "chisui"; githubId = 4526429; }; + foo-dogsquared = { + name = "Gabriel Arazas"; + email = "foo.dogsquared@gmail.com"; + github = "foo-dogsquared"; + githubId = 34962634; + }; olmokramer = { name = "Olmo Kramer"; email = "olmokramer@users.noreply.github.com"; @@ -265,4 +271,14 @@ github = "rszamszur"; githubId = 10353018; }; + rcerc = { + name = "rcerc"; + email = "88944439+rcerc@users.noreply.github.com"; + github = "rcerc"; + githubId = 88944439; + keys = [{ + longkeyid = "ed25519/0x3F98EC7EC2B87ED1"; + fingerprint = "D5D6 FD1F 0D9A 3284 FB9B C26D 3F98 EC7E C2B8 7ED1"; + }]; + }; } diff --git a/infra/libkookie/home-manager/modules/misc/gtk.nix b/infra/libkookie/home-manager/modules/misc/gtk.nix index 6687a33be51..dfebf201f19 100644 --- a/infra/libkookie/home-manager/modules/misc/gtk.nix +++ b/infra/libkookie/home-manager/modules/misc/gtk.nix @@ -30,7 +30,7 @@ let package = mkOption { type = types.nullOr types.package; default = null; - example = literalExpression "pkgs.gnome.gnome_themes_standard"; + example = literalExpression "pkgs.gnome.gnome-themes-extra"; description = '' Package providing the theme. This package will be installed to your profile. If null then the theme @@ -51,7 +51,7 @@ let package = mkOption { type = types.nullOr types.package; default = null; - example = literalExpression "pkgs.adwaita-icon-theme"; + example = literalExpression "pkgs.gnome.adwaita-icon-theme"; description = '' Package providing the icon theme. This package will be installed to your profile. If null then the theme diff --git a/infra/libkookie/home-manager/modules/misc/news.nix b/infra/libkookie/home-manager/modules/misc/news.nix index 44b09f01494..ea06be5f037 100644 --- a/infra/libkookie/home-manager/modules/misc/news.nix +++ b/infra/libkookie/home-manager/modules/misc/news.nix @@ -120,1931 +120,6 @@ in # # date -u +'%Y-%m-%dT%H:%M:%S+00:00' news.entries = [ - { - time = "2017-09-01T10:56:28+00:00"; - message = '' - Hello! This is a news entry and it represents an - experimental new feature of Home Manager. The idea is to - inform you when something of importance happens in Home - Manager or its modules. - - We will try to not disturb you about the same news more than - once so the next time you run - - home-manager switch - - or - - home-manager build - - it should not notify you about this text again. - - News items may be conditional and will then only show if the - condition holds, for example if they are relevant to your - configuration. - - If you want to see all relevant news then please use the - - home-manager news - - command. - - Since this is an experimental feature any positive or - negative feedback would be greatly appreciated. For example, - by commenting in https://git.io/v5BJL. - ''; - } - - { - time = "2017-09-10T22:15:19+00:00"; - condition = config.programs.zsh.enable; - message = '' - Home Manager now offers its own minimal zsh plugin manager - under the 'programs.zsh.plugins' option path. By statically - sourcing your plugins it achieves no startup overhead. - ''; - } - - { - time = "2017-09-12T13:11:48+00:00"; - condition = ( - config.programs.zsh.enable && - config.programs.zsh.shellAliases != {} - ); - message = '' - Aliases defined in 'programs.zsh.shellAliases' - are now have the highest priority. Such aliases will - not be redefined by the code in 'programs.zsh.initExtra' - or any external plugins. - ''; - } - - { - time = "2017-09-12T14:22:18+00:00"; - message = '' - A new service is available: 'services.blueman-applet'. - ''; - } - - { - time = "2017-09-13T11:30:22+00:00"; - message = '' - A new service is available: 'services.compton'. - ''; - } - - { - time = "2017-09-20T14:47:14+00:00"; - message = '' - A new service is available: 'services.screen-locker'. - ''; - } - - { - time = "2017-09-22T12:09:01+00:00"; - condition = isString config.programs.git.extraConfig; - message = '' - The 'programs.git.extraConfig' parameter now accepts - attributes instead of strings which allows more flexible - configuration. - - The string parameter type will be deprecated in the future, - please change your configuration file accordingly. - - For example, if your configuration includes - - programs.git.extraConfig = ''' - [core] - editor = vim - '''; - - then you can now change it to - - programs.git.extraConfig = { - core = { - editor = "vim"; - }; - }; - ''; - } - - { - time = "2017-09-27T07:28:54+00:00"; - message = '' - A new program module is available: 'programs.command-not-found'. - - Note, this differs from the NixOS system command-not-found - tool in that NIX_AUTO_INSTALL is not supported. - ''; - } - - { - time = "2017-09-28T12:39:36+00:00"; - message = '' - A new program module is available: 'programs.rofi'; - ''; - } - - { - time = "2017-10-02T11:15:03+00:00"; - condition = config.services.udiskie.enable; - message = '' - The udiskie service now defaults to automatically mounting - new devices. Previous behavior was to not automatically - mount. To restore this previous behavior add - - services.udiskie.automount = false; - - to your Home Manager configuration. - ''; - } - - { - time = "2017-10-04T18:36:07+00:00"; - message = '' - A new module is available: 'xsession.windowManager.xmonad'. - ''; - } - - { - time = "2017-10-06T08:21:43+00:00"; - message = '' - A new service is available: 'services.polybar'. - ''; - } - - { - time = "2017-10-09T16:38:34+00:00"; - message = '' - A new module is available: 'fonts.fontconfig'. - - In particular, the Boolean option - - fonts.fontconfig.enableProfileFonts - - was added for those who do not use NixOS and want to install - font packages using 'nix-env' or 'home.packages'. If you are - using NixOS then you do not need to enable this option. - ''; - } - - { - time = "2017-10-12T11:21:45+00:00"; - condition = config.programs.zsh.enable; - message = '' - A new option in zsh module is available: 'programs.zsh.sessionVariables'. - - This option can be used to set zsh specific session variables which - will be set only on zsh launch. - ''; - } - - { - time = "2017-10-15T13:59:47+00:00"; - message = '' - A new module is available: 'programs.man'. - - This module is enabled by default and makes sure that manual - pages are installed for packages in 'home.packages'. - ''; - } - - { - time = "2017-10-20T12:15:27+00:00"; - condition = with config.systemd.user; - services != {} || sockets != {} || targets != {} || timers != {}; - message = '' - Home Manager's interaction with systemd is now done using - 'systemctl' from Nixpkgs, not the 'systemctl' in '$PATH'. - - If you are using a distribution whose systemd is - incompatible with the version in Nixpkgs then you can - override this behavior by adding - - systemd.user.systemctlPath = "/usr/bin/systemctl" - - to your configuration. Home Manager will then use your - chosen version. - ''; - } - - { - time = "2017-10-23T23:10:29+00:00"; - condition = !config.programs.home-manager.enable; - message = '' - Unfortunately, due to some internal restructuring it is no - longer possible to install the home-manager command when - having - - home-manager = import ./home-manager { inherit pkgs; }; - - in the '~/.config/nixpkgs/config.nix' package override - section. Attempting to use the above override will now - result in the error "cannot coerce a set to a string". - - To resolve this please delete the override from the - 'config.nix' file and either link the Home Manager overlay - - $ ln -s ~/.config/nixpkgs/home-manager/overlay.nix \ - ~/.config/nixpkgs/overlays/home-manager.nix - - or add - - programs.home-manager.enable = true; - - to your Home Manager configuration. The latter is - recommended as the home-manager tool then is updated - automatically whenever you do a switch. - ''; - } - - { - time = "2017-10-23T23:26:17+00:00"; - message = '' - A new module is available: 'nixpkgs'. - - Like the identically named NixOS module, this allows you to - set Nixpkgs options and define Nixpkgs overlays. Note, the - changes you make here will not automatically apply to Nix - commands run outside Home Manager. - ''; - } - - { - time = "2017-10-28T23:39:55+00:00"; - message = '' - A new module is available: 'xdg'. - - If enabled, this module allows configuration of the XDG base - directory paths. - - Whether the module is enabled or not, it also offers the - option 'xdg.configFile', which acts much like 'home.file' - except the target path is relative to the XDG configuration - directory. That is, unless `XDG_CONFIG_HOME` is configured - otherwise, the assignment - - xdg.configFile.hello.text = "hello world"; - - will result in a file '$HOME/.config/hello'. - - Most modules in Home Manager that previously were hard coded - to write configuration to '$HOME/.config' now use this - option and will therefore honor the XDG configuration - directory. - ''; - } - - { - time = "2017-10-31T11:46:07+00:00"; - message = '' - A new window manager module is available: 'xsession.windowManager.i3'. - ''; - } - - { - time = "2017-11-12T00:18:59+00:00"; - message = '' - A new program module is available: 'programs.neovim'. - ''; - } - - { - time = "2017-11-14T19:56:49+00:00"; - condition = with config.xsession.windowManager; ( - i3.enable && i3.config != null && i3.config.startup != [] - ); - message = '' - A new 'notification' option was added to - xsession.windowManager.i3.startup submodule. - - Startup commands are now executed with the startup-notification - support enabled by default. Please, set 'notification' to false - where --no-startup-id option is necessary. - ''; - } - - { - time = "2017-11-17T10:36:10+00:00"; - condition = config.xsession.windowManager.i3.enable; - message = '' - The i3 window manager module has been extended with the following options: - - i3.config.keycodebindings - i3.config.window.commands - i3.config.window.hideEdgeBorders - i3.config.focus.mouseWarping - ''; - } - - { - time = "2017-11-26T21:57:23+00:00"; - message = '' - Two new modules are available: - - 'services.kbfs' and 'services.keybase' - ''; - } - - { - time = "2017-12-07T22:23:11+00:00"; - message = '' - A new module is available: 'services.parcellite' - ''; - } - - { - time = "2017-12-11T17:23:12+00:00"; - condition = config.home.activation ? reloadSystemd; - message = '' - The Boolean option 'systemd.user.startServices' is now - available. When enabled the current naive systemd unit - reload logic is replaced by a more sophisticated one that - attempts to automatically start, stop, and restart units as - necessary. - ''; - } - - { - time = "2018-02-02T11:15:00+00:00"; - message = '' - A new program configuration is available: 'programs.mercurial' - ''; - } - - { - time = "2018-02-03T10:00:00+00:00"; - message = '' - A new module is available: 'services.stalonetray' - ''; - } - - { - time = "2018-02-04T22:58:49+00:00"; - condition = config.xsession.enable; - message = '' - A new option 'xsession.pointerCursor' is now available. It - allows specifying the pointer cursor theme and size. The - settings will be applied in the xsession, Xresources, and - GTK configurations. - ''; - } - - { - time = "2018-02-06T20:23:34+00:00"; - message = '' - It is now possible to use Home Manager as a NixOS module. - This allows you to prepare user environments from the system - configuration file, which often is more convenient than - using the 'home-manager' tool. It also opens up additional - possibilities, for example, to automatically configure user - environments in NixOS declarative containers or on systems - deployed through NixOps. - - This feature should be considered experimental for now and - some critial limitations apply. For example, it is currently - not possible to use 'nixos-rebuild build-vm' when using the - Home Manager NixOS module. That said, it should be - reasonably robust and stable for simpler use cases. - - To make Home Manager available in your NixOS system - configuration you can add - - imports = [ - "''${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/master.tar.gz}/nixos" - ]; - - to your 'configuration.nix' file. This will introduce a new - NixOS option called 'home-manager.users' whose type is an - attribute set mapping user names to Home Manager - configurations. - - For example, a NixOS configuration may include the lines - - users.users.eve.isNormalUser = true; - home-manager.users.eve = { - home.packages = [ pkgs.atool pkgs.httpie ]; - programs.bash.enable = true; - }; - - and after a 'nixos-rebuild switch' the user eve's - environment should include a basic Bash configuration and - the packages atool and httpie. - - More detailed documentation on the intricacies of this new - feature is slowly forthcoming. - ''; - } - - { - time = "2018-02-19T21:45:26+00:00"; - message = '' - A new module is available: 'programs.pidgin' - ''; - } - - { - time = "2018-03-04T06:54:26+00:00"; - message = '' - A new module is available: 'services.unclutter' - ''; - } - - { - time = "2018-03-07T21:38:27+00:00"; - message = '' - A new module is available: 'programs.fzf'. - ''; - } - - { - time = "2018-03-25T06:49:57+00:00"; - condition = with config.programs.ssh; enable && matchBlocks != {}; - message = '' - Options set through the 'programs.ssh' module are now placed - at the end of the SSH configuration file. This was done to - make it possible to override global options such as - 'ForwardAgent' or 'Compression' inside a host match block. - - If you truly need to override an SSH option across all match - blocks then the new option - - programs.ssh.extraOptionOverrides - - can be used. - ''; - } - - { - time = "2018-04-19T07:42:01+00:00"; - message = '' - A new module is available: 'programs.autorandr'. - ''; - } - - { - time = "2018-04-19T15:44:55+00:00"; - condition = config.programs.git.enable; - message = '' - A new option 'programs.git.includes' is available. Additional - Git configuration files may be included via - - programs.git.includes = [ - { path = "~/path/to/config.inc"; } - ]; - - or conditionally via - - programs.git.includes = [ - { path = "~/path/to/config.inc"; condition = "gitdir:~/src/"; } - ]; - - and the corresponding '[include]' or '[includeIf]' sections will be - appended to the main Git configuration file. - ''; - } - - { - time = "2018-05-01T20:49:31+00:00"; - message = '' - A new module is available: 'services.mbsync'. - ''; - } - { - time = "2018-05-03T12:34:47+00:00"; - message = '' - A new module is available: 'services.flameshot'. - ''; - } - - { - time = "2018-05-18T18:34:15+00:00"; - message = '' - A new module is available: 'qt' - - At the moment this module allows you to set up Qt to use the - GTK+ theme, and not much else. - ''; - } - - { - time = "2018-06-05T01:36:45+00:00"; - message = '' - A new module is available: 'services.kdeconnect'. - ''; - } - - { - time = "2018-06-09T09:11:59+00:00"; - message = '' - A new module is available: `programs.newsboat`. - ''; - } - - { - time = "2018-07-01T14:33:15+00:00"; - message = '' - A new module is available: 'accounts.email'. - - As the name suggests, this new module offers a number of - options for configuring email accounts. This, for example, - includes the email address and owner's real name but also - server settings for IMAP and SMTP. - - The intent is to have a central location for account - specific configuration that other modules can use. - - Note, this module is still somewhat experimental and its - structure should not be seen as final. Feedback is greatly - appreciated, both positive and negative. - ''; - } - - { - time = "2018-07-01T16:07:04+00:00"; - message = '' - A new module is available: 'programs.mbsync'. - ''; - } - - { - time = "2018-07-01T16:12:20+00:00"; - message = '' - A new module is available: 'programs.notmuch'. - ''; - } - - { - time = "2018-07-07T15:48:56+00:00"; - message = '' - A new module is available: 'xsession.windowManager.awesome'. - ''; - } - - { - time = "2018-07-18T20:14:11+00:00"; - message = '' - A new module is available: 'services.mpd'. - ''; - } - - { - time = "2018-07-31T13:33:39+00:00"; - message = '' - A new module is available: 'services.status-notifier-watcher'. - ''; - } - - { - time = "2018-07-31T13:47:06+00:00"; - message = '' - A new module is available: 'programs.direnv'. - ''; - } - - { - time = "2018-08-17T20:30:14+00:00"; - message = '' - A new module is available: 'programs.fish'. - ''; - } - - { - time = "2018-08-18T19:03:42+00:00"; - condition = config.services.gpg-agent.enable; - message = '' - A new option is available: 'services.gpg-agent.extraConfig'. - - Extra lines may be appended to $HOME/.gnupg/gpg-agent.conf - using this option. - ''; - } - - { - time = "2018-08-19T20:46:09+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new modules is available: 'programs.chromium'. - ''; - } - - { - time = "2018-08-20T20:27:26+00:00"; - message = '' - A new module is available: 'programs.msmtp'. - ''; - } - - { - time = "2018-08-21T20:13:50+00:00"; - message = '' - A new module is available: 'services.pasystray'. - ''; - } - - { - time = "2018-08-29T20:27:04+00:00"; - message = '' - A new module is available: 'programs.offlineimap'. - ''; - } - - { - time = "2018-09-18T21:25:14+00:00"; - message = '' - A new module is available: 'programs.taskwarrior'. - ''; - } - - { - time = "2018-09-18T21:43:54+00:00"; - message = '' - A new module is available: 'programs.zathura'. - ''; - } - - { - time = "2018-09-20T19:26:40+00:00"; - message = '' - A new module is available: 'programs.noti'. - ''; - } - - { - time = "2018-09-20T22:10:45+00:00"; - message = '' - A new module is available: 'programs.go'. - ''; - } - - { - time = "2018-09-27T17:48:08+00:00"; - message = '' - A new module is available: 'programs.obs-studio'. - ''; - } - - { - time = "2018-09-28T21:38:48+00:00"; - message = '' - A new module is available: 'programs.alot'. - ''; - } - - { - time = "2018-10-20T09:30:57+00:00"; - message = '' - A new module is available: 'programs.urxvt'. - ''; - } - - { - time = "2018-11-13T23:08:03+00:00"; - message = '' - A new module is available: 'programs.tmux'. - ''; - } - - { - time = "2018-11-18T18:55:15+00:00"; - message = '' - A new module is available: 'programs.astroid'. - ''; - } - - { - time = "2018-11-18T21:41:51+00:00"; - message = '' - A new module is available: 'programs.afew'. - ''; - } - - { - time = "2018-11-19T00:40:34+00:00"; - message = '' - A new nix-darwin module is available. Use it the same way the NixOS - module is used. A major limitation is that Home Manager services don't - work, as they depend explicitly on Linux and systemd user services. - However, 'home.file' and 'home.packages' do work. Everything else is - untested at this time. - ''; - } - - { - time = "2018-11-24T16:22:19+00:00"; - message = '' - A new option 'home.stateVersion' is available. Its function - is much like the 'system.stateVersion' option in NixOS. - - Briefly, the state version indicates a stable set of option - defaults. In the future, whenever Home Manager changes an - option default in a way that may cause program breakage it - will do so only for the unstable state version, currently - 19.03. Once 19.03 becomes the stable version only backwards - compatible changes will be made and 19.09 becomes the - unstable state version. - - The default value for this option is 18.09 but it may still - be a good idea to explicitly add - - home.stateVersion = "18.09"; - - to your Home Manager configuration. - ''; - } - - { - time = "2018-11-25T22:10:15+00:00"; - message = '' - A new module is available: 'services.nextcloud-client'. - ''; - } - - { - time = "2018-11-25T22:55:12+00:00"; - message = '' - A new module is available: 'programs.vscode'. - ''; - } - - { - time = "2018-12-04T21:54:38+00:00"; - condition = config.programs.beets.settings != {}; - message = '' - A new option 'programs.beets.enable' has been added. - Starting with state version 19.03 this option defaults to - false. For earlier versions it defaults to true if - 'programs.beets.settings' is non-empty. - - It is recommended to explicitly add - - programs.beets.enable = true; - - to your configuration. - ''; - } - - { - time = "2018-12-12T21:02:05+00:00"; - message = '' - A new module is available: 'programs.jq'. - ''; - } - - { - time = "2018-12-24T16:26:16+00:00"; - message = '' - A new module is available: 'dconf'. - - Note, on NixOS you may need to add - - services.dbus.packages = with pkgs; [ dconf ]; - - to the system configuration for this module to work as - expected. In particular if you get the error message - - The name ca.desrt.dconf was not provided by any .service files - - when activating your Home Manager configuration. - ''; - } - - { - time = "2018-12-28T12:32:30+00:00"; - message = '' - A new module is available: 'programs.opam'. - ''; - } - - { - time = "2019-01-18T00:21:56+00:00"; - message = '' - A new module is available: 'programs.matplotlib'. - ''; - } - - { - time = "2019-01-26T13:20:37+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.xembed-sni-proxy'. - ''; - } - - { - time = "2019-01-28T23:36:10+00:00"; - message = '' - A new module is available: 'programs.irssi'. - ''; - } - - { - time = "2019-02-09T14:09:58+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.emacs'. - - This module provides a user service that runs the Emacs - configured in - - programs.emacs - - as an Emacs daemon. - ''; - } - - { - time = "2019-02-16T20:33:56+00:00"; - condition = hostPlatform.isLinux; - message = '' - When using Home Manager as a NixOS submodule it is now - possible to install packages using the NixOS - - users.users..packages - - option. This is enabled by adding - - home-manager.useUserPackages = true; - - to your NixOS system configuration. This mode of operation - is necessary if you want to use 'nixos-rebuild build-vm'. - ''; - } - - { - time = "2019-02-17T21:11:24+00:00"; - message = '' - A new module is available: 'programs.keychain'. - ''; - } - - { - time = "2019-02-24T00:32:23+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new service is available: 'services.mpdris2'. - ''; - } - - { - time = "2019-03-19T22:56:20+00:00"; - message = '' - A new module is available: 'programs.bat'. - ''; - } - - { - time = "2019-03-19T23:07:34+00:00"; - message = '' - A new module is available: 'programs.lsd'. - ''; - } - - { - time = "2019-04-09T20:10:22+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.xcape'. - ''; - } - - { - time = "2019-04-11T22:50:10+00:00"; - condition = hostPlatform.isLinux; - message = '' - The type used for the systemd unit options under - - systemd.user.services, systemd.user.sockets, etc. - - has been changed to offer more robust merging of configurations. - - If you don't override values within systemd units then you are not - affected by this change. Unfortunately, if you do override unit values - you may encounter errors due to this change. - - In particular, if you get an error saying that a "unique option" is - "defined multiple times" then you need to use 'lib.mkForce'. For - example, - - systemd.user.services.foo.Service.ExecStart = "/foo/bar"; - - becomes - - systemd.user.services.foo.Service.ExecStart = lib.mkForce "/foo/bar"; - - We had to make this change because the old merging was causing too - many confusing situations for people. Apologies for potentially - breaking your configuration! - ''; - } - - { - time = "2019-04-14T15:35:16+00:00"; - message = '' - A new module is available: 'programs.skim'. - ''; - } - - { - time = "2019-04-22T12:43:20+00:00"; - message = '' - A new module is available: 'programs.alacritty'. - ''; - } - - { - time = "2019-04-26T22:53:48+00:00"; - condition = config.programs.vscode.enable; - message = '' - A new module is available: 'programs.vscode.haskell'. - - Enable to add Haskell IDE Engine and syntax highlighting - support to your VSCode. - ''; - } - - { - time = "2019-05-04T23:56:39+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.rsibreak'. - ''; - } - - { - time = "2019-05-07T20:49:29+00:00"; - message = '' - A new module is available: 'programs.mpv'. - ''; - } - - { - time = "2019-05-30T17:49:29+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.xsuspender'. - ''; - } - - { - time = "2019-06-03T21:47:10+00:00"; - message = '' - A new module is available: 'programs.gpg'. - ''; - } - - { - time = "2019-06-09T12:19:18+00:00"; - message = '' - Collisions between unmanaged and managed files can now be - automatically resolved by moving the target file to a new - path instead of failing the switch operation. To enable - this, use the new '-b' command line argument. For example, - - home-manager -b bck switch - - where 'bck' is the suffix to give the moved file. In this - case a colliding file 'foo.conf' will be moved to - 'foo.conf.bck'. - ''; - } - - { - time = "2019-06-19T17:49:29+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: `services.getmail`. - ''; - } - - { - time = "2019-07-02T09:27:56+00:00"; - message = '' - A new module is available: 'programs.broot'. - ''; - } - - { - time = "2019-07-17T19:30:29+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.taskwarrior-sync'. - ''; - } - - { - time = "2019-07-17T20:05:29+00:00"; - message = '' - A new module is available: 'programs.kakoune'. - ''; - } - - { - time = "2019-08-08T11:49:35+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.hound'. - ''; - } - - { - time = "2019-08-17T12:24:58+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.muchsync'. - ''; - } - - { - time = "2019-08-18T14:22:41+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.dwm-status'. - ''; - } - - { - time = "2019-08-28T10:18:07+00:00"; - condition = config.programs.vim.enable; - message = '' - The 'programs.vim.plugins' option now accepts packages. - Specifying them as strings is deprecated. - ''; - } - - { - time = "2019-09-17T19:33:49+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.sxhkd'. - ''; - } - - { - time = "2019-09-26T21:05:24+00:00"; - message = '' - A new module is available: 'programs.starship'. - ''; - } - - { - time = "2019-09-26T21:47:13+00:00"; - message = '' - A new module is available: 'programs.rtorrent'. - ''; - } - - { - time = "2019-11-04T20:56:29+00:00"; - message = '' - A new module is available: 'programs.pazi'. - ''; - } - - { - time = "2019-11-05T21:54:04+00:00"; - condition = config.programs.zsh.enable; - message = '' - The 'programs.zsh.history.path' option behavior and the - default value has changed for state version 20.03 and above. - - Specifically, '$HOME' will no longer be prepended to the - option value, which allows specifying absolute paths (e.g. - using the xdg module). Also, the default value is fixed to - '$HOME/.zsh_history' and 'dotDir' path is not prepended to - it anymore. - ''; - } - - { - time = "2019-11-17T18:47:40+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.lorri'. - ''; - } - - { - time = "2019-11-24T17:46:57+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.spotifyd'. - ''; - } - - { - time = "2019-11-29T21:18:48+00:00"; - message = '' - A new module is available: 'programs.password-store'. - ''; - } - - { - time = "2019-11-29T21:18:48+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.password-store-sync'. - ''; - } - - { - time = "2019-11-29T22:46:49+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.unison'. - ''; - } - - { - time = "2019-12-01T22:10:23+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'xdg.mime'. - - If enabled, which it is by default, this module will create - the XDG mime database and desktop file database caches from - programs installed via Home Manager. - ''; - } - - { - time = "2019-12-08T19:48:26+00:00"; - message = '' - A new module is available: 'programs.readline'. - ''; - } - - { - time = "2020-01-11T11:49:51+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.cbatticon'. - ''; - } - - { - time = "2020-01-26T12:42:33+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'xsession.windowManager.bspwm'. - ''; - } - - { - time = "2020-01-26T12:49:40+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.grobi'. - ''; - } - - { - time = "2020-01-26T19:37:57+00:00"; - message = '' - A new module is available: 'programs.neomutt'. - ''; - } - - { - time = "2020-02-23T10:19:48+00:00"; - message = '' - A new module is available: 'programs.kitty'. - ''; - } - - { - time = "2020-02-26T21:20:55+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'wayland.windowManager.sway' - ''; - } - - { - time = "2020-03-04T18:55:03+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'programs.abook' - ''; - } - - { - time = "2020-03-07T11:43:26+00:00"; - condition = config.programs.fish.enable; - message = '' - The option 'programs.fish.functions' has been reworked in - order to support all available flags, such as - '--description', '--on-event', and more. - ''; - } - - { - time = "2020-03-07T13:11:43+00:00"; - condition = hostPlatform.isLinux; - message = '' - The NixOS module has a new option: 'home-manager.useGlobalPkgs'. - - This enables using the system configuration's 'pkgs' - argument in Home Manager. - - To learn more, see the installation section of the manual - - https://nix-community.github.io/home-manager/#sec-install-nixos-module - ''; - } - - { - time = "2020-03-07T14:12:50+00:00"; - message = '' - A new module is available: 'programs.lieer'. - ''; - } - - { - time = "2020-03-07T14:12:50+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.lieer'. - ''; - } - - { - time = "2020-03-15T16:55:28+00:00"; - condition = config.programs.firefox.enable; - message = '' - In anticipation of Firefox dropping support for extension - sideloading[1], we now install extensions directly to - Firefox profiles managed through Home Manager's - - 'programs.firefox.profiles' - - option. - - Unfortunately this will most likely trigger an "Existing - file is in the way" error when activating your configuration - since Firefox keeps a copy of the add-on in the location - Home Manager wants to overwrite. If this is the case, remove - the listed '.xpi' files and try again. - - This change also means that extensions installed through - Home Manager may disappear from unmanaged profiles in future - Firefox releases. - - [1] https://blog.mozilla.org/addons/2019/10/31/firefox-to-discontinue-sideloaded-extensions/ - ''; - } - - { - time = "2020-03-17T21:56:26+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.keynav'. - ''; - } - - { - time = "2020-03-24T22:17:20+00:00"; - condition = config.services.compton.enable; - message = '' - The 'services.compton' module has been deprecated and - instead the new module 'services.picom' should be used. This - is because Nixpkgs no longer packages compton, and instead - packages the (mostly) compatible fork called picom. - - The 'services.compton' and 'services.picom' modules have a - few differences: - - - 'services.picom' has a new 'experimentalBackends' - option. - - - 'vSync' is now a boolean value on 'services.picom', as - opposed to the string in 'services.compton'. - - Migrating to the new picom service is simple - just change - all references to 'services.compton' to 'services.picom', - and adhere to the above changes. - - The deprecated 'services.compton' will eventually be removed - in the future. Please update your configurations to use - 'services.picom' as soon as possible. - ''; - } - - { - time = "2020-04-08T09:33:05+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'targets.genericLinux'. - - When enabled, this module will configure various settings - and environment variables to make Home Manager and programs - installed through Nix work better on GNU/Linux distributions - other than NixOS. - - It should not be enabled if your Home Manager configuration - is deployed on a NixOS host. - ''; - } - - { - time = "2020-04-08T11:51:15+00:00"; - message = '' - A new module is available: 'programs.qutebrowser' - ''; - } - - { - time = "2020-04-09T09:19:38+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.mako' - ''; - } - - { - time = "2020-04-23T19:45:26+00:00"; - message = '' - A new module is available: 'programs.lf' - ''; - } - - { - time = "2020-04-26T13:46:28+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.pulseeffects' - ''; - } - - { - time = "2020-05-03T11:13:07+00:00"; - message = '' - A new module is available: 'programs.i3status' - ''; - } - - { - time = "2020-05-03T11:21:42+00:00"; - message = '' - A new module is available: 'programs.aria2' - ''; - } - - { - time = "2020-05-04T21:19:43+00:00"; - condition = config.programs.git.enable; - message = '' - The Git module now supports the 'delta' syntax highlighter. - - It can be enabled through the option 'programs.git.delta.enable'. - ''; - } - - { - time = "2020-05-12T20:09:54+00:00"; - message = '' - A new module is available: 'programs.dircolors' - ''; - } - - { - time = "2020-05-26T17:13:58+00:00"; - message = '' - A new module is available: 'programs.zoxide' - ''; - } - - { - time = "2020-06-03T17:46:11+00:00"; - condition = config.programs.ssh.enable; - message = '' - The ssh module now supports the 'ServerAliveCountMax' option - both globally through - - programs.ssh.serverAliveCountMax - - and per match blocks - - programs.ssh.matchBlocks..serverAliveCountMax - ''; - } - - { - time = "2020-06-11T18:06:37+00:00"; - condition = hostPlatform.isLinux && config.services.emacs.enable; - message = '' - The Emacs service now supports systemd socket activation. - - It can be enabled through the option 'services.emacs.socketActivation.enable'. - ''; - } - - { - time = "2020-06-12T17:48:01+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.clipmenu' - ''; - } - - { - time = "2020-06-12T07:08:09+00:00"; - condition = config.programs.bash.enable; - message = '' - A new module is available: 'programs.powerline-go' - ''; - } - - { - time = "2020-06-14T13:30:19+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'service.fluidsynth' - ''; - } - - { - time = "2020-06-17T22:17:52+00:00"; - condition = config.programs.git.enable; - message = '' - Since May 1, 2020 string values in Git configurations are - automatically escaped. If you have any manually escaped characters, - then you may need to restore them to their unescaped form to avoid - double escaping. - - In other words, if you now have something along the lines of - - programs.git.aliases.hello = '''"!echo $'Hello\\nWorld'"'''; - - you must replace it by the unescaped form - - programs.git.aliases.hello = "!echo $'Hello\nWorld'"; - - Apologies for the belated notification! - ''; - } - - { - time = "2020-06-23T20:06:39+00:00"; - message = '' - A new module is available: 'programs.ne' - ''; - } - - { - time = "2020-07-24T15:03:11+00:00"; - message = '' - A new module is available: 'programs.nushell'. - ''; - } - - { - time = "2020-07-25T21:04:59+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.dropbox'. - ''; - } - - { - time = "2020-08-13T22:15:27+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'programs.waybar' - ''; - } - - { - time = "2020-08-14T22:44:20+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.kanshi' - ''; - } - - { - time = "2020-08-25T22:14:01+00:00"; - message = '' - A new module is available: 'programs.mcfly' - ''; - } - - { - time = "2020-09-01T18:38:18+00:00"; - message = '' - A new module is available: 'programs.ncmpcpp' - ''; - } - - { - time = "2020-09-11T10:06:47+00:00"; - condition = hostPlatform.isLinux && config.targets.genericLinux.enable; - message = '' - A new option 'targets.genericLinux.extraXdgDataDirs' is available - to setup the user environment with the OS's data files. - - This is useful for example to get Bash completion for - 'systemctl' which shouldn't be installed through Home Manager. - - This is also useful to have non Home Manager applications - available in menus. - ''; - } - - { - time = "2020-09-09T06:54:59+00:00"; - condition = config.programs.man.enable; - message = '' - A new option 'programs.man.generateCaches' was added to - support the apropos command. - ''; - } - - { - time = "2020-09-22T21:03:28+00:00"; - message = '' - A new module is available: 'programs.pet'. - ''; - } - - { - time = "2020-09-29T21:21:44+00:00"; - message = '' - A new module is available: 'programs.mu'. - ''; - } - - { - time = "2020-10-08T21:28:16+00:00"; - message = '' - A new module is available: 'programs.autojump' - - The option `programs.bash.enableAutojump` is deprecated and this new - module should be used instead. - ''; - } - - { - time = "2020-10-12T00:12:23+00:00"; - condition = config.programs.zsh.enable; - message = '' - A new zsh submodule is available: 'programs.zsh.prezto'. - ''; - } - - { - time = "2020-10-22T21:10:38+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.gammastep'. - ''; - } - - { - time = "2020-10-22T21:30:42+00:00"; - message = '' - A new module is available: 'programs.gh'. - ''; - } - - { - time = "2020-11-01T11:17:02+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.caffeine'. - ''; - } - - { - time = "2020-11-05T22:59:21+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'programs.i3status-rust'. - ''; - } - - { - time = "2020-11-14T13:02:40+00:00"; - condition = config.programs.broot.enable; - message = '' - The 'programs.broot.verbs' option is now a list rather than an - attribute set. To migrate, move the keys of the attrset into the - list items' 'invocation' keys. For example, - - programs.broot.verbs = { - "p" = { execution = ":parent"; }; - }; - - becomes - - programs.broot.verbs = [ - { - invocation = "p"; - execution = ":parent"; - } - ]; - ''; - } - - { - time = "2020-12-01T20:46:14+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.wlsunset'. - ''; - } - - { - time = "2020-12-09T22:34:33+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.pbgopy'. - ''; - } - - { - time = "2020-12-18T22:22:25+00:00"; - message = '' - A new module is available: 'programs.rofi.pass'. - ''; - } - - { - time = "2020-12-31T14:16:47+00:00"; - message = '' - A new module is available: 'programs.octant'. - ''; - } - - { - time = "2021-01-01T08:51:11+00:00"; - condition = config.pam.sessionVariables != {}; - message = '' - The option 'pam.sessionVariables' will be deprecated in the future. - This is due to PAM 1.5.0 deprecating reading of the user environment. - The deprecation will not take place immediately but you may wish to - consider alternatives to PAM environment variables. - - See - - https://github.com/nix-community/home-manager/issues/1691 - - for discussion. - ''; - } - - { - time = "2021-01-02T07:49:15+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.plan9port'. - ''; - } - - { - time = "2021-01-31T11:23:30+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.playerctld'. - ''; - } - - { - time = "2021-01-28T15:07:34+00:00"; - condition = hostPlatform.isDarwin; - message = '' - New options are available for 'targets.darwin': - - - targets.darwin.defaults - - This adds options for configuring macOS through the defaults(1) - system. - - - targets.darwin.keybindings - - This adds options for configuring the default keybindings for macOS - text fields. - - - targets.darwin.search - - This adds options for configuring the default search engine for - macOS. - ''; - } - - { - time = "2021-02-04T22:28:26+00:00"; - message = '' - A new module is available: 'programs.sbt'. - ''; - } - - { - time = "2021-02-20T00:00:00+00:00"; - condition = config.services.polybar.enable; - message = '' - The polybar configuration can now be written in a more nix-friendly format. - The new 'services.polybar.settings' option is an alternative to - 'services.polybar.config' that supports nested keys and converts nix - lists to polybar-style 'foo-0, foo-1, ...' lists. - ''; - } - - { - time = "2021-02-25T22:36:43+00:00"; - condition = config.programs.git.enable && any (msmtp: msmtp.enable) - (mapAttrsToList (name: account: account.msmtp) - config.accounts.email.accounts); - message = '' - Git will now defer to msmtp for sending emails if - 'accounts.email.accounts..msmtp.enable' is true. - ''; - } - - { - time = "2021-03-03T22:16:05+00:00"; - message = '' - Home Manager now respects the 'NO_COLOR' environment variable as per - https://no-color.org/. - ''; - } - - { - time = "2021-03-29T21:05:50+00:00"; - message = '' - Configuration specified by 'programs.dircolors.extraConfig' is now - applied after 'programs.dircolors.settings'. - ''; - } - - { - time = "2021-04-11T20:44:54+00:00"; - message = '' - A new module is available: 'programs.exa'. - ''; - } - - { - time = "2021-04-23T10:00:00+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.pass-secret-service'. - ''; - } - - { - time = "2021-04-26T07:00:00+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new service is available: 'services.poweralertd'. - ''; - } - - { - time = "2021-04-28T10:00:00+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new service is available: 'services.mpris-proxy'. - ''; - } - - { - time = "2021-04-28T12:00:00+00:00"; - message = '' - A new module is available: 'programs.topgrade'. - ''; - } - - { - time = "2021-04-30T22:05:01+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new service is available: 'services.barrier'. - ''; - } - - { - time = "2021-05-01T15:16:08+00:00"; - message = '' - A new module is available: 'programs.lazygit'. - ''; - } - - { - time = "2021-04-27T00:00:00+00:00"; - message = '' - A new module is available: 'programs.ncspot'. - ''; - } - - { - time = "2021-05-02T11:22:42+00:00"; - condition = hostPlatform.isLinux && config.services.sxhkd.enable; - message = '' - The sxhkd service now is started using 'xsession.initExtra', - therefore this module loses systemd service management capabilities - and works only if Home Manager starts the user X session. - - The option 'services.sxhkd.extraPath' has been deprecated. - ''; - } - - { - time = "2021-05-06T20:47:37+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'services.etesync-dav' - ''; - } - - { - time = "2021-05-06T11:01:41+00:00"; - message = '' - A new module is available: 'programs.nix-index'. - ''; - } - - { - time = "2021-05-10T18:50:07+00:00"; - message = '' - A new module is available: 'xdg.systemDirs'. Options are: - - - xdg.systemDirs.config - - Extra directory names to add to $XDG_CONFIG_DIRS in the user - session. - - - xdg.systemDirs.data - - Extra directory names to add to $XDG_DATA_DIRS in the user - session. - - These variables are visible in both systemd user services and - login shells. - ''; - } - - { - time = "2021-05-18T12:22:42+00:00"; - condition = config.services.syncthing != {}; - message = '' - Setting 'services.syncthing.tray' as a boolean will be deprecated in - the future. - - This is to make the syncthing tray package configurable, with - `services.syncthing.tray.package`, following QSyncthingTray becoming - no longer actively maintained. The default syncthing tray package has - also changed to https://github.com/Martchus/syncthingtray. To - continue as before, set `services.syncthing.tray.enable`. - - See - - https://github.com/nix-community/home-manager/pull/1257 - - for discussion. - ''; - } - - { - time = "2021-05-18T20:28:50+00:00"; - condition = hostPlatform.isLinux; - message = '' - A new module is available: 'programs.foot'. - ''; - } - - { - time = "2021-05-23T18:31:38+00:00"; - condition = config.programs.mbsync.enable; - message = '' - mbsync channels no longer accepts the masterPattern or slavePattern - attribute keys. This is due to an upstream change. - They have been renamed: masterPattern -> farPattern, and - slavePattern -> nearPattern. - This is a stateful change, where the database file(s) used to keep track - of mail are silently upgraded once you upgrade both your configuration file - and the mbsync program. - - Note that this change is non-reversible, meaning once you choose to switch to - near/farPattern, you can no longer use your previous slave/masterPattern - configuration file. - ''; - } - - { - time = "2021-05-10T20:41:44+00:00"; - message = '' - A new module is available: 'programs.rbw'. - ''; - } - - { - time = "2021-05-30T15:22:10+00:00"; - message = '' - A new module is available: 'programs.piston-cli'. - ''; - } - { time = "2021-06-02T04:24:10+00:00"; condition = hostPlatform.isLinux; @@ -2464,6 +539,21 @@ in A new module is available: 'services.fusuma'. ''; } + + { + time = "2022-05-02T20:55:46+00:00"; + message = '' + A new module is available: 'programs.tealdeer'. + ''; + } + + { + time = "2022-05-18T22:09:45+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.mopidy'. + ''; + } ]; }; } diff --git a/infra/libkookie/home-manager/modules/misc/specialization.nix b/infra/libkookie/home-manager/modules/misc/specialization.nix new file mode 100644 index 00000000000..67e593e2c4d --- /dev/null +++ b/infra/libkookie/home-manager/modules/misc/specialization.nix @@ -0,0 +1,71 @@ +{ config, extendModules, lib, ... }: + +with lib; + +{ + options.specialization = mkOption { + type = types.attrsOf (types.submodule { + options = { + configuration = mkOption { + type = let + stopRecursion = { specialization = mkOverride 0 { }; }; + extended = extendModules { modules = [ stopRecursion ]; }; + in extended.type; + default = { }; + visible = "shallow"; + description = '' + Arbitrary Home Manager configuration settings. + ''; + }; + }; + }); + default = { }; + description = '' + A set of named specialized configurations. These can be used to extend + your base configuration with additional settings. For example, you can + have specializations named light and dark + that applies light and dark color theme configurations. + + + + Note, this is an experimental option for now and you therefore have to + activate the specialization by looking up and running the activation + script yourself. Note, running the activation script will create a new + Home Manager generation. + + + + For example, to activate the dark specialization. You can + first look up your current Home Manager generation by running + + + $ home-manager generations | head -1 + 2022-05-02 22:49 : id 1758 -> /nix/store/jy…ac-home-manager-generation + + + then run + + + $ /nix/store/jy…ac-home-manager-generation/specialization/dark/activate + Starting Home Manager activation + … + + + + + WARNING! Since this option is experimental, the activation process may + change in backwards incompatible ways. + ''; + }; + + config = mkIf (config.specialization != { }) { + home.extraBuilderCommands = let + link = n: v: + let pkg = v.configuration.home.activationPackage; + in "ln -s ${pkg} $out/specialization/${n}"; + in '' + mkdir $out/specialization + ${concatStringsSep "\n" (mapAttrsToList link config.specialization)} + ''; + }; +} diff --git a/infra/libkookie/home-manager/modules/misc/version.nix b/infra/libkookie/home-manager/modules/misc/version.nix index 9673c0ffa5a..c56b55ba233 100644 --- a/infra/libkookie/home-manager/modules/misc/version.nix +++ b/infra/libkookie/home-manager/modules/misc/version.nix @@ -15,6 +15,7 @@ with lib; "21.05" "21.11" "22.05" + "22.11" ]; default = "18.09"; description = '' diff --git a/infra/libkookie/home-manager/modules/misc/xdg-desktop-entries.nix b/infra/libkookie/home-manager/modules/misc/xdg-desktop-entries.nix index f563f49d871..e5038c3f7f6 100644 --- a/infra/libkookie/home-manager/modules/misc/xdg-desktop-entries.nix +++ b/infra/libkookie/home-manager/modules/misc/xdg-desktop-entries.nix @@ -152,7 +152,7 @@ let }; # Required for the assertions - # TODO: Remove me once `mkRemovedOptionModule` works correctly with submodules + # TODO: Remove me once https://github.com/NixOS/nixpkgs/issues/96006 is fixed assertions = mkOption { type = types.listOf types.unspecified; default = [ ]; diff --git a/infra/libkookie/home-manager/modules/modules.nix b/infra/libkookie/home-manager/modules/modules.nix index 462575f471b..99b1b756a6d 100644 --- a/infra/libkookie/home-manager/modules/modules.nix +++ b/infra/libkookie/home-manager/modules/modules.nix @@ -15,6 +15,7 @@ let modules = [ ./accounts/email.nix + ./config/home-cursor.nix ./config/i18n.nix ./files.nix ./home-environment.nix @@ -30,6 +31,7 @@ let ./misc/numlock.nix ./misc/pam.nix ./misc/qt.nix + ./misc/specialization.nix ./misc/submodule-support.nix ./misc/tmpfiles.nix ./misc/version.nix @@ -148,7 +150,9 @@ let ./programs/sqls.nix ./programs/ssh.nix ./programs/starship.nix + ./programs/swaylock.nix ./programs/taskwarrior.nix + ./programs/tealdeer.nix ./programs/terminator.nix ./programs/termite.nix ./programs/texlive.nix @@ -209,6 +213,7 @@ let ./services/lorri.nix ./services/mako.nix ./services/mbsync.nix + ./services/mopidy.nix ./services/mpd.nix ./services/mpdris2.nix ./services/mpd-discord-rpc.nix @@ -270,7 +275,6 @@ let ./systemd.nix ./targets/darwin ./targets/generic-linux.nix - ./xcursor.nix ./xresources.nix ./xsession.nix ./misc/nix.nix diff --git a/infra/libkookie/home-manager/modules/po/fr.po b/infra/libkookie/home-manager/modules/po/fr.po index 6195b2f4f97..c538ddc5dd8 100644 --- a/infra/libkookie/home-manager/modules/po/fr.po +++ b/infra/libkookie/home-manager/modules/po/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2022-03-26 15:08+0100\n" -"PO-Revision-Date: 2022-03-26 23:57+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2022-05-18 23:12+0000\n" +"Last-Translator: Naïm Camille Favier \n" "Language-Team: French \n" "Language: fr\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.12-dev\n" +"X-Generator: Weblate 4.13-dev\n" #: modules/files.nix:233 msgid "Creating home file links in %s" @@ -53,11 +53,11 @@ msgstr "" "Oups, Nix n'a pas réussi à installer votre nouveau profil de Home Manager !\n" "\n" "Il y a peut-être un conflit avec un autre paquet qui a été installé avec\n" -"« %s » ? Essayez d'éxecuter\n" +"« %s » ? Essayez d'exécuter\n" "\n" " %s\n" "\n" -"et s'il y a un paquet en conflict, vous pourrez le supprimer avec\n" +"et s'il y a un paquet en conflit, vous pourrez le supprimer avec\n" "\n" " %s\n" "\n" @@ -69,7 +69,7 @@ msgstr "Activation de %s" #: modules/lib-bash/activation-init.sh:31 msgid "Sanity checking oldGenNum and oldGenPath" -msgstr "Vérification rationnelle de oldGenNum et oldGenPath" +msgstr "Vérification de oldGenNum et oldGenPath" #: modules/lib-bash/activation-init.sh:34 msgid "" @@ -86,20 +86,20 @@ msgid "" "\n" "and trying home-manager switch again. Good luck!" msgstr "" -"Le numéro et le chemin de la génération dernière sont en conflit ! Ils " +"Le numéro et le chemin de la génération précédente sont en conflit ! Ils " "doivent\n" "être vides ou les deux mis à\n" "\n" " '%s' et '%s'\n" "\n" -"Si ça ne vous dérange pas de perdre la génération dernière, la solution la " -"plus\n" +"Si ça ne vous dérange pas de perdre les générations précédentes, la solution " +"la plus\n" "simple est probablement d'exécuter\n" "\n" " rm %s/home-manager*\n" " rm %s/current-home\n" "\n" -"et d'essayer encore home-manager switch. Bonne chance !" +"et de réessayer home-manager switch. Bonne chance !" #: modules/lib-bash/activation-init.sh:51 msgid "Starting Home Manager activation" @@ -107,19 +107,19 @@ msgstr "Démarrage de l'activation de Home Manager" #: modules/lib-bash/activation-init.sh:55 msgid "Sanity checking Nix" -msgstr "Vérification rationnelle de Nix" +msgstr "Vérification de Nix" #: modules/lib-bash/activation-init.sh:61 msgid "This is a dry run" -msgstr "Ceci est une course à sec" +msgstr "Ceci est une fausse activation (essai à blanc)" #: modules/lib-bash/activation-init.sh:64 msgid "This is a live run" -msgstr "Ceci est une course réelle" +msgstr "Ceci est une vraie activation" #: modules/lib-bash/activation-init.sh:69 msgid "Using Nix version: %s" -msgstr "Usage de la version de Nix : %s" +msgstr "Version de Nix : %s" #: modules/lib-bash/activation-init.sh:72 msgid "Activation variables:" diff --git a/infra/libkookie/home-manager/modules/po/zh_Hans.po b/infra/libkookie/home-manager/modules/po/zh_Hans.po index 4348f185bed..ca62aa87498 100644 --- a/infra/libkookie/home-manager/modules/po/zh_Hans.po +++ b/infra/libkookie/home-manager/modules/po/zh_Hans.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2022-03-26 15:08+0100\n" -"PO-Revision-Date: 2022-01-05 00:56+0000\n" -"Last-Translator: ethinx \n" +"PO-Revision-Date: 2022-05-16 13:18+0000\n" +"Last-Translator: Yubo-Cao \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_Hans\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.10.1\n" +"X-Generator: Weblate 4.13-dev\n" #: modules/files.nix:233 msgid "Creating home file links in %s" @@ -50,6 +50,18 @@ msgid "" "\n" "Then try activating your Home Manager configuration again." msgstr "" +"糟糕,Nix 未能安装您的新 Home Manager 配置文件!\n" +"\n" +"也许这里和使用 \"%s\" 安装的包有冲突?\n" +"尝试运行\n" +"\n" +" %s\n" +"\n" +"如果有冲突的包,你可以用\n" +"\n" +" %s\n" +"\n" +"来移除。然后尝试再次激活您的 Home Manager 配置。" #: modules/home-environment.nix:639 msgid "Activating %s" @@ -57,7 +69,7 @@ msgstr "正在激活 %s" #: modules/lib-bash/activation-init.sh:31 msgid "Sanity checking oldGenNum and oldGenPath" -msgstr "" +msgstr "正在进行 oldGenNum 和 oldGenPath 的完整性检查" #: modules/lib-bash/activation-init.sh:34 msgid "" @@ -81,15 +93,15 @@ msgstr "正在启动 Home Manager 初始化程序" #: modules/lib-bash/activation-init.sh:55 msgid "Sanity checking Nix" -msgstr "" +msgstr "正在进行 Nix 完整性检查" #: modules/lib-bash/activation-init.sh:61 msgid "This is a dry run" -msgstr "" +msgstr "这是试运行" #: modules/lib-bash/activation-init.sh:64 msgid "This is a live run" -msgstr "" +msgstr "这是在实际运行" #: modules/lib-bash/activation-init.sh:69 msgid "Using Nix version: %s" @@ -97,4 +109,4 @@ msgstr "正在使用的 Nix 版本: %s" #: modules/lib-bash/activation-init.sh:72 msgid "Activation variables:" -msgstr "" +msgstr "激活的变量:" diff --git a/infra/libkookie/home-manager/modules/programs/emacs.nix b/infra/libkookie/home-manager/modules/programs/emacs.nix index 4e69c55b0ea..4253cb3b955 100644 --- a/infra/libkookie/home-manager/modules/programs/emacs.nix +++ b/infra/libkookie/home-manager/modules/programs/emacs.nix @@ -13,11 +13,15 @@ let emacsWithPackages = emacsPackages.emacsWithPackages; - createConfPackage = epkgs: - epkgs.trivialBuild { - pname = "default"; - src = pkgs.writeText "default.el" cfg.extraConfig; - }; + extraPackages = epkgs: + let + packages = cfg.extraPackages epkgs; + userConfig = epkgs.trivialBuild { + pname = "default"; + src = pkgs.writeText "default.el" cfg.extraConfig; + packageRequires = packages; + }; + in packages ++ optional (cfg.extraConfig != "") userConfig; in { meta.maintainers = [ maintainers.rycee ]; @@ -91,10 +95,6 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.finalPackage ]; - programs.emacs = { - finalPackage = emacsWithPackages cfg.extraPackages; - extraPackages = epkgs: - optional (cfg.extraConfig != "") (createConfPackage epkgs); - }; + programs.emacs.finalPackage = emacsWithPackages extraPackages; }; } diff --git a/infra/libkookie/home-manager/modules/programs/fish.nix b/infra/libkookie/home-manager/modules/programs/fish.nix index e39a141ceb2..1fbb9e0710d 100644 --- a/infra/libkookie/home-manager/modules/programs/fish.nix +++ b/infra/libkookie/home-manager/modules/programs/fish.nix @@ -307,7 +307,7 @@ in { generateCompletions = package: pkgs.runCommand "${package.name}-fish-completions" { src = package; - nativeBuildInputs = [ pkgs.python2 ]; + nativeBuildInputs = [ pkgs.python3 ]; buildInputs = [ cfg.package ]; preferLocalBuild = true; } '' diff --git a/infra/libkookie/home-manager/modules/programs/git.nix b/infra/libkookie/home-manager/modules/programs/git.nix index 61792f866fa..c79bdae2048 100644 --- a/infra/libkookie/home-manager/modules/programs/git.nix +++ b/infra/libkookie/home-manager/modules/programs/git.nix @@ -296,6 +296,65 @@ in { ''; }; }; + + diff-so-fancy = { + enable = mkEnableOption "" // { + description = '' + Enable the diff-so-fancy diff colorizer. + See . + ''; + }; + + markEmptyLines = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + Whether the first block of an empty line should be colored. + ''; + }; + + changeHunkIndicators = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + Simplify git header chunks to a more human readable format. + ''; + }; + + stripLeadingSymbols = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + Whether the + or - at + line-start should be removed. + ''; + }; + + useUnicodeRuler = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + By default, the separator for the file header uses Unicode + line-drawing characters. If this is causing output errors on + your terminal, set this to false to use ASCII characters instead. + ''; + }; + + rulerWidth = mkOption { + type = types.nullOr types.int; + default = null; + example = false; + description = '' + By default, the separator for the file header spans the full + width of the terminal. Use this setting to set the width of + the file header manually. + ''; + }; + }; }; }; @@ -303,9 +362,12 @@ in { { home.packages = [ cfg.package ]; assertions = [{ - assertion = !(cfg.delta.enable && cfg.difftastic.enable); + assertion = let + enabled = + [ cfg.delta.enable cfg.diff-so-fancy.enable cfg.difftastic.enable ]; + in count id enabled <= 1; message = - "Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' can be set to true at the same time."; + "Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' or 'programs.git.diff-so-fancy.enable' can be set to true at the same time."; }]; programs.git.iniContent.user = { @@ -432,5 +494,24 @@ in { delta = cfg.delta.options; }; }) + + (mkIf cfg.diff-so-fancy.enable { + home.packages = [ pkgs.diff-so-fancy ]; + + programs.git.iniContent = + let dsfCommand = "${pkgs.diff-so-fancy}/bin/diff-so-fancy"; + in { + core.pager = "${dsfCommand} | ${pkgs.less}/bin/less --tabs=4 -RFX"; + interactive.diffFilter = "${dsfCommand} --patch"; + diff-so-fancy = { + markEmptyLines = cfg.diff-so-fancy.markEmptyLines; + changeHunkIndicators = cfg.diff-so-fancy.changeHunkIndicators; + stripLeadingSymbols = cfg.diff-so-fancy.stripLeadingSymbols; + useUnicodeRuler = cfg.diff-so-fancy.useUnicodeRuler; + rulerWidth = mkIf (cfg.diff-so-fancy.rulerWidth != null) + (cfg.diff-so-fancy.rulerWidth); + }; + }; + }) ]); } diff --git a/infra/libkookie/home-manager/modules/programs/himalaya.nix b/infra/libkookie/home-manager/modules/programs/himalaya.nix index dd91e5976fa..1faee820260 100644 --- a/infra/libkookie/home-manager/modules/programs/himalaya.nix +++ b/infra/libkookie/home-manager/modules/programs/himalaya.nix @@ -14,10 +14,12 @@ let name = account.realName; default = account.primary; - inbox-folder = account.folders.inbox; - sent-folder = account.folders.sent; - draft-folder = account.folders.drafts; - # NOTE: himalaya does not support configuring the name of the trash folder + mailboxes = { + inbox = account.folders.inbox; + sent = account.folders.sent; + draft = account.folders.drafts; + # NOTE: himalaya does not support configuring the name of the trash folder + }; # FIXME: does not support disabling TLS altogether # NOTE: does not accept sequence of strings for password commands diff --git a/infra/libkookie/home-manager/modules/programs/htop.nix b/infra/libkookie/home-manager/modules/programs/htop.nix index 0d3530264f6..27368602d2a 100644 --- a/infra/libkookie/home-manager/modules/programs/htop.nix +++ b/infra/libkookie/home-manager/modules/programs/htop.nix @@ -3,6 +3,7 @@ with lib; let + inherit (pkgs.stdenv.hostPlatform) isDarwin; cfg = config.programs.htop; @@ -41,6 +42,8 @@ let TIME = 49; NLWP = 50; TGID = 51; + PERCENT_NORM_CPU = 52; + ELAPSED = 53; CMINFLT = 10; CMAJFLT = 12; UTIME = 13; @@ -73,6 +76,21 @@ let M_PSSWP = 120; }; + defaultFields = with fields; [ + PID + USER + PRIORITY + NICE + M_SIZE + M_RESIDENT + M_SHARE + STATE + PERCENT_CPU + PERCENT_MEM + TIME + COMM + ]; + modes = { Bar = 1; Text = 2; @@ -154,20 +172,10 @@ in { xdg.configFile."htop/htoprc" = let defaults = { - fields = with fields; [ - PID - USER - PRIORITY - NICE - M_SIZE - M_RESIDENT - M_SHARE - STATE - PERCENT_CPU - PERCENT_MEM - TIME - COMM - ]; + fields = if isDarwin then + remove fields.M_SHARE defaultFields + else + defaultFields; }; before = optionalAttrs (cfg.settings ? header_layout) { diff --git a/infra/libkookie/home-manager/modules/programs/neomutt.nix b/infra/libkookie/home-manager/modules/programs/neomutt.nix index b3e92818396..75508303e26 100644 --- a/infra/libkookie/home-manager/modules/programs/neomutt.nix +++ b/infra/libkookie/home-manager/modules/programs/neomutt.nix @@ -196,7 +196,16 @@ let accountStr = account: with account; - '' + let + signature = if account.signature.showSignature == "none" then + "unset signature" + else if account.signature.command != null then + ''set signature = "${account.signature.command}|"'' + else + "set signature = ${ + pkgs.writeText "signature.txt" account.signature.text + }"; + in '' # Generated by Home Manager. set ssl_force_tls = yes set certificate_file=${toString config.accounts.email.certificatesFile} @@ -223,11 +232,9 @@ let # Extra configuration ${account.neomutt.extraConfig} - '' + (if (account.signature.showSignature == "none") then '' - unset signature - '' else '' - set signature = ${pkgs.writeText "signature.txt" account.signature.text} - '') + optionalString account.notmuch.enable (notmuchSection account); + + ${signature} + '' + optionalString account.notmuch.enable (notmuchSection account); in { options = { diff --git a/infra/libkookie/home-manager/modules/programs/neovim.nix b/infra/libkookie/home-manager/modules/programs/neovim.nix index a0e21476e49..91d573405c4 100644 --- a/infra/libkookie/home-manager/modules/programs/neovim.nix +++ b/infra/libkookie/home-manager/modules/programs/neovim.nix @@ -66,7 +66,7 @@ let allPlugins = cfg.plugins ++ optional cfg.coc.enable { type = "viml"; - plugin = pkgs.vimPlugins.coc-nvim; + plugin = cfg.coc.package; config = cfg.coc.pluginConfig; optional = false; }; @@ -302,6 +302,13 @@ in { coc = { enable = mkEnableOption "Coc"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.coc-nvim; + defaultText = literalExpression "pkgs.vimPlugins.coc-nvim"; + description = "The package to use for the CoC plugin."; + }; + settings = mkOption { type = jsonFormat.type; default = { }; diff --git a/infra/libkookie/home-manager/modules/programs/offlineimap.nix b/infra/libkookie/home-manager/modules/programs/offlineimap.nix index 8817e2ba7e9..c5b800599e1 100644 --- a/infra/libkookie/home-manager/modules/programs/offlineimap.nix +++ b/infra/libkookie/home-manager/modules/programs/offlineimap.nix @@ -158,13 +158,13 @@ in { xdg.configFile."offlineimap/get_settings.py".text = cfg.pythonFile; xdg.configFile."offlineimap/get_settings.pyc".source = "${ pkgs.runCommandLocal "get_settings-compile" { - nativeBuildInputs = [ pkgs.python2 ]; + nativeBuildInputs = [ pkgs.offlineimap ]; pythonFile = cfg.pythonFile; passAsFile = [ "pythonFile" ]; } '' mkdir -p $out/bin cp $pythonFilePath $out/bin/get_settings.py - python2 -m py_compile $out/bin/get_settings.py + python -m py_compile $out/bin/get_settings.py '' }/bin/get_settings.pyc"; diff --git a/infra/libkookie/home-manager/modules/programs/pywal.nix b/infra/libkookie/home-manager/modules/programs/pywal.nix new file mode 100644 index 00000000000..3f95ebfac33 --- /dev/null +++ b/infra/libkookie/home-manager/modules/programs/pywal.nix @@ -0,0 +1,76 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let cfg = config.programs.pywal; + +in { + options = { programs.pywal = { enable = mkEnableOption "pywal"; }; }; + + config = mkIf cfg.enable { + + home.packages = [ pkgs.pywal ]; + + programs.zsh.initExtra = '' + # Import colorscheme from 'wal' asynchronously + # & # Run the process in the background. + # ( ) # Hide shell job control messages. + (cat ${config.xdg.cacheHome}/wal/sequences &) + ''; + + programs.kitty.extraConfig = '' + include ${config.xdg.cacheHome}/wal/colors-kitty.conf + ''; + + programs.rofi.theme."@import" = + "${config.xdg.cacheHome}/wal/colors-rofi-dark.rasi"; + + # wal generates and that's the one we should load from /home/teto/.cache/wal/colors.Xresources ~/.Xresources + xsession.windowManager.i3 = { + extraConfig = '' + set_from_resource $bg i3wm.color0 #ff0000 + set_from_resource $bg-alt i3wm.color14 #ff0000 + set_from_resource $fg i3wm.color15 #ff0000 + set_from_resource $fg-alt i3wm.color2 #ff0000 + set_from_resource $hl i3wm.color13 #ff0000 + ''; + + config.colors = { + focused = { + border = "$fg-alt"; + background = "$bg"; + text = "$hl"; + indicator = "$fg-alt"; + childBorder = "$hl"; + }; + + focusedInactive = { + border = "$fg-alt"; + background = "$bg"; + text = "$fg"; + indicator = "$fg-alt"; + childBorder = "$fg-alt"; + }; + + unfocused = { + border = "$fg-alt"; + background = "$bg"; + text = "$fg"; + indicator = "$fg-alt"; + childBorder = "$fg-alt"; + }; + + urgent = { + border = "$fg-alt"; + background = "$bg"; + text = "$fg"; + indicator = "$fg-alt"; + childBorder = "$fg-alt"; + }; + + background = "$bg"; + }; + }; + }; +} + diff --git a/infra/libkookie/home-manager/modules/programs/swaylock.nix b/infra/libkookie/home-manager/modules/programs/swaylock.nix new file mode 100644 index 00000000000..187ff9d616e --- /dev/null +++ b/infra/libkookie/home-manager/modules/programs/swaylock.nix @@ -0,0 +1,32 @@ +{ config, lib, ... }: + +let cfg = config.programs.swaylock; +in { + meta.maintainers = [ lib.hm.maintainers.rcerc ]; + + options.programs.swaylock.settings = lib.mkOption { + type = with lib.types; attrsOf (oneOf [ bool float int str ]); + default = { }; + description = '' + Default arguments to swaylock. An empty set + disables configuration generation. + ''; + example = { + color = "808080"; + font-size = 24; + indicator-idle-visible = false; + indicator-radius = 100; + line-color = "ffffff"; + show-failed-attempts = true; + }; + }; + + config.xdg.configFile."swaylock/config" = lib.mkIf (cfg.settings != { }) { + text = lib.concatStrings (lib.mapAttrsToList (n: v: + if v == false then + "" + else + (if v == true then n else n + "=" + builtins.toString v) + "\n") + cfg.settings); + }; +} diff --git a/infra/libkookie/home-manager/modules/programs/tealdeer.nix b/infra/libkookie/home-manager/modules/programs/tealdeer.nix new file mode 100644 index 00000000000..98ef4d2c8a3 --- /dev/null +++ b/infra/libkookie/home-manager/modules/programs/tealdeer.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.programs.tealdeer; + + tomlFormat = pkgs.formats.toml { }; + + configDir = if pkgs.stdenv.isDarwin then + "Library/Application Support" + else + config.xdg.configHome; + +in { + meta.maintainers = [ maintainers.marsam ]; + + options.programs.tealdeer = { + enable = mkEnableOption "Tealdeer"; + + settings = mkOption { + type = tomlFormat.type; + default = { }; + defaultText = literalExpression "{ }"; + example = literalExpression '' + { + display = { + compact = false; + use_pager = true; + }; + updates = { + auto_update = false; + }; + }; + ''; + description = '' + Configuration written to + $XDG_CONFIG_HOME/tealdeer/config.toml on Linux or + $HOME/Library/Application Support/tealdeer/config.toml + on Darwin. See + + for more information. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ pkgs.tealdeer ]; + + home.file."${configDir}/tealdeer/config.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "tealdeer-config" cfg.settings; + }; + }; +} diff --git a/infra/libkookie/home-manager/modules/services/getmail.nix b/infra/libkookie/home-manager/modules/services/getmail.nix index 83ed4ed4569..05950e62aee 100644 --- a/infra/libkookie/home-manager/modules/services/getmail.nix +++ b/infra/libkookie/home-manager/modules/services/getmail.nix @@ -44,7 +44,7 @@ in { systemd.user.services.getmail = { Unit = { Description = "getmail email fetcher"; }; - Service = { ExecStart = "${pkgs.getmail}/bin/getmail ${configFiles}"; }; + Service = { ExecStart = "${pkgs.getmail6}/bin/getmail ${configFiles}"; }; }; systemd.user.timers.getmail = { diff --git a/infra/libkookie/home-manager/modules/services/gpg-agent.nix b/infra/libkookie/home-manager/modules/services/gpg-agent.nix index d4ccef3ec8f..21303ee8e5d 100644 --- a/infra/libkookie/home-manager/modules/services/gpg-agent.nix +++ b/infra/libkookie/home-manager/modules/services/gpg-agent.nix @@ -197,6 +197,18 @@ in { now. ''; }; + + enableBashIntegration = mkEnableOption "Bash integration" // { + default = true; + }; + + enableZshIntegration = mkEnableOption "Zsh integration" // { + default = true; + }; + + enableFishIntegration = mkEnableOption "Fish integration" // { + default = true; + }; }; }; @@ -224,9 +236,9 @@ in { fi ''; - programs.bash.initExtra = gpgInitStr; - programs.zsh.initExtra = gpgInitStr; - programs.fish.interactiveShellInit = '' + programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr; + programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgInitStr; + programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' set -gx GPG_TTY (tty) ''; } diff --git a/infra/libkookie/home-manager/modules/services/mako.nix b/infra/libkookie/home-manager/modules/services/mako.nix index 67c11e314f5..88068e0ba52 100644 --- a/infra/libkookie/home-manager/modules/services/mako.nix +++ b/infra/libkookie/home-manager/modules/services/mako.nix @@ -15,6 +15,13 @@ in { Mako, lightweight notification daemon for Wayland ''; + package = mkOption { + type = types.package; + default = pkgs.mako; + defaultText = literalExpression "pkgs.mako"; + description = "The mako package to use."; + }; + maxVisible = mkOption { default = 5; type = types.nullOr types.int; @@ -295,11 +302,11 @@ in { assertions = [ (hm.assertions.assertPlatform "services.mako" pkgs platforms.linux) ]; - home.packages = [ pkgs.mako ]; + home.packages = [ cfg.package ]; xdg.configFile."mako/config" = { onChange = '' - ${pkgs.mako}/bin/makoctl reload || true + ${cfg.package}/bin/makoctl reload || true ''; text = '' ${optionalInteger "max-visible" cfg.maxVisible} diff --git a/infra/libkookie/home-manager/modules/services/mopidy.nix b/infra/libkookie/home-manager/modules/services/mopidy.nix new file mode 100644 index 00000000000..32862542b36 --- /dev/null +++ b/infra/libkookie/home-manager/modules/services/mopidy.nix @@ -0,0 +1,136 @@ +{ config, options, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.mopidy; + + # The configuration format of Mopidy. It seems to use configparser with + # some quirky handling of its types. You can see how they're handled in + # `mopidy/config/types.py` from the source code. + toMopidyConf = generators.toINI { + mkKeyValue = generators.mkKeyValueDefault { + mkValueString = v: + if isList v then + "\n " + concatStringsSep "\n " v + else + generators.mkValueStringDefault { } v; + } " = "; + }; + + mopidyEnv = pkgs.buildEnv { + name = "mopidy-with-extensions-${pkgs.mopidy.version}"; + paths = closePropagation cfg.extensionPackages; + pathsToLink = [ "/${pkgs.mopidyPackages.python.sitePackages}" ]; + buildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + makeWrapper ${pkgs.mopidy}/bin/mopidy $out/bin/mopidy \ + --prefix PYTHONPATH : $out/${pkgs.mopidyPackages.python.sitePackages} + ''; + }; + + # Nix-representable format for Mopidy config. + mopidyConfFormat = { }: { + type = with types; + let + valueType = nullOr (oneOf [ bool float int str (listOf valueType) ]) + // { + description = "Mopidy config value"; + }; + in attrsOf (attrsOf valueType); + + generate = name: value: pkgs.writeText name (toMopidyConf value); + }; + + settingsFormat = mopidyConfFormat { }; + +in { + meta.maintainers = [ hm.maintainers.foo-dogsquared ]; + + options.services.mopidy = { + enable = mkEnableOption "Mopidy music player daemon"; + + extensionPackages = mkOption { + type = with types; listOf package; + default = [ ]; + example = literalExpression + "with pkgs; [ mopidy-spotify mopidy-mpd mopidy-mpris ]"; + description = '' + Mopidy extensions that should be loaded by the service. + ''; + }; + + settings = mkOption { + type = settingsFormat.type; + default = { }; + example = literalExpression '' + { + file = { + media_dirs = [ + "$XDG_MUSIC_DIR|Music" + "~/library|Library" + ]; + follow_symlinks = true; + excluded_file_extensions = [ + ".html" + ".zip" + ".jpg" + ".jpeg" + ".png" + ]; + }; + + # Please don't put your mopidy-spotify configuration in the public. :) + # Think of your Spotify Premium subscription! + spotify = { + client_id = "CLIENT_ID"; + client_secret = "CLIENT_SECRET"; + }; + } + ''; + description = '' + Configuration written to + $XDG_CONFIG_HOME/mopidy/mopidy.conf. + + See for + more details. + ''; + }; + }; + + config = mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "services.mopidy" pkgs platforms.linux) ]; + + xdg.configFile."mopidy/mopidy.conf".source = + settingsFormat.generate "mopidy-${config.home.username}" cfg.settings; + + systemd.user.services.mopidy = { + Unit = { + Description = "mopidy music player daemon"; + Documentation = [ "https://mopidy.com/" ]; + After = [ "network.target" "sound.target" ]; + }; + + Service = { ExecStart = "${mopidyEnv}/bin/mopidy"; }; + + Install.WantedBy = [ "default.target" ]; + }; + + systemd.user.services.mopidy-scan = { + Unit = { + Description = "mopidy local files scanner"; + Documentation = [ "https://mopidy.com/" ]; + After = [ "network.target" "sound.target" ]; + }; + + Service = { + ExecStart = "${mopidyEnv}/bin/mopidy local scan"; + Type = "oneshot"; + }; + + Install.WantedBy = [ "default.target" ]; + }; + }; +} diff --git a/infra/libkookie/home-manager/modules/services/mpdris2.nix b/infra/libkookie/home-manager/modules/services/mpdris2.nix index bf9b783b3b9..79f2709fc54 100644 --- a/infra/libkookie/home-manager/modules/services/mpdris2.nix +++ b/infra/libkookie/home-manager/modules/services/mpdris2.nix @@ -21,6 +21,8 @@ let host = cfg.mpd.host; port = cfg.mpd.port; music_dir = cfg.mpd.musicDirectory; + } // optionalAttrs (cfg.mpd.password != null) { + password = cfg.mpd.password; }; Bling = { @@ -70,6 +72,14 @@ in { If set, mpDris2 will use this directory to access music artwork. ''; }; + + password = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + The password to connect to MPD. + ''; + }; }; }; @@ -77,11 +87,6 @@ in { assertions = [ (lib.hm.assertions.assertPlatform "services.mpdris2" pkgs lib.platforms.linux) - - { - assertion = config.services.mpd.enable; - message = "The mpdris2 module requires 'services.mpd.enable = true'."; - } ]; xdg.configFile."mpDris2/mpDris2.conf".text = toIni mpdris2Conf; diff --git a/infra/libkookie/home-manager/modules/services/swayidle.nix b/infra/libkookie/home-manager/modules/services/swayidle.nix index 6cbf840b0ae..217fb435493 100644 --- a/infra/libkookie/home-manager/modules/services/swayidle.nix +++ b/infra/libkookie/home-manager/modules/services/swayidle.nix @@ -15,8 +15,8 @@ let mkEvent = e: [ e.event (escapeShellArg e.command) ]; - args = (concatMap mkTimeout cfg.timeouts) ++ (concatMap mkEvent cfg.events) - ++ cfg.extraArgs; + args = cfg.extraArgs ++ (concatMap mkTimeout cfg.timeouts) + ++ (concatMap mkEvent cfg.events); in { meta.maintainers = [ maintainers.c0deaddict ]; diff --git a/infra/libkookie/home-manager/modules/services/window-managers/i3-sway/sway.nix b/infra/libkookie/home-manager/modules/services/window-managers/i3-sway/sway.nix index 178ceacd693..f8ad577b998 100644 --- a/infra/libkookie/home-manager/modules/services/window-managers/i3-sway/sway.nix +++ b/infra/libkookie/home-manager/modules/services/window-managers/i3-sway/sway.nix @@ -431,12 +431,14 @@ in { home.packages = optional (cfg.package != null) cfg.package ++ optional cfg.xwayland pkgs.xwayland; - xdg.configFile."sway/config" = { + xdg.configFile."sway/config" = let + swayPackage = if cfg.package == null then pkgs.sway else cfg.package; + in { source = configFile; onChange = '' swaySocket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep --uid $UID -x sway || true).sock" if [ -S "$swaySocket" ]; then - ${pkgs.sway}/bin/swaymsg -s $swaySocket reload + ${swayPackage}/bin/swaymsg -s $swaySocket reload fi ''; }; diff --git a/infra/libkookie/home-manager/modules/xcursor.nix b/infra/libkookie/home-manager/modules/xcursor.nix deleted file mode 100644 index a91f79ee5c9..00000000000 --- a/infra/libkookie/home-manager/modules/xcursor.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - - cfg = config.xsession.pointerCursor; - - cursorType = types.submodule { - options = { - package = mkOption { - type = types.package; - example = literalExpression "pkgs.vanilla-dmz"; - description = "Package providing the cursor theme."; - }; - - name = mkOption { - type = types.str; - example = "Vanilla-DMZ"; - description = "The cursor name within the package."; - }; - - size = mkOption { - type = types.int; - default = 32; - example = 64; - description = "The cursor size."; - }; - - defaultCursor = mkOption { - type = types.str; - default = "left_ptr"; - example = "X_cursor"; - description = "The default cursor file to use within the package."; - }; - }; - }; - - cursorPath = "${cfg.package}/share/icons/${escapeShellArg cfg.name}/cursors/${ - escapeShellArg cfg.defaultCursor - }"; - -in { - meta.maintainers = [ maintainers.league ]; - - options = { - xsession.pointerCursor = mkOption { - type = types.nullOr cursorType; - default = null; - description = '' - The X cursor theme and settings. The package - xorg.xcursorthemes contains cursors named - whiteglass, redglass, and handhelds. The package - vanilla-dmz contains cursors named Vanilla-DMZ - and Vanilla-DMZ-AA. Note: handhelds does not seem to work at - custom sizes. - ''; - }; - }; - - config = mkIf (cfg != null) { - assertions = [ - (hm.assertions.assertPlatform "xsession.pointerCursor" pkgs - platforms.linux) - ]; - - home.packages = [ cfg.package ]; - - xsession.initExtra = '' - ${pkgs.xorg.xsetroot}/bin/xsetroot -xcf ${cursorPath} ${toString cfg.size} - ''; - - xresources.properties = { - "Xcursor.theme" = cfg.name; - "Xcursor.size" = cfg.size; - }; - - gtk.cursorTheme = mkDefault { inherit (cfg) package name size; }; - - # Set name in icons theme, for compatibility with AwesomeWM etc. See: - # https://github.com/nix-community/home-manager/issues/2081 - # https://wiki.archlinux.org/title/Cursor_themes#XDG_specification - home.file.".icons/default/index.theme".text = '' - [icon theme] - Name=Default - Comment=Default Cursor Theme - Inherits=${cfg.name} - ''; - }; -} diff --git a/infra/libkookie/home-manager/nix-darwin/default.nix b/infra/libkookie/home-manager/nix-darwin/default.nix index 57f7559a317..8535edf2a0b 100644 --- a/infra/libkookie/home-manager/nix-darwin/default.nix +++ b/infra/libkookie/home-manager/nix-darwin/default.nix @@ -6,140 +6,26 @@ let cfg = config.home-manager; - extendedLib = import ../modules/lib/stdlib-extended.nix pkgs.lib; - - hmModule = types.submoduleWith { - specialArgs = { - lib = extendedLib; - darwinConfig = config; - osConfig = config; - modulesPath = builtins.toString ../modules; - } // cfg.extraSpecialArgs; - modules = [ - ({ name, ... }: { - imports = import ../modules/modules.nix { - inherit pkgs; - lib = extendedLib; - useNixpkgsModule = !cfg.useGlobalPkgs; - }; - - config = { - submoduleSupport.enable = true; - submoduleSupport.externalPackageInstall = cfg.useUserPackages; - - home.username = config.users.users.${name}.name; - home.homeDirectory = config.users.users.${name}.home; - - # Make activation script use same version of Nix as system as a whole. - # This avoids problems with Nix not being in PATH. - home.extraActivationPath = [ config.nix.package ]; - }; - }) - ] ++ cfg.sharedModules; - }; - -in - -{ - options = { - home-manager = { - useUserPackages = mkEnableOption '' - installation of user packages through the - option. - ''; - - useGlobalPkgs = mkEnableOption '' - using the system configuration's pkgs - argument in Home Manager. This disables the Home Manager - options - ''; - - backupFileExtension = mkOption { - type = types.nullOr types.str; - default = null; - example = "backup"; - description = '' - On activation move existing files by appending the given - file extension rather than exiting with an error. - ''; - }; - - extraSpecialArgs = mkOption { - type = types.attrs; - default = { }; - example = literalExpression "{ inherit emacs-overlay; }"; - description = '' - Extra specialArgs passed to Home Manager. This - option can be used to pass additional arguments to all modules. - ''; - }; - - sharedModules = mkOption { - type = with types; - # TODO: use types.raw once this PR is merged: https://github.com/NixOS/nixpkgs/pull/132448 - listOf (mkOptionType { - name = "submodule"; - inherit (submodule { }) check; - merge = lib.options.mergeOneOption; - description = "Home Manager modules"; - }); - default = [ ]; - example = literalExpression "[ { home.packages = [ nixpkgs-fmt ]; } ]"; - description = '' - Extra modules added to all users. - ''; - }; - - verbose = mkEnableOption "verbose output on activation"; - - users = mkOption { - type = types.attrsOf hmModule; - default = {}; - # Set as not visible to prevent the entire submodule being included in - # the documentation. - visible = false; - description = '' - Per-user Home Manager configuration. - ''; - }; - }; - }; - - config = mkIf (cfg.users != {}) { - warnings = - flatten (flip mapAttrsToList cfg.users (user: config: - flip map config.warnings (warning: - "${user} profile: ${warning}" - ) - )); - - assertions = - flatten (flip mapAttrsToList cfg.users (user: config: - flip map config.assertions (assertion: - { - inherit (assertion) assertion; - message = "${user} profile: ${assertion.message}"; +in { + imports = [ ../integration-common.nix ]; + + config = mkMerge [ + { home-manager.extraSpecialArgs.darwinConfig = config; } + (mkIf (cfg.users != { }) { + system.activationScripts.postActivation.text = concatStringsSep "\n" + (mapAttrsToList (username: usercfg: '' + echo Activating home-manager configuration for ${username} + sudo -u ${username} -s --set-home ${ + pkgs.writeShellScript "activation-${username}" '' + ${lib.optionalString (cfg.backupFileExtension != null) + "export HOME_MANAGER_BACKUP_EXT=${ + lib.escapeShellArg cfg.backupFileExtension + }"} + ${lib.optionalString cfg.verbose "export VERBOSE=1"} + exec ${usercfg.home.activationPackage}/activate + '' } - ) - )); - - users.users = mkIf cfg.useUserPackages ( - mapAttrs (username: usercfg: { - packages = [ usercfg.home.path ]; - }) cfg.users - ); - - environment.pathsToLink = mkIf cfg.useUserPackages [ "/etc/profile.d" ]; - - system.activationScripts.postActivation.text = - concatStringsSep "\n" (mapAttrsToList (username: usercfg: '' - echo Activating home-manager configuration for ${username} - sudo -u ${username} -s --set-home ${pkgs.writeShellScript "activation-${username}" '' - ${lib.optionalString (cfg.backupFileExtension != null) - "export HOME_MANAGER_BACKUP_EXT=${lib.escapeShellArg cfg.backupFileExtension}"} - ${lib.optionalString cfg.verbose "export VERBOSE=1"} - exec ${usercfg.home.activationPackage}/activate - ''} - '') cfg.users); - }; + '') cfg.users); + }) + ]; } diff --git a/infra/libkookie/home-manager/nixos/default.nix b/infra/libkookie/home-manager/nixos/default.nix index 766ce76f9cf..b1c1b30b097 100644 --- a/infra/libkookie/home-manager/nixos/default.nix +++ b/infra/libkookie/home-manager/nixos/default.nix @@ -6,180 +6,80 @@ let cfg = config.home-manager; - extendedLib = import ../modules/lib/stdlib-extended.nix pkgs.lib; - - hmModule = types.submoduleWith { - specialArgs = { - lib = extendedLib; - nixosConfig = config; - osConfig = config; - modulesPath = builtins.toString ../modules; - } // cfg.extraSpecialArgs; - modules = [ - ({ name, ... }: { - imports = import ../modules/modules.nix { - inherit pkgs; - lib = extendedLib; - useNixpkgsModule = !cfg.useGlobalPkgs; - }; - - config = { - submoduleSupport.enable = true; - submoduleSupport.externalPackageInstall = cfg.useUserPackages; - - # The per-user directory inside /etc/profiles is not known by - # fontconfig by default. - fonts.fontconfig.enable = cfg.useUserPackages - && config.fonts.fontconfig.enable; - - home.username = config.users.users.${name}.name; - home.homeDirectory = config.users.users.${name}.home; - - # Make activation script use same version of Nix as system as a whole. - # This avoids problems with Nix not being in PATH. - home.extraActivationPath = [ config.nix.package ]; - }; - }) - ] ++ cfg.sharedModules; - }; - serviceEnvironment = optionalAttrs (cfg.backupFileExtension != null) { HOME_MANAGER_BACKUP_EXT = cfg.backupFileExtension; } // optionalAttrs cfg.verbose { VERBOSE = "1"; }; in { - options = { - home-manager = { - useUserPackages = mkEnableOption '' - installation of user packages through the - option - ''; - - useGlobalPkgs = mkEnableOption '' - using the system configuration's pkgs - argument in Home Manager. This disables the Home Manager - options - ''; - - backupFileExtension = mkOption { - type = types.nullOr types.str; - default = null; - example = "backup"; - description = '' - On activation move existing files by appending the given - file extension rather than exiting with an error. - ''; - }; - - extraSpecialArgs = mkOption { - type = types.attrs; - default = { }; - example = literalExpression "{ inherit emacs-overlay; }"; - description = '' - Extra specialArgs passed to Home Manager. This - option can be used to pass additional arguments to all modules. - ''; - }; + imports = [ ../integration-common.nix ]; - sharedModules = mkOption { - type = with types; - # TODO: use types.raw once this PR is merged: https://github.com/NixOS/nixpkgs/pull/132448 - listOf (mkOptionType { - name = "submodule"; - inherit (submodule { }) check; - merge = lib.options.mergeOneOption; - description = "Home Manager modules"; - }); - default = [ ]; - example = literalExpression "[ { home.packages = [ nixpkgs-fmt ]; } ]"; - description = '' - Extra modules added to all users. - ''; - }; + config = mkMerge [ + { + home-manager = { + extraSpecialArgs.nixosConfig = config; - verbose = mkEnableOption "verbose output on activation"; - - users = mkOption { - type = types.attrsOf hmModule; - default = { }; - # Set as not visible to prevent the entire submodule being included in - # the documentation. - visible = false; - description = '' - Per-user Home Manager configuration. - ''; + sharedModules = [{ + # The per-user directory inside /etc/profiles is not known by + # fontconfig by default. + fonts.fontconfig.enable = cfg.useUserPackages + && config.fonts.fontconfig.enable; + }]; }; - }; - }; - - config = mkIf (cfg.users != { }) { - warnings = flatten (flip mapAttrsToList cfg.users (user: config: - flip map config.warnings (warning: "${user} profile: ${warning}"))); - - assertions = flatten (flip mapAttrsToList cfg.users (user: config: - flip map config.assertions (assertion: { - inherit (assertion) assertion; - message = "${user} profile: ${assertion.message}"; - }))); - - users.users = mkIf cfg.useUserPackages - (mapAttrs (username: usercfg: { packages = [ usercfg.home.path ]; }) - cfg.users); - - environment.pathsToLink = mkIf cfg.useUserPackages [ "/etc/profile.d" ]; - - systemd.services = mapAttrs' (_: usercfg: - let username = usercfg.home.username; - in nameValuePair ("home-manager-${utils.escapeSystemdPath username}") { - description = "Home Manager environment for ${username}"; - wantedBy = [ "multi-user.target" ]; - wants = [ "nix-daemon.socket" ]; - after = [ "nix-daemon.socket" ]; - before = [ "systemd-user-sessions.service" ]; - - environment = serviceEnvironment; - - unitConfig = { RequiresMountsFor = usercfg.home.homeDirectory; }; - - stopIfChanged = false; - - serviceConfig = { - User = usercfg.home.username; - Type = "oneshot"; - RemainAfterExit = "yes"; - TimeoutStartSec = 90; - SyslogIdentifier = "hm-activate-${username}"; - - ExecStart = let - systemctl = - "XDG_RUNTIME_DIR=\${XDG_RUNTIME_DIR:-/run/user/$UID} systemctl"; - - sed = "${pkgs.gnused}/bin/sed"; - - exportedSystemdVariables = concatStringsSep "|" [ - "DBUS_SESSION_BUS_ADDRESS" - "DISPLAY" - "WAYLAND_DISPLAY" - "XAUTHORITY" - "XDG_RUNTIME_DIR" - ]; - - setupEnv = pkgs.writeScript "hm-setup-env" '' - #! ${pkgs.runtimeShell} -el - - # The activation script is run by a login shell to make sure - # that the user is given a sane environment. - # If the user is logged in, import variables from their current - # session environment. - eval "$( - ${systemctl} --user show-environment 2> /dev/null \ - | ${sed} -En '/^(${exportedSystemdVariables})=/s/^/export /p' - )" - - exec "$1/activate" - ''; - in "${setupEnv} ${usercfg.home.activationPackage}"; - }; - }) cfg.users; - }; + } + (mkIf (cfg.users != { }) { + systemd.services = mapAttrs' (_: usercfg: + let username = usercfg.home.username; + in nameValuePair ("home-manager-${utils.escapeSystemdPath username}") { + description = "Home Manager environment for ${username}"; + wantedBy = [ "multi-user.target" ]; + wants = [ "nix-daemon.socket" ]; + after = [ "nix-daemon.socket" ]; + before = [ "systemd-user-sessions.service" ]; + + environment = serviceEnvironment; + + unitConfig = { RequiresMountsFor = usercfg.home.homeDirectory; }; + + stopIfChanged = false; + + serviceConfig = { + User = usercfg.home.username; + Type = "oneshot"; + RemainAfterExit = "yes"; + TimeoutStartSec = 90; + SyslogIdentifier = "hm-activate-${username}"; + + ExecStart = let + systemctl = + "XDG_RUNTIME_DIR=\${XDG_RUNTIME_DIR:-/run/user/$UID} systemctl"; + + sed = "${pkgs.gnused}/bin/sed"; + + exportedSystemdVariables = concatStringsSep "|" [ + "DBUS_SESSION_BUS_ADDRESS" + "DISPLAY" + "WAYLAND_DISPLAY" + "XAUTHORITY" + "XDG_RUNTIME_DIR" + ]; + + setupEnv = pkgs.writeScript "hm-setup-env" '' + #! ${pkgs.runtimeShell} -el + + # The activation script is run by a login shell to make sure + # that the user is given a sane environment. + # If the user is logged in, import variables from their current + # session environment. + eval "$( + ${systemctl} --user show-environment 2> /dev/null \ + | ${sed} -En '/^(${exportedSystemdVariables})=/s/^/export /p' + )" + + exec "$1/activate" + ''; + in "${setupEnv} ${usercfg.home.activationPackage}"; + }; + }) cfg.users; + }) + ]; } diff --git a/infra/libkookie/home-manager/tests/default.nix b/infra/libkookie/home-manager/tests/default.nix index 03a86aec768..ada8c40f2b5 100644 --- a/infra/libkookie/home-manager/tests/default.nix +++ b/infra/libkookie/home-manager/tests/default.nix @@ -4,12 +4,7 @@ let lib = import ../modules/lib/stdlib-extended.nix pkgs.lib; - nmt = pkgs.fetchFromGitLab { - owner = "rycee"; - repo = "nmt"; - rev = "d83601002c99b78c89ea80e5e6ba21addcfe12ae"; - sha256 = "1xzwwxygzs1cmysg97hzd285r7n1g1lwx5y1ar68gwq07a1rczmv"; - }; + inherit ((import ./.. { }).inputs) nmt; modules = import ../modules/modules.nix { inherit lib pkgs; @@ -46,6 +41,7 @@ import nmt { ./modules/home-environment ./modules/misc/fontconfig ./modules/misc/nix + ./modules/misc/specialization ./modules/programs/alacritty ./modules/programs/alot ./modules/programs/aria2 @@ -134,6 +130,7 @@ import nmt { ./modules/programs/rbw ./modules/programs/rofi ./modules/programs/rofi-pass + ./modules/programs/swaylock ./modules/programs/terminator ./modules/programs/waybar ./modules/programs/xmobar @@ -152,7 +149,9 @@ import nmt { ./modules/services/home-manager-auto-upgrade ./modules/services/kanshi ./modules/services/lieer + ./modules/services/mopidy ./modules/services/mpd + ./modules/services/mpdris2 ./modules/services/pantalaimon ./modules/services/pbgopy ./modules/services/picom diff --git a/infra/libkookie/home-manager/tests/modules/misc/specialization/default.nix b/infra/libkookie/home-manager/tests/modules/misc/specialization/default.nix new file mode 100644 index 00000000000..ddbc22c6ac8 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/misc/specialization/default.nix @@ -0,0 +1 @@ +{ specialization = ./specialization.nix; } diff --git a/infra/libkookie/home-manager/tests/modules/misc/specialization/specialization.nix b/infra/libkookie/home-manager/tests/modules/misc/specialization/specialization.nix new file mode 100644 index 00000000000..9d6149a0a5d --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/misc/specialization/specialization.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + home.file.testfile.text = "not special"; + specialization.test.configuration = { + home.file.testfile.text = "very special"; + }; + + nmt.script = '' + assertFileExists home-files/testfile + assertFileContains home-files/testfile "not special" + + assertFileExists specialization/test/home-files/testfile + assertFileContains specialization/test/home-files/testfile "not special" + ''; +} diff --git a/infra/libkookie/home-manager/tests/modules/programs/emacs/extra-config.nix b/infra/libkookie/home-manager/tests/modules/programs/emacs/extra-config.nix index de8a5ee1af9..52e83de5c9e 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/emacs/extra-config.nix +++ b/infra/libkookie/home-manager/tests/modules/programs/emacs/extra-config.nix @@ -5,16 +5,32 @@ let testScript = pkgs.writeText "test.el" '' ;; Emacs won't automatically load default.el when --script is specified (load "default") - (kill-emacs (if (eq hm 'home-manager) 0 1)) + (let* ((test-load-config (eq hm 'home-manager)) + (test-load-package (eq (hm-test-fn) 'success)) + (is-ok (and test-load-config test-load-package))) + (kill-emacs (if is-ok 0 1))) ''; emacsBin = "${config.programs.emacs.finalPackage}/bin/emacs"; + mkTestPackage = epkgs: + epkgs.trivialBuild { + pname = "hm-test"; + src = pkgs.writeText "hm-test.el" '' + (defun hm-test-fn () 'success) + (provide 'hm-test) + ''; + }; + in lib.mkIf config.test.enableBig { programs.emacs = { enable = true; package = pkgs.emacs-nox; - extraConfig = "(setq hm 'home-manager)"; + extraConfig = '' + (require 'hm-test) + (setq hm 'home-manager) + ''; + extraPackages = epkgs: [ (mkTestPackage epkgs) ]; }; # running emacs with --script would enable headless mode diff --git a/infra/libkookie/home-manager/tests/modules/programs/himalaya/himalaya-expected.toml b/infra/libkookie/home-manager/tests/modules/programs/himalaya/himalaya-expected.toml index 6d27107ec7f..6c2dfb84c38 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/himalaya/himalaya-expected.toml +++ b/infra/libkookie/home-manager/tests/modules/programs/himalaya/himalaya-expected.toml @@ -4,18 +4,20 @@ name = "" ["hm@example.com"] default = true default-page-size = 50 -draft-folder = "Drafts" email = "hm@example.com" imap-host = "imap.example.com" imap-login = "home.manager" imap-passwd-cmd = "'password-command'" imap-port = 995 imap-starttls = false -inbox-folder = "In" name = "H. M. Test" -sent-folder = "Out" smtp-host = "smtp.example.com" smtp-login = "home.manager" smtp-passwd-cmd = "'password-command'" smtp-port = 465 smtp-starttls = false + +["hm@example.com".mailboxes] +draft = "Drafts" +inbox = "In" +sent = "Out" diff --git a/infra/libkookie/home-manager/tests/modules/programs/htop/header_layout.nix b/infra/libkookie/home-manager/tests/modules/programs/htop/header_layout.nix index 2cf34998d6e..aaf62852237 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/htop/header_layout.nix +++ b/infra/libkookie/home-manager/tests/modules/programs/htop/header_layout.nix @@ -17,7 +17,12 @@ with lib; # Test that the 'fields' key is written in addition to the customized # settings or htop won't read the options. - nmt.script = '' + nmt.script = let + fields = if pkgs.stdenv.hostPlatform.isDarwin then + "0 48 17 18 38 39 2 46 47 49 1" + else + "0 48 17 18 38 39 40 2 46 47 49 1"; + in '' htoprc=home-files/.config/htop/htoprc assertFileExists $htoprc assertFileContent $htoprc \ @@ -28,7 +33,7 @@ with lib; column_meters_1=Tasks LoadAverage Uptime Systemd column_meters_modes_0=1 1 1 2 column_meters_modes_1=2 2 2 2 - fields=0 48 17 18 38 39 40 2 46 47 49 1 + fields=${fields} '' } ''; diff --git a/infra/libkookie/home-manager/tests/modules/programs/htop/settings-without-fields.nix b/infra/libkookie/home-manager/tests/modules/programs/htop/settings-without-fields.nix index 2f4b3e864c5..f1efac2d435 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/htop/settings-without-fields.nix +++ b/infra/libkookie/home-manager/tests/modules/programs/htop/settings-without-fields.nix @@ -11,14 +11,19 @@ with lib; # Test that the 'fields' key is written in addition to the customized # settings or htop won't read the options. - nmt.script = '' + nmt.script = let + fields = if pkgs.stdenv.hostPlatform.isDarwin then + "0 48 17 18 38 39 2 46 47 49 1" + else + "0 48 17 18 38 39 40 2 46 47 49 1"; + in '' htoprc=home-files/.config/htop/htoprc assertFileExists $htoprc assertFileContent $htoprc \ ${ builtins.toFile "htoprc-expected" '' color_scheme=6 - fields=0 48 17 18 38 39 40 2 46 47 49 1 + fields=${fields} '' } ''; diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/default.nix b/infra/libkookie/home-manager/tests/modules/programs/neomutt/default.nix index 62319dd3650..8216017c1cc 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/neomutt/default.nix +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/default.nix @@ -9,4 +9,6 @@ neomutt-with-gpg = ./neomutt-with-gpg.nix; neomutt-no-folder-change = ./neomutt-no-folder-change.nix; neomutt-with-named-mailboxes = ./neomutt-with-named-mailboxes.nix; + neomutt-with-signature = ./neomutt-with-signature.nix; + neomutt-with-signature-command = ./neomutt-with-signature-command.nix; } diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-expected b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-expected index 74fbf6b1ae6..78b756364ac 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-expected +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-expected @@ -31,6 +31,7 @@ set trash='+Trash' # Extra configuration color status cyan default + unset signature # notmuch section set nm_default_uri = "notmuch:///home/hm-user/Mail" diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf index 8c5c10439e6..576064243dc 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf @@ -30,4 +30,5 @@ set trash='+Trash' # Extra configuration + unset signature diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf index 8ccd3629ab0..354cc43ee69 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf @@ -30,4 +30,5 @@ set trash='+Trash' # Extra configuration color status cyan default + unset signature diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf index 22fcf7884bf..e5dee06168b 100644 --- a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf @@ -28,4 +28,5 @@ set trash='+Trash' # Extra configuration + unset signature diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-signature-command-expected b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-signature-command-expected new file mode 100644 index 00000000000..dfc8bc39ad8 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-signature-command-expected @@ -0,0 +1,38 @@ +# Generated by Home Manager. +set ssl_force_tls = yes +set certificate_file=/etc/ssl/certs/ca-certificates.crt + +# GPG section +set crypt_use_gpgme = yes +set crypt_autosign = no +set crypt_opportunistic_encrypt = no +set pgp_use_gpg_agent = yes +set mbox_type = Maildir +set sort = "threads" + +# MTA section +set smtp_pass="`password-command`" +set smtp_url='smtps://home.manager@smtp.example.com' + + + + + +# MRA section +set folder='/home/hm-user/Mail/hm@example.com' +set from='hm@example.com' +set postponed='+Drafts' +set realname='H. M. Test' +set record='+Sent' +set spoolfile='+Inbox' +set trash='+Trash' + + +# Extra configuration +color status cyan default + + +set signature = "/nix/store/00000000000000000000000000000000-signature|" +# notmuch section +set nm_default_uri = "notmuch:///home/hm-user/Mail" +virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox" diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-signature-expected b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-signature-expected new file mode 100644 index 00000000000..441374a9b8f --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/hm-example.com-signature-expected @@ -0,0 +1,38 @@ +# Generated by Home Manager. +set ssl_force_tls = yes +set certificate_file=/etc/ssl/certs/ca-certificates.crt + +# GPG section +set crypt_use_gpgme = yes +set crypt_autosign = no +set crypt_opportunistic_encrypt = no +set pgp_use_gpg_agent = yes +set mbox_type = Maildir +set sort = "threads" + +# MTA section +set smtp_pass="`password-command`" +set smtp_url='smtps://home.manager@smtp.example.com' + + + + + +# MRA section +set folder='/home/hm-user/Mail/hm@example.com' +set from='hm@example.com' +set postponed='+Drafts' +set realname='H. M. Test' +set record='+Sent' +set spoolfile='+Inbox' +set trash='+Trash' + + +# Extra configuration +color status cyan default + + +set signature = /nix/store/00000000000000000000000000000000-signature.txt +# notmuch section +set nm_default_uri = "notmuch:///home/hm-user/Mail" +virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox" diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/neomutt-with-signature-command.nix b/infra/libkookie/home-manager/tests/modules/programs/neomutt/neomutt-with-signature-command.nix new file mode 100644 index 00000000000..97c2001f964 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/neomutt-with-signature-command.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + imports = [ ../../accounts/email-test-accounts.nix ]; + + config = { + accounts.email.accounts = { + "hm@example.com" = { + notmuch.enable = true; + neomutt = { + enable = true; + extraConfig = '' + color status cyan default + ''; + }; + imap.port = 993; + signature = { + showSignature = "append"; + command = pkgs.writeScript "signature" "echo This is my signature"; + }; + }; + }; + + programs.neomutt = { + enable = true; + vimKeys = false; + }; + + test.stubs.neomutt = { }; + + nmt.script = '' + assertFileExists home-files/.config/neomutt/neomuttrc + assertFileExists home-files/.config/neomutt/hm@example.com + assertFileContent home-files/.config/neomutt/neomuttrc ${ + ./neomutt-expected.conf + } + expectedSignature=$(normalizeStorePaths "home-files/.config/neomutt/hm@example.com") + assertFileContent "$expectedSignature" ${ + ./hm-example.com-signature-command-expected + } + ''; + }; +} diff --git a/infra/libkookie/home-manager/tests/modules/programs/neomutt/neomutt-with-signature.nix b/infra/libkookie/home-manager/tests/modules/programs/neomutt/neomutt-with-signature.nix new file mode 100644 index 00000000000..9461976d3ef --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/neomutt/neomutt-with-signature.nix @@ -0,0 +1,48 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + imports = [ ../../accounts/email-test-accounts.nix ]; + + config = { + accounts.email.accounts = { + "hm@example.com" = { + notmuch.enable = true; + neomutt = { + enable = true; + extraConfig = '' + color status cyan default + ''; + }; + imap.port = 993; + signature = { + showSignature = "append"; + text = '' + -- + Test Signature + ''; + }; + }; + }; + + programs.neomutt = { + enable = true; + vimKeys = false; + }; + + test.stubs.neomutt = { }; + + nmt.script = '' + assertFileExists home-files/.config/neomutt/neomuttrc + assertFileExists home-files/.config/neomutt/hm@example.com + assertFileContent home-files/.config/neomutt/neomuttrc ${ + ./neomutt-expected.conf + } + expectedSignature=$(normalizeStorePaths "home-files/.config/neomutt/hm@example.com") + assertFileContent "$expectedSignature" ${ + ./hm-example.com-signature-expected + } + ''; + }; +} diff --git a/infra/libkookie/home-manager/tests/modules/programs/swaylock/config b/infra/libkookie/home-manager/tests/modules/programs/swaylock/config new file mode 100644 index 00000000000..fdda03ea09f --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/swaylock/config @@ -0,0 +1,5 @@ +color=808080 +font-size=24 +indicator-radius=100 +line-color=ffffff +show-failed-attempts diff --git a/infra/libkookie/home-manager/tests/modules/programs/swaylock/default.nix b/infra/libkookie/home-manager/tests/modules/programs/swaylock/default.nix new file mode 100644 index 00000000000..a8a33fd691f --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/swaylock/default.nix @@ -0,0 +1,4 @@ +{ + swaylock-disabled = import ./disabled.nix; + swaylock-settings = import ./settings.nix; +} diff --git a/infra/libkookie/home-manager/tests/modules/programs/swaylock/disabled.nix b/infra/libkookie/home-manager/tests/modules/programs/swaylock/disabled.nix new file mode 100644 index 00000000000..94dd14dc708 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/swaylock/disabled.nix @@ -0,0 +1,7 @@ +{ ... }: { + programs.swaylock.settings = { }; + + nmt.script = '' + assertPathNotExists home-files/.config/swaylock/config + ''; +} diff --git a/infra/libkookie/home-manager/tests/modules/programs/swaylock/settings.nix b/infra/libkookie/home-manager/tests/modules/programs/swaylock/settings.nix new file mode 100644 index 00000000000..9ad46ba5a6a --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/programs/swaylock/settings.nix @@ -0,0 +1,16 @@ +{ ... }: { + programs.swaylock.settings = { + color = "808080"; + font-size = 24; + indicator-idle-visible = false; # Test that this does nothing + indicator-radius = 100; + line-color = "ffffff"; + show-failed-attempts = true; + }; + + nmt.script = let homeConfig = "home-files/.config/swaylock/config"; + in '' + assertFileExists ${homeConfig} + assertFileContent ${homeConfig} ${./config} + ''; +} diff --git a/infra/libkookie/home-manager/tests/modules/services/mopidy/basic-configuration.conf b/infra/libkookie/home-manager/tests/modules/services/mopidy/basic-configuration.conf new file mode 100644 index 00000000000..3654b961054 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mopidy/basic-configuration.conf @@ -0,0 +1,10 @@ +[file] +enabled = true +media_dirs = + $XDG_MUSIC_DIR|Music + ~/Downloads|Downloads + +[spotify] +client_id = TOTALLY_NOT_A_FAKE_CLIENT_ID +client_secret = YOU_CAN_USE_ME_FOR_YOUR_SPOTIFY_PREMIUM_SUBSCRIPTION +enabled = true diff --git a/infra/libkookie/home-manager/tests/modules/services/mopidy/basic-configuration.nix b/infra/libkookie/home-manager/tests/modules/services/mopidy/basic-configuration.nix new file mode 100644 index 00000000000..418bfde1f6c --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mopidy/basic-configuration.nix @@ -0,0 +1,38 @@ +{ config, pkgs, ... }: + +{ + services.mopidy = { + enable = true; + settings = { + file = { + enabled = true; + media_dirs = [ "$XDG_MUSIC_DIR|Music" "~/Downloads|Downloads" ]; + }; + + spotify = { + enabled = true; + client_id = "TOTALLY_NOT_A_FAKE_CLIENT_ID"; + client_secret = "YOU_CAN_USE_ME_FOR_YOUR_SPOTIFY_PREMIUM_SUBSCRIPTION"; + }; + }; + }; + + test.stubs.mopidy = { + version = "0"; + outPath = null; + buildScript = '' + mkdir -p $out/bin + touch $out/bin/mopidy + chmod +x $out/bin/mopidy + ''; + }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/mopidy.service + assertFileExists home-files/.config/systemd/user/mopidy-scan.service + + assertFileExists home-files/.config/mopidy/mopidy.conf + assertFileContent home-files/.config/mopidy/mopidy.conf \ + ${./basic-configuration.conf} + ''; +} diff --git a/infra/libkookie/home-manager/tests/modules/services/mopidy/default.nix b/infra/libkookie/home-manager/tests/modules/services/mopidy/default.nix new file mode 100644 index 00000000000..2f2c33d2351 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mopidy/default.nix @@ -0,0 +1 @@ +{ mopidy-basic-configuration = ./basic-configuration.nix; } diff --git a/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.config b/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.config new file mode 100644 index 00000000000..e68277562a8 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.config @@ -0,0 +1,8 @@ +[Bling] +mmkeys = True +notify = True + +[Connection] +host = 127.0.0.1 +music_dir = /home/hm-user/music +port = 6600 diff --git a/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.nix b/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.nix new file mode 100644 index 00000000000..5e809df394c --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + services.mpdris2 = { + enable = true; + notifications = true; + multimediaKeys = true; + }; + + test.stubs.mpdris2 = { }; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/mpdris2.service + assertFileContent "$serviceFile" ${./basic-configuration.service} + + configFile=home-files/.config/mpDris2/mpDris2.conf + assertFileContent "$configFile" ${./basic-configuration.config} + ''; +} diff --git a/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.service b/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.service new file mode 100644 index 00000000000..2ea4656c752 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mpdris2/basic-configuration.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=default.target + +[Service] +BusName=org.mpris.MediaPlayer2.mpd +ExecStart=@mpdris2@/bin/mpDris2 +Restart=on-failure +RestartSec=5s +Type=simple + +[Unit] +After=mpd.service +Description=MPRIS 2 support for MPD diff --git a/infra/libkookie/home-manager/tests/modules/services/mpdris2/default.nix b/infra/libkookie/home-manager/tests/modules/services/mpdris2/default.nix new file mode 100644 index 00000000000..eaf6be337ff --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mpdris2/default.nix @@ -0,0 +1,4 @@ +{ + mpdris2-basic-configuration = ./basic-configuration.nix; + mpdris2-with-password = ./with-password.nix; +} diff --git a/infra/libkookie/home-manager/tests/modules/services/mpdris2/with-password.config b/infra/libkookie/home-manager/tests/modules/services/mpdris2/with-password.config new file mode 100644 index 00000000000..939a4058999 --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mpdris2/with-password.config @@ -0,0 +1,9 @@ +[Bling] +mmkeys = False +notify = False + +[Connection] +host = somehost +music_dir = /home/hm-user/music +password = foo +port = 42 diff --git a/infra/libkookie/home-manager/tests/modules/services/mpdris2/with-password.nix b/infra/libkookie/home-manager/tests/modules/services/mpdris2/with-password.nix new file mode 100644 index 00000000000..fcfe153151e --- /dev/null +++ b/infra/libkookie/home-manager/tests/modules/services/mpdris2/with-password.nix @@ -0,0 +1,22 @@ +{ ... }: + +{ + services.mpdris2 = { + enable = true; + mpd = { + host = "somehost"; + port = 42; + password = "foo"; + }; + }; + + test.stubs.mpdris2 = { }; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/mpdris2.service + assertFileContent "$serviceFile" ${./basic-configuration.service} + + configFile=home-files/.config/mpDris2/mpDris2.conf + assertFileContent "$configFile" ${./with-password.config} + ''; +}