Initial commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# User accounts
|
||||
# Don't forget to set a password with ‘passwd’!
|
||||
|
||||
imports = [
|
||||
<home-manager/nixos>
|
||||
./pbsds
|
||||
];
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
# TODO: nas stuff
|
||||
# TODO: can uid mapping be done at nfs level?
|
||||
users.users.pbsds.uid = 1001;
|
||||
users.groups.pbsds.gid = 1001;
|
||||
|
||||
users.users.jornane = {
|
||||
isNormalUser = true;
|
||||
uid = 1002;
|
||||
description = "jornane";
|
||||
extraGroups = [ "networkmanager" "wheel" ]; # TODO: NAS stuff
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhGRFktIRrppVVILraEn5eTrANBIBMcpNT4qvNcd7Ut"
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAA/UAomSQjOHb4Im0TV70f7Jb/JpsQDd7YKHCXBmjmsrXi2dJVpw/tn+FzP4d2XJXm38hVN89yG+PQwZhf3PSHBaB4DXqFnVLFNWXTRyPPnc1U9uTEvLnZPpVJ/iv2zuS73QHrDcBdIubtdnsr239dJizUJJKwSMHszhOAN4AMYS9WivozdmyS+3o4p8mSp+tOWhq0hmVewnH0teTaHASpvE0V65xW9RGc5AWx0PgkGTXScOOf4/N8oXILn6mepODstlRKCZnBsC/LaXgJsk2+BX/Q/t4V0ytHh9iYblSavNjZZXRvygvkmV/eYAJAJ+igHubs2fEDsXfRj9J0O6JWjAmsELObCYGRbg9QkvaRq5EQgDoSW64iQUmbfB8NmYyXxg4fh0xBUrX87YkYvtHznWzD8hZkqRfj4K9Ixfk1Bsaxb5ubU3/mjGLOpZZ47zEqoen43rUxLq+eeMEQGDbq3mAcA6uX73MvBTzERrfh93rojwlUHEUDoUYyq7aN6Y9vF8/gy3KT2+pvAoUy4NDImSmJTwVcFJ+qUsAaGMECKiznte3Qn8TiD5G9nqeqCoA9edegM2N0z+ovsiXRxVqQDPh3cz/VPSsTKa8jNxhFpw4Q6KzDrtQOKXDkrhSKTxozVLYw2rYCkd2odOhjIJiN63UTNSm2z37ckKbOCqDy6LwW2ls4OzH/LOz2QDkMCwe7MYMrC66wanDhsRUZwlbSEs8aB25NB6OGg61hId3SLS8HzJ+4dmbHhciZm0oJlKRSMAqMLO6o9OVguJOl1td71rhnqAbp4UuaMqm5Zzut1ET+zkYB4t2voTuMhSrEJn1RS4hxR2rWt5jF9Nn67Mu70c0K2DE7FXqldGALC87GO7PHLTnNRg3o8FCkmVYlHNUEqHR56Incg5sC6KS9G1RL3KEHzjgzz8RjFXR5p1Qj+ZZjObVuENdWuqk7gQaxsyocCCB4pbBtF9AYDOIIGCn8rJSKUFvD8KIaTpWFsFoUXanSnAiSCT98GhfIBLbgAt4yJmegRKOML/cxplCh0z9MkNlfPdVU+LI/2RSj3NJpxd/KuR1l73IpgVNcbumXefAY95ztB/w067ZHCFlO0r+Q42NacthsMDc4Ffd+grLpo7KSmDRc+L9YdRNDgLZMbfIimHYIRRMdvEMEICXe1tUvtKBSfU1goTSXXYK2fLOBfOFIXCQponfgZ04klRjgpzCtv8juCOOrHU6r/FpIRkDNbwjWm9i8yBacZGT30bwjK8UW6JSFvDDu747f0ztKyQew8hEivOyqGDwZyrhFImasulsS0/7DB07oUQtaXJ7J8ucGsarttt02D6K8yuCh5bqEVk5Fy4Xlw=="
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
|
||||
users.users.pbsds = {
|
||||
isNormalUser = true;
|
||||
description = "pbsds";
|
||||
extraGroups = [ "pbsds" "networkmanager" "wheel" "nixbld" ]; # TODO: NAS stuff
|
||||
initialHashedPassword = "$6$yNgxTHcP1UYkNwuZ$1sBehnKgPjVnDe0tSV8kyfynWpfjDzuohZX6SoTrMn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+Y7DlwNI9wBx3xhShb5tuML+ZR1XyBYgprwoZML5l2pzEeK7dXdmkc4QT4TM13EcNOopsNZymH/xOCsY/yVqVJJC2Smp6mkIk+Or0zdlzxXFp4u3MS4bg5pzFVFfsqJAQGB7laMxtakMbn0if54MOA34hEAdmzdBCc+g9suuqFhA9WPqMsVlxx9khTue0MNoUVflUkm4B51aPbnPe+aycxdqMgfONroOjtBAQYfGnlRUP1qR3AD9Y2ND/NhGA9f8gTKPBRam+lRDWEGQO9HmWQdpeZbfWEyJa82HZcTCIhQyQukfa5PIzwtops= pbsds@pbsds-optiplex7060"
|
||||
];
|
||||
|
||||
#EDITOR = "micro";
|
||||
|
||||
#packages = with pkgs; [
|
||||
#
|
||||
#];
|
||||
};
|
||||
users.groups.pbsds = {};
|
||||
|
||||
|
||||
|
||||
home-manager.users.pbsds = import ./home;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
# https://nix-community.github.io/home-manager/options.html
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./modules/jump.nix
|
||||
./modules/micro.nix
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home.stateVersion = "22.05";
|
||||
home.sessionVariables = {
|
||||
EDITOR = "micro";
|
||||
};
|
||||
programs.bash.initExtra = ''
|
||||
if [ "$COLORTERM" = "truecolor" ] || [ "$TERM" == "xterm" ]; then
|
||||
export TERM=xterm-256color
|
||||
export MICRO_TRUECOLOR=1
|
||||
fi
|
||||
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
}
|
||||
export PS1='\[\033[01;32m\]\u@\h\[\033[01;37m\] \[\033[01;34m\]\W\[\033[33m\]$(parse_git_branch)\[\033[01;32m\]\$\[\033[00m\] '
|
||||
|
||||
# ssh autocomplete
|
||||
if test -f ~/.ssh/config; then
|
||||
complete -W "$(cat ~/.ssh/config | grep '^Host ' | cut -b 6- | grep -v "\*")" ssh
|
||||
complete -W "$(cat ~/.ssh/config | grep '^Host ' | cut -b 6- | grep -v "\*")" rssh
|
||||
complete -W "$(cat ~/.ssh/config | grep '^Host ' | cut -b 6- | grep -v "\*")" vpn
|
||||
complete -W "$(cat ~/.ssh/config | grep '^Host ' | cut -b 6- | grep -v "\*")" lvpn
|
||||
complete -W "$(cat ~/.ssh/config | grep '^Host ' | cut -b 6- | grep -v "\*")" dvpn
|
||||
complete -W "$(cat ~/.ssh/config | grep '^Host ' | cut -b 6- | grep -v "\*")" scp
|
||||
complete -W "$(cat ~/.ssh/config | grep '^Host ' | cut -b 6- | grep -v "\*")" remote-init
|
||||
fi
|
||||
|
||||
# remote-exec and tldr
|
||||
complete -F _command remote
|
||||
complete -F _command remote-quick
|
||||
#complete -F _command tldr
|
||||
|
||||
function atom_nix {
|
||||
nix-shell -p atom --run "atom $(printf "%q " "$@") --in-process-gpu --no-sandbox"
|
||||
}
|
||||
'';
|
||||
# TODO: split ^
|
||||
|
||||
|
||||
home.packages = with pkgs; [
|
||||
rsync
|
||||
bind.dnsutils
|
||||
xclip
|
||||
|
||||
zip
|
||||
unrar
|
||||
unzip
|
||||
atool
|
||||
p7zip
|
||||
bzip2
|
||||
gzip
|
||||
atool
|
||||
|
||||
micro
|
||||
aspell
|
||||
aspellDicts.en
|
||||
aspellDicts.nb
|
||||
vimv
|
||||
dos2unix
|
||||
|
||||
pandoc
|
||||
graphviz
|
||||
vgmstream
|
||||
gallery-dl
|
||||
yt-dlp
|
||||
ffmpeg-full
|
||||
|
||||
git
|
||||
curl
|
||||
wget
|
||||
|
||||
visidata
|
||||
|
||||
lolcat
|
||||
toilet
|
||||
boxes
|
||||
tewisay
|
||||
ponysay
|
||||
|
||||
#tldr
|
||||
entr
|
||||
axel aria
|
||||
bat
|
||||
xe # xargs alternative
|
||||
sd # sed alternative
|
||||
fd # find alternative
|
||||
silver-searcher # `ag`
|
||||
ripgrep
|
||||
gron
|
||||
jq
|
||||
yq
|
||||
htmlq
|
||||
sysz
|
||||
du-dust # du alternative
|
||||
ncdu # Disk usage analyzer with an ncurses interface
|
||||
|
||||
mesa-demos
|
||||
cage
|
||||
|
||||
gh
|
||||
hub
|
||||
|
||||
librespeed-cli
|
||||
|
||||
nix-template
|
||||
nix-output-monitor
|
||||
nixpkgs-review
|
||||
manix
|
||||
|
||||
(python3.withPackages (python-packages: with python-packages; [
|
||||
requests
|
||||
numpy
|
||||
scipy
|
||||
ptpython
|
||||
poetry
|
||||
rich
|
||||
matplotlib
|
||||
more-itertools
|
||||
toml
|
||||
pyyaml
|
||||
virtualenv
|
||||
]))
|
||||
|
||||
];
|
||||
home.shellAliases = {
|
||||
ip = "ip -br -color";
|
||||
watch = "watch -c ";
|
||||
hman = "man -H ";
|
||||
#igrep = "grep -i";
|
||||
#flexget = "ssh -t knut.pbsds.net sudo -u flexget flexget";
|
||||
flexget = "sudo --user=flexget flexget -c /var/lib/flexget/flexget.yml";
|
||||
tmux = "systemd-run --scope --user tmux";
|
||||
ed = "$EDITOR"; # ed is the standard editor
|
||||
de = "$EDITOR";
|
||||
dush = "du -shc * | sort -h";
|
||||
dushd = "du -shc * .[!.]?* | sort -h";
|
||||
diff = "diff -u --color";
|
||||
sudo = "sudo ";
|
||||
xargs = "xargs ";
|
||||
dc = "cd";
|
||||
#sl = "ls";
|
||||
sl = "exa";
|
||||
rssh = "ssh -l root";
|
||||
|
||||
# TODO: wayland detection
|
||||
clip = "xclip -sel clip -t text/plain -rmlastnl -i";
|
||||
|
||||
# git gud
|
||||
gs = "git status";
|
||||
gb = "git blame";
|
||||
gl = "git log --oneline --color | head -n 30";
|
||||
glg = "git log --all --decorate --oneline --graph";
|
||||
gpra = "git pull --rebase --autostash";
|
||||
gd = "git diff";
|
||||
gdwd = "git diff --word-diff";
|
||||
gdwdr = "git diff --word-diff --word-diff-regex=.";
|
||||
gds = "git diff --staged";
|
||||
gdswd = "git diff --staged --word-diff";
|
||||
gdswdr = "git diff --staged --word-diff --word-diff-regex=.";
|
||||
gcp = "git cherry-pick";
|
||||
gca = "git commit --amend";
|
||||
gcara = "git commit --amend --reset-author";
|
||||
gpo = "git push origin";
|
||||
gpasr = "git pull --autostash --rebase";
|
||||
#gfr = "git fetch origin master && git rebase FETCH_HEAD";
|
||||
gfr = "git pull --rebase";
|
||||
gp = "git pull --rebase --autostash";
|
||||
|
||||
python = "ptpython"; # this has too many problems...
|
||||
cpython = "python";
|
||||
|
||||
pwd-fqdn = ''echo "$(whoami)@$(hostname -f):$(printf "%q" "$(realpath .)/")"'';
|
||||
|
||||
http-server = "${pkgs.python3}/bin/python -m http.server";
|
||||
|
||||
manix-fzf = ''manix "" 2>/dev/null | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix'';
|
||||
};
|
||||
programs.bash.enable = true;
|
||||
#programs.bash.enableCompletion = true;
|
||||
programs.bash.shellOptions = [
|
||||
# Append to history file rather than replacing it.
|
||||
"histappend"
|
||||
# check the window size after each command and, if
|
||||
# necessary, update the values of LINES and COLUMNS.
|
||||
"checkwinsize"
|
||||
# Extended globbing.
|
||||
"extglob"
|
||||
"globstar"
|
||||
# Warn if closing shell with running jobs.
|
||||
"checkjobs"
|
||||
];
|
||||
programs.fzf.enable = true; # TODO: does this conflict with system-wide setup?
|
||||
#programs.git.gitui.enable = true;
|
||||
programs.git.enable = true;
|
||||
programs.git.delta.enable = true;
|
||||
#programs.git.lfs.enable = true;
|
||||
#programs.git.signing
|
||||
#programs.git.userName = "pbsds"
|
||||
programs.git.userName = "Peder Bergebakken Sundt";
|
||||
programs.git.userEmail = "pbsds@hotmail.com";
|
||||
programs.git.ignores = [ "result" "__pycache__" ];
|
||||
programs.exa.enable = true;
|
||||
programs.exa.enableAliases = true;
|
||||
programs.direnv.enable = true;
|
||||
programs.just.enable = true;
|
||||
#programs.mpv.bindings
|
||||
#programs.mpv.config
|
||||
|
||||
/**/
|
||||
# TODO: upstream this
|
||||
programs.micro.enable = true;
|
||||
programs.micro.trueColor = true;
|
||||
programs.micro.settings = {
|
||||
colorscheme = "railscast";
|
||||
rmtrailingws = true;
|
||||
tabstospaces = true;
|
||||
};
|
||||
#xdg.configFile."micro/bindings.json".source = (pkgs.formats.json {}).generate "micro-bindings" {
|
||||
programs.micro.bindings = {
|
||||
"Alt-/" = "lua:comment.comment";
|
||||
"Alt-d" = "SpawnMultiCursor";
|
||||
"Alt-j" = "lua:joinLines.joinLines";
|
||||
"Alt-l" = "command:lower";
|
||||
"Alt-u" = "command:upper";
|
||||
"AltLeft" = "PreviousTab";
|
||||
"AltRight" = "NextTab";
|
||||
"Ctrl-j" = "EndOfLine,CursorRight,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,Backspace";
|
||||
"CtrlDown" = "None";
|
||||
"CtrlUnderscore" = "lua:comment.comment";
|
||||
"CtrlUp" = "None";
|
||||
"Escape" = "RemoveAllMultiCursors";
|
||||
"Shift-PageDown" = "SelectPageDown";
|
||||
"Shift-PageUp" = "SelectPageUp";
|
||||
};
|
||||
programs.micro.ensurePlugins = [
|
||||
"aspell"
|
||||
"detectindent"
|
||||
"editorconfig"
|
||||
"joinLines"
|
||||
"manipulator"
|
||||
"quoter"
|
||||
];
|
||||
/**/
|
||||
|
||||
programs.nix-index.enable = true;
|
||||
programs.tealdeer.enable = true;
|
||||
|
||||
xdg.enable = true;
|
||||
#xdg.desktopEntries
|
||||
|
||||
gtk.enable = true; # TODO: only if programs.dconf is enabled
|
||||
gtk.theme.name = "vimix-dark-ruby";
|
||||
gtk.theme.package = pkgs.vimix-gtk-themes;
|
||||
gtk.iconTheme.name = "Flat-Remix-Blue-Dark";
|
||||
gtk.iconTheme.package = pkgs.flat-remix-icon-theme;
|
||||
|
||||
programs.jump.enableBash = true;
|
||||
|
||||
programs.beets = {
|
||||
enable = true;
|
||||
settings = {
|
||||
directory = "/mnt/meconium/beets_preprocessed/data";
|
||||
#library = "/mnt/meconium/beets_preprocessed/library.db";
|
||||
library = "${config.xdg.configHome}/beets/library_preprocessed.db";
|
||||
|
||||
#directory = "/mnt/meconium/beets_music/library";
|
||||
#library = "${config.xdg.configHome}/beets/library_meconium.db";
|
||||
##library = "/mnt/meconium/beets_music/data.db";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.jump;
|
||||
|
||||
enabled = cfg.enableBash || cfg.enableZsh;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.pbsds ];
|
||||
|
||||
options.programs.jump = {
|
||||
# Jumping around with symbolic links
|
||||
# Based on http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
|
||||
|
||||
enableBash = mkEnableOption "jump - Quickly Navigate your Filesystem";
|
||||
enableZsh = mkEnableOption "jump - Quickly Navigate your Filesystem";
|
||||
|
||||
marksPath = mkOption {
|
||||
type = types.str;
|
||||
default = "$HOME/.marks";
|
||||
description = ''
|
||||
Where the jump marks are stored
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf enabled {
|
||||
#home.packages = [ cfg.package ];
|
||||
|
||||
home.sessionVariables = { _JUMP_MARKPATH = cfg.marksPath; };
|
||||
|
||||
programs = let
|
||||
rcScript = ''
|
||||
function jump {
|
||||
pushd . > /dev/null
|
||||
cd -P "$_JUMP_MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
|
||||
}
|
||||
function mark {
|
||||
mkdir -p "$_JUMP_MARKPATH" &&
|
||||
test ! -L "$_JUMP_MARKPATH/$1" \
|
||||
&& ln -s "$(pwd)" "$_JUMP_MARKPATH/$1" \
|
||||
|| echo "mark already exists!"
|
||||
}
|
||||
function unmark {
|
||||
test ! -z "$1" \
|
||||
&& rm -i "$_JUMP_MARKPATH/$1"
|
||||
}
|
||||
function marks {
|
||||
#ls -l "$_JUMP_MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
|
||||
ls --color=always -l "$_JUMP_MARKPATH" | tr -s ' ' | cut -d' ' -f9- | sed -e 's/ -> /§/g' | column -t -s '§' -o ' -> '
|
||||
}
|
||||
_complete_jump_marks() {
|
||||
local curw=''${COMP_WORDS[COMP_CWORD]}
|
||||
local wordlist=$(find $_JUMP_MARKPATH -type l -printf "%f\n")
|
||||
COMPREPLY=($(compgen -W ''\'''${wordlist[@]}' -- "$curw"))
|
||||
return 0
|
||||
}
|
||||
complete -F _complete_jump_marks jump unmark
|
||||
'';
|
||||
in {
|
||||
# TODO: fish
|
||||
bash.initExtra = mkIf cfg.enableBash rcScript;
|
||||
zsh.initExtra = mkIf cfg.enableZsh rcScript;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.micro;
|
||||
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.mforster maintainers.pbsds ];
|
||||
|
||||
options = {
|
||||
programs.micro = {
|
||||
enable = mkEnableOption "micro, a terminal-based text editor";
|
||||
|
||||
trueColor = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description =
|
||||
"Enables support for the whole color range, should the terminal allow.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
autosu = false;
|
||||
cursorline = false;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/micro/settings.json</filename>. See
|
||||
<link xlink:href="https://github.com/zyedidia/micro/blob/master/runtime/help/options.md"/>
|
||||
for supported values.
|
||||
'';
|
||||
};
|
||||
|
||||
bindings = mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
"Alt-d" = "SpawnMultiCursor";
|
||||
"Escape" = "RemoveAllMultiCursors";
|
||||
"CtrlDown" = "None";
|
||||
"CtrlUp" = "None";
|
||||
"Shift-PageDown" = "SelectPageDown";
|
||||
"Shift-PageUp" = "SelectPageUp";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/micro/bindings.json</filename>. See
|
||||
<link xlink:href="https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md"/>
|
||||
for supported values.
|
||||
'';
|
||||
};
|
||||
|
||||
ensurePlugins = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = literalExpression ''
|
||||
[
|
||||
"aspell"
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
Install micro plugins during activation. See
|
||||
<link xlink:href="https://micro-editor.github.io/plugins.html"/>
|
||||
for a listing of available plugins.
|
||||
'';
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.micro ];
|
||||
|
||||
home.sessionVariables = mkIf cfg.trueColor { MICRO_TRUECOLOR = "1"; };
|
||||
|
||||
xdg.configFile."micro/settings.json".source =
|
||||
jsonFormat.generate "micro-settings" cfg.settings;
|
||||
|
||||
xdg.configFile."micro/bindings.json".source =
|
||||
jsonFormat.generate "micro-bindings" cfg.bindings;
|
||||
|
||||
home.activation = let
|
||||
mkInstall = pluginName: ''
|
||||
if ! test -d ${config.xdg.configHome}/micro/plug/${
|
||||
lib.escapeShellArg pluginName
|
||||
}; then
|
||||
(set -x
|
||||
$DRY_RUN_CMD ${pkgs.micro}/bin/micro -plugin install ${
|
||||
lib.escapeShellArg pluginName
|
||||
}
|
||||
)
|
||||
fi
|
||||
'';
|
||||
installs = lib.concatStringsSep "\n" (map mkInstall cfg.ensurePlugins);
|
||||
in mkIf (cfg.ensurePlugins != [ ]) {
|
||||
microPluginSetup = lib.hm.dag.entryAfter [ "writeBoundary" ] installs;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user