Compare commits
41 commits
master
...
release-19
Author | SHA1 | Date | |
---|---|---|---|
ef64bc598f | |||
8def383511 | |||
c13c1b33d9 | |||
d74320012e | |||
aa2f70def7 | |||
76ba4bedff | |||
46eaee3262 | |||
f8187816a4 | |||
f9ac2671bb | |||
2307cb280a | |||
14c5a22cfb | |||
0f85326dee | |||
35d31c390d | |||
176e82ee1c | |||
634a909ddc | |||
33c6230dac | |||
1d8b6e7d9e | |||
cf5e08cfb8 | |||
45a73067ac | |||
ef906c5a92 | |||
bb18d4c746 | |||
6d5246f49f | |||
5d054abe6a | |||
a85f22164d | |||
dd6d8e278b | |||
9291923e84 | |||
b8bbd242f8 | |||
413ac52bed | |||
4f13f06b01 | |||
d714740961 | |||
81d600d948 | |||
3daa1da497 | |||
41d2a16f99 | |||
24b734500f | |||
de9fc235d0 | |||
14a0dce9e8 | |||
ef78cae6a4 | |||
e3c4ec12cc | |||
f73c6ed74f | |||
de0dae5666 | |||
162a65f029 |
|
@ -1,6 +1,18 @@
|
||||||
image: nixos/nix:latest
|
image: nixos/nix:latest
|
||||||
|
|
||||||
pages:
|
stages:
|
||||||
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
Run tests:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- nix-shell tests -A run.files-text
|
||||||
|
only:
|
||||||
|
- release-19.03
|
||||||
|
|
||||||
|
Deploy manual:
|
||||||
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- mkdir -p ~/.config/nixpkgs
|
- mkdir -p ~/.config/nixpkgs
|
||||||
- echo '{ manual.html.enable = true; }' > ~/.config/nixpkgs/home.nix
|
- echo '{ manual.html.enable = true; }' > ~/.config/nixpkgs/home.nix
|
||||||
|
@ -12,3 +24,14 @@ pages:
|
||||||
- public
|
- public
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
Deploy NUR:
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
HM_BRANCH: $CI_COMMIT_REF_NAME
|
||||||
|
HM_COMMIT_SHA: $CI_COMMIT_SHA
|
||||||
|
trigger:
|
||||||
|
project: rycee/nur-expressions
|
||||||
|
branch: master
|
||||||
|
only:
|
||||||
|
- release-19.03
|
||||||
|
|
|
@ -230,7 +230,81 @@ home-manager.useUserPackages = true;
|
||||||
<title>nix-darwin module</title>
|
<title>nix-darwin module</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To be done.
|
Home Manager provides a module that allows you to prepare user
|
||||||
|
environments directly from the nix-darwin configuration file, which often is
|
||||||
|
more convenient than using the <command>home-manager</command> tool.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
To make the NixOS module available for use you must <option>import</option>
|
||||||
|
it into your system configuration. This is most conveniently done by adding
|
||||||
|
a Home Manager channel, for example
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<screen>
|
||||||
|
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager</userinput>
|
||||||
|
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||||
|
</screen>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
if you are following Nixpkgs master or an unstable channel and
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<screen>
|
||||||
|
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/rycee/home-manager/archive/release-19.03.tar.gz home-manager</userinput>
|
||||||
|
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||||
|
</screen>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
if you follow a Nixpkgs version 19.03 channel.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
It is then possible to add
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<programlisting language="nix">
|
||||||
|
imports = [ <home-manager/nix-darwin> ];
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
to your nix-darwin <filename>configuration.nix</filename> file, which will
|
||||||
|
introduce a new NixOS option called <option>home-manager</option> whose type
|
||||||
|
is an attribute set that maps user names to Home Manager configurations.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
For example, a nix-darwin configuration may include the lines
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<programlisting language="nix">
|
||||||
|
home-manager.users.eve = { pkgs, ... }: {
|
||||||
|
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||||
|
programs.bash.enable = true;
|
||||||
|
};
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
and after a <command>darwin-rebuild --switch</command> the user eve's
|
||||||
|
environment should include a basic Bash configuration and the packages atool
|
||||||
|
and httpie.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
By default user packages will not be ignored in favor of
|
||||||
|
<option>environment.systemPackages</option>, but they will be intalled to
|
||||||
|
<option>/etc/profiles/per-user/$USERNAME</option> if
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<programlisting language="nix">
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
is added to the nix-darwin configuration. This option may become the default
|
||||||
|
value in the future.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
</section>
|
</section>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
|
@ -10,6 +10,20 @@ function errorEcho() {
|
||||||
echo $* >&2
|
echo $* >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setVerboseAndDryRun() {
|
||||||
|
if [[ -v VERBOSE ]]; then
|
||||||
|
export VERBOSE_ARG="--verbose"
|
||||||
|
else
|
||||||
|
export VERBOSE_ARG=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -v DRY_RUN ]] ; then
|
||||||
|
export DRY_RUN_CMD=echo
|
||||||
|
else
|
||||||
|
export DRY_RUN_CMD=""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function setWorkDir() {
|
function setWorkDir() {
|
||||||
if [[ ! -v WORK_DIR ]]; then
|
if [[ ! -v WORK_DIR ]]; then
|
||||||
WORK_DIR="$(mktemp --tmpdir -d home-manager-build.XXXXXXXXXX)"
|
WORK_DIR="$(mktemp --tmpdir -d home-manager-build.XXXXXXXXXX)"
|
||||||
|
@ -216,17 +230,7 @@ function doListGens() {
|
||||||
# Removes linked generations. Takes as arguments identifiers of
|
# Removes linked generations. Takes as arguments identifiers of
|
||||||
# generations to remove.
|
# generations to remove.
|
||||||
function doRmGenerations() {
|
function doRmGenerations() {
|
||||||
if [[ -v VERBOSE ]]; then
|
setVerboseAndDryRun
|
||||||
export VERBOSE_ARG="--verbose"
|
|
||||||
else
|
|
||||||
export VERBOSE_ARG=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -v DRY_RUN ]] ; then
|
|
||||||
export DRY_RUN_CMD=echo
|
|
||||||
else
|
|
||||||
export DRY_RUN_CMD=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
|
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
|
||||||
|
|
||||||
|
@ -246,6 +250,11 @@ function doRmGenerations() {
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doRmAllGenerations() {
|
||||||
|
$DRY_RUN_CMD rm $VERBOSE_ARG \
|
||||||
|
"/nix/var/nix/profiles/per-user/$USER/home-manager"*
|
||||||
|
}
|
||||||
|
|
||||||
function doExpireGenerations() {
|
function doExpireGenerations() {
|
||||||
local profileDir="/nix/var/nix/profiles/per-user/$USER"
|
local profileDir="/nix/var/nix/profiles/per-user/$USER"
|
||||||
|
|
||||||
|
@ -347,6 +356,56 @@ function doShowNews() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doUninstall() {
|
||||||
|
setVerboseAndDryRun
|
||||||
|
|
||||||
|
echo "This will remove Home Manager from your system."
|
||||||
|
|
||||||
|
if [[ -v DRY_RUN ]]; then
|
||||||
|
echo "This is a dry run, nothing will actually be uninstalled."
|
||||||
|
fi
|
||||||
|
|
||||||
|
local confirmation
|
||||||
|
read -r -n 1 -p "Really uninstall Home Manager? [y/n] " confirmation
|
||||||
|
echo
|
||||||
|
|
||||||
|
case $confirmation in
|
||||||
|
y|Y)
|
||||||
|
echo "Switching to empty Home Manager configuration..."
|
||||||
|
HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)"
|
||||||
|
echo "{}" > "$HOME_MANAGER_CONFIG"
|
||||||
|
doSwitch
|
||||||
|
rm "$HOME_MANAGER_CONFIG"
|
||||||
|
$DRY_RUN_CMD rm $VERBOSE_ARG -r \
|
||||||
|
"${XDG_DATA_HOME:-$HOME/.local/share}/home-manager"
|
||||||
|
$DRY_RUN_CMD rm $VERBOSE_ARG \
|
||||||
|
"/nix/var/nix/gcroots/per-user/$USER/current-home"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Yay!"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local deleteProfiles
|
||||||
|
read -r -n 1 \
|
||||||
|
-p 'Remove all Home Manager generations? [y/n] ' \
|
||||||
|
deleteProfiles
|
||||||
|
echo
|
||||||
|
|
||||||
|
case $deleteProfiles in
|
||||||
|
y|Y)
|
||||||
|
doRmAllGenerations
|
||||||
|
echo "All generations are now eligible for garbage collection."
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Leaving generations but they may still be garbage collected."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "Home Manager is uninstalled but your home.nix is left untouched."
|
||||||
|
}
|
||||||
|
|
||||||
function doHelp() {
|
function doHelp() {
|
||||||
echo "Usage: $0 [OPTION] COMMAND"
|
echo "Usage: $0 [OPTION] COMMAND"
|
||||||
echo
|
echo
|
||||||
|
@ -385,6 +444,8 @@ function doHelp() {
|
||||||
echo " packages List all packages installed in home-manager-path"
|
echo " packages List all packages installed in home-manager-path"
|
||||||
echo
|
echo
|
||||||
echo " news Show news entries in a pager"
|
echo " news Show news entries in a pager"
|
||||||
|
echo
|
||||||
|
echo " uninstall Remove Home Manager"
|
||||||
}
|
}
|
||||||
|
|
||||||
EXTRA_NIX_PATH=()
|
EXTRA_NIX_PATH=()
|
||||||
|
@ -466,6 +527,9 @@ case "$cmd" in
|
||||||
news)
|
news)
|
||||||
doShowNews --all
|
doShowNews --all
|
||||||
;;
|
;;
|
||||||
|
uninstall)
|
||||||
|
doUninstall
|
||||||
|
;;
|
||||||
help|--help)
|
help|--help)
|
||||||
doHelp
|
doHelp
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -6,6 +6,7 @@ runCommand
|
||||||
propagatedBuildInputs = [ home-manager ];
|
propagatedBuildInputs = [ home-manager ];
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
allowSubstitutes = false;
|
allowSubstitutes = false;
|
||||||
|
shellHookOnly = true;
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
confFile="''${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix"
|
confFile="''${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix"
|
||||||
|
|
||||||
|
@ -53,4 +54,7 @@ runCommand
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
""
|
''
|
||||||
|
echo This derivation is not buildable, instead run it using nix-shell.
|
||||||
|
exit 1
|
||||||
|
''
|
||||||
|
|
|
@ -95,7 +95,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.nullOr types.ints.positive;
|
type = types.nullOr types.port;
|
||||||
default = null;
|
default = null;
|
||||||
example = 993;
|
example = 993;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -125,7 +125,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.nullOr types.ints.positive;
|
type = types.nullOr types.port;
|
||||||
default = null;
|
default = null;
|
||||||
example = 465;
|
example = 465;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
@ -74,8 +74,8 @@ in
|
||||||
function checkNewGenCollision() {
|
function checkNewGenCollision() {
|
||||||
local newGenFiles
|
local newGenFiles
|
||||||
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
||||||
find "$newGenFiles" -type f -print0 -or -type l -print0 \
|
find "$newGenFiles" \( -type f -or -type l \) \
|
||||||
| xargs -0 bash ${check} "$newGenFiles"
|
-exec bash ${check} "$newGenFiles" {} +
|
||||||
}
|
}
|
||||||
|
|
||||||
checkNewGenCollision || exit 1
|
checkNewGenCollision || exit 1
|
||||||
|
@ -155,8 +155,8 @@ in
|
||||||
|
|
||||||
local newGenFiles
|
local newGenFiles
|
||||||
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
||||||
find "$newGenFiles" -type f -print0 -or -type l -print0 \
|
find "$newGenFiles" \( -type f -or -type l \) \
|
||||||
| xargs -0 bash ${link} "$newGenFiles"
|
-exec bash ${link} "$newGenFiles" {} +
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanOldGen() {
|
function cleanOldGen() {
|
||||||
|
|
|
@ -149,7 +149,7 @@ in
|
||||||
|
|
||||||
home.sessionVariables = mkOption {
|
home.sessionVariables = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = with types; attrsOf (either int str);
|
type = types.attrs;
|
||||||
example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; };
|
example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; };
|
||||||
description = ''
|
description = ''
|
||||||
Environment variables to always set at login.
|
Environment variables to always set at login.
|
||||||
|
@ -370,7 +370,7 @@ in
|
||||||
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
||||||
|
|
||||||
activationScript = pkgs.writeScript "activation-script" ''
|
activationScript = pkgs.writeScript "activation-script" ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.runtimeShell}
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
|
@ -13,9 +13,15 @@ let
|
||||||
let
|
let
|
||||||
tweakVal = v:
|
tweakVal = v:
|
||||||
if isString v then "'${v}'"
|
if isString v then "'${v}'"
|
||||||
else if isList v then "[" + concatMapStringsSep "," tweakVal v + "]"
|
else if isList v then tweakList v
|
||||||
else if isBool v then (if v then "true" else "false")
|
else if isBool v then (if v then "true" else "false")
|
||||||
else toString v;
|
else toString v;
|
||||||
|
|
||||||
|
# Assume empty list is a list of strings, see #769
|
||||||
|
tweakList = v:
|
||||||
|
if v == [] then "@as []"
|
||||||
|
else "[" + concatMapStringsSep "," tweakVal v + "]";
|
||||||
|
|
||||||
in
|
in
|
||||||
"${key}=${tweakVal value}";
|
"${key}=${tweakVal value}";
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,7 @@ in
|
||||||
|
|
||||||
<programlisting language="nix">
|
<programlisting language="nix">
|
||||||
nixpkgs.config = import ./nixpkgs-config.nix;
|
nixpkgs.config = import ./nixpkgs-config.nix;
|
||||||
xdg.configFile."nixpkgs/config.nix".source =
|
xdg.configFile."nixpkgs/config.nix".source = ./nixpkgs-config.nix;
|
||||||
./nixpkgs-config.nix;
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
in your Home Manager configuration.
|
in your Home Manager configuration.
|
||||||
|
|
|
@ -14,7 +14,7 @@ in
|
||||||
options = {
|
options = {
|
||||||
pam.sessionVariables = mkOption {
|
pam.sessionVariables = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = with types; attrsOf (either int str);
|
type = types.attrs;
|
||||||
example = { EDITOR = "vim"; };
|
example = { EDITOR = "vim"; };
|
||||||
description = ''
|
description = ''
|
||||||
Environment variables that will be set for the PAM session.
|
Environment variables that will be set for the PAM session.
|
||||||
|
|
|
@ -41,10 +41,13 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkMerge [
|
||||||
|
(mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.alacritty ];
|
home.packages = [ pkgs.alacritty ];
|
||||||
|
|
||||||
xdg.configFile."alacritty/alacritty.yml".text =
|
xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != {}) {
|
||||||
replaceStrings ["\\\\"] ["\\"] (builtins.toJSON cfg.settings);
|
text = replaceStrings ["\\\\"] ["\\"] (builtins.toJSON cfg.settings);
|
||||||
};
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,11 +36,10 @@ let
|
||||||
boolStr (signature.showSignature == "attach");
|
boolStr (signature.showSignature == "attach");
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
++ [ alot.extraConfig ]
|
||||||
++ [ "[[[abook]]]" ]
|
++ [ "[[[abook]]]" ]
|
||||||
++ mapAttrsToList (n: v: n + "=" + v) alot.contactCompletion
|
++ mapAttrsToList (n: v: n + "=" + v) alot.contactCompletion
|
||||||
)
|
);
|
||||||
+ "\n"
|
|
||||||
+ alot.extraConfig;
|
|
||||||
|
|
||||||
configFile =
|
configFile =
|
||||||
let
|
let
|
||||||
|
|
|
@ -72,7 +72,7 @@ in
|
||||||
|
|
||||||
sessionVariables = mkOption {
|
sessionVariables = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = with types; attrsOf (either int str);
|
type = types.attrs;
|
||||||
example = { MAILCHECK = 30; };
|
example = { MAILCHECK = 30; };
|
||||||
description = ''
|
description = ''
|
||||||
Environment variables that will be set for the Bash session.
|
Environment variables that will be set for the Bash session.
|
||||||
|
|
|
@ -36,7 +36,11 @@ in
|
||||||
default = self: [];
|
default = self: [];
|
||||||
defaultText = "epkgs: []";
|
defaultText = "epkgs: []";
|
||||||
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
|
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
|
||||||
description = "Extra packages available to Emacs.";
|
description = ''
|
||||||
|
Extra packages available to Emacs. To get a list of
|
||||||
|
available packages run:
|
||||||
|
<command>nix-env -f '<nixpkgs>' -qaP -A emacsPackagesNg</command>.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
overrides = mkOption {
|
overrides = mkOption {
|
||||||
|
|
|
@ -49,13 +49,33 @@ in
|
||||||
enableGoogleTalk = mkOption {
|
enableGoogleTalk = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable the unfree Google Talk plugin.";
|
description = ''
|
||||||
|
Whether to enable the unfree Google Talk plugin. This option
|
||||||
|
is <emphasis>deprecated</emphasis> and will only work if
|
||||||
|
|
||||||
|
<programlisting language="nix">
|
||||||
|
programs.firefox.package = pkgs.firefox-esr-52-unwrapped;
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
and the <option>plugin.load_flash_only</option> Firefox
|
||||||
|
option has been disabled.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
enableIcedTea = mkOption {
|
enableIcedTea = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable the Java applet plugin.";
|
description = ''
|
||||||
|
Whether to enable the Java applet plugin. This option is
|
||||||
|
<emphasis>deprecated</emphasis> and will only work if
|
||||||
|
|
||||||
|
<programlisting language="nix">
|
||||||
|
programs.firefox.package = pkgs.firefox-esr-52-unwrapped;
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
and the <option>plugin.load_flash_only</option> Firefox
|
||||||
|
option has been disabled.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -101,7 +101,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.int;
|
type = types.port;
|
||||||
default = 6667;
|
default = 6667;
|
||||||
description = "Port of the chat server.";
|
description = "Port of the chat server.";
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,7 @@ let
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
optionalAttrs (tls.enable && tls.certificatesFile != null) {
|
optionalAttrs (tls.enable && tls.certificatesFile != null) {
|
||||||
CertificateFile = tls.certificatesFile;
|
CertificateFile = toString tls.certificatesFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
masterSlaveMapping = {
|
masterSlaveMapping = {
|
||||||
|
@ -173,9 +173,9 @@ in
|
||||||
in
|
in
|
||||||
concatStringsSep "\n" (
|
concatStringsSep "\n" (
|
||||||
[ "# Generated by Home Manager.\n" ]
|
[ "# Generated by Home Manager.\n" ]
|
||||||
|
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||||
++ accountsConfig
|
++ accountsConfig
|
||||||
++ groupsConfig
|
++ groupsConfig
|
||||||
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
|
||||||
) + "\n";
|
) + "\n";
|
||||||
|
|
||||||
home.activation.createMaildir =
|
home.activation.createMaildir =
|
||||||
|
|
|
@ -188,7 +188,7 @@ in
|
||||||
{
|
{
|
||||||
target = "${notmuchIni.database.path}/.notmuch/hooks/${name}";
|
target = "${notmuchIni.database.path}/.notmuch/hooks/${name}";
|
||||||
source = pkgs.writeScript name ''
|
source = pkgs.writeScript name ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.runtimeShell}
|
||||||
|
|
||||||
export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH"
|
export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH"
|
||||||
export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/notmuchrc"
|
export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/notmuchrc"
|
||||||
|
|
|
@ -270,7 +270,7 @@ in
|
||||||
|
|
||||||
theme = mkOption {
|
theme = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = with types; nullOr (either string path);
|
type = with types; nullOr (either str path);
|
||||||
example = "Arc";
|
example = "Arc";
|
||||||
description = ''
|
description = ''
|
||||||
Name of theme or path to theme file in rasi format. Available
|
Name of theme or path to theme file in rasi format. Available
|
||||||
|
|
|
@ -107,7 +107,7 @@ in
|
||||||
SKIM_CTRL_T_COMMAND = cfg.fileWidgetCommand;
|
SKIM_CTRL_T_COMMAND = cfg.fileWidgetCommand;
|
||||||
SKIM_CTRL_T_OPTS = cfg.fileWidgetOptions;
|
SKIM_CTRL_T_OPTS = cfg.fileWidgetOptions;
|
||||||
SKIM_DEFAULT_COMMAND = cfg.defaultCommand;
|
SKIM_DEFAULT_COMMAND = cfg.defaultCommand;
|
||||||
SKIM_DEFAULT_OPTS = cfg.defaultOptions;
|
SKIM_DEFAULT_OPTIONS = cfg.defaultOptions;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.port;
|
||||||
default = null;
|
default = null;
|
||||||
description = "Specifies port number to connect on remote host.";
|
description = "Specifies port number to connect on remote host.";
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,12 @@ let
|
||||||
|
|
||||||
cfg = config.programs.vscode;
|
cfg = config.programs.vscode;
|
||||||
|
|
||||||
|
configFilePath =
|
||||||
|
if pkgs.stdenv.hostPlatform.isDarwin then
|
||||||
|
"Library/Application Support/Code/User/settings.json"
|
||||||
|
else
|
||||||
|
"${config.xdg.configHome}/Code/User/settings.json";
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -23,14 +29,15 @@ in
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Configuration written to
|
Configuration written to Visual Studio Code's
|
||||||
<filename>~/.config/Code/User/settings.json</filename>.
|
<filename>settings.json</filename>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
extensions = mkOption {
|
extensions = mkOption {
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
default = [];
|
default = [];
|
||||||
|
example = literalExample "[ pkgs.vscode-extensions.bbenoist.Nix ]";
|
||||||
description = ''
|
description = ''
|
||||||
The extensions Visual Studio Code should be started with.
|
The extensions Visual Studio Code should be started with.
|
||||||
These will override but not delete manually installed ones.
|
These will override but not delete manually installed ones.
|
||||||
|
@ -46,7 +53,6 @@ in
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.configFile."Code/User/settings.json".text =
|
home.file."${configFilePath}".text = builtins.toJSON cfg.userSettings;
|
||||||
builtins.toJSON cfg.userSettings;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ in
|
||||||
|
|
||||||
sessionVariables = mkOption {
|
sessionVariables = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = with types; attrsOf (either int str);
|
type = types.attrs;
|
||||||
example = { MAILCHECK = 30; };
|
example = { MAILCHECK = 30; };
|
||||||
description = "Environment variables that will be set for zsh session.";
|
description = "Environment variables that will be set for zsh session.";
|
||||||
};
|
};
|
||||||
|
@ -294,7 +294,7 @@ in
|
||||||
(mkIf cfg.oh-my-zsh.enable {
|
(mkIf cfg.oh-my-zsh.enable {
|
||||||
home.file."${relToDotDir ".zshenv"}".text = ''
|
home.file."${relToDotDir ".zshenv"}".text = ''
|
||||||
ZSH="${pkgs.oh-my-zsh}/share/oh-my-zsh";
|
ZSH="${pkgs.oh-my-zsh}/share/oh-my-zsh";
|
||||||
ZSH_CACHE_DIR="''${XDG_CACHE_HOME:-''$HOME/.cache}/oh-my-zsh";
|
ZSH_CACHE_DIR="${config.xdg.cacheHome}/oh-my-zsh";
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -338,7 +338,13 @@ in
|
||||||
fpath+="$HOME/${pluginsDir}/${plugin.name}"
|
fpath+="$HOME/${pluginsDir}/${plugin.name}"
|
||||||
'') cfg.plugins)}
|
'') cfg.plugins)}
|
||||||
|
|
||||||
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
|
# Oh-My-Zsh calls compinit during initialization,
|
||||||
|
# calling it twice causes sight start up slowdown
|
||||||
|
# as all $fpath entries will be traversed again.
|
||||||
|
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable)
|
||||||
|
"autoload -U compinit && compinit"
|
||||||
|
}
|
||||||
|
|
||||||
${optionalString cfg.enableAutosuggestions
|
${optionalString cfg.enableAutosuggestions
|
||||||
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||||
}
|
}
|
||||||
|
@ -387,10 +393,9 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.oh-my-zsh.enable {
|
(mkIf cfg.oh-my-zsh.enable {
|
||||||
# Oh-My-Zsh calls compinit during initialization,
|
# Make sure we create a cache directory since some plugins expect it to exist
|
||||||
# calling it twice causes sight start up slowdown
|
# See: https://github.com/rycee/home-manager/issues/761
|
||||||
# as all $fpath entries will be traversed again.
|
home.file."${config.xdg.cacheHome}/oh-my-zsh/.keep".text = "";
|
||||||
programs.zsh.enableCompletion = mkForce false;
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.plugins != []) {
|
(mkIf (cfg.plugins != []) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.stdenv.shell} -l -c 'exec ${emacsBinPath}/emacs --fg-daemon'";
|
ExecStart = "${pkgs.runtimeShell} -l -c 'exec ${emacsBinPath}/emacs --fg-daemon'";
|
||||||
ExecStop = "${emacsBinPath}/emacsclient --eval '(kill-emacs)'";
|
ExecStop = "${emacsBinPath}/emacsclient --eval '(kill-emacs)'";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,7 +23,7 @@ in
|
||||||
|
|
||||||
systemd.user.services.flameshot = {
|
systemd.user.services.flameshot = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Powerful yet simple to use screenshot software";
|
Description = "Flameshot screenshot tool";
|
||||||
After = [
|
After = [
|
||||||
"graphical-session-pre.target"
|
"graphical-session-pre.target"
|
||||||
"polybar.service"
|
"polybar.service"
|
||||||
|
|
|
@ -71,7 +71,7 @@ in
|
||||||
postExec = mkOption {
|
postExec = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
example = "mu index";
|
example = "\${pkgs.mu}/bin/mu index";
|
||||||
description = ''
|
description = ''
|
||||||
An optional command to run after mbsync executes successfully.
|
An optional command to run after mbsync executes successfully.
|
||||||
This is useful for running mailbox indexing tools.
|
This is useful for running mailbox indexing tools.
|
||||||
|
|
|
@ -46,6 +46,7 @@ in {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "${config.home.homeDirectory}/music";
|
default = "${config.home.homeDirectory}/music";
|
||||||
defaultText = "$HOME/music";
|
defaultText = "$HOME/music";
|
||||||
|
apply = toString; # Prevent copies to Nix store.
|
||||||
description = ''
|
description = ''
|
||||||
The directory where mpd reads music from.
|
The directory where mpd reads music from.
|
||||||
'';
|
'';
|
||||||
|
@ -55,6 +56,7 @@ in {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "${cfg.dataDir}/playlists";
|
default = "${cfg.dataDir}/playlists";
|
||||||
defaultText = ''''${dataDir}/playlists'';
|
defaultText = ''''${dataDir}/playlists'';
|
||||||
|
apply = toString; # Prevent copies to Nix store.
|
||||||
description = ''
|
description = ''
|
||||||
The directory where mpd stores playlists.
|
The directory where mpd stores playlists.
|
||||||
'';
|
'';
|
||||||
|
@ -79,6 +81,7 @@ in {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "${config.xdg.dataHome}/${name}";
|
default = "${config.xdg.dataHome}/${name}";
|
||||||
defaultText = "$XDG_DATA_HOME/mpd";
|
defaultText = "$XDG_DATA_HOME/mpd";
|
||||||
|
apply = toString; # Prevent copies to Nix store.
|
||||||
description = ''
|
description = ''
|
||||||
The directory where MPD stores its state, tag cache,
|
The directory where MPD stores its state, tag cache,
|
||||||
playlists etc.
|
playlists etc.
|
||||||
|
@ -98,7 +101,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.ints.positive;
|
type = types.port;
|
||||||
default = 6600;
|
default = 6600;
|
||||||
description = ''
|
description = ''
|
||||||
The TCP port on which the the daemon will listen.
|
The TCP port on which the the daemon will listen.
|
||||||
|
|
|
@ -56,7 +56,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.ints.positive;
|
type = types.port;
|
||||||
default = config.services.mpd.network.port;
|
default = config.services.mpd.network.port;
|
||||||
defaultText = "config.services.mpd.network.port";
|
defaultText = "config.services.mpd.network.port";
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
@ -131,6 +131,7 @@ in
|
||||||
scriptPkg = pkgs.writeShellScriptBin "polybar-start" cfg.script;
|
scriptPkg = pkgs.writeShellScriptBin "polybar-start" cfg.script;
|
||||||
in
|
in
|
||||||
"${scriptPkg}/bin/polybar-start";
|
"${scriptPkg}/bin/polybar-start";
|
||||||
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
|
|
|
@ -123,6 +123,18 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion =
|
||||||
|
cfg.provider == "manual"
|
||||||
|
-> cfg.latitude != null && cfg.longitude != null;
|
||||||
|
message =
|
||||||
|
"Must provide services.redshift.latitude and"
|
||||||
|
+ " services.redshift.latitude when"
|
||||||
|
+ " services.redshift.provider is set to \"manual\".";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.redshift = {
|
systemd.user.services.redshift = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Redshift colour temperature adjuster";
|
Description = "Redshift colour temperature adjuster";
|
||||||
|
|
|
@ -58,13 +58,12 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = ''
|
ExecStart = concatStringsSep " " ([
|
||||||
${pkgs.xautolock}/bin/xautolock \
|
"${pkgs.xautolock}/bin/xautolock"
|
||||||
-detectsleep \
|
"-detectsleep"
|
||||||
-time ${toString cfg.inactiveInterval} \
|
"-time ${toString cfg.inactiveInterval}"
|
||||||
-locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID' \
|
"-locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID'"
|
||||||
${concatStringsSep " " cfg.xautolockExtraOptions}
|
] ++ cfg.xautolockExtraOptions);
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ def get_services(dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_service_files(dir)
|
def get_service_files(dir)
|
||||||
Dir.chdir(dir) { Dir['*.service'] }
|
Dir.chdir(dir) { Dir['*.{service,socket}'] }
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_changed_services(dir_a, dir_b, services)
|
def get_changed_services(dir_a, dir_b, services)
|
||||||
|
|
|
@ -81,6 +81,7 @@ let
|
||||||
|
|
||||||
unitExample = type: literalExample ''
|
unitExample = type: literalExample ''
|
||||||
{
|
{
|
||||||
|
${toLower type}-name = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Example description";
|
Description = "Example description";
|
||||||
Documentation = [ "man:example(1)" "man:example(5)" ];
|
Documentation = [ "man:example(1)" "man:example(5)" ];
|
||||||
|
@ -90,6 +91,7 @@ let
|
||||||
…
|
…
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
};
|
||||||
'';
|
'';
|
||||||
|
|
||||||
sessionVariables = mkIf (cfg.sessionVariables != {}) {
|
sessionVariables = mkIf (cfg.sessionVariables != {}) {
|
||||||
|
|
|
@ -81,6 +81,7 @@ in
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
ExecStart =
|
ExecStart =
|
||||||
let
|
let
|
||||||
args = concatStringsSep " " (
|
args = concatStringsSep " " (
|
||||||
|
@ -109,7 +110,7 @@ in
|
||||||
home.file.".xprofile".text = ''
|
home.file.".xprofile".text = ''
|
||||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||||
|
|
||||||
if [[ -e "$HOME/.profile" ]]; then
|
if [ -e "$HOME/.profile" ]; then
|
||||||
. "$HOME/.profile"
|
. "$HOME/.profile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -134,7 +135,7 @@ in
|
||||||
home.file.${cfg.scriptPath} = {
|
home.file.${cfg.scriptPath} = {
|
||||||
executable = true;
|
executable = true;
|
||||||
text = ''
|
text = ''
|
||||||
if [[ ! -v HM_XPROFILE_SOURCED ]]; then
|
if [ -z "$HM_XPROFILE_SOURCED" ]; then
|
||||||
. ~/.xprofile
|
. ~/.xprofile
|
||||||
fi
|
fi
|
||||||
unset HM_XPROFILE_SOURCED
|
unset HM_XPROFILE_SOURCED
|
||||||
|
@ -149,7 +150,7 @@ in
|
||||||
systemctl --user stop graphical-session-pre.target
|
systemctl --user stop graphical-session-pre.target
|
||||||
|
|
||||||
# Wait until the units actually stop.
|
# Wait until the units actually stop.
|
||||||
while [[ -n "$(systemctl --user --no-legend --state=deactivating list-units)" ]]; do
|
while [ -n "$(systemctl --user --no-legend --state=deactivating list-units)" ]; do
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -39,6 +39,29 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.users != {}) {
|
config = mkIf (cfg.users != {}) {
|
||||||
|
warnings =
|
||||||
|
flatten (flip mapAttrsToList cfg.users (user: config:
|
||||||
|
flip map config.warnings (warning:
|
||||||
|
"${user} profile: ${warning}"
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
assertions =
|
||||||
|
flatten (flip mapAttrsToList cfg.users (user: config:
|
||||||
|
flip map config.assertions (assertion:
|
||||||
|
{
|
||||||
|
inherit (assertion) assertion;
|
||||||
|
message = "${user} profile: ${assertion.message}";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
users.users = mkIf cfg.useUserPackages (
|
||||||
|
mapAttrs (username: usercfg: {
|
||||||
|
packages = usercfg.home.packages;
|
||||||
|
}) cfg.users
|
||||||
|
);
|
||||||
|
|
||||||
system.activationScripts.postActivation.text =
|
system.activationScripts.postActivation.text =
|
||||||
concatStringsSep "\n" (mapAttrsToList (username: usercfg: ''
|
concatStringsSep "\n" (mapAttrsToList (username: usercfg: ''
|
||||||
echo Activating home-manager configuration for ${username}
|
echo Activating home-manager configuration for ${username}
|
||||||
|
|
|
@ -44,6 +44,13 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.users != {}) {
|
config = mkIf (cfg.users != {}) {
|
||||||
|
warnings =
|
||||||
|
flatten (flip mapAttrsToList cfg.users (user: config:
|
||||||
|
flip map config.warnings (warning:
|
||||||
|
"${user} profile: ${warning}"
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
assertions =
|
assertions =
|
||||||
flatten (flip mapAttrsToList cfg.users (user: config:
|
flatten (flip mapAttrsToList cfg.users (user: config:
|
||||||
flip map config.assertions (assertion:
|
flip map config.assertions (assertion:
|
||||||
|
@ -60,7 +67,10 @@ in
|
||||||
}) cfg.users
|
}) cfg.users
|
||||||
);
|
);
|
||||||
|
|
||||||
systemd.services = mapAttrs' (username: usercfg:
|
systemd.services = mapAttrs' (_: usercfg:
|
||||||
|
let
|
||||||
|
username = usercfg.home.username;
|
||||||
|
in
|
||||||
nameValuePair ("home-manager-${utils.escapeSystemdPath username}") {
|
nameValuePair ("home-manager-${utils.escapeSystemdPath username}") {
|
||||||
description = "Home Manager environment for ${username}";
|
description = "Home Manager environment for ${username}";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
@ -76,7 +86,7 @@ in
|
||||||
# The activation script is run by a login shell to make sure
|
# The activation script is run by a login shell to make sure
|
||||||
# that the user is given a sane Nix environment.
|
# that the user is given a sane Nix environment.
|
||||||
ExecStart = pkgs.writeScript "activate-${username}" ''
|
ExecStart = pkgs.writeScript "activate-${username}" ''
|
||||||
#! ${pkgs.stdenv.shell} -el
|
#! ${pkgs.runtimeShell} -el
|
||||||
echo Activating home-manager configuration for ${username}
|
echo Activating home-manager configuration for ${username}
|
||||||
exec ${usercfg.home.activationPackage}/activate
|
exec ${usercfg.home.activationPackage}/activate
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -5,8 +5,8 @@ let
|
||||||
nmt = pkgs.fetchFromGitLab {
|
nmt = pkgs.fetchFromGitLab {
|
||||||
owner = "rycee";
|
owner = "rycee";
|
||||||
repo = "nmt";
|
repo = "nmt";
|
||||||
rev = "b6ab61e707ec1ca3839fef42f9960a1179d543c4";
|
rev = "89fb12a2aaa8ec671e22a033162c7738be714305";
|
||||||
sha256 = "097fm1hmsyhy8chf73wwrvafcxny37414fna3haxf0q5fvpv4jfb";
|
sha256 = "07yc1jkgw8vhskzk937k9hfba401q8rn4sgj9baw3fkjl9zrbcyf";
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
@ -31,8 +31,13 @@ import nmt {
|
||||||
{
|
{
|
||||||
i3-keybindings = ./modules/services/window-managers/i3-keybindings.nix;
|
i3-keybindings = ./modules/services/window-managers/i3-keybindings.nix;
|
||||||
}
|
}
|
||||||
|
// import ./modules/misc/pam
|
||||||
// import ./modules/systemd
|
// import ./modules/systemd
|
||||||
)
|
)
|
||||||
|
// import ./modules/home-environment
|
||||||
|
// import ./modules/programs/alacritty
|
||||||
|
// import ./modules/programs/bash
|
||||||
// import ./modules/programs/ssh
|
// import ./modules/programs/ssh
|
||||||
// import ./modules/programs/tmux;
|
// import ./modules/programs/tmux
|
||||||
|
// import ./modules/programs/zsh;
|
||||||
}
|
}
|
||||||
|
|
3
tests/modules/home-environment/default.nix
Normal file
3
tests/modules/home-environment/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
home-session-variables = ./session-variables.nix;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Only source this once.
|
||||||
|
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
|
||||||
|
export __HM_SESS_VARS_SOURCED=1
|
||||||
|
|
||||||
|
export V1="v1"
|
||||||
|
export V2="v2-v1"
|
19
tests/modules/home-environment/session-variables.nix
Normal file
19
tests/modules/home-environment/session-variables.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
home.sessionVariables = {
|
||||||
|
V1 = "v1";
|
||||||
|
V2 = "v2-${config.home.sessionVariables.V1}";
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
||||||
|
assertFileContent \
|
||||||
|
home-path/etc/profile.d/hm-session-vars.sh \
|
||||||
|
${./session-variables-expected.txt}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
3
tests/modules/misc/pam/default.nix
Normal file
3
tests/modules/misc/pam/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
pam-session-variables = ./session-variables.nix;
|
||||||
|
}
|
2
tests/modules/misc/pam/session-variables-expected.txt
Normal file
2
tests/modules/misc/pam/session-variables-expected.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
V1 OVERRIDE="v1"
|
||||||
|
V2 OVERRIDE="v2-v1"
|
19
tests/modules/misc/pam/session-variables.nix
Normal file
19
tests/modules/misc/pam/session-variables.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
pam.sessionVariables = {
|
||||||
|
V1 = "v1";
|
||||||
|
V2 = "v2-${config.pam.sessionVariables.V1}";
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.pam_environment
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.pam_environment \
|
||||||
|
${./session-variables-expected.txt}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
4
tests/modules/programs/alacritty/default.nix
Normal file
4
tests/modules/programs/alacritty/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
alacritty-example-settings = ./example-settings.nix;
|
||||||
|
alacritty-empty-settings = ./empty-settings.nix;
|
||||||
|
}
|
13
tests/modules/programs/alacritty/empty-settings.nix
Normal file
13
tests/modules/programs/alacritty/empty-settings.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.alacritty.enable = true;
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertPathNotExists home-files/.config/alacritty
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"key_bindings":[{"chars":"\x0c","key":"K","mods":"Control"}],"window":{"dimensions":{"columns":200,"lines":3}}}
|
32
tests/modules/programs/alacritty/example-settings.nix
Normal file
32
tests/modules/programs/alacritty/example-settings.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.alacritty = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
window.dimensions = {
|
||||||
|
lines = 3;
|
||||||
|
columns = 200;
|
||||||
|
};
|
||||||
|
|
||||||
|
key_bindings = [
|
||||||
|
{
|
||||||
|
key = "K";
|
||||||
|
mods = "Control";
|
||||||
|
chars = "\\x0c";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.config/alacritty/alacritty.yml \
|
||||||
|
${./example-settings-expected.yml}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
3
tests/modules/programs/bash/default.nix
Normal file
3
tests/modules/programs/bash/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
bash-session-variables = ./session-variables.nix;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
# -*- mode: sh -*-
|
||||||
|
|
||||||
|
. "@homeDirectory@/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||||
|
|
||||||
|
export V1="v1"
|
||||||
|
export V2="v2-v1"
|
||||||
|
|
||||||
|
|
28
tests/modules/programs/bash/session-variables.nix
Normal file
28
tests/modules/programs/bash/session-variables.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.bash = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
sessionVariables = {
|
||||||
|
V1 = "v1";
|
||||||
|
V2 = "v2-${config.programs.bash.sessionVariables.V1}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.profile
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.profile \
|
||||||
|
${
|
||||||
|
pkgs.substituteAll {
|
||||||
|
src = ./session-variables-expected.txt;
|
||||||
|
inherit (config.home) homeDirectory;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ with lib;
|
||||||
programs.tmux = { enable = false; };
|
programs.tmux = { enable = false; };
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertFileNotExists home-files/.tmux.conf
|
assertPathNotExists home-files/.tmux.conf
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
3
tests/modules/programs/zsh/default.nix
Normal file
3
tests/modules/programs/zsh/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
zsh-session-variables = ./session-variables.nix;
|
||||||
|
}
|
22
tests/modules/programs/zsh/session-variables.nix
Normal file
22
tests/modules/programs/zsh/session-variables.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
sessionVariables = {
|
||||||
|
V1 = "v1";
|
||||||
|
V2 = "v2-${config.programs.zsh.sessionVariables.V1}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.zshrc
|
||||||
|
assertFileRegex home-files/.zshrc 'export V1="v1"'
|
||||||
|
assertFileRegex home-files/.zshrc 'export V2="v2-v1"'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue