Compare commits

...

35 commits

Author SHA1 Message Date
dependabot[bot] 454abeb5a8
ci: bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 01:25:15 +00:00
Bart Bakker 7329ffc6e9
htop: fix order or header_columns setting (backport) (#2443)
Backport of !2435 to fix #2426 on release branch.
2021-11-30 09:15:21 -05:00
Robert Helgesson 7efd99ef87
firefox: fix test case
(cherry picked from commit a19f40d39d)
2021-11-26 10:11:34 +01:00
Robert Helgesson 5721e19975
firefox: fix tests
(cherry picked from commit 18461b5dda)
2021-11-26 10:11:22 +01:00
dependabot[bot] 2a8974098b
ci: bump cachix/install-nix-action from 15 to 16
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 15 to 16.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v15...v16)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit a28cf79a78)
2021-11-26 10:10:13 +01:00
dependabot[bot] bcf03fa16a
ci: bump cachix/install-nix-action from 14 to 15
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 14 to 15.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v14...v15)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-15 23:33:21 +00:00
Robert Helgesson 4f1f57deca
ci: explicitly set Nix version 2021-11-16 00:22:44 +01:00
Robert Helgesson ff2bed9dac
ci: update install-nix-action to v14.1
(cherry picked from commit b5d738b5a3)
2021-10-18 10:01:08 +02:00
Lava 49695f33aa
xresources: Add path configuration option (#2141)
* xresources: Add path configuration option

This allows the user to move .Xresources somewhere else, which can help
with decluttering the home directory.

* xresources: Update xresources.path docs

* xresources: Fix formatting

(cherry picked from commit dc4337d9fe)
2021-10-07 10:54:10 +02:00
Naïm Favier 68ec2dd609
xresources: load .Xresources in xsession.initExtra
(cherry picked from commit 1e8d0beae4)
2021-10-07 10:54:02 +02:00
Shamrock Lee 382505714d
java: add module
(cherry picked from commit a4a8307897)
2021-10-03 22:03:30 +02:00
Faye Duxovni 0e58ffec58
kanshi: allow multiple exec statements per profile
kanshi configurations can have more than one exec statement in a
profile. This change allows services.kanshi.profiles.<name>.exec to be
a list of strings rather than a single string.

(cherry picked from commit 095f3e32ae)
2021-10-03 18:25:35 +02:00
dependabot[bot] 7d9ba15214
ci: bump cachix/install-nix-action from 13 to 14
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 13 to 14.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v13...v14)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 5199bc841a)
2021-09-14 00:53:31 +02:00
crazymanjinn f5adb9be82
zsh: add completionInit option (#2046) (#2296)
Factored out from original .zshrc construction.

(cherry picked from commit 42847469b3)

Co-authored-by: bb010g <me@bb010g.com>
2021-08-27 10:57:07 -04:00
Connor Prussin 9f2b766d0f
[nixos] Fix race condition with user units (#2286) (#2287)
One of the things managed by the `home-manager-<username>` unit is the systemd
user directory `.config/systemd/user`.  However, this directory needs to be in
place completely before systemd user sessions start up or the user sessions will
come up with an incomplete listing of enabled units, etc.

There was a race condition where nothing prevented
`systemd-user-sessions.service` from starting ahead of the systemd user
directory's initialization completing.  This commit makes
`home-manager-<username>` finishes _before_ we start
`systemd-user-sessions.service` to avoid such race condition.

This issue was probably not all that noticeable in most cases, but when using a
non-persistent root config (i.e. tmp on / or
https://grahamc.com/blog/erase-your-darlings) the race condition triggering
causes all kinds of issues on each reboot.
2021-08-21 23:51:31 -04:00
Colin Summers b39647e52e
brave: fix config dir path (#2173)
Changes install path for extensions from `~/.config/brave` to
`~/.config/BraveSoftware/Brave-Browser` on Linux.

(cherry picked from commit 9e3c402972)
2021-07-30 14:55:12 +02:00
Bjørn Forsman 9c0abed522
taskwarrior: don't create dataLocation with home.file
With

  programs.taskwarrior.dataLocation = /absolute/path

(outside of $HOME) the current implementation wrongly creates
$HOME/absolute/path (due to how home.file is implemented).

Since taskwarrior creates the dataLocation automatically on first run,
there is actually no need for HM to create that directory.

Additional benefit, the .keep symlink that HM creates as a side-effect
no longer appears in the taskwarrior data directory.

Fixes #2207.

(cherry picked from commit 6c984bd675)
2021-07-24 22:27:24 +02:00
Naïm Favier 03db229cc2
setxkbmap: reset options before setting new ones (#2160)
(cherry picked from commit 4971b9cad0)
2021-07-24 22:26:43 +02:00
Kid 88de11327c
README: fix outdated description (#2131)
* README: fix outdated description

(cherry picked from commit 04955ca970)
2021-07-24 22:25:29 +02:00
Josh Holland 35a24648d1
direnv: add enableFlakes option for enableNixDirenvIntegration (#2089)
NixOS/nixpkgs@03310df843 disabled flake
support by default, so we now need to build a custom package and use it
if the user wants to `use flake` successfully.  This should fix #2087.

(cherry picked from commit e0f2949c98)
2021-06-21 00:35:57 +02:00
Naïm Favier d370447e28
nixos: set stopIfChanged to false (#2105)
There is no ExecStop so we can just restart the service.

(cherry picked from commit 4ed6705b0f)
2021-06-21 00:35:14 +02:00
puzzlewolf 2bfad60b73
etesync-dav: fix typo (#2067)
Upstream (https://github.com/etesync/etesync-dav/blob/master/README.md#configuration-and-running) uses 37358 as default port.

(cherry picked from commit e9ed9c2e11)
2021-06-21 00:32:23 +02:00
bb010g 8d64c164fc
home-manager: pass on --debug option (#2049)
* man-home-manager: remove trailing whitespace

* home-manager: pass on `--debug` option

(cherry picked from commit 5eb199e937)
2021-06-21 00:32:22 +02:00
Naïm Favier ffd6c84c25
dunst: add the whole package to home.packages (#2079)
The `dunst` package provides the `dunstctl` and `dunstify` command-line utilities which are useful to have.

(cherry picked from commit dba802c1d9)
2021-06-21 00:32:21 +02:00
Robert Helgesson d40f84a340
ci: run tests against nixos-21.05 2021-06-21 00:21:09 +02:00
Robert Helgesson 148d85ee83
docs: mark 21.05 as stable version
(cherry picked from commit 5c1415d67f)
2021-06-05 20:31:59 +02:00
Dusk Banks fd5fbb0a24
texlive: add packageSet option
(cherry picked from commit 45f9cb06a9)
2021-06-04 08:48:46 +02:00
Dusk Banks 0ff5951285
texlive: "Texlive" -> "TeX Live"
(cherry picked from commit c12d53dd7c)
2021-06-04 08:48:45 +02:00
Robert Helgesson b8edffb918
Replace references to pkgs.gnome3 by pkgs.gnome
(cherry picked from commit d3cdabb5c9)
2021-06-04 08:48:44 +02:00
Robert Helgesson cd33531e59
docs: minor additional issue template update
(cherry picked from commit 9e253a8c30)
2021-06-04 08:48:18 +02:00
Robert Helgesson 8c72c4f981
docs: update issue template
Most importantly change chat contact information.

(cherry picked from commit 5573c10ea4)
2021-06-04 08:48:17 +02:00
bb010g bfb65f2d8d
jq: add package option
(cherry picked from commit 0e329cee4c)
2021-06-04 08:48:16 +02:00
Robert Helgesson 913f722560
files: remove assertion on recursive onChange
See discussion in

  https://github.com/nix-community/home-manager/pull/2031

(cherry picked from commit d2aaeac42c)
2021-06-04 08:48:15 +02:00
Robert Helgesson 2f997178fa
files: fix use of onChange with directory source
Previously, the comparison would not handle directory comparison
correctly, always finding that the source and target differed. This
would trigger the `onChange` script on each activation.

Fixes #2004

(cherry picked from commit 07ad6a4f76)
2021-06-04 08:48:14 +02:00
Bart Bakker ffd4d9955b
htop: fix preserving the order of meters (#2068) (backport)
Pass meters for formatting in a list of attrsets so that ordering can be
preserved. In addition provide some mode-specific functions to create these
attrsets, to make for a bit nicer config.

This fixes #2060 on 21.05.
2021-06-03 22:29:06 -04:00
45 changed files with 360 additions and 192 deletions

2
.github/CODEOWNERS vendored
View file

@ -84,6 +84,8 @@
/modules/programs/i3status-rust.nix @workflow
/modules/programs/java.nix @ShamrockLee
/modules/programs/keychain.nix @marsam
/modules/programs/lazygit.nix @kalhauge

View file

@ -1,15 +1,7 @@
<!--
If you are encountering the error
element xref: validity error : IDREF attribute linkend references an unknown ID "opt-home.file._name__.source"
then it means that you are using an old version of Home Manager, such
as the release-20.03 branch, with a recent version of Nixpkgs, such as
version 20.09 or master. See https://git.io/JTb6K for more.
In general, please check if there already exists a relevant issue
before creating a new one.
Don't forget to check if there already exists a relevant issue before
creating a new one.
-->
@ -17,7 +9,8 @@ before creating a new one.
<!--
Please describe the issue. For support and help please use the IRC
channel #home-manager @ freenode.net instead.
channel #home-manager at irc.oftc.net or Matrix room
https://matrix.to/#/#hm:rycee.net instead.
-->
### Meta

View file

@ -10,8 +10,8 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v13
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10

View file

@ -10,10 +10,11 @@ jobs:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v13
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.3.16/install
nix_path: nixpkgs=channel:nixos-21.05
- uses: cachix/cachix-action@v10
with:
name: nix-community

View file

@ -32,7 +32,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 20.09 (the
Home Manager targets [NixOS][] unstable and NixOS version 21.05 (the
current stable version), it may or may not work on other Linux
distributions and NixOS versions.
@ -75,10 +75,10 @@ Currently the easiest way to install Home Manager is as follows:
$ nix-channel --update
```
and if you follow a Nixpkgs version 20.09 channel you can run
and if you follow a Nixpkgs version 21.05 channel you can run
```console
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
$ nix-channel --update
```
@ -142,7 +142,7 @@ configuration generations.
As an example, let us expand the initial configuration file from the
installation above to install the htop and fortune packages, install
Emacs with a few extra packages enabled, install Firefox with
smooth scrolling enabled, and enable the user gpg-agent service.
smooth scrolling disabled, and enable the user gpg-agent service.
To satisfy the above setup we should elaborate the
`~/.config/nixpkgs/home.nix` file as follows:
@ -279,7 +279,7 @@ then result in
$ home-manager switch
Activating checkLinkTargets
Existing file '/home/jdoe/.gitconfig' is in the way
Existing file '/home/jdoe/.config/git/config' is in the way
Please move the above files and try again
```
@ -366,7 +366,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-20.09`). These branches get fixes, but usually not new
(e.g. `release-21.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.

View file

@ -92,7 +92,7 @@ error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.
The solution on NixOS is to add
[source,nix]
services.dbus.packages = with pkgs; [ gnome3.dconf ];
services.dbus.packages = with pkgs; [ gnome.dconf ];
to your system configuration.

View file

@ -47,11 +47,11 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master
$ nix-channel --update
----
+
and if you follow a Nixpkgs version 20.09 channel, you can run
and if you follow a Nixpkgs version 21.05 channel, you can run
+
[source,console]
----
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
$ nix-channel --update
----
+
@ -125,11 +125,11 @@ or an unstable channel, you can run
# nix-channel --update
----
and if you follow a Nixpkgs version 20.09 channel, you can run
and if you follow a Nixpkgs version 21.05 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
# nix-channel --update
----
@ -203,11 +203,11 @@ or an unstable channel, you can run
# nix-channel --update
----
and if you follow a Nixpkgs version 20.09 channel, you can run
and if you follow a Nixpkgs version 21.05 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
# nix-channel --update
----

View file

@ -12,47 +12,47 @@
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>home-manager</command> <group choice="req">
<command>home-manager</command> <group choice="req">
<arg choice="plain">
build
</arg>
<arg choice="plain">
instantiate
</arg>
<arg choice="plain">
edit
</arg>
<arg choice="plain">
expire-generations <replaceable>timestamp</replaceable>
</arg>
<arg choice="plain">
generations
</arg>
<arg choice="plain">
help
</arg>
<arg choice="plain">
news
</arg>
<arg choice="plain">
packages
</arg>
<arg choice="plain">
remove-generations <replaceable>ID …</replaceable>
</arg>
<arg choice="plain">
switch
</arg>
<arg choice="plain">
uninstall
</arg>
@ -61,63 +61,63 @@
<arg>
-A <replaceable>attrPath</replaceable>
</arg>
<arg>
-I <replaceable>path</replaceable>
</arg>
<arg>
--flake <replaceable>flake-uri</replaceable>
</arg>
<arg>
-b <replaceable>ext</replaceable>
</arg>
<arg>
<group choice="req">
<group choice="req">
<arg choice="plain">
-f
</arg>
<arg choice="plain">
--file
</arg>
</group> <replaceable>path</replaceable>
</arg>
<arg>
<group choice="req">
<group choice="req">
<arg choice="plain">
-h
</arg>
<arg choice="plain">
--help
</arg>
</group>
</arg>
<arg>
<group choice="req">
<group choice="req">
<arg choice="plain">
-n
</arg>
<arg choice="plain">
--dry-run
</arg>
</group>
</arg>
<arg>
--option <replaceable>name</replaceable> <replaceable>value</replaceable>
</arg>
<arg>
--cores <replaceable>number</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
@ -130,29 +130,33 @@
</group>
<replaceable>number</replaceable>
</arg>
<arg>
--debug
</arg>
<arg>
--keep-failed
</arg>
<arg>
--keep-going
</arg>
<arg>
--show-trace
</arg>
<arg>
--(no-)substitute
</arg>
<arg>
<group choice="req">
<group choice="req">
<arg choice="plain">
-v
</arg>
<arg choice="plain">
--verbose
</arg>
@ -456,6 +460,18 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--debug</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--keep-failed</option>

View file

@ -1,8 +1,7 @@
[[sec-release-21.05]]
== Release 21.05
This is the current unstable branch and the information in this
section is therefore not final.
The 21.05 release branch became the stable branch in May, 2021.
[[sec-release-21.05-highlights]]
=== Highlights

View file

@ -285,8 +285,8 @@ _home-manager_completions ()
#--------------------------#
local Options
Options=( "-f" "--file" "-b" "-A" "-I" "-h" "--help" "-n" "--dry-run" "-v" "--verbose" "--show-trace" \
"-j" "--max-jobs" )
Options=( "-f" "--file" "-b" "-A" "-I" "-h" "--help" "-n" "--dry-run" "-v" "--verbose" \
"--cores" "--debug" "--keep-failed" "--keep-going" "-j" "--max-jobs" "--no-substitute" "--show-trace" "--substitute")
# ^ « home-manager »'s options.

View file

@ -7,6 +7,7 @@ _arguments \
'-I[search path]:PATH:_files -/' \
'-b[backup files]:EXT:()' \
'--cores[cores]:NUM:()' \
'--debug[debug]' \
'--keep-failed[keep failed]' \
'--keep-going[keep going]' \
'(-h --help)'{--help,-h}'[help]' \
@ -42,11 +43,14 @@ case "$state" in
build|switch)
_arguments \
'--cores[cores]:NUM:()' \
'--debug[debug]' \
'--keep-failed[keep failed]' \
'--keep-going[keep going]' \
'--max-jobs[max jobs]:NUM:()' \
'--no-substitute[no substitute]' \
'--option[option]:NAME VALUE:()' \
'--show-trace[show trace]'
'--show-trace[show trace]' \
'--substitute[substitute]'
;;
esac
esac

View file

@ -473,6 +473,7 @@ function doHelp() {
echo
echo " --arg(str) NAME VALUE Override inputs passed to home-manager.nix"
echo " --cores NUM"
echo " --debug"
echo " --keep-failed"
echo " --keep-going"
echo " -j, --max-jobs NUM"
@ -572,7 +573,7 @@ while [[ $# -gt 0 ]]; do
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--keep-failed|--keep-going|--show-trace\
--debug|--keep-failed|--keep-going|--show-trace\
|--substitute|--no-substitute)
PASSTHROUGH_OPTS+=("$opt")
;;

View file

@ -236,12 +236,22 @@ in
home.activation.checkFilesChanged = hm.dag.entryBefore ["linkGeneration"] (
''
function _cmp() {
if [[ -d $1 && -d $2 ]]; then
diff -rq "$1" "$2" &> /dev/null
else
cmp --quiet "$1" "$2"
fi
}
declare -A changedFiles
'' + concatMapStrings (v: ''
cmp --quiet "${sourceStorePath v}" "${homeDirectory}/${v.target}" \
_cmp "${sourceStorePath v}" "${homeDirectory}/${v.target}" \
&& changedFiles["${v.target}"]=0 \
|| changedFiles["${v.target}"]=1
'') (filter (v: v.onChange != "") (attrValues cfg))
+ ''
unset -f _cmp
''
);
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (

View file

@ -82,6 +82,9 @@ with lib;
generations. The script will be run
<emphasis>after</emphasis> the new files have been linked
into place.
</para><para>
Note, this code is always run when <literal>recursive</literal> is
enabled.
'';
};

View file

@ -33,7 +33,7 @@ let
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExample "pkgs.gnome3.gnome_themes_standard";
example = literalExample "pkgs.gnome.gnome_themes_standard";
description = ''
Package providing the theme. This package will be installed
to your profile. If <literal>null</literal> then the theme

View file

@ -2047,6 +2047,13 @@ in
configuration file.
'';
}
{
time = "2021-10-03T20:00:52+00:00";
message = ''
A new module is available: 'programs.java'.
'';
}
];
};
}

View file

@ -83,6 +83,7 @@ let
(loadModule ./programs/info.nix { })
(loadModule ./programs/irssi.nix { })
(loadModule ./programs/lieer.nix { })
(loadModule ./programs/java.nix { })
(loadModule ./programs/jq.nix { })
(loadModule ./programs/kakoune.nix { })
(loadModule ./programs/keychain.nix { })

View file

@ -114,10 +114,12 @@ let
brave = "BraveSoftware/Brave-Browser";
};
linuxDirs = { brave = "BraveSoftware/Brave-Browser"; };
configDir = if pkgs.stdenv.isDarwin then
"Library/Application Support/${getAttr browser darwinDirs}"
"Library/Application Support/" + (darwinDirs."${browser}" or browser)
else
"${config.xdg.configHome}/${browser}";
"${config.xdg.configHome}/" + (linuxDirs."${browser}" or browser);
extensionJson = ext:
assert ext.crxPath != null -> ext.version != null;

View file

@ -9,6 +9,14 @@ let
tomlFormat = pkgs.formats.toml { };
in {
imports = [
(mkRenamedOptionModule [
"programs"
"direnv"
"enableNixDirenvIntegration"
] [ "programs" "direnv" "nix-direnv" "enable" ])
];
meta.maintainers = [ maintainers.rycee ];
options.programs.direnv = {
@ -63,10 +71,14 @@ in {
'';
};
enableNixDirenvIntegration = mkEnableOption ''
<link
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
a fast, persistent use_nix implementation for direnv'';
nix-direnv = {
enable = mkEnableOption ''
<link
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
a fast, persistent use_nix implementation for direnv'';
enableFlakes = mkEnableOption "Flake support in nix-direnv";
};
};
config = mkIf cfg.enable {
@ -77,9 +89,11 @@ in {
};
xdg.configFile."direnv/direnvrc" = let
package =
pkgs.nix-direnv.override { inherit (cfg.nix-direnv) enableFlakes; };
text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib
++ optional cfg.enableNixDirenvIntegration
"source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc");
++ optional cfg.nix-direnv.enable
"source ${package}/share/nix-direnv/direnvrc");
in mkIf (text != "") { inherit text; };
programs.bash.initExtra = mkIf cfg.enableBashIntegration (

View file

@ -315,7 +315,7 @@ in {
};
config = mkIf cfg.enable {
home.packages = [ pkgs.gnome3.gnome-terminal ];
home.packages = [ pkgs.gnome.gnome-terminal ];
dconf.settings = let dconfPath = "org/gnome/terminal/legacy";
in {

View file

@ -10,10 +10,14 @@ let
let v' = if isBool v then (if v then "1" else "0") else toString v;
in "${n}=${v'}";
formatMeters = side: meters: {
"${side}_meters" = mapAttrsToList (x: _: x) meters;
"${side}_meter_modes" = mapAttrsToList (_: y: y) meters;
};
formatMeters = side: meters:
let
warn' = warn "htop: meters should be passed as a list";
meters' = if isList meters then meters else warn' [ meters ];
in {
"${side}_meters" = concatMap (mapAttrsToList (x: _: x)) meters';
"${side}_meter_modes" = concatMap (mapAttrsToList (_: y: y)) meters';
};
leftMeters = formatMeters "left";
rightMeters = formatMeters "right";
@ -80,6 +84,14 @@ let
LED = 4;
};
# Utilities for constructing meters
meter = mode: name: { ${name} = mode; };
bar = meter modes.Bar;
text = meter modes.Text;
graph = meter modes.Graph;
led = meter modes.LED;
blank = text "Blank";
# Mapping from names to defaults
meters = {
Clock = 2;
@ -231,15 +243,17 @@ in {
tree_view = false;
update_process_names = false;
vim_mode = false;
} // (leftMeters {
AllCPUs = modes.Bar;
Memory = modes.Bar;
Swap = modes.Bar;
}) // (rightMeters {
Tasks = modes.Text;
LoadAverage = modes.Text;
Uptime = modes.Text;
});
} // (leftMeters [
(bar "AllCPUs2")
(bar "Memory")
(bar "Swap")
(text "Zram")
]) // (rightMeters [
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
(text "Systemd")
]);
example = literalExample ''
{
color_scheme = 6;
@ -262,17 +276,17 @@ in {
highlight_base_name = 1;
highlight_megabytes = 1;
highlight_threads = 1;
} // (with config.lib.htop; leftMeters {
AllCPUs2 = modes.Bar;
Memory = modes.Bar;
Swap = modes.Bar;
Zram = modes.Text;
}) // (with config.lib.htop; rightMeters {
Tasks = modes.Text;
LoadAverage = modes.Text;
Uptime = modes.Text;
Systemd = modes.Text;
})
} // (with config.lib.htop; leftMeters [
(bar "AllCPUs2")
(bar "Memory")
(bar "Swap")
(text "Zram")
]) // (with config.lib.htop; rightMeters [
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
(text "Systemd")
]);
'';
description = ''
Configuration options to add to
@ -576,7 +590,9 @@ in {
};
config = mkIf cfg.enable {
lib.htop = { inherit fields modes leftMeters rightMeters; };
lib.htop = {
inherit fields modes leftMeters rightMeters bar text graph led blank;
};
home.packages = [ pkgs.htop ];
@ -607,45 +623,53 @@ in {
rightModes = deprecate "right_meter_modes" "meters.right"
(ifNonNull cfg.meters (map (m: m.mode) cfg.meters.right));
settings' = cfg.settings // (filterAttrs (_: v: !isNull v) {
fields = deprecate "fields" "fields"
(ifNonNull cfg.fields (map (n: fields.${n}) cfg.fields));
sort_key = deprecate "sort_key" "sortKey"
(ifNonNull cfg.sortKey fields.${cfg.sortKey});
sort_direction = deprecate' "sort_direction" "sortDescending";
hide_threads = deprecate' "hide_threads" "hideThreads";
hide_kernel_threads =
deprecate' "hide_kernel_threads" "hideKernelThreads";
hide_userland_threads =
deprecate' "hide_userland_threads" "hideUserlandThreads";
shadow_other_users = deprecate' "shadow_other_users" "shadowOtherUsers";
show_thread_names = deprecate' "show_thread_names" "showThreadNames";
show_program_path = deprecate' "show_program_path" "showProgramPath";
highlight_base_name =
deprecate' "highlight_base_name" "highlightBaseName";
highlight_megabytes =
deprecate' "highlight_megabytes" "highlightMegabytes";
highlight_threads = deprecate' "highlight_threads" "highlightThreads";
tree_view = deprecate' "tree_view" "treeView";
header_margin = deprecate' "header_margin" "headerMargin";
detailed_cpu_time = deprecate' "detailed_cpu_time" "detailedCpuTime";
cpu_count_from_zero =
deprecate' "cpu_count_from_zero" "cpuCountFromZero";
show_cpu_usage = deprecate' "show_cpu_usage" "showCpuUsage";
show_cpu_frequency = deprecate' "show_cpu_frequency" "showCpuFrequency";
update_process_names =
deprecate' "update_process_names" "updateProcessNames";
account_guest_in_cpu_meter =
deprecate' "account_guest_in_cpu_meter" "accountGuestInCpuMeter";
color_scheme = deprecate' "color_scheme" "colorScheme";
enable_mouse = deprecate' "enable_mouse" "enableMouse";
delay = deprecate' "delay" "delay";
left_meters = leftMeters;
left_meter_modes = leftModes;
right_meters = rightMeters;
right_meter_modes = rightModes;
vim_mode = deprecate' "vim_mode" "vimMode";
});
in concatStringsSep "\n" (mapAttrsToList formatOption settings');
before = optionalAttrs (cfg.settings ? header_layout) {
inherit (cfg.settings) header_layout;
};
settings' = (removeAttrs cfg.settings (attrNames before))
// (filterAttrs (_: v: !isNull v) {
fields = deprecate "fields" "fields"
(ifNonNull cfg.fields (map (n: fields.${n}) cfg.fields));
sort_key = deprecate "sort_key" "sortKey"
(ifNonNull cfg.sortKey fields.${cfg.sortKey});
sort_direction = deprecate' "sort_direction" "sortDescending";
hide_threads = deprecate' "hide_threads" "hideThreads";
hide_kernel_threads =
deprecate' "hide_kernel_threads" "hideKernelThreads";
hide_userland_threads =
deprecate' "hide_userland_threads" "hideUserlandThreads";
shadow_other_users =
deprecate' "shadow_other_users" "shadowOtherUsers";
show_thread_names = deprecate' "show_thread_names" "showThreadNames";
show_program_path = deprecate' "show_program_path" "showProgramPath";
highlight_base_name =
deprecate' "highlight_base_name" "highlightBaseName";
highlight_megabytes =
deprecate' "highlight_megabytes" "highlightMegabytes";
highlight_threads = deprecate' "highlight_threads" "highlightThreads";
tree_view = deprecate' "tree_view" "treeView";
header_margin = deprecate' "header_margin" "headerMargin";
detailed_cpu_time = deprecate' "detailed_cpu_time" "detailedCpuTime";
cpu_count_from_zero =
deprecate' "cpu_count_from_zero" "cpuCountFromZero";
show_cpu_usage = deprecate' "show_cpu_usage" "showCpuUsage";
show_cpu_frequency =
deprecate' "show_cpu_frequency" "showCpuFrequency";
update_process_names =
deprecate' "update_process_names" "updateProcessNames";
account_guest_in_cpu_meter =
deprecate' "account_guest_in_cpu_meter" "accountGuestInCpuMeter";
color_scheme = deprecate' "color_scheme" "colorScheme";
enable_mouse = deprecate' "enable_mouse" "enableMouse";
delay = deprecate' "delay" "delay";
left_meters = leftMeters;
left_meter_modes = leftModes;
right_meters = rightMeters;
right_meter_modes = rightModes;
vim_mode = deprecate' "vim_mode" "vimMode";
});
in concatStringsSep "\n" (mapAttrsToList formatOption before
++ mapAttrsToList formatOption settings');
};
}

46
modules/programs/java.nix Normal file
View file

@ -0,0 +1,46 @@
# This module provides JAVA_HOME, with a different way to install java locally.
# This module is modified from the NixOS module `programs.java`
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.java;
in {
meta.maintainers = with maintainers; [ ShamrockLee ];
options = {
programs.java = {
enable = mkEnableOption "" // {
description = ''
Install the Java development kit and set the <envar>JAVA_HOME</envar>
variable.
'';
};
package = mkOption {
type = types.package;
default = pkgs.jdk;
defaultText = "pkgs.jdk";
description = ''
Java package to install. Typical values are
<literal>pkgs.jdk</literal> or <literal>pkgs.jre</literal>.
'';
};
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
home.sessionVariables = {
JAVA_HOME = fileContents (pkgs.runCommandLocal "java-home" { } ''
source "${cfg.package}/nix-support/setup-hook"
echo "$JAVA_HOME" > $out
'');
};
};
}

View file

@ -30,6 +30,13 @@ in {
programs.jq = {
enable = mkEnableOption "the jq command-line JSON processor";
package = mkOption {
type = types.package;
default = pkgs.jq;
defaultText = literalExample "pkgs.jq";
description = "jq package to use.";
};
colors = mkOption {
description = ''
The colors used in colored JSON output.</para>
@ -65,7 +72,7 @@ in {
};
config = mkIf cfg.enable {
home.packages = [ pkgs.jq ];
home.packages = [ cfg.package ];
home.sessionVariables = let c = cfg.colors;
in {

View file

@ -261,7 +261,7 @@ in {
description = ''
Path to the terminal which will be used to run console applications
'';
example = "\${pkgs.gnome3.gnome_terminal}/bin/gnome-terminal";
example = "\${pkgs.gnome.gnome_terminal}/bin/gnome-terminal";
};
separator = mkOption {

View file

@ -98,8 +98,6 @@ in {
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}

View file

@ -6,14 +6,21 @@ let
cfg = config.programs.texlive;
texlivePkgs = cfg.extraPackages pkgs.texlive;
texlive = cfg.packageSet;
texlivePkgs = cfg.extraPackages texlive;
in {
meta.maintainers = [ maintainers.rycee ];
options = {
programs.texlive = {
enable = mkEnableOption "Texlive";
enable = mkEnableOption "TeX Live";
packageSet = mkOption {
default = pkgs.texlive;
defaultText = literalExample "pkgs.texlive";
description = "TeX Live package set to use.";
};
extraPackages = mkOption {
default = tpkgs: { inherit (tpkgs) collection-basic; };
@ -21,12 +28,12 @@ in {
example = literalExample ''
tpkgs: { inherit (tpkgs) collection-fontsrecommended algorithms; }
'';
description = "Extra packages available to Texlive.";
description = "Extra packages available to TeX Live.";
};
package = mkOption {
type = types.package;
description = "Resulting customized Texlive package.";
description = "Resulting customized TeX Live package.";
readOnly = true;
};
};
@ -41,6 +48,6 @@ in {
home.packages = [ cfg.package ];
programs.texlive.package = pkgs.texlive.combine texlivePkgs;
programs.texlive.package = texlive.combine texlivePkgs;
};
}

View file

@ -279,6 +279,12 @@ in
type = types.bool;
};
completionInit = mkOption {
default = "autoload -U compinit && compinit";
description = "Initialization commands to run when completion is enabled.";
type = types.lines;
};
enableAutosuggestions = mkOption {
default = false;
description = "Enable zsh autosuggestions";
@ -469,7 +475,7 @@ in
# calling it twice causes slight start up slowdown
# as all $fpath entries will be traversed again.
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable)
"autoload -U compinit && compinit"
cfg.completionInit
}
${optionalString cfg.enableAutosuggestions
@ -500,7 +506,7 @@ in
(builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")}
${concatStrings (map (plugin: ''
if [ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]; then
if [[ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]]; then
source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
fi
'') cfg.plugins)}

View file

@ -25,7 +25,7 @@ let
options = {
package = mkOption {
type = types.package;
example = literalExample "pkgs.gnome3.adwaita-icon-theme";
example = literalExample "pkgs.gnome.adwaita-icon-theme";
description = "Package providing the theme.";
};
@ -103,7 +103,7 @@ in {
config = mkIf cfg.enable (mkMerge [
{
home.packages = [ (getOutput "man" pkgs.dunst) ];
home.packages = [ cfg.package ];
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =
"${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service";

View file

@ -35,7 +35,7 @@ in {
example = literalExample ''
{
ETESYNC_LISTEN_ADDRESS = "localhost";
ETESYNC_LISTEN_PORT = 37385;
ETESYNC_LISTEN_PORT = 37358;
}
'';
description = ''

View file

@ -36,7 +36,7 @@ in {
args = concatStringsSep " " ([ "--start" "--foreground" ]
++ optional (cfg.components != [ ])
("--components=" + concatStringsSep "," cfg.components));
in "${pkgs.gnome3.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
in "${pkgs.gnome.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
Restart = "on-abort";
};

View file

@ -104,23 +104,26 @@ let
};
exec = mkOption {
type = types.nullOr types.str;
default = null;
type = with types; coercedTo str singleton (listOf str);
default = [ ];
example =
"\${pkg.sway}/bin/swaymsg workspace 1, move workspace to eDP-1";
"[ \${pkg.sway}/bin/swaymsg workspace 1, move workspace to eDP-1 ]";
description = ''
Command executed after the profile is succesfully applied.
Commands executed after the profile is succesfully applied.
Note that if you provide multiple commands, they will be
executed asynchronously with no guaranteed ordering.
'';
};
};
};
profileStr = name:
{ outputs, exec, ... }:
''
{ outputs, exec, ... }: ''
profile ${name} {
${concatStringsSep "\n " (map outputStr outputs)}
'' + optionalString (exec != null) " exec ${exec}\n" + ''
${
concatStringsSep "\n "
(map outputStr outputs ++ map (cmd: "exec ${cmd}") exec)
}
}
'';
in {

View file

@ -38,7 +38,7 @@ in {
# "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files"
home.packages = [ cfg.package pkgs.at-spi2-core ];
# Will need to add `services.dbus.packages = with pkgs; [ gnome3.dconf ];`
# Will need to add `services.dbus.packages = with pkgs; [ gnome.dconf ];`
# to /etc/nixos/configuration.nix for daemon to work correctly
systemd.user.services.pulseeffects = {

View file

@ -23,6 +23,8 @@ let
toString v;
in "${n}: ${formatValue v}";
xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ${cfg.path}";
in {
meta.maintainers = [ maintainers.rycee ];
@ -45,7 +47,7 @@ in {
X server resources that should be set.
Booleans are formatted as "true" or "false" respectively.
List elements are recursively formatted as a string and joined by commas.
All other values are directly formatted using builtins.toString.
All other values are directly formatted using builtins.toString.
Note, that 2-dimensional lists are not supported and specifying one will throw an exception.
If this and all other xresources options are
<code>null</code>, then this feature is disabled and no
@ -73,20 +75,30 @@ in {
<filename>~/.Xresources</filename> link is produced.
'';
};
xresources.path = mkOption {
type = types.str;
default = "${config.home.homeDirectory}/.Xresources";
defaultText = "$HOME/.Xresources";
description =
"Path where Home Manager should link the <filename>.Xresources</filename> file.";
};
};
config = mkIf ((cfg.properties != null && cfg.properties != { })
|| cfg.extraConfig != "") {
home.file.".Xresources" = {
home.file.${cfg.path} = {
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
$DRY_RUN_CMD ${xrdbMerge}
fi
'';
};
xsession.initExtra = xrdbMerge;
};
}

View file

@ -104,7 +104,7 @@ in {
args = optional (layout != null) "-layout '${layout}'"
++ optional (variant != null) "-variant '${variant}'"
++ optional (model != null) "-model '${model}'"
++ map (v: "-option '${v}'") options;
++ [ "-option ''" ] ++ map (v: "-option '${v}'") options;
in "${pkgs.xorg.setxkbmap}/bin/setxkbmap ${toString args}";
};
};

View file

@ -125,11 +125,14 @@ in {
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";

View file

@ -2,7 +2,7 @@
WantedBy=graphical-session.target
[Service]
ExecStart=@setxkbmap@/bin/setxkbmap -layout 'us' -variant ''
ExecStart=@setxkbmap@/bin/setxkbmap -layout 'us' -variant '' -option ''
RemainAfterExit=true
Type=oneshot

View file

@ -2,7 +2,7 @@
WantedBy=graphical-session.target
[Service]
ExecStart=@setxkbmap@/bin/setxkbmap -option 'ctrl:nocaps' -option 'altwin:no_win'
ExecStart=@setxkbmap@/bin/setxkbmap -option '' -option 'ctrl:nocaps' -option 'altwin:no_win'
RemainAfterExit=true
Type=oneshot

View file

@ -6,7 +6,7 @@ with lib;
config = {
programs.bash.enable = true;
programs.direnv.enable = true;
programs.direnv.enableNixDirenvIntegration = true;
programs.direnv.nix-direnv.enable = true;
nmt.script = ''
assertFileExists home-files/.bashrc

View file

@ -7,7 +7,7 @@ in {
config = {
programs.bash.enable = true;
programs.direnv.enable = true;
programs.direnv.enableNixDirenvIntegration = true;
programs.direnv.nix-direnv.enable = true;
programs.direnv.stdlib = expectedContent;
nmt.script = ''

View file

@ -16,7 +16,7 @@ with lib;
preferLocalBuild = true;
allowSubstitutes = false;
} ''
mkdir -p "$out/bin"
mkdir -p "$out"/{bin,lib}
touch "$out/bin/firefox"
chmod 755 "$out/bin/firefox"
'';

View file

@ -21,7 +21,7 @@ with lib;
preferLocalBuild = true;
allowSubstitutes = false;
} ''
mkdir -p "$out/bin"
mkdir -p "$out"/{bin,lib}
touch "$out/bin/firefox"
chmod 755 "$out/bin/firefox"
'';

View file

@ -15,7 +15,7 @@ with lib;
preferLocalBuild = true;
allowSubstitutes = false;
} ''
mkdir -p "$out/bin"
mkdir -p "$out"/{bin,lib}
touch "$out/bin/firefox"
chmod 755 "$out/bin/firefox"
'';

View file

@ -27,18 +27,14 @@ with lib;
highlight_megabytes = 1;
highlight_threads = 1;
} // (with config.lib.htop;
leftMeters {
AllCPUs2 = modes.Bar;
Memory = modes.Bar;
Swap = modes.Bar;
Zram = modes.Text;
}) // (with config.lib.htop;
rightMeters {
Tasks = modes.Text;
LoadAverage = modes.Text;
Uptime = modes.Text;
Systemd = modes.Text;
});
leftMeters [ (bar "AllCPUs2") (bar "Memory") (bar "Swap") (text "Zram") ])
// (with config.lib.htop;
rightMeters [
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
(text "Systemd")
]);
nmt.script = ''
assertFileExists home-files/.config/htop/htoprc

View file

@ -1,8 +1,14 @@
profile backwardsCompat {
output "LVDS-1" enable
exec echo "7 eight 9"
}
profile desktop {
output "eDP-1" disable
output "Iiyama North America PLE2483H-DP" enable position 0,0
output "Iiyama North America PLE2483H-DP 1158765348486" enable mode 1920x1080 position 1920,0 scale 2.100000 transform flipped-270
exec echo "1 two 3"
exec echo "4 five 6"
}
profile nomad {

View file

@ -11,7 +11,7 @@
}];
};
desktop = {
exec = ''echo "1 two 3"'';
exec = [ ''echo "1 two 3"'' ''echo "4 five 6"'' ];
outputs = [
{
criteria = "eDP-1";
@ -32,6 +32,13 @@
}
];
};
backwardsCompat = {
outputs = [{
criteria = "LVDS-1";
status = "enable";
}];
exec = ''echo "7 eight 9"'';
};
};
extraConfig = ''
profile test {