Compare commits

...

20 commits

Author SHA1 Message Date
Will Dietz bbe82a3ac5
mbsync: add option to add extra account configuration
(cherry picked from commit 5770dc58b9)
2018-10-05 17:39:48 +02:00
Edward Betts ee242ec757
Correct spelling mistakes
(cherry picked from commit 36da7a918f)
2018-10-05 17:39:48 +02:00
Matthieu Coudron 038f1eac11
rofi: fix default path
(cherry picked from commit 782d2fab83)
2018-10-05 17:39:48 +02:00
Matthieu Coudron 44a1e72d2e
alot: add module
Alot is a python mail user agent (MUA) built around the Notmuch mail
system.

(cherry picked from commit d9c5d3c868)
2018-10-05 17:39:42 +02:00
Robert Helgesson f34e5f1c6c
lib: copy module from NixOS
Importing the module directly from NixOS causes the documentation to
break, in particular the "Declared by" section.

Fixes #405

(cherry picked from commit 9b3122e92c)
2018-10-05 17:39:10 +02:00
Mario Rodas d268605244
bash: fix bashrcExtra interactive shell test
To determine if bash is running interactively test whether "$-"
contains "i".

See: https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html
(cherry picked from commit a1a7e7cd24)
2018-10-05 17:39:10 +02:00
Robert Helgesson 091f52197d
xresources: remove unnecessary parentheses
(cherry picked from commit 6957911657)
2018-09-24 23:54:48 +02:00
Robert Helgesson 68228fce93
xresources: run xrdb -merge on change
Fixes #400

(cherry picked from commit 7cc36b7703)
2018-09-24 23:54:48 +02:00
Matthieu Coudron 26b16162b7
accounts.emails: adding gpg/signature modules
(cherry picked from commit 9407b42f97)
2018-09-24 23:54:48 +02:00
Matthieu Coudron b17b760755
mbsync: add options extraConfig.{channel|local|remote}
To allow supporting more advanced configurations. The local refers to
the "maildir store" configuration, remote to the "IMAP store", and
"channel" to the channel.

(cherry picked from commit 151f29a17a)
2018-09-24 23:54:48 +02:00
Roman Volosatovs 9d7f7fe3a8
go: Fix package example
(cherry picked from commit f7dc354f42)
2018-09-24 23:54:48 +02:00
Robert Helgesson b19478d820
taffybar: fix indentation
(cherry picked from commit 4d870f665b)
2018-09-24 23:54:47 +02:00
Roman Volosatovs e11f110b4b
go: add module
(cherry picked from commit 0635423e73)
2018-09-24 23:54:44 +02:00
Robert Helgesson 451f376231
xsession: add option xsession.scriptPath
This option allows overriding the default script path `~/.xsession`.
On NixOS, this is needed to allow multiple possible graphical login
sessions.

Fixes #391.

(cherry picked from commit 9f0fdc68a9)
2018-09-24 23:53:55 +02:00
Robert Helgesson f3c02513a9
Remove unnecessary dag variables
Also remove a few trailing whitespaces.

(cherry picked from commit 701b4130bd)
2018-09-24 23:53:55 +02:00
Adam Washington 85cd97e616
zathura: add module
Add the zathura document viewer as a program option with support for
managing the zathurarc configuration file.

(cherry picked from commit d27bccdff1)
2018-09-24 23:53:55 +02:00
Minijackson b641138602
taskwarrior: add module
(cherry picked from commit 5ff03ce5ac)
2018-09-24 23:53:55 +02:00
Nikita Uvarov 310b604f92
vim: improve instructions for listing available plugins
(cherry picked from commit 6eea2a409e)
2018-09-24 23:53:54 +02:00
Robert Helgesson 94fad32e41
emacs: add internal finalPackage option
(cherry picked from commit 50de1a6885)
2018-09-14 22:24:02 +02:00
gnidorah 163588b61b
i3 module: add missing pieces to default config
(cherry picked from commit 055d100548)
2018-09-11 19:45:58 +02:00
23 changed files with 696 additions and 59 deletions

View file

@ -6,6 +6,52 @@ let
cfg = config.accounts.email;
gpgModule = types.submodule {
options = {
key = mkOption {
type = types.str;
description = ''
The key to use as listed in <command>gpg --list-keys</command>.
'';
};
signByDefault = mkOption {
type = types.bool;
default = false;
description = "Sign messages by default.";
};
encryptByDefault = mkOption {
type = types.bool;
default = false;
description = "Encrypt outgoing messages by default.";
};
};
};
signatureModule = types.submodule {
options = {
text = mkOption {
type = types.str;
default = "";
example = ''
--
Luke Skywalker
May the force be with you.
'';
description = ''
Signature content.
'';
};
showSignature = mkOption {
type = types.enum [ "append" "attach" "none" ];
default = "none";
description = "Method to communicate the signature.";
};
};
};
tlsModule = types.submodule {
options = {
enable = mkOption {
@ -237,6 +283,22 @@ let
'';
};
signature = mkOption {
type = signatureModule;
default = {};
description = ''
Signature configuration.
'';
};
gpg = mkOption {
type = types.nullOr gpgModule;
default = null;
description = ''
GPG configuration.
'';
};
smtp = mkOption {
type = types.nullOr smtpModule;
default = null;
@ -317,6 +379,7 @@ in
accounts = mkOption {
type = types.attrsOf (types.submodule [
mailAccountOpts
(import ../programs/alot-accounts.nix)
(import ../programs/mbsync-accounts.nix)
(import ../programs/msmtp-accounts.nix)
(import ../programs/notmuch-accounts.nix)

14
modules/misc/lib.nix Normal file
View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
options = {
lib = lib.mkOption {
type = lib.types.attrsOf lib.types.attrs;
default = {};
description = ''
This option allows modules to define helper functions,
constants, etc.
'';
};
};
}

View file

@ -779,6 +779,34 @@ in
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-20T22:10:45+00:00";
message = ''
A new module is available: 'programs.go'.
'';
}
{
time = "2018-09-28T21:38:48+00:00";
message = ''
A new module is available: 'programs.alot'.
'';
}
];
};
}

View file

@ -19,11 +19,13 @@ let
./manual.nix
./misc/fontconfig.nix
./misc/gtk.nix
./misc/lib.nix
./misc/news.nix
./misc/nixpkgs.nix
./misc/pam.nix
./misc/qt.nix
./misc/xdg.nix
./programs/alot.nix
./programs/autorandr.nix
./programs/bash.nix
./programs/beets.nix
@ -38,6 +40,7 @@ let
./programs/fzf.nix
./programs/git.nix
./programs/gnome-terminal.nix
./programs/go.nix
./programs/home-manager.nix
./programs/htop.nix
./programs/info.nix
@ -53,9 +56,11 @@ let
./programs/pidgin.nix
./programs/rofi.nix
./programs/ssh.nix
./programs/taskwarrior.nix
./programs/termite.nix
./programs/texlive.nix
./programs/vim.nix
./programs/zathura.nix
./programs/zsh.nix
./services/blueman-applet.nix
./services/compton.nix
@ -93,7 +98,6 @@ let
./xresources.nix
./xsession.nix
<nixpkgs/nixos/modules/misc/assertions.nix>
<nixpkgs/nixos/modules/misc/lib.nix>
<nixpkgs/nixos/modules/misc/meta.nix>
]
++

View file

@ -0,0 +1,32 @@
{ config, lib, ... }:
with lib;
{
options.alot = {
sendMailCommand = mkOption {
type = types.nullOr types.str;
description = ''
Command to send a mail. If msmtp is enabled for the account,
then this is set to
<command>msmtpq --read-envelope-from --read-recipients</command>.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra settings to add to this Alot account configuration.
'';
};
};
config = mkIf config.notmuch.enable {
alot.sendMailCommand = mkOptionDefault (
if config.msmtp.enable
then "msmtpq --read-envelope-from --read-recipients"
else null
);
};
}

167
modules/programs/alot.nix Normal file
View file

@ -0,0 +1,167 @@
# alot config loader is sensitive to leading space !
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.alot;
alotAccounts = filter (a: a.notmuch.enable)
(attrValues config.accounts.email.accounts);
boolStr = v: if v then "True" else "False";
accountStr = account: with account;
concatStringsSep "\n" (
[ "[[${name}]]" ]
++ mapAttrsToList (n: v: n + "=" + v) (
{
address = address;
realname = realName;
sendmail_command =
optionalString (alot.sendMailCommand != null) alot.sendMailCommand;
}
// optionalAttrs (gpg != null) {
gpg_key = gpg.key;
encrypt_by_default = if gpg.encryptByDefault then "all" else "none";
sign_by_default = boolStr gpg.signByDefault;
}
// optionalAttrs (signature.showSignature != "none") {
signature = pkgs.writeText "signature.txt" signature.text;
signature_as_attachment =
boolStr (signature.showSignature == "attach");
}
)
)
+ "\n"
+ alot.extraConfig;
configFile =
let
bindingsToStr = attrSet:
concatStringsSep "\n" (mapAttrsToList (n: v: "${n} = ${v}") attrSet);
in
''
# Generated by Home Manager.
# See http://alot.readthedocs.io/en/latest/configuration/config_options.html
${cfg.extraConfig}
[bindings]
${bindingsToStr cfg.bindings.global}
[[bufferlist]]
${bindingsToStr cfg.bindings.bufferlist}
[[search]]
${bindingsToStr cfg.bindings.search}
[[envelope]]
${bindingsToStr cfg.bindings.envelope}
[[taglist]]
${bindingsToStr cfg.bindings.taglist}
[[thread]]
${bindingsToStr cfg.bindings.thread}
[accounts]
${concatStringsSep "\n\n" (map accountStr alotAccounts)}
'';
in
{
options.programs.alot = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether to enable the Alot mail user agent. Alot uses the
Notmuch email system and will therefore be automatically
enabled for each email account that is managed by Notmuch.
'';
};
hooks = mkOption {
type = types.lines;
default = "";
description = ''
Content of the hooks file.
'';
};
bindings = mkOption {
type = types.submodule {
options = {
global = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Global keybindings.";
};
bufferlist = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Bufferlist mode keybindings.";
};
search = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Search mode keybindings.";
};
envelope = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Envelope mode keybindings.";
};
taglist = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Taglist mode keybindings.";
};
thread = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Thread mode keybindings.";
};
};
};
default = {};
description = ''
Keybindings.
'';
};
extraConfig = mkOption {
type = types.lines;
default = ''
auto_remove_unread = True
ask_subject = False
handle_mouse = True
initial_command = "search tag:inbox AND NOT tag:killed"
input_timeout = 0.3
prefer_plaintext = True
thread_indent_replies = 4
'';
description = ''
Extra lines added to alot configuration file.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.alot ];
xdg.configFile."alot/config".text = configFile;
xdg.configFile."alot/hooks.py".text =
''
# Generated by Home Manager.
''
+ cfg.hooks;
};
}

View file

@ -155,7 +155,7 @@ in
in mkIf cfg.enable {
programs.bash.bashrcExtra = ''
# Commands that should be applied only for interactive shells.
if [[ -n $PS1 ]]; then
if [[ $- == *i* ]]; then
${historyControlStr}
${shoptsStr}

View file

@ -33,10 +33,19 @@ in
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
description = "Extra packages available to Emacs.";
};
finalPackage = mkOption {
type = types.package;
internal = true;
readOnly = true;
description = "The Emacs package including any extra packages.";
};
};
};
config = mkIf cfg.enable {
home.packages = [ (emacsWithPackages cfg.extraPackages) ];
home.packages = [ cfg.finalPackage ];
programs.emacs.finalPackage = emacsWithPackages cfg.extraPackages;
};
}

75
modules/programs/go.nix Normal file
View file

@ -0,0 +1,75 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.go;
in
{
meta.maintainers = [ maintainers.rvolosatovs ];
options = {
programs.go = {
enable = mkEnableOption "Go";
package = mkOption {
type = types.package;
default = pkgs.go;
defaultText = "pkgs.go";
description = "The Go package to use.";
};
packages = mkOption {
type = with types; attrsOf path;
default = {};
example = literalExample ''
{
"golang.org/x/text" = builtins.fetchGit "https://go.googlesource.com/text";
"golang.org/x/time" = builtins.fetchGit "https://go.googlesource.com/time";
}
'';
description = "Packages to add to GOPATH.";
};
goPath = mkOption {
type = with types; nullOr str;
default = null;
example = "go";
description = "GOPATH relative to HOME";
};
goBin = mkOption {
type = with types; nullOr str;
default = null;
example = ".local/bin.go";
description = "GOBIN relative to HOME";
};
};
};
config = mkIf cfg.enable (mkMerge [
{
home.packages = [ cfg.package ];
home.file =
let
goPath = if cfg.goPath != null then cfg.goPath else "go";
mkSrc = n: v: {
target = "${goPath}/src/${n}";
source = v;
};
in
mapAttrsToList mkSrc cfg.packages;
}
(mkIf (cfg.goPath != null) {
home.sessionVariables.GOPATH = builtins.toPath "${config.home.homeDirectory}/${cfg.goPath}";
})
(mkIf (cfg.goBin != null) {
home.sessionVariables.GOBIN = builtins.toPath "${config.home.homeDirectory}/${cfg.goBin}";
})
]);
}

View file

@ -2,6 +2,12 @@
with lib;
let
extraConfigType = with lib.types; attrsOf (either (either str int) bool);
in
{
options.mbsync = {
enable = mkEnableOption "synchronization using mbsync";
@ -53,5 +59,49 @@ with lib;
Pattern of mailboxes to synchronize.
'';
};
extraConfig.channel = mkOption {
type = extraConfigType;
default = {};
example = literalExample ''
{
MaxMessages = 10000;
MaxSize = "1m";
};
'';
description = ''
Per channel extra configuration.
'';
};
extraConfig.local = mkOption {
type = extraConfigType;
default = {};
description = ''
Local store extra configuration.
'';
};
extraConfig.remote = mkOption {
type = extraConfigType;
default = {};
description = ''
Remote store extra configuration.
'';
};
extraConfig.account = mkOption {
type = extraConfigType;
default = {};
example = literalExample ''
{
PipelineDepth = 10;
Timeout = 60;
};
'';
description = ''
Account section extra configuration.
'';
};
};
}

View file

@ -33,10 +33,14 @@ let
genSection = header: entries:
let
escapeValue = escape [ "\"" ];
hasSpace = v: builtins.match ".* .*" v != null;
genValue = v:
if isList v
then concatMapStringsSep " " genValue v
else "\"${escapeValue v}\"";
else if isBool v then (if v then "yes" else "no")
else if isInt v then toString v
else if hasSpace v then "\"${escapeValue v}\""
else v;
in
''
${header}
@ -54,15 +58,17 @@ let
User = userName;
PassCmd = toString passwordCommand;
}
//
genTlsConfig imap.tls
//
optionalAttrs (imap.port != null) { Port = toString imap.port; }
// genTlsConfig imap.tls
// optionalAttrs (imap.port != null) { Port = toString imap.port; }
// mbsync.extraConfig.account
)
+ "\n"
+ genSection "IMAPStore ${name}-remote" {
Account = name;
}
+ genSection "IMAPStore ${name}-remote" (
{
Account = name;
}
// mbsync.extraConfig.remote
)
+ "\n"
+ genSection "MaildirStore ${name}-local" (
{
@ -70,19 +76,22 @@ let
Inbox = "${maildir.absPath}/${folders.inbox}";
SubFolders = "Verbatim";
}
//
optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
// optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
// mbsync.extraConfig.local
)
+ "\n"
+ genSection "Channel ${name}" {
Master = ":${name}-remote:";
Slave = ":${name}-local:";
Patterns = mbsync.patterns;
Create = masterSlaveMapping.${mbsync.create};
Remove = masterSlaveMapping.${mbsync.remove};
Expunge = masterSlaveMapping.${mbsync.expunge};
SyncState = "*";
}
+ genSection "Channel ${name}" (
{
Master = ":${name}-remote:";
Slave = ":${name}-local:";
Patterns = mbsync.patterns;
Create = masterSlaveMapping.${mbsync.create};
Remove = masterSlaveMapping.${mbsync.remove};
Expunge = masterSlaveMapping.${mbsync.expunge};
SyncState = "*";
}
// mbsync.extraConfig.channel
)
+ "\n";
genGroupConfig = name: channels:

View file

@ -6,8 +6,6 @@ let
cfg = config.programs.msmtp;
dag = config.lib.dag;
msmtpAccounts = filter (a: a.msmtp.enable)
(attrValues config.accounts.email.accounts);

View file

@ -4,8 +4,6 @@ with lib;
let
dag = config.lib.dag;
cfg = config.programs.notmuch;
mkIniKeyValue = key: value:
@ -24,12 +22,12 @@ let
database = {
path = config.accounts.email.maildirBasePath;
};
new = {
ignore = cfg.new.ignore;
tags = cfg.new.tags;
};
user =
let
accounts =
@ -42,7 +40,7 @@ let
primary_email = catAttrs "address" primary;
other_email = catAttrs "address" secondaries;
};
search = {
exclude_tags = [ "deleted" "spam" ];
};
@ -168,7 +166,7 @@ in
export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH"
export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/notmuchrc"
export NMBGIT="${config.xdg.dataHome}/notmuch/nmbug"
${cmds}
'';
executable = true;

View file

@ -280,7 +280,7 @@ in
};
configPath = mkOption {
default = ".config/rofi/config";
default = "${config.xdg.configHome}/rofi/config";
type = types.string;
description = "Path where to put generated configuration file.";
};

View file

@ -0,0 +1,112 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.taskwarrior;
themePath = theme: "${pkgs.taskwarrior}/share/doc/task/rc/${theme}.theme";
includeTheme = location:
if location == null then ""
else if isString location then "include ${themePath location}"
else "include ${location}";
formatValue = value:
if isBool value then if value then "true" else "false"
else if isList value then concatMapStringsSep "," formatValue value
else toString value;
formatLine = key: value:
"${key}=${formatValue value}";
formatSet = key: values:
(concatStringsSep "\n"
(mapAttrsToList
(subKey: subValue: formatPair "${key}.${subKey}" subValue)
values));
formatPair = key: value:
if isAttrs value then formatSet key value
else formatLine key value;
in
{
options = {
programs.taskwarrior = {
enable = mkEnableOption "Task Warrior";
config = mkOption {
type = types.attrs;
default = {};
example = literalExample ''
{
confirmation = false;
report.minimal.filter = "status:pending";
report.active.columns = [ "id" "start" "entry.age" "priority" "project" "due" "description" ];
report.active.labels = [ "ID" "Started" "Age" "Priority" "Project" "Due" "Description" ];
taskd = {
certificate = "/path/to/cert";
key = "/path/to/key";
ca = "/path/to/ca";
server = "host.domain:53589";
credentials = "Org/First Last/cf31f287-ee9e-43a8-843e-e8bbd5de4294";
};
}
'';
description = ''
Key-value configuration written to
<filename>~/.taskrc</filename>.
'';
};
dataLocation = mkOption {
type = types.str;
default = "${config.xdg.dataHome}/task";
defaultText = "$XDG_DATA_HOME/task";
description = ''
Location where Task Warrior will store its data.
</para><para>
Home Manager will attempt to create this directory.
'';
};
colorTheme = mkOption {
type = with types; nullOr (either str path);
default = null;
example = "dark-blue-256";
description = ''
Either one of the default provided theme as string, or a
path to a theme configuration file.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Additional content written at the end of
<filename>~/.taskrc</filename>.
'';
};
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.taskwarrior ];
home.file."${cfg.dataLocation}/.keep".text = "";
home.file.".taskrc".text = ''
data.location=${cfg.dataLocation}
${includeTheme cfg.colorTheme}
${concatStringsSep "\n" (
mapAttrsToList formatPair cfg.config)}
${cfg.extraConfig}
'';
};
}

View file

@ -75,8 +75,8 @@ in
default = defaultPlugins;
example = [ "YankRing" ];
description = ''
List of vim plugins to install. For supported plugins see:
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/misc/vim-plugins/vim-plugin-names"/>.
List of vim plugins to install. To get a list of supported plugins run:
<command>nix-env -f '&lt;nixpkgs&gt;' -qaP -A vimPlugins</command>.
'';
};

View file

@ -0,0 +1,61 @@
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.programs.zathura;
formatLine = n: v:
let
formatValue = v:
if isBool v then (if v then "true" else "false")
else toString v;
in
"set ${n}\t\"${formatValue v}\"";
in
{
meta.maintainers = [ maintainers.rprospero ];
options.programs.zathura = {
enable = mkEnableOption ''
Zathura, a highly customizable and functional document viewer
focused on keyboard interaction'';
options = mkOption {
default = {};
type = with types; attrsOf (either str (either bool int));
description = ''
Add <option>:set</option> command options to zathura and make
them permanent. See
<citerefentry>
<refentrytitle>zathurarc</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry>
for the full list of options.
'';
example = { default-bg = "#000000"; default-fg = "#FFFFFF"; };
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Additional commands for zathura that will be added to the
<filename>zathurarc</filename> file.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.zathura ];
xdg.configFile."zathura/zathurarc".text =
concatStringsSep "\n" ([]
++ optional (cfg.extraConfig != "") cfg.extraConfig
++ mapAttrsToList formatLine cfg.options
) + "\n";
};
}

View file

@ -6,8 +6,6 @@ let
cfg = config.services.polybar;
dag = config.lib.dag;
toPolybarIni = generators.toINI {
mkKeyValue = key: value:
let
@ -61,7 +59,7 @@ in
(p: { "section/base" = { include-file = "${p}"; }; })
(types.attrsOf types.attrs);
description = ''
Polybar configuration. Can be either path to a file, or set of attibutes
Polybar configuration. Can be either path to a file, or set of attributes
that will be used to create the final configuration.
'';
default = {};

View file

@ -27,19 +27,19 @@ in
config = mkIf config.services.taffybar.enable {
systemd.user.services.taffybar = {
Unit = {
Description = "Taffybar desktop bar";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Unit = {
Description = "Taffybar desktop bar";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${cfg.package}/bin/taffybar";
};
Service = {
ExecStart = "${cfg.package}/bin/taffybar";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
};
}

View file

@ -6,8 +6,6 @@ let
cfg = config.xsession.windowManager.i3;
dag = config.lib.dag;
commonOptions = {
fonts = mkOption {
type = types.listOf types.string;
@ -378,7 +376,7 @@ let
type = types.attrsOf (types.listOf criteriaModule);
default = {};
description = ''
An attribute set that assignes applications to workspaces based
An attribute set that assigns applications to workspaces based
on criteria.
'';
example = literalExample ''
@ -408,6 +406,11 @@ let
"${cfg.config.modifier}+Up" = "focus up";
"${cfg.config.modifier}+Right" = "focus right";
"${cfg.config.modifier}+Shift+Left" = "move left";
"${cfg.config.modifier}+Shift+Down" = "move down";
"${cfg.config.modifier}+Shift+Up" = "move up";
"${cfg.config.modifier}+Shift+Right" = "move right";
"${cfg.config.modifier}+h" = "split h";
"${cfg.config.modifier}+v" = "split v";
"${cfg.config.modifier}+f" = "fullscreen toggle";
@ -417,6 +420,7 @@ let
"${cfg.config.modifier}+e" = "layout toggle split";
"${cfg.config.modifier}+Shift+space" = "floating toggle";
"${cfg.config.modifier}+space" = "focus mode_toggle";
"${cfg.config.modifier}+1" = "workspace 1";
"${cfg.config.modifier}+2" = "workspace 2";
@ -469,7 +473,7 @@ let
type = types.attrs;
default = {};
description = ''
An attribute set that assignes keypress to an action using key code.
An attribute set that assigns keypress to an action using key code.
See <link xlink:href="https://i3wm.org/docs/userguide.html#keybindings"/>.
'';
example = { "214" = "exec --no-startup-id /bin/script.sh"; };

View file

@ -6,8 +6,6 @@ let
cfg = config.xsession.windowManager.xmonad;
dag = config.lib.dag;
xmonad = pkgs.xmonad-with-packages.override {
ghcWithPackages = cfg.haskellPackages.ghcWithPackages;
packages = self:

View file

@ -69,10 +69,17 @@ in
};
config = mkIf (cfg.properties != null || cfg.extraConfig != "") {
home.file.".Xresources".text =
concatStringsSep "\n" ([]
++ (optional (cfg.extraConfig != "") cfg.extraConfig)
++ (optionals (cfg.properties != null) (mapAttrsToList formatLine cfg.properties))
) + "\n";
home.file.".Xresources" = {
text =
concatStringsSep "\n" ([]
++ optional (cfg.extraConfig != "") cfg.extraConfig
++ optionals (cfg.properties != null) (mapAttrsToList formatLine cfg.properties)
) + "\n";
onChange = ''
if [[ -v DISPLAY ]] ; then
$DRY_RUN_CMD ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.Xresources
fi
'';
};
};
}

View file

@ -15,6 +15,16 @@ in
xsession = {
enable = mkEnableOption "X Session";
scriptPath = mkOption {
type = types.str;
default = ".xsession";
example = ".xsession-hm";
description = ''
Path, relative <envar>HOME</envar>, where Home Manager
should write the X session script.
'';
};
windowManager.command = mkOption {
type = types.str;
example = literalExample ''
@ -117,7 +127,7 @@ in
export HM_XPROFILE_SOURCED=1
'';
home.file.".xsession" = {
home.file.${cfg.scriptPath} = {
executable = true;
text = ''
if [[ ! -v HM_XPROFILE_SOURCED ]]; then