Compare commits
22 commits
master
...
release-20
Author | SHA1 | Date | |
---|---|---|---|
e6f96b6aa3 | |||
4a8d628054 | |||
318bc0754e | |||
3a8e036f4a | |||
d8fdbbdf03 | |||
12620f7fd4 | |||
1710db409d | |||
ab911f44e6 | |||
3797004203 | |||
96fcf3b017 | |||
db21f23943 | |||
b49ababba0 | |||
7c0774ba0e | |||
cc69c3115f | |||
9fea5ac54f | |||
22d03f20fb | |||
c91b2f4556 | |||
25ddbf4824 | |||
a378bccd60 | |||
98fa8f63b8 | |||
9b5133529e | |||
2dd4c20f49 |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
/modules/programs/broot.nix @aheaume
|
/modules/programs/broot.nix @aheaume
|
||||||
|
|
||||||
|
/modules/programs/dircolors.nix @JustinLovinger
|
||||||
|
|
||||||
/modules/programs/direnv.nix @rycee
|
/modules/programs/direnv.nix @rycee
|
||||||
|
|
||||||
/modules/programs/eclipse.nix @rycee
|
/modules/programs/eclipse.nix @rycee
|
||||||
|
|
|
@ -4,9 +4,6 @@ os:
|
||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
before_script:
|
|
||||||
- mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./format -c
|
- ./format -c
|
||||||
- nix-shell . -A install
|
- nix-shell . -A install
|
||||||
|
|
29
README.md
29
README.md
|
@ -46,21 +46,12 @@ Installation
|
||||||
|
|
||||||
Currently the easiest way to install Home Manager is as follows:
|
Currently the easiest way to install Home Manager is as follows:
|
||||||
|
|
||||||
1. Make sure you have a working Nix installation. If you are not
|
1. Make sure you have a working Nix installation. Specifically, make
|
||||||
using NixOS then you may here have to run
|
sure that your user is able to build and install Nix packages. For
|
||||||
|
example, you should be able to successfully run a command like
|
||||||
```console
|
`nix-instantiate '<nixpkgs>' -A hello` without having to switch to
|
||||||
$ mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
|
the root user. For a multi-user install of Nix this means that
|
||||||
```
|
your user must be covered by the
|
||||||
|
|
||||||
since Home Manager uses these directories to manage your profile
|
|
||||||
generations. On NixOS these should already be available.
|
|
||||||
|
|
||||||
Also make sure that your user is able to build and install Nix
|
|
||||||
packages. For example, you should be able to successfully run a
|
|
||||||
command like `nix-instantiate '<nixpkgs>' -A hello` without having
|
|
||||||
to switch to the root user. For a multi-user install of Nix this
|
|
||||||
means that your user must be covered by the
|
|
||||||
[`allowed-users`][nixAllowedUsers] Nix option. On NixOS you can
|
[`allowed-users`][nixAllowedUsers] Nix option. On NixOS you can
|
||||||
control this option using the
|
control this option using the
|
||||||
[`nix.allowedUsers`][nixosAllowedUsers] system option.
|
[`nix.allowedUsers`][nixosAllowedUsers] system option.
|
||||||
|
@ -158,7 +149,13 @@ To satisfy the above setup we should elaborate the
|
||||||
|
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableIcedTea = true;
|
profiles = {
|
||||||
|
myprofile = {
|
||||||
|
settings = {
|
||||||
|
"general.smoothScroll" = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
|
|
|
@ -44,22 +44,12 @@
|
||||||
<orderedlist>
|
<orderedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Make sure you have a working Nix installation. If you are not using NixOS
|
Make sure you have a working Nix installation. Specifically, make
|
||||||
then it may be necessary to run
|
sure that your user is able to build and install Nix packages.
|
||||||
</para>
|
For example, you should be able to successfully run a command
|
||||||
<screen>
|
like <literal>nix-instantiate '<nixpkgs>' -A hello</literal>
|
||||||
<prompt>$</prompt> <userinput>mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER</userinput>
|
without having to switch to the root user. For a multi-user
|
||||||
</screen>
|
install of Nix this means that your user must be covered by the
|
||||||
<para>
|
|
||||||
since Home Manager uses these directories to manage your profile
|
|
||||||
generations. On NixOS these should already be available.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Also make sure that your user is able to build and install Nix packages.
|
|
||||||
For example, you should be able to successfully run a command like
|
|
||||||
<literal>nix-instantiate '<nixpkgs>' -A hello</literal> without
|
|
||||||
having to switch to the root user. For a multi-user install of Nix this
|
|
||||||
means that your user must be covered by the
|
|
||||||
<link xlink:href="https://nixos.org/nix/manual/#conf-allowed-users"><literal>allowed-users</literal></link>
|
<link xlink:href="https://nixos.org/nix/manual/#conf-allowed-users"><literal>allowed-users</literal></link>
|
||||||
Nix option. On NixOS you can control this option using the
|
Nix option. On NixOS you can control this option using the
|
||||||
<link xlink:href="https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers"><literal>nix.allowedUsers</literal></link>
|
<link xlink:href="https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers"><literal>nix.allowedUsers</literal></link>
|
||||||
|
|
|
@ -3,13 +3,16 @@
|
||||||
function setupVars() {
|
function setupVars() {
|
||||||
local profilesPath="/nix/var/nix/profiles/per-user/$USER"
|
local profilesPath="/nix/var/nix/profiles/per-user/$USER"
|
||||||
local gcPath="/nix/var/nix/gcroots/per-user/$USER"
|
local gcPath="/nix/var/nix/gcroots/per-user/$USER"
|
||||||
local greatestGenNum
|
|
||||||
|
|
||||||
|
genProfilePath="$profilesPath/home-manager"
|
||||||
|
newGenPath="@GENERATION_DIR@";
|
||||||
|
newGenGcPath="$gcPath/current-home"
|
||||||
|
|
||||||
|
local greatestGenNum
|
||||||
greatestGenNum=$( \
|
greatestGenNum=$( \
|
||||||
find "$profilesPath" -name 'home-manager-*-link' \
|
nix-env --list-generations --profile "$genProfilePath" \
|
||||||
| sed 's/^.*-\([0-9]*\)-link$/\1/' \
|
| tail -1 \
|
||||||
| sort -rn \
|
| sed -E 's/ *([[:digit:]]+) .*/\1/')
|
||||||
| head -1)
|
|
||||||
|
|
||||||
if [[ -n $greatestGenNum ]] ; then
|
if [[ -n $greatestGenNum ]] ; then
|
||||||
oldGenNum=$greatestGenNum
|
oldGenNum=$greatestGenNum
|
||||||
|
@ -18,15 +21,15 @@ function setupVars() {
|
||||||
newGenNum=1
|
newGenNum=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -e $gcPath/current-home ]] ; then
|
if [[ -e $profilesPath/home-manager ]] ; then
|
||||||
oldGenPath="$(readlink -e "$gcPath/current-home")"
|
oldGenPath="$(readlink -e "$profilesPath/home-manager")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$VERBOSE_ECHO "Sanity checking oldGenNum and oldGenPath"
|
$VERBOSE_ECHO "Sanity checking oldGenNum and oldGenPath"
|
||||||
if [[ -v oldGenNum && ! -v oldGenPath
|
if [[ -v oldGenNum && ! -v oldGenPath
|
||||||
|| ! -v oldGenNum && -v oldGenPath ]]; then
|
|| ! -v oldGenNum && -v oldGenPath ]]; then
|
||||||
errorEcho "Invalid profile number and GC root values! These must be"
|
errorEcho "Invalid profile number and current profile values! These"
|
||||||
errorEcho "either both empty or both set but are now set to"
|
errorEcho "must be either both empty or both set but are now set to"
|
||||||
errorEcho " '${oldGenNum:-}' and '${oldGenPath:-}'"
|
errorEcho " '${oldGenNum:-}' and '${oldGenPath:-}'"
|
||||||
errorEcho "If you don't mind losing previous profile generations then"
|
errorEcho "If you don't mind losing previous profile generations then"
|
||||||
errorEcho "the easiest solution is probably to run"
|
errorEcho "the easiest solution is probably to run"
|
||||||
|
@ -35,12 +38,6 @@ function setupVars() {
|
||||||
errorEcho "and trying home-manager switch again. Good luck!"
|
errorEcho "and trying home-manager switch again. Good luck!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
genProfilePath="$profilesPath/home-manager"
|
|
||||||
newGenPath="@GENERATION_DIR@";
|
|
||||||
newGenProfilePath="$profilesPath/home-manager-$newGenNum-link"
|
|
||||||
newGenGcPath="$gcPath/current-home"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -v VERBOSE ]]; then
|
if [[ -v VERBOSE ]]; then
|
||||||
|
@ -53,6 +50,11 @@ fi
|
||||||
|
|
||||||
echo "Starting home manager activation"
|
echo "Starting home manager activation"
|
||||||
|
|
||||||
|
# Verify that we can connect to the Nix store and/or daemon. This will
|
||||||
|
# also create the necessary directories in profiles and gcroots.
|
||||||
|
$VERBOSE_ECHO "Sanity checking Nix"
|
||||||
|
nix-build --expr '{}' --no-out-link
|
||||||
|
|
||||||
setupVars
|
setupVars
|
||||||
|
|
||||||
if [[ -v DRY_RUN ]] ; then
|
if [[ -v DRY_RUN ]] ; then
|
||||||
|
@ -78,6 +80,5 @@ else
|
||||||
fi
|
fi
|
||||||
$VERBOSE_ECHO " newGenPath=$newGenPath"
|
$VERBOSE_ECHO " newGenPath=$newGenPath"
|
||||||
$VERBOSE_ECHO " newGenNum=$newGenNum"
|
$VERBOSE_ECHO " newGenNum=$newGenNum"
|
||||||
$VERBOSE_ECHO " newGenProfilePath=$newGenProfilePath"
|
|
||||||
$VERBOSE_ECHO " newGenGcPath=$newGenGcPath"
|
$VERBOSE_ECHO " newGenGcPath=$newGenGcPath"
|
||||||
$VERBOSE_ECHO " genProfilePath=$genProfilePath"
|
$VERBOSE_ECHO " genProfilePath=$genProfilePath"
|
||||||
|
|
|
@ -1474,6 +1474,13 @@ in
|
||||||
A new module is available: 'services.mako'
|
A new module is available: 'services.mako'
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-05-12T20:09:54+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.dircolors'
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# Deprecated but still used by some applications.
|
# Deprecated but still used by some applications.
|
||||||
home.file.".local/share/applications/mimeapps.list".source =
|
xdg.dataFile."applications/mimeapps.list".source =
|
||||||
config.xdg.configFile."mimeapps.list".source;
|
config.xdg.configFile."mimeapps.list".source;
|
||||||
|
|
||||||
xdg.configFile."mimeapps.list".text =
|
xdg.configFile."mimeapps.list".text =
|
||||||
|
|
|
@ -30,7 +30,7 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
home.extraProfileCommands = ''
|
home.extraProfileCommands = ''
|
||||||
if [[ -w $out/share/mime && -d $out/share/mime/packages ]]; then
|
if [[ -w $out/share/mime && -w $out/share/mime/packages && -d $out/share/mime/packages ]]; then
|
||||||
XDG_DATA_DIRS=$out/share \
|
XDG_DATA_DIRS=$out/share \
|
||||||
PKGSYSTEM_ENABLE_FSYNC=0 \
|
PKGSYSTEM_ENABLE_FSYNC=0 \
|
||||||
${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \
|
${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \
|
||||||
|
|
|
@ -89,16 +89,21 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
xdg.configFile."user-dirs.dirs".text = generators.toKeyValue { } ({
|
xdg.configFile."user-dirs.dirs".text = let
|
||||||
XDG_DESKTOP_DIR = cfg.desktop;
|
options = {
|
||||||
XDG_DOCUMENTS_DIR = cfg.documents;
|
XDG_DESKTOP_DIR = cfg.desktop;
|
||||||
XDG_DOWNLOAD_DIR = cfg.download;
|
XDG_DOCUMENTS_DIR = cfg.documents;
|
||||||
XDG_MUSIC_DIR = cfg.music;
|
XDG_DOWNLOAD_DIR = cfg.download;
|
||||||
XDG_PICTURES_DIR = cfg.pictures;
|
XDG_MUSIC_DIR = cfg.music;
|
||||||
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
XDG_PICTURES_DIR = cfg.pictures;
|
||||||
XDG_TEMPLATES_DIR = cfg.templates;
|
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
||||||
XDG_VIDEOS_DIR = cfg.videos;
|
XDG_TEMPLATES_DIR = cfg.templates;
|
||||||
} // cfg.extraConfig);
|
XDG_VIDEOS_DIR = cfg.videos;
|
||||||
|
} // cfg.extraConfig;
|
||||||
|
|
||||||
|
# For some reason, these need to be wrapped with quotes to be valid.
|
||||||
|
wrapped = mapAttrs (_: value: ''"${value}"'') options;
|
||||||
|
in generators.toKeyValue { } wrapped;
|
||||||
|
|
||||||
xdg.configFile."user-dirs.conf".text = "enabled=False";
|
xdg.configFile."user-dirs.conf".text = "enabled=False";
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,6 +54,7 @@ let
|
||||||
(loadModule ./programs/browserpass.nix { })
|
(loadModule ./programs/browserpass.nix { })
|
||||||
(loadModule ./programs/chromium.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./programs/chromium.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./programs/command-not-found/command-not-found.nix { })
|
(loadModule ./programs/command-not-found/command-not-found.nix { })
|
||||||
|
(loadModule ./programs/dircolors.nix { })
|
||||||
(loadModule ./programs/direnv.nix { })
|
(loadModule ./programs/direnv.nix { })
|
||||||
(loadModule ./programs/eclipse.nix { })
|
(loadModule ./programs/eclipse.nix { })
|
||||||
(loadModule ./programs/emacs.nix { })
|
(loadModule ./programs/emacs.nix { })
|
||||||
|
|
223
modules/programs/dircolors.nix
Normal file
223
modules/programs/dircolors.nix
Normal file
|
@ -0,0 +1,223 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.dircolors;
|
||||||
|
|
||||||
|
formatLine = n: v: "${n} ${toString v}";
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ hm.maintainers.justinlovinger ];
|
||||||
|
|
||||||
|
options.programs.dircolors = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to manage <filename>.dir_colors</filename>
|
||||||
|
and set <code>LS_COLORS</code>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
enableBashIntegration = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable Bash integration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
enableFishIntegration = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable Fish integration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
enableZshIntegration = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable Zsh integration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = with types; attrsOf str;
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Options to add to <filename>.dir_colors</filename> file.
|
||||||
|
See <command>dircolors --print-database</command>
|
||||||
|
for options.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
OTHER_WRITABLE = "30;46";
|
||||||
|
".sh" = "01;32";
|
||||||
|
".csh" = "01;32";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Extra lines added to <filename>.dir_colors</filename> file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Add default settings from `dircolors --print-database`.
|
||||||
|
programs.dircolors.settings = {
|
||||||
|
RESET = mkDefault "0";
|
||||||
|
DIR = mkDefault "01;34";
|
||||||
|
LINK = mkDefault "01;36";
|
||||||
|
MULTIHARDLINK = mkDefault "00";
|
||||||
|
FIFO = mkDefault "40;33";
|
||||||
|
SOCK = mkDefault "01;35";
|
||||||
|
DOOR = mkDefault "01;35";
|
||||||
|
BLK = mkDefault "40;33;01";
|
||||||
|
CHR = mkDefault "40;33;01";
|
||||||
|
ORPHAN = mkDefault "40;31;01";
|
||||||
|
MISSING = mkDefault "00";
|
||||||
|
SETUID = mkDefault "37;41";
|
||||||
|
SETGID = mkDefault "30;43";
|
||||||
|
CAPABILITY = mkDefault "30;41";
|
||||||
|
STICKY_OTHER_WRITABLE = mkDefault "30;42";
|
||||||
|
OTHER_WRITABLE = mkDefault "34;42";
|
||||||
|
STICKY = mkDefault "37;44";
|
||||||
|
EXEC = mkDefault "01;32";
|
||||||
|
".tar" = mkDefault "01;31";
|
||||||
|
".tgz" = mkDefault "01;31";
|
||||||
|
".arc" = mkDefault "01;31";
|
||||||
|
".arj" = mkDefault "01;31";
|
||||||
|
".taz" = mkDefault "01;31";
|
||||||
|
".lha" = mkDefault "01;31";
|
||||||
|
".lz4" = mkDefault "01;31";
|
||||||
|
".lzh" = mkDefault "01;31";
|
||||||
|
".lzma" = mkDefault "01;31";
|
||||||
|
".tlz" = mkDefault "01;31";
|
||||||
|
".txz" = mkDefault "01;31";
|
||||||
|
".tzo" = mkDefault "01;31";
|
||||||
|
".t7z" = mkDefault "01;31";
|
||||||
|
".zip" = mkDefault "01;31";
|
||||||
|
".z" = mkDefault "01;31";
|
||||||
|
".dz" = mkDefault "01;31";
|
||||||
|
".gz" = mkDefault "01;31";
|
||||||
|
".lrz" = mkDefault "01;31";
|
||||||
|
".lz" = mkDefault "01;31";
|
||||||
|
".lzo" = mkDefault "01;31";
|
||||||
|
".xz" = mkDefault "01;31";
|
||||||
|
".zst" = mkDefault "01;31";
|
||||||
|
".tzst" = mkDefault "01;31";
|
||||||
|
".bz2" = mkDefault "01;31";
|
||||||
|
".bz" = mkDefault "01;31";
|
||||||
|
".tbz" = mkDefault "01;31";
|
||||||
|
".tbz2" = mkDefault "01;31";
|
||||||
|
".tz" = mkDefault "01;31";
|
||||||
|
".deb" = mkDefault "01;31";
|
||||||
|
".rpm" = mkDefault "01;31";
|
||||||
|
".jar" = mkDefault "01;31";
|
||||||
|
".war" = mkDefault "01;31";
|
||||||
|
".ear" = mkDefault "01;31";
|
||||||
|
".sar" = mkDefault "01;31";
|
||||||
|
".rar" = mkDefault "01;31";
|
||||||
|
".alz" = mkDefault "01;31";
|
||||||
|
".ace" = mkDefault "01;31";
|
||||||
|
".zoo" = mkDefault "01;31";
|
||||||
|
".cpio" = mkDefault "01;31";
|
||||||
|
".7z" = mkDefault "01;31";
|
||||||
|
".rz" = mkDefault "01;31";
|
||||||
|
".cab" = mkDefault "01;31";
|
||||||
|
".wim" = mkDefault "01;31";
|
||||||
|
".swm" = mkDefault "01;31";
|
||||||
|
".dwm" = mkDefault "01;31";
|
||||||
|
".esd" = mkDefault "01;31";
|
||||||
|
".jpg" = mkDefault "01;35";
|
||||||
|
".jpeg" = mkDefault "01;35";
|
||||||
|
".mjpg" = mkDefault "01;35";
|
||||||
|
".mjpeg" = mkDefault "01;35";
|
||||||
|
".gif" = mkDefault "01;35";
|
||||||
|
".bmp" = mkDefault "01;35";
|
||||||
|
".pbm" = mkDefault "01;35";
|
||||||
|
".pgm" = mkDefault "01;35";
|
||||||
|
".ppm" = mkDefault "01;35";
|
||||||
|
".tga" = mkDefault "01;35";
|
||||||
|
".xbm" = mkDefault "01;35";
|
||||||
|
".xpm" = mkDefault "01;35";
|
||||||
|
".tif" = mkDefault "01;35";
|
||||||
|
".tiff" = mkDefault "01;35";
|
||||||
|
".png" = mkDefault "01;35";
|
||||||
|
".svg" = mkDefault "01;35";
|
||||||
|
".svgz" = mkDefault "01;35";
|
||||||
|
".mng" = mkDefault "01;35";
|
||||||
|
".pcx" = mkDefault "01;35";
|
||||||
|
".mov" = mkDefault "01;35";
|
||||||
|
".mpg" = mkDefault "01;35";
|
||||||
|
".mpeg" = mkDefault "01;35";
|
||||||
|
".m2v" = mkDefault "01;35";
|
||||||
|
".mkv" = mkDefault "01;35";
|
||||||
|
".webm" = mkDefault "01;35";
|
||||||
|
".ogm" = mkDefault "01;35";
|
||||||
|
".mp4" = mkDefault "01;35";
|
||||||
|
".m4v" = mkDefault "01;35";
|
||||||
|
".mp4v" = mkDefault "01;35";
|
||||||
|
".vob" = mkDefault "01;35";
|
||||||
|
".qt" = mkDefault "01;35";
|
||||||
|
".nuv" = mkDefault "01;35";
|
||||||
|
".wmv" = mkDefault "01;35";
|
||||||
|
".asf" = mkDefault "01;35";
|
||||||
|
".rm" = mkDefault "01;35";
|
||||||
|
".rmvb" = mkDefault "01;35";
|
||||||
|
".flc" = mkDefault "01;35";
|
||||||
|
".avi" = mkDefault "01;35";
|
||||||
|
".fli" = mkDefault "01;35";
|
||||||
|
".flv" = mkDefault "01;35";
|
||||||
|
".gl" = mkDefault "01;35";
|
||||||
|
".dl" = mkDefault "01;35";
|
||||||
|
".xcf" = mkDefault "01;35";
|
||||||
|
".xwd" = mkDefault "01;35";
|
||||||
|
".yuv" = mkDefault "01;35";
|
||||||
|
".cgm" = mkDefault "01;35";
|
||||||
|
".emf" = mkDefault "01;35";
|
||||||
|
".ogv" = mkDefault "01;35";
|
||||||
|
".ogx" = mkDefault "01;35";
|
||||||
|
".aac" = mkDefault "00;36";
|
||||||
|
".au" = mkDefault "00;36";
|
||||||
|
".flac" = mkDefault "00;36";
|
||||||
|
".m4a" = mkDefault "00;36";
|
||||||
|
".mid" = mkDefault "00;36";
|
||||||
|
".midi" = mkDefault "00;36";
|
||||||
|
".mka" = mkDefault "00;36";
|
||||||
|
".mp3" = mkDefault "00;36";
|
||||||
|
".mpc" = mkDefault "00;36";
|
||||||
|
".ogg" = mkDefault "00;36";
|
||||||
|
".ra" = mkDefault "00;36";
|
||||||
|
".wav" = mkDefault "00;36";
|
||||||
|
".oga" = mkDefault "00;36";
|
||||||
|
".opus" = mkDefault "00;36";
|
||||||
|
".spx" = mkDefault "00;36";
|
||||||
|
".xspf" = mkDefault "00;36";
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".dir_colors".text = concatStringsSep "\n" ([ ]
|
||||||
|
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||||
|
++ mapAttrsToList formatLine cfg.settings) + "\n";
|
||||||
|
|
||||||
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||||
|
eval $(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)
|
||||||
|
'';
|
||||||
|
|
||||||
|
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
||||||
|
eval (${pkgs.coreutils}/bin/dircolors -c ~/.dir_colors)
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Set `LS_COLORS` before Oh My Zsh and `initExtra`.
|
||||||
|
programs.zsh.initExtraBeforeCompInit = mkIf cfg.enableZshIntegration ''
|
||||||
|
eval $(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -70,6 +70,11 @@ in {
|
||||||
Whether to enable Fish integration.
|
Whether to enable Fish integration.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableNixDirenvIntegration = mkEnableOption ''
|
||||||
|
<link
|
||||||
|
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
|
||||||
|
a fast, persistent use_nix implementation for direnv'';
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -78,8 +83,11 @@ in {
|
||||||
xdg.configFile."direnv/config.toml" =
|
xdg.configFile."direnv/config.toml" =
|
||||||
mkIf (cfg.config != { }) { source = configFile cfg.config; };
|
mkIf (cfg.config != { }) { source = configFile cfg.config; };
|
||||||
|
|
||||||
xdg.configFile."direnv/direnvrc" =
|
xdg.configFile."direnv/direnvrc" = let
|
||||||
mkIf (cfg.stdlib != "") { text = cfg.stdlib; };
|
text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib
|
||||||
|
++ optional cfg.enableNixDirenvIntegration
|
||||||
|
"source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc");
|
||||||
|
in mkIf (text != "") { inherit text; };
|
||||||
|
|
||||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
|
||||||
# Using mkAfter to make it more likely to appear after other
|
# Using mkAfter to make it more likely to appear after other
|
||||||
|
|
|
@ -101,9 +101,19 @@ in
|
||||||
]
|
]
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
List of Firefox add-on packages to install. Note, it is
|
List of Firefox add-on packages to install. Some
|
||||||
necessary to manually enable these extensions inside Firefox
|
pre-packaged add-ons are accessible from NUR,
|
||||||
after the first installation.
|
<link xlink:href="https://github.com/nix-community/NUR"/>.
|
||||||
|
Once you have NUR installed run
|
||||||
|
|
||||||
|
<screen language="console">
|
||||||
|
<prompt>$</prompt> <userinput>nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons</userinput>
|
||||||
|
</screen>
|
||||||
|
|
||||||
|
to list the available Firefox add-ons.
|
||||||
|
</para><para>
|
||||||
|
Note that it is necessary to manually enable these
|
||||||
|
extensions inside Firefox after the first installation.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,19 @@ let
|
||||||
else
|
else
|
||||||
''${section} "${subsection}"'';
|
''${section} "${subsection}"'';
|
||||||
|
|
||||||
|
mkValueString = v:
|
||||||
|
let
|
||||||
|
escapedV = ''
|
||||||
|
"${
|
||||||
|
replaceStrings [ "\n" " " ''"'' "\\" ] [ "\\n" "\\t" ''\"'' "\\\\" ] v
|
||||||
|
}"'';
|
||||||
|
in generators.mkValueStringDefault { } (if isString v then escapedV else v);
|
||||||
|
|
||||||
# generation for multiple ini values
|
# generation for multiple ini values
|
||||||
mkKeyValue = k: v:
|
mkKeyValue = k: v:
|
||||||
let mkKeyValue = generators.mkKeyValueDefault { } " = " k;
|
let
|
||||||
|
mkKeyValue =
|
||||||
|
generators.mkKeyValueDefault { inherit mkValueString; } " = " k;
|
||||||
in concatStringsSep "\n" (map (kv: " " + mkKeyValue kv) (toList v));
|
in concatStringsSep "\n" (map (kv: " " + mkKeyValue kv) (toList v));
|
||||||
|
|
||||||
# converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
|
# converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
|
||||||
|
|
|
@ -186,7 +186,7 @@ in {
|
||||||
|
|
||||||
themeVariant = mkOption {
|
themeVariant = mkOption {
|
||||||
default = "default";
|
default = "default";
|
||||||
type = types.enum [ "default" "light" "dark" ];
|
type = types.enum [ "default" "light" "dark" "system" ];
|
||||||
description = "The theme variation to request";
|
description = "The theme variation to request";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -78,11 +78,14 @@ in
|
||||||
home.file =
|
home.file =
|
||||||
let
|
let
|
||||||
toPaths = path:
|
toPaths = path:
|
||||||
# Links every dir in path to the extension path.
|
let
|
||||||
mapAttrsToList (k: v:
|
p = "${path}/share/vscode/extensions";
|
||||||
{
|
in
|
||||||
"${extensionPath}/${k}".source = "${path}/${k}";
|
# Links every dir in p to the extension path.
|
||||||
}) (builtins.readDir path);
|
mapAttrsToList (k: v:
|
||||||
|
{
|
||||||
|
"${extensionPath}/${k}".source = "${p}/${k}";
|
||||||
|
}) (builtins.readDir p);
|
||||||
toSymlink = concatMap toPaths cfg.extensions;
|
toSymlink = concatMap toPaths cfg.extensions;
|
||||||
in
|
in
|
||||||
foldr
|
foldr
|
||||||
|
|
|
@ -18,7 +18,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${cfg.package}/bin/keynav";
|
ExecStart = "${pkgs.keynav}/bin/keynav";
|
||||||
RestartSec = 3;
|
RestartSec = 3;
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,7 +32,7 @@ in {
|
||||||
Environment = let
|
Environment = let
|
||||||
path = with pkgs;
|
path = with pkgs;
|
||||||
makeSearchPath "bin" [ nix gitMinimal gnutar gzip ];
|
makeSearchPath "bin" [ nix gitMinimal gnutar gzip ];
|
||||||
in "PATH=${path}";
|
in [ "PATH=${path}" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ in {
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
global = {
|
global = {
|
||||||
user = "Alex";
|
username = "Alex";
|
||||||
password = "foo";
|
password = "foo";
|
||||||
device_name = "nix";
|
device_name = "nix";
|
||||||
};
|
};
|
||||||
|
|
|
@ -60,7 +60,7 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
serialiseArg = key: val: "-${key}=${escapeShellArg val}";
|
serialiseArg = key: val: escapeShellArg "-${key}=${escape [ "=" ] val}";
|
||||||
|
|
||||||
serialiseArgs = args: concatStringsSep " " (mapAttrsToList serialiseArg args);
|
serialiseArgs = args: concatStringsSep " " (mapAttrsToList serialiseArg args);
|
||||||
|
|
||||||
|
|
|
@ -101,10 +101,8 @@ let
|
||||||
'';
|
'';
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
let
|
let
|
||||||
modifier = xsession.windowManager.i3.config.modifier;
|
modifier = config.xsession.windowManager.i3.config.modifier;
|
||||||
in
|
in lib.mkOptionDefault {
|
||||||
|
|
||||||
lib.mkOptionDefault {
|
|
||||||
"''${modifier}+Return" = "exec i3-sensible-terminal";
|
"''${modifier}+Return" = "exec i3-sensible-terminal";
|
||||||
"''${modifier}+Shift+q" = "kill";
|
"''${modifier}+Shift+q" = "kill";
|
||||||
"''${modifier}+d" = "exec \${pkgs.dmenu}/bin/dmenu_run";
|
"''${modifier}+d" = "exec \${pkgs.dmenu}/bin/dmenu_run";
|
||||||
|
|
|
@ -130,10 +130,8 @@ let
|
||||||
'';
|
'';
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
let
|
let
|
||||||
modifier = cfg.config.modifier;
|
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||||
in
|
in lib.mkOptionDefault {
|
||||||
|
|
||||||
lib.mkOptionDefault {
|
|
||||||
"''${modifier}+Return" = "exec ${cfg.config.terminal}";
|
"''${modifier}+Return" = "exec ${cfg.config.terminal}";
|
||||||
"''${modifier}+Shift+q" = "kill";
|
"''${modifier}+Shift+q" = "kill";
|
||||||
"''${modifier}+d" = "exec ${cfg.config.menu}";
|
"''${modifier}+d" = "exec ${cfg.config.menu}";
|
||||||
|
|
|
@ -249,7 +249,7 @@ in
|
||||||
if [[ $systemdStatus == 'running' || $systemdStatus == 'degraded' ]]; then
|
if [[ $systemdStatus == 'running' || $systemdStatus == 'degraded' ]]; then
|
||||||
if [[ $systemdStatus == 'degraded' ]]; then
|
if [[ $systemdStatus == 'degraded' ]]; then
|
||||||
warnEcho "The user systemd session is degraded:"
|
warnEcho "The user systemd session is degraded:"
|
||||||
${systemctl} --user --state=failed
|
${systemctl} --user --no-pager --state=failed
|
||||||
warnEcho "Attempting to reload services anyway..."
|
warnEcho "Attempting to reload services anyway..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,8 @@ in {
|
||||||
|
|
||||||
environment = serviceEnvironment;
|
environment = serviceEnvironment;
|
||||||
|
|
||||||
|
unitConfig = { RequiresMountsFor = usercfg.home.homeDirectory; };
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = usercfg.home.username;
|
User = usercfg.home.username;
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
|
|
|
@ -29,6 +29,8 @@ import nmt {
|
||||||
./modules/programs/alacritty
|
./modules/programs/alacritty
|
||||||
./modules/programs/bash
|
./modules/programs/bash
|
||||||
./modules/programs/browserpass
|
./modules/programs/browserpass
|
||||||
|
./modules/programs/dircolors
|
||||||
|
./modules/programs/direnv
|
||||||
./modules/programs/fish
|
./modules/programs/fish
|
||||||
./modules/programs/git
|
./modules/programs/git
|
||||||
./modules/programs/gpg
|
./modules/programs/gpg
|
||||||
|
|
1
tests/modules/programs/dircolors/default.nix
Normal file
1
tests/modules/programs/dircolors/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ dircolors-settings = ./settings.nix; }
|
133
tests/modules/programs/dircolors/settings-expected.conf
Normal file
133
tests/modules/programs/dircolors/settings-expected.conf
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
# Extra dircolors configuration.
|
||||||
|
|
||||||
|
.7z 01;31
|
||||||
|
.aac 00;36
|
||||||
|
.ace 01;31
|
||||||
|
.alz 01;31
|
||||||
|
.arc 01;31
|
||||||
|
.arj 01;31
|
||||||
|
.asf 01;35
|
||||||
|
.au 00;36
|
||||||
|
.avi 01;35
|
||||||
|
.bmp 01;35
|
||||||
|
.bz 01;31
|
||||||
|
.bz2 01;31
|
||||||
|
.cab 01;31
|
||||||
|
.cgm 01;35
|
||||||
|
.cpio 01;31
|
||||||
|
.csh 01;32
|
||||||
|
.deb 01;31
|
||||||
|
.dl 01;35
|
||||||
|
.dwm 01;31
|
||||||
|
.dz 01;31
|
||||||
|
.ear 01;31
|
||||||
|
.emf 01;35
|
||||||
|
.esd 01;31
|
||||||
|
.flac 00;36
|
||||||
|
.flc 01;35
|
||||||
|
.fli 01;35
|
||||||
|
.flv 01;35
|
||||||
|
.gif 01;35
|
||||||
|
.gl 01;35
|
||||||
|
.gz 01;31
|
||||||
|
.jar 01;31
|
||||||
|
.jpeg 01;35
|
||||||
|
.jpg 01;35
|
||||||
|
.lha 01;31
|
||||||
|
.lrz 01;31
|
||||||
|
.lz 01;31
|
||||||
|
.lz4 01;31
|
||||||
|
.lzh 01;31
|
||||||
|
.lzma 01;31
|
||||||
|
.lzo 01;31
|
||||||
|
.m2v 01;35
|
||||||
|
.m4a 00;36
|
||||||
|
.m4v 01;35
|
||||||
|
.mid 00;36
|
||||||
|
.midi 00;36
|
||||||
|
.mjpeg 01;35
|
||||||
|
.mjpg 01;35
|
||||||
|
.mka 00;36
|
||||||
|
.mkv 01;35
|
||||||
|
.mng 01;35
|
||||||
|
.mov 01;35
|
||||||
|
.mp3 00;36
|
||||||
|
.mp4 01;35
|
||||||
|
.mp4v 01;35
|
||||||
|
.mpc 00;36
|
||||||
|
.mpeg 01;35
|
||||||
|
.mpg 01;35
|
||||||
|
.nuv 01;35
|
||||||
|
.oga 00;36
|
||||||
|
.ogg 00;36
|
||||||
|
.ogm 01;35
|
||||||
|
.ogv 01;35
|
||||||
|
.ogx 01;35
|
||||||
|
.opus 00;36
|
||||||
|
.pbm 01;35
|
||||||
|
.pcx 01;35
|
||||||
|
.pgm 01;35
|
||||||
|
.png 01;35
|
||||||
|
.ppm 01;35
|
||||||
|
.qt 01;35
|
||||||
|
.ra 00;36
|
||||||
|
.rar 01;31
|
||||||
|
.rm 01;35
|
||||||
|
.rmvb 01;35
|
||||||
|
.rpm 01;31
|
||||||
|
.rz 01;31
|
||||||
|
.sar 01;31
|
||||||
|
.sh 01;32
|
||||||
|
.spx 00;36
|
||||||
|
.svg 01;35
|
||||||
|
.svgz 01;35
|
||||||
|
.swm 01;31
|
||||||
|
.t7z 01;31
|
||||||
|
.tar 01;31
|
||||||
|
.taz 01;31
|
||||||
|
.tbz 01;31
|
||||||
|
.tbz2 01;31
|
||||||
|
.tga 01;35
|
||||||
|
.tgz 01;31
|
||||||
|
.tif 01;35
|
||||||
|
.tiff 01;35
|
||||||
|
.tlz 01;31
|
||||||
|
.txz 01;31
|
||||||
|
.tz 01;31
|
||||||
|
.tzo 01;31
|
||||||
|
.tzst 01;31
|
||||||
|
.vob 01;35
|
||||||
|
.war 01;31
|
||||||
|
.wav 00;36
|
||||||
|
.webm 01;35
|
||||||
|
.wim 01;31
|
||||||
|
.wmv 01;35
|
||||||
|
.xbm 01;35
|
||||||
|
.xcf 01;35
|
||||||
|
.xpm 01;35
|
||||||
|
.xspf 00;36
|
||||||
|
.xwd 01;35
|
||||||
|
.xz 01;31
|
||||||
|
.yuv 01;35
|
||||||
|
.z 01;31
|
||||||
|
.zip 01;31
|
||||||
|
.zoo 01;31
|
||||||
|
.zst 01;31
|
||||||
|
BLK 40;33;01
|
||||||
|
CAPABILITY 30;41
|
||||||
|
CHR 40;33;01
|
||||||
|
DIR 01;34
|
||||||
|
DOOR 01;35
|
||||||
|
EXEC 01;32
|
||||||
|
FIFO 40;33
|
||||||
|
LINK 01;36
|
||||||
|
MISSING 00
|
||||||
|
MULTIHARDLINK 00
|
||||||
|
ORPHAN 40;31;01
|
||||||
|
OTHER_WRITABLE 30;46
|
||||||
|
RESET 0
|
||||||
|
SETGID 30;43
|
||||||
|
SETUID 37;41
|
||||||
|
SOCK 01;35
|
||||||
|
STICKY 37;44
|
||||||
|
STICKY_OTHER_WRITABLE 30;42
|
27
tests/modules/programs/dircolors/settings.nix
Normal file
27
tests/modules/programs/dircolors/settings.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.dircolors = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
OTHER_WRITABLE = "30;46";
|
||||||
|
".sh" = "01;32";
|
||||||
|
".csh" = "01;32";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
# Extra dircolors configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.dir_colors \
|
||||||
|
${./settings-expected.conf}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
17
tests/modules/programs/direnv/bash.nix
Normal file
17
tests/modules/programs/direnv/bash.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.bash.enable = true;
|
||||||
|
programs.direnv.enable = true;
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.bashrc
|
||||||
|
assertFileRegex \
|
||||||
|
home-files/.bashrc \
|
||||||
|
'eval "\$(/nix/store/.*direnv.*/bin/direnv hook bash)"'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
6
tests/modules/programs/direnv/default.nix
Normal file
6
tests/modules/programs/direnv/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
direnv-bash = ./bash.nix;
|
||||||
|
direnv-nix-direnv = ./nix-direnv.nix;
|
||||||
|
direnv-stdlib = ./stdlib.nix;
|
||||||
|
direnv-stdlib-and-nix-direnv = ./stdlib-and-nix-direnv.nix;
|
||||||
|
}
|
18
tests/modules/programs/direnv/nix-direnv.nix
Normal file
18
tests/modules/programs/direnv/nix-direnv.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.bash.enable = true;
|
||||||
|
programs.direnv.enable = true;
|
||||||
|
programs.direnv.enableNixDirenvIntegration = true;
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.bashrc
|
||||||
|
assertFileRegex \
|
||||||
|
home-files/.config/direnv/direnvrc \
|
||||||
|
'source /nix/store/.*nix-direnv.*/share/nix-direnv/direnvrc'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
23
tests/modules/programs/direnv/stdlib-and-nix-direnv.nix
Normal file
23
tests/modules/programs/direnv/stdlib-and-nix-direnv.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let expectedContent = "something important";
|
||||||
|
in {
|
||||||
|
config = {
|
||||||
|
programs.bash.enable = true;
|
||||||
|
programs.direnv.enable = true;
|
||||||
|
programs.direnv.enableNixDirenvIntegration = true;
|
||||||
|
programs.direnv.stdlib = expectedContent;
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.bashrc
|
||||||
|
assertFileRegex \
|
||||||
|
home-files/.config/direnv/direnvrc \
|
||||||
|
'source /nix/store/.*nix-direnv.*/share/nix-direnv/direnvrc'
|
||||||
|
assertFileRegex \
|
||||||
|
home-files/.config/direnv/direnvrc \
|
||||||
|
'${expectedContent}'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
19
tests/modules/programs/direnv/stdlib.nix
Normal file
19
tests/modules/programs/direnv/stdlib.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let expectedContent = "something important";
|
||||||
|
in {
|
||||||
|
config = {
|
||||||
|
programs.bash.enable = true;
|
||||||
|
programs.direnv.enable = true;
|
||||||
|
programs.direnv.stdlib = expectedContent;
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.bashrc
|
||||||
|
assertFileRegex \
|
||||||
|
home-files/.config/direnv/direnvrc \
|
||||||
|
'${expectedContent}'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
[user]
|
[user]
|
||||||
email = user@example.org
|
email = "user@example.org"
|
||||||
name = John Doe
|
name = "John Doe"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[alias]
|
[alias]
|
||||||
a1 = foo
|
a1 = "foo"
|
||||||
a2 = baz
|
a2 = "baz"
|
||||||
|
escapes = "\"\\n\t"
|
||||||
|
|
||||||
[commit]
|
[commit]
|
||||||
gpgSign = true
|
gpgSign = true
|
||||||
|
@ -10,33 +11,33 @@
|
||||||
integer = 38
|
integer = 38
|
||||||
multiple = 1
|
multiple = 1
|
||||||
multiple = 2
|
multiple = 2
|
||||||
name = value
|
name = "value"
|
||||||
|
|
||||||
[extra "backcompat.with.dots"]
|
[extra "backcompat.with.dots"]
|
||||||
previously = worked
|
previously = "worked"
|
||||||
|
|
||||||
[extra "subsection"]
|
[extra "subsection"]
|
||||||
value = test
|
value = "test"
|
||||||
|
|
||||||
[filter "lfs"]
|
[filter "lfs"]
|
||||||
clean = git-lfs clean -- %f
|
clean = "git-lfs clean -- %f"
|
||||||
process = git-lfs filter-process
|
process = "git-lfs filter-process"
|
||||||
required = true
|
required = true
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = "git-lfs smudge -- %f"
|
||||||
|
|
||||||
[gpg]
|
[gpg]
|
||||||
program = path-to-gpg
|
program = "path-to-gpg"
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
email = user@example.org
|
email = "user@example.org"
|
||||||
name = John Doe
|
name = "John Doe"
|
||||||
signingKey = 00112233445566778899AABBCCDDEEFF
|
signingKey = "00112233445566778899AABBCCDDEEFF"
|
||||||
|
|
||||||
[include]
|
[include]
|
||||||
path = ~/path/to/config.inc
|
path = "~/path/to/config.inc"
|
||||||
|
|
||||||
[includeIf "gitdir:~/src/dir"]
|
[includeIf "gitdir:~/src/dir"]
|
||||||
path = ~/path/to/conditional.inc
|
path = "~/path/to/conditional.inc"
|
||||||
|
|
||||||
[includeIf "gitdir:~/src/dir"]
|
[includeIf "gitdir:~/src/dir"]
|
||||||
path = @git_include_path@
|
path = "@git_include_path@"
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
[sendemail "hm-account"]
|
[sendemail "hm-account"]
|
||||||
from = hm@example.org
|
from = "hm@example.org"
|
||||||
smtpEncryption = tls
|
smtpEncryption = "tls"
|
||||||
smtpServer = smtp.example.org
|
smtpServer = "smtp.example.org"
|
||||||
smtpUser = home.manager.jr
|
smtpUser = "home.manager.jr"
|
||||||
|
|
||||||
[sendemail "hm@example.com"]
|
[sendemail "hm@example.com"]
|
||||||
from = hm@example.com
|
from = "hm@example.com"
|
||||||
smtpEncryption = tls
|
smtpEncryption = "tls"
|
||||||
smtpServer = smtp.example.com
|
smtpServer = "smtp.example.com"
|
||||||
smtpUser = home.manager
|
smtpUser = "home.manager"
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
email = hm@example.com
|
email = "hm@example.com"
|
||||||
name = H. M. Test
|
name = "H. M. Test"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
This can be anything.
|
This can be anything.
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
email = user@example.org
|
email = "user@example.org"
|
||||||
name = John Doe
|
name = "John Doe"
|
||||||
|
|
|
@ -28,6 +28,7 @@ in {
|
||||||
aliases = {
|
aliases = {
|
||||||
a1 = "foo";
|
a1 = "foo";
|
||||||
a2 = "bar";
|
a2 = "bar";
|
||||||
|
escapes = ''"\n '';
|
||||||
};
|
};
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
extra = {
|
extra = {
|
||||||
|
|
Loading…
Reference in a new issue