Compare commits

...

23 commits

Author SHA1 Message Date
dependabot[bot] f5395026bf
ci: bump cachix/install-nix-action from 13 to 14.1 (#2404)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 13 to 14.1.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v13...v14.1)

---
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>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-20 09:29:25 -06:00
Robert Helgesson 49706878e1
docs: make OFTC upper case
(cherry picked from commit ab64dc3249)
2021-05-29 20:24:38 +02:00
Robert Helgesson c76b158024
docs: switch IRC to OFTC 2021-05-29 20:20:59 +02:00
Viacheslav Lotsmanov 2aa20ae969
Backport “Make Git signing key id be optional” to “release-20.09” (#1903) 2021-04-07 15:46:34 -04:00
dependabot[bot] a36c4fe973
ci: bump cachix/cachix-action from v8 to v10
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from v8 to v10.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v8...73e75d1a0cd4330597a571e8f9dedb41faa2fc4e)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-07 19:14:03 +00:00
dependabot[bot] 2cfbf16c6d
ci: bump cachix/install-nix-action from v12 to v13
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from v12 to v13.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v12...8d6d5e949675fbadb765c6b1a975047fa5f09b27)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-07 21:12:31 +02:00
dependabot[bot] f019c1cf16
ci: bump peaceiris/actions-gh-pages from v3 to v3.8.0 (#1888)
Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from v3 to v3.8.0.
- [Release notes](https://github.com/peaceiris/actions-gh-pages/releases)
- [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md)
- [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...068dc23d9710f1ba62e86896f84735d869951305)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 14:31:28 +02:00
Thiago Kenji Okada 209566c752
flake: add extraSpecialArgs (#1790)
This allows flake user to pass extra arguments to all modules.

(cherry picked from commit cf5dad76c1)

Co-authored-by: mlatus <wqseleven@gmail.com>
2021-02-09 15:29:47 -05:00
c4710n 91bd34620d chromium: add support for brave
Brave Browser is a chromium-based browser, too.

+ it use the same web store with Chromium and Google Chrome.
+ the machanism of installing extensions works, and it's verified on
my macOS box.
2021-01-22 14:53:58 +01:00
Ivan Babrou f33be4894c
docs: remove stray ` from README.md
The typo came from #1705.

(cherry picked from commit cc89be5a30)
2021-01-20 22:43:47 +01:00
Aleksey Kladov 0410410e90
doc: clarify what is user environment
(cherry picked from commit 32371301d3)
2021-01-20 22:43:40 +01:00
Robert Helgesson 392c3da3fe
docs: rephrase warning section slightly
(cherry picked from commit cb1ed0d2f3)
2021-01-20 22:42:02 +01:00
Robert Helgesson 2c7a2f8084
docs: improve phrasing around backwards compatibility
(cherry picked from commit 3e218f2600)
2021-01-20 22:41:25 +01:00
David Arnold 0a5e0868dc
readme: use less ambiguous user name in example
The example used `user` as the username, which may be confusing.
Instead use `jdoe`, which is more clearly a username.

(cherry picked from commit ca7fd5a643)
2021-01-20 22:40:58 +01:00
Christian Lütke-Stetzkamp 5aacf64d0e
dunst: include legacy icons
Fixes #744

(cherry picked from commit e87bccabc3)
2021-01-20 22:40:35 +01:00
seylerius a4f41474b0
rofi-pass: add rofi-pass plugin for password-store
(cherry picked from commit 1a7f190cb9)
2021-01-20 22:39:48 +01:00
Robert Helgesson feb7455112
tests: remove format meta test
This test requires copying the Home Manager checkout to the Nix store,
which seems to require too much memory for the CI jobs. Instead simply
run the format script directly.

(cherry picked from commit 9fe15dc83b)
2021-01-20 22:36:16 +01:00
Robert Helgesson b1e0cbad4b
github-ci: use default max-jobs
(cherry picked from commit b9b8a42fda)
2021-01-20 22:36:15 +01:00
Roosembert Palacios 22f6736e62
flake: expose Home Manager lib
(cherry picked from commit 6dc8de259a)
2020-12-26 11:22:47 -08:00
dependabot[bot] 57e4bf3707
ci: bump cachix/cachix-action from v6 to v8
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from v6 to v8.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v6...6e4751ed42b22f60165d3f266cfa4cce66ae406d)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-26 11:23:25 +00:00
dependabot[bot] e2f7da3a58
ci: update cachix/install-nix-action requirement to v12
Updates the requirements on [cachix/install-nix-action](https://github.com/cachix/install-nix-action) to permit the latest version.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](07da2520ee)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-26 10:26:35 +00:00
Robert Helgesson b183e7f77e
ci: use 20.09 branch in CI 2020-12-26 11:22:31 +01:00
Robert Helgesson 63f299b334
home-manager: add --version option 2020-11-03 23:11:32 +01:00
28 changed files with 261 additions and 65 deletions

3
.github/CODEOWNERS vendored
View file

@ -117,6 +117,9 @@
/modules/programs/powerline-go.nix @DamienCassou /modules/programs/powerline-go.nix @DamienCassou
/modules/programs/rofi-pass.nix @seylerius
/tests/modules/programs/rofi-pass @seylerius
/modules/programs/rtorrent.nix @marsam /modules/programs/rtorrent.nix @marsam
/modules/programs/ssh.nix @rycee /modules/programs/ssh.nix @rycee

View file

@ -11,10 +11,10 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: cachix/install-nix-action@v10 - uses: cachix/install-nix-action@v14.1
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v6 - uses: cachix/cachix-action@v10
with: with:
name: nix-community name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
@ -22,7 +22,7 @@ jobs:
nix-build -A docs.html nix-build -A docs.html
cp -r result/share/doc/home-manager public cp -r result/share/doc/home-manager public
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3.8.0
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public publish_dir: ./public

View file

@ -11,12 +11,13 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: cachix/install-nix-action@v11 - uses: cachix/install-nix-action@v14.1
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-20.09
- uses: cachix/cachix-action@v6 - uses: cachix/cachix-action@v10
with: with:
name: nix-community name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: ./format -c
- run: nix-shell . -A install - run: nix-shell . -A install
- run: nix-shell --pure --max-jobs 4 tests -A run.all - run: nix-shell --pure tests -A run.all

View file

@ -1,8 +1,7 @@
image: nixos/nix:latest image: nixos/nix:latest
variables: variables:
# Pinned 2020-09-11. NIX_PATH: "nixpkgs=channel:nixos-20.09"
NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/6d4b93323e7f78121f8d6db6c59f3889aa1dd931.tar.gz"
stages: stages:
- test - test

View file

@ -3,8 +3,10 @@ Home Manager using Nix
This project provides a basic system for managing a user environment This project provides a basic system for managing a user environment
using the [Nix][] package manager together with the Nix libraries using the [Nix][] package manager together with the Nix libraries
found in [Nixpkgs][]. Before attempting to use Home Manager please found in [Nixpkgs][]. It allows declarative configuration of user
read the warning below. specific (non global) packages and dotfiles.
Before attempting to use Home Manager please read the warning below.
For a more systematic overview of Home Manager and its available For a more systematic overview of Home Manager and its available
options, please see the [Home Manager manual][manual]. options, please see the [Home Manager manual][manual].
@ -12,14 +14,17 @@ options, please see the [Home Manager manual][manual].
Words of warning Words of warning
---------------- ----------------
This project is under development. I personally use it to manage Unfortunately, it is quite possible to get difficult to understand
several user configurations but it may fail catastrophically for you. errors when working with Home Manager, such as infinite loops with no
So beware! clear source reference. You should therefore be comfortable using the
Nix language and the various tools in the Nix ecosystem. Reading
through the [Nix Pills][] document is a good way to familiarize
yourself with them.
Before using Home Manager you should be comfortable using the Nix If you are not very familiar with Nix but still want to use Home
language and the various tools in the Nix ecosystem. Reading through Manager then you are strongly encouraged to start with a small and
the [Nix Pills][] document is a good way to familiarize yourself with very simple configuration and gradually make it more elaborate as you
them. learn.
In some cases Home Manager cannot detect whether it will overwrite a In some cases Home Manager cannot detect whether it will overwrite a
previous manual configuration. For example, the Gnome Terminal module previous manual configuration. For example, the Gnome Terminal module
@ -43,8 +48,7 @@ Contact
------- -------
You can chat with us on IRC in the channel [#home-manager][] on You can chat with us on IRC in the channel [#home-manager][] on
[freenode][]. The [channel logs][] are hosted courtesy of [OFTC][].
[samueldr][].
Installation Installation
------------ ------------
@ -333,7 +337,7 @@ as follows:
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.user = import ./home.nix; home-manager.users.jdoe = import ./home.nix;
} }
]; ];
}; };
@ -342,6 +346,9 @@ as follows:
} }
``` ```
Note, the Home Manager library is exported by the flake under
`lib.hm`.
Releases Releases
-------- --------
@ -362,9 +369,8 @@ an issue.
[Z shell]: http://zsh.sourceforge.net/ [Z shell]: http://zsh.sourceforge.net/
[manual]: https://nix-community.github.io/home-manager/ [manual]: https://nix-community.github.io/home-manager/
[configuration options]: https://nix-community.github.io/home-manager/options.html [configuration options]: https://nix-community.github.io/home-manager/options.html
[#home-manager]: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager [#home-manager]: https://webchat.oftc.net/?channels=home-manager
[freenode]: https://freenode.net/ [OFTC]: https://oftc.net/
[channel logs]: https://logs.nix.samueldr.com/home-manager/
[samueldr]: https://github.com/samueldr/ [samueldr]: https://github.com/samueldr/
[Nix Pills]: https://nixos.org/nixos/nix-pills/ [Nix Pills]: https://nixos.org/nixos/nix-pills/
[Nix Flakes]: https://nixos.wiki/wiki/Flakes [Nix Flakes]: https://nixos.wiki/wiki/Flakes

View file

@ -44,9 +44,10 @@ The first option is good if you only temporarily want to use your clone.
[[sec-guidelines]] [[sec-guidelines]]
=== Guidelines === Guidelines
:irc-home-manager: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager :irc-home-manager: https://webchat.oftc.net/?channels=home-manager
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options :valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md :rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
:assertions: https://nixos.org/manual/nixos/stable/index.html#sec-assertions
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system. If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
@ -55,7 +56,9 @@ If you are uncertain how these rules affect the change you would like to make th
[[sec-guidelines-back-compat]] [[sec-guidelines-back-compat]]
==== Maintain backward compatibility ==== Maintain backward compatibility
Your contribution should never cause another user's existing configuration to break. Home Manager is used in many different environments and you should consider how you change may effect others. For example, Your contribution should not cause another user's existing configuration to break unless there is a very good reason and the change should be announced to the user through an {assertions}[assertion] or similar.
Remember that Home Manager is used in many different environments and you should consider how your change may effect others. For example,
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS. - Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
- Does your change work for people whose configuration is built on one system and deployed on another system? - Does your change work for people whose configuration is built on one system and deployed on another system?

View file

@ -14,10 +14,8 @@
</para> </para>
<para> <para>
If you encounter problems then please reach out on the IRC channel If you encounter problems then please reach out on the IRC channel
<link xlink:href="https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager">#home-manager</link> <link xlink:href="https://webchat.oftc.net/?channels=home-manager">#home-manager</link>
hosted by <link xlink:href="https://freenode.net/">freenode</link>. hosted by <link xlink:href="https://oftc.net/">OFTC</link>.
The <link xlink:href="https://logs.nix.samueldr.com/home-manager/">channel logs</link>
are hosted courtesy of <link xlink:href="https://github.com/samueldr/">samueldr</link>.
If your problem is caused by a bug in Home Manager then it should If your problem is caused by a bug in Home Manager then it should
be reported on the be reported on the
<link xlink:href="https://github.com/nix-community/home-manager/issues">Home Manager issue tracker</link>. <link xlink:href="https://github.com/nix-community/home-manager/issues">Home Manager issue tracker</link>.

View file

@ -7,12 +7,13 @@
darwinModules.home-manager = import ./nix-darwin; darwinModules.home-manager = import ./nix-darwin;
lib = { lib = {
hm = import ./modules/lib { lib = nixpkgs.lib; };
homeManagerConfiguration = { configuration, system, homeDirectory homeManagerConfiguration = { configuration, system, homeDirectory
, username , username, extraSpecialArgs ? { }
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages , pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
, check ? true }@args: , check ? true }@args:
import ./modules { import ./modules {
inherit pkgs check; inherit pkgs check extraSpecialArgs;
configuration = { ... }: { configuration = { ... }: {
imports = [ configuration ]; imports = [ configuration ];
home = { inherit homeDirectory username; }; home = { inherit homeDirectory username; };

View file

@ -512,6 +512,10 @@ while [[ $# -gt 0 ]]; do
-v|--verbose) -v|--verbose)
export VERBOSE=1 export VERBOSE=1
;; ;;
--version)
echo 20.09
exit 0
;;
*) *)
case $COMMAND in case $COMMAND in
expire-generations|remove-generations) expire-generations|remove-generations)

View file

@ -4,6 +4,8 @@
# Whether to check that each option has a matching declaration. # Whether to check that each option has a matching declaration.
, check ? true , check ? true
# Extra arguments passed to specialArgs.
, extraSpecialArgs ? { }
}: }:
with lib; with lib;
@ -31,7 +33,7 @@ let
modules = [ configuration ] ++ hmModules; modules = [ configuration ] ++ hmModules;
specialArgs = { specialArgs = {
modulesPath = builtins.toString ./.; modulesPath = builtins.toString ./.;
}; } // extraSpecialArgs;
}; };
module = showWarnings ( module = showWarnings (

View file

@ -31,4 +31,14 @@
github = "olmokramer"; github = "olmokramer";
githubId = 3612514; githubId = 3612514;
}; };
seylerius = {
email = "sable@seyleri.us";
name = "Sable Seyler";
github = "seylerius";
githubId = 1145981;
keys = [{
logkeyid = "rsa4096/0x68BF2EAE6D91CAFF";
fingerprint = "F0E0 0311 126A CD72 4392 25E6 68BF 2EAE 6D91 CAFF";
}];
};
} }

View file

@ -1728,6 +1728,13 @@ in
A new module is available: 'services.caffeine'. A new module is available: 'services.caffeine'.
''; '';
} }
{
time = "2020-12-18T22:22:25+00:00";
message = ''
A new module is available: 'programs.rofi.pass'.
'';
}
]; ];
}; };
} }

View file

@ -112,6 +112,7 @@ let
(loadModule ./programs/qutebrowser.nix { }) (loadModule ./programs/qutebrowser.nix { })
(loadModule ./programs/readline.nix { }) (loadModule ./programs/readline.nix { })
(loadModule ./programs/rofi.nix { }) (loadModule ./programs/rofi.nix { })
(loadModule ./programs/rofi-pass.nix { })
(loadModule ./programs/rtorrent.nix { }) (loadModule ./programs/rtorrent.nix { })
(loadModule ./programs/skim.nix { }) (loadModule ./programs/skim.nix { })
(loadModule ./programs/starship.nix { }) (loadModule ./programs/starship.nix { })

View file

@ -53,6 +53,7 @@ let
google-chrome = "Google/Chrome"; google-chrome = "Google/Chrome";
google-chrome-beta = "Google/Chrome Beta"; google-chrome-beta = "Google/Chrome Beta";
google-chrome-dev = "Google/Chrome Dev"; google-chrome-dev = "Google/Chrome Dev";
brave = "BraveSoftware/Brave-Browser";
}; };
configDir = if pkgs.stdenv.isDarwin then configDir = if pkgs.stdenv.isDarwin then
@ -81,6 +82,7 @@ in {
browserModule pkgs.google-chrome-beta "Google Chrome Beta" false; browserModule pkgs.google-chrome-beta "Google Chrome Beta" false;
google-chrome-dev = google-chrome-dev =
browserModule pkgs.google-chrome-dev "Google Chrome Dev" false; browserModule pkgs.google-chrome-dev "Google Chrome Dev" false;
brave = browserModule pkgs.brave "Brave Browser" false;
}; };
config = mkMerge [ config = mkMerge [
@ -88,5 +90,6 @@ in {
(browserConfig config.programs.google-chrome) (browserConfig config.programs.google-chrome)
(browserConfig config.programs.google-chrome-beta) (browserConfig config.programs.google-chrome-beta)
(browserConfig config.programs.google-chrome-dev) (browserConfig config.programs.google-chrome-dev)
(browserConfig config.programs.brave)
]; ];
} }

View file

@ -61,8 +61,13 @@ let
signModule = types.submodule { signModule = types.submodule {
options = { options = {
key = mkOption { key = mkOption {
type = types.str; type = types.nullOr types.str;
description = "The default GPG signing key fingerprint."; description = ''
The default GPG signing key fingerprint.
</para><para>
Set to <literal>null</literal> to let GnuPG decide what signing key
to use depending on commits author.
'';
}; };
signByDefault = mkOption { signByDefault = mkOption {
@ -297,7 +302,7 @@ in {
(mkIf (cfg.signing != null) { (mkIf (cfg.signing != null) {
programs.git.iniContent = { programs.git.iniContent = {
user.signingKey = cfg.signing.key; user.signingKey = mkIf (cfg.signing.key != null) cfg.signing.key;
commit.gpgSign = cfg.signing.signByDefault; commit.gpgSign = cfg.signing.signByDefault;
gpg.program = cfg.signing.gpgPath; gpg.program = cfg.signing.gpgPath;
}; };

View file

@ -0,0 +1,46 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.rofi.pass;
in {
meta.maintainers = [ maintainers.seylerius ];
options.programs.rofi.pass = {
enable = mkEnableOption "rofi integration with password-store";
stores = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Directory roots of your password-stores.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
URL_field='url'
USERNAME_field='user'
AUTOTYPE_field='autotype'
'';
description = ''
Extra configuration to be added at to the rofi-pass config file.
Additional examples can be found at
<link xlink:href="https://github.com/carnager/rofi-pass/blob/master/config.example"/>.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.rofi-pass ];
xdg.configFile."rofi-pass/config".text = optionalString (cfg.stores != [ ])
("root=" + (concatStringsSep ":" cfg.stores) + "\n") + cfg.extraConfig
+ optionalString (cfg.extraConfig != "") "\n";
};
}

View file

@ -118,6 +118,7 @@ in {
"emotes" "emotes"
"filesystem" "filesystem"
"intl" "intl"
"legacy"
"mimetypes" "mimetypes"
"places" "places"
"status" "status"

View file

@ -76,7 +76,6 @@ import nmt {
] ++ lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ ] ++ lib.optionals pkgs.stdenv.hostPlatform.isDarwin [
./modules/targets-darwin ./modules/targets-darwin
] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ ] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
./meta # Suffices to run on one platform.
./modules/misc/debug ./modules/misc/debug
./modules/misc/numlock ./modules/misc/numlock
./modules/misc/pam ./modules/misc/pam
@ -89,6 +88,7 @@ import nmt {
./modules/programs/ncmpcpp-linux ./modules/programs/ncmpcpp-linux
./modules/programs/neovim # Broken package dependency on Darwin. ./modules/programs/neovim # Broken package dependency on Darwin.
./modules/programs/rofi ./modules/programs/rofi
./modules/programs/rofi-pass
./modules/programs/waybar ./modules/programs/waybar
./modules/services/dropbox ./modules/services/dropbox
./modules/services/emacs ./modules/services/emacs

View file

@ -1 +0,0 @@
{ meta-formatting = ./formatting.nix; }

View file

@ -1,27 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
pinnedNixpkgs = builtins.fetchTarball {
url =
"https://github.com/NixOS/nixpkgs/archive/05f0934825c2a0750d4888c4735f9420c906b388.tar.gz";
sha256 = "1g8c2w0661qn89ajp44znmwfmghbbiygvdzq0rzlvlpdiz28v6gy";
};
pinnedPkgs = import pinnedNixpkgs { };
in {
config = {
nmt.script = ''
PATH="${with pinnedPkgs; lib.makeBinPath [ findutils nixfmt ]}:$PATH"
cd ${../..}
if ! ${pkgs.runtimeShell} format -c; then
fail "${''
Expected source code to be formatted with nixfmt but it was not.
This error can be resolved by running the './format' in the project root directory.''}"
fi
'';
};
}

View file

@ -2,4 +2,6 @@
git-with-email = ./git-with-email.nix; git-with-email = ./git-with-email.nix;
git-with-most-options = ./git.nix; git-with-most-options = ./git.nix;
git-with-str-extra-config = ./git-with-str-extra-config.nix; git-with-str-extra-config = ./git-with-str-extra-config.nix;
git-with-signing-key-id = ./git-with-signing-key-id.nix;
git-without-signing-key-id = ./git-without-signing-key-id.nix;
} }

View file

@ -0,0 +1,10 @@
[commit]
gpgSign = true
[gpg]
program = "path-to-gpg"
[user]
email = "user@example.org"
name = "John Doe"
signingKey = "00112233445566778899AABBCCDDEEFF"

View file

@ -0,0 +1,22 @@
{ pkgs, ... }: {
config = {
programs.git = {
enable = true;
userName = "John Doe";
userEmail = "user@example.org";
signing = {
gpgPath = "path-to-gpg";
key = "00112233445566778899AABBCCDDEEFF";
signByDefault = true;
};
};
nmt.script = ''
assertFileExists home-files/.config/git/config
assertFileContent home-files/.config/git/config ${
./git-with-signing-key-id-expected.conf
}
'';
};
}

View file

@ -0,0 +1,9 @@
[commit]
gpgSign = true
[gpg]
program = "path-to-gpg"
[user]
email = "user@example.org"
name = "John Doe"

View file

@ -0,0 +1,22 @@
{ pkgs, ... }: {
config = {
programs.git = {
enable = true;
userName = "John Doe";
userEmail = "user@example.org";
signing = {
gpgPath = "path-to-gpg";
key = null;
signByDefault = true;
};
};
nmt.script = ''
assertFileExists home-files/.config/git/config
assertFileContent home-files/.config/git/config ${
./git-without-signing-key-id-expected.conf
}
'';
};
}

View file

@ -0,0 +1,4 @@
{
rofi-pass-root = ./rofi-pass-root.nix;
rofi-pass-config = ./rofi-pass-config.nix;
}

View file

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.rofi = {
enable = true;
pass = {
enable = true;
extraConfig = ''
# Extra config for rofi-pass
xdotool_delay=12
'';
};
};
nixpkgs.overlays = [
(self: super: { rofi-pass = pkgs.writeScriptBin "dummy-rofi-pass" ""; })
];
nmt.script = ''
assertFileContent \
home-files/.config/rofi-pass/config \
${
pkgs.writeText "rofi-pass-expected-config" ''
# Extra config for rofi-pass
xdotool_delay=12
''
}
'';
};
}

View file

@ -0,0 +1,30 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.rofi = {
enable = true;
pass = {
enable = true;
stores = [ "~/.local/share/password-store" ];
};
};
nixpkgs.overlays = [
(self: super: { rofi-pass = pkgs.writeScriptBin "dummy-rofi-pass" ""; })
];
nmt.script = ''
assertFileContent \
home-files/.config/rofi-pass/config \
${
pkgs.writeText "rofi-pass-expected-config" ''
root=~/.local/share/password-store
''
}
'';
};
}