commit
ea24089e12
@ -1,2 +1 @@ |
||||
/flake.lock |
||||
/result* |
||||
|
@ -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. |
@ -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 |
||||
} |
@ -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>users.users.<name>.packages</option> option |
||||
''; |
||||
|
||||
useGlobalPkgs = mkEnableOption '' |
||||
using the system configuration's <literal>pkgs</literal> |
||||
argument in Home Manager. This disables the Home Manager |
||||
options <option>nixpkgs.*</option> |
||||
''; |
||||
|
||||
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 <literal>specialArgs</literal> 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" ]; |
||||
}; |
||||
} |
@ -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 <option>home.pointerCursor</option> |
||||
''; |
||||
|
||||
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 <option>home.pointerCursor</option> |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
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 <literal>null</literal> to disable. |
||||
</para><para> |
||||
Top-level options declared under this submodule are backend indepedent |
||||
options. Options declared under namespaces such as <literal>x11</literal> |
||||
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, <varname> |
||||
<link linkend="opt-home.pointerCursor.x11.enable">home.pointerCursor.x11.enable</link> |
||||
</varname> 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; }; |
||||
}) |
||||
]); |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -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 <quote>light</quote> and <quote>dark</quote> |
||||
that applies light and dark color theme configurations. |
||||
|
||||
</para><para> |
||||
|
||||
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. |
||||
|
||||
</para><para> |
||||
|
||||
For example, to activate the <quote>dark</quote> specialization. You can |
||||
first look up your current Home Manager generation by running |
||||
|
||||
<programlisting language="console"> |
||||
$ home-manager generations | head -1 |
||||
2022-05-02 22:49 : id 1758 -> /nix/store/jy…ac-home-manager-generation |
||||
</programlisting> |
||||
|
||||
then run |
||||
|
||||
<programlisting language="console"> |
||||
$ /nix/store/jy…ac-home-manager-generation/specialization/dark/activate |
||||
Starting Home Manager activation |
||||
… |
||||
</programlisting> |
||||
|
||||
</para><para> |
||||
|
||||
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)} |
||||
''; |
||||
}; |
||||
} |
@ -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"; |
||||
}; |
||||
}; |
||||
}; |
||||
} |
||||
|
@ -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 <command>swaylock</command>. 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); |
||||
}; |
||||
} |
@ -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 |
||||
<filename>$XDG_CONFIG_HOME/tealdeer/config.toml</filename> on Linux or |
||||
<filename>$HOME/Library/Application Support/tealdeer/config.toml</filename> |
||||
on Darwin. See |
||||
<link xlink:href="https://dbrgn.github.io/tealdeer/config.html"/> |
||||
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; |
||||
}; |
||||
}; |
||||
} |
@ -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 |
||||
<filename>$XDG_CONFIG_HOME/mopidy/mopidy.conf</filename>. |
||||
</para><para> |
||||
See <link xlink:href="https://docs.mopidy.com/en/latest/config/"/> 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" ]; |
||||
}; |
||||
}; |
||||
} |
@ -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 |
||||
<varname>xorg.xcursorthemes</varname> contains cursors named |
||||
whiteglass, redglass, and handhelds. The package |
||||
<varname>vanilla-dmz</varname> 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} |
||||
''; |
||||
}; |
||||
} |
@ -0,0 +1 @@ |
||||
{ 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" |
||||
''; |
||||
} |
@ -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" |
@ -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" |
@ -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 |
||||
} |
||||
''; |
||||
}; |
||||
} |
@ -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 |
||||
} |
||||
''; |
||||
}; |
||||
} |
@ -0,0 +1,5 @@ |
||||
color=808080 |
||||
font-size=24 |
||||
indicator-radius=100 |
||||
line-color=ffffff |
||||
show-failed-attempts |
@ -0,0 +1,4 @@ |
||||
{ |
||||
swaylock-disabled = import ./disabled.nix; |
||||
swaylock-settings = import ./settings.nix; |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ ... }: { |
||||
programs.swaylock.settings = { }; |
||||
|
||||
nmt.script = '' |
||||
assertPathNotExists home-files/.config/swaylock/config |
||||
''; |
||||
} |
@ -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} |
||||
''; |
||||
} |
@ -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 |
@ -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} |
||||
''; |
||||
} |
@ -0,0 +1 @@ |
||||
{ mopidy-basic-configuration = ./basic-configuration.nix; } |
@ -0,0 +1,8 @@ |
||||
[Bling] |
||||
mmkeys = True |
||||
notify = True |
||||
|
||||
[Connection] |
||||
host = 127.0.0.1 |
||||
music_dir = /home/hm-user/music |
||||
port = 6600 |
@ -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} |
||||
''; |
||||
} |
@ -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 |
@ -0,0 +1,4 @@ |
||||
{ |
||||
mpdris2-basic-configuration = ./basic-configuration.nix; |
||||
mpdris2-with-password = ./with-password.nix; |
||||
} |
@ -0,0 +1,9 @@ |
||||
[Bling] |
||||
mmkeys = False |
||||
notify = False |
||||
|
||||
[Connection] |
||||
host = somehost |
||||
music_dir = /home/hm-user/music |
||||
password = foo |
||||
port = 42 |
@ -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} |
||||
''; |
||||
} |
Loading…
Reference in new issue