diff options
Diffstat (limited to '')
-rwxr-xr-x | bootstrap/config_setup/config_setup.sh | 13 | ||||
-rw-r--r-- | bootstrap/config_setup/default.nix | 12 | ||||
-rwxr-xr-x | bootstrap/setup/setup.sh | 12 | ||||
-rw-r--r-- | flake.nix | 8 |
4 files changed, 45 insertions, 0 deletions
diff --git a/bootstrap/config_setup/config_setup.sh b/bootstrap/config_setup/config_setup.sh new file mode 100755 index 00000000..92e91187 --- /dev/null +++ b/bootstrap/config_setup/config_setup.sh @@ -0,0 +1,13 @@ +#! /usr/bin/env dash +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. %SHELL_LIBRARY_PATH +export LIB_TEMP_DIR_FOR_SCRIPT="$(mktemp -d)" + + +# clone packer.nvim to the needed dir, for the nvim install to work +git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim + +nvim -c 'PackerSync' -c 'qall' -u '/mnt/soispha/.config/nvim/init.lua' --headless + +if [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ];then rm -r "$LIB_TEMP_DIR_FOR_SCRIPT"; fi diff --git a/bootstrap/config_setup/default.nix b/bootstrap/config_setup/default.nix new file mode 100644 index 00000000..7f4b6f2a --- /dev/null +++ b/bootstrap/config_setup/default.nix @@ -0,0 +1,12 @@ +# vim: ts=2 +{ + pkgs, + shell-library, + ... +}: let + dependencies = with pkgs; [dash git]; + name = "setup"; + script = ./config_setup.sh; + lib = import ../../lib {inherit pkgs shell-library;}; +in + lib.makeShellScriptWithLibrary {inherit dependencies name script;} diff --git a/bootstrap/setup/setup.sh b/bootstrap/setup/setup.sh index 8ef74b0a..3a73793b 100755 --- a/bootstrap/setup/setup.sh +++ b/bootstrap/setup/setup.sh @@ -34,4 +34,16 @@ git clone https://git.sils.li/ene/nixos-config /mnt/srv/etc/nixos mkdir -p /srv/home chmod 777 /srv/home +readp "Do you want to continue with the user configuration setup?[y/n]: " result; +case "$result" in + [yY]) + nix run "git+https://git.sils.li/ene/nixos-config#config_setup"; + ;; + *) + msg "Well, if you want to do everything yourself..." + exit 1 + ;; +esac + + if [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ];then rm -r "$LIB_TEMP_DIR_FOR_SCRIPT"; fi diff --git a/flake.nix b/flake.nix index 24f6e5f1..bb54840d 100644 --- a/flake.nix +++ b/flake.nix @@ -89,6 +89,10 @@ inherit pkgs; inherit (inputs) shell-library; }; + config_setup = import ./bootstrap/config_setup { + inherit pkgs; + inherit (inputs) shell-library; + }; }; apps."${system}" = { @@ -104,6 +108,10 @@ type = "app"; program = "${self.packages."${system}".setup}/bin/setup"; }; + config_setup = { + type = "app"; + program = "${self.packages."${system}".config_setup}/bin/config_setup"; + }; default = self.apps."${system}".activate; }; }; |