NixOnDroid : Add some common modules and remove nvim config.

This commit is contained in:
Dmitry Voronin 2024-03-09 01:15:42 +03:00
parent b7b4c09d10
commit ac8ac14f4f
15 changed files with 59 additions and 127 deletions

View file

@ -253,7 +253,7 @@
# Android.
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
modules = [
{ system.stateVersion = inputs.self.nixosModules.const.stateVersion; }
{ system.stateVersion = inputs.self.nixosModules.const.droidStateVersion; }
./module/NixOnDroid.nix
];
extraSpecialArgs.const = self.nixosModules.const;

View file

@ -1,4 +1,4 @@
{ config, pkgs, environment, ... }: {
{ ... }: {
imports = [ ];
# Filesystems.

View file

@ -1,4 +1,4 @@
{ pkgs, environment, ... }: {
{ pkgs, ... }: {
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ];
hardware.opengl.driSupport = true;

View file

@ -1,4 +1,4 @@
{ environment, ... }: {
{ ... }: {
environment.etc.docker.source = ./docker;
environment.variables.DOCKER_CONFIG = "/etc/docker";
virtualisation.docker.enable = true;

View file

@ -1,45 +1,6 @@
{ pkgs, inputs, const, ... }: let
homePath = "/data/data/com.termux.nix/files/home";
in {
environment.packages = with pkgs; [
android-tools
binwalk
coreutils
curl
diffutils
ffmpeg
file
findutils
gcc
git
gnugrep
gnumake
gnused
gnutar
gzip
hostname
imagemagick
jq
lsof
ltex-ls
man
ncdu
nmap
openssh
parallel
pv
ripgrep
rsync
sqlite
tmux
tree
utillinux
wget
xz
yt-dlp
zip unzip
];
home-manager.config = {
home.stateVersion = const.droidStateVersion;
home.file = {
@ -50,6 +11,8 @@ in {
};
home.sessionVariables = {
BASH_PATH = "${homePath}/.bash";
NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}";
TERM = "xterm-256color";
};
programs.bash = {
enable = true;
@ -69,76 +32,46 @@ in {
rebase.autoStash = true;
};
};
programs.neovim = { # TODO: Find a way to reuse global config.
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
extraConfig = ''
set runtimepath+=~/.cache/nvim
set runtimepath+=~/.cache/nvim/treesitter
set runtimepath+=${inputs.nvimAlign}
set runtimepath+=${inputs.nvimAutoclose}
set runtimepath+=${inputs.nvimBufferline}
set runtimepath+=${inputs.nvimCloseBuffers}
set runtimepath+=${inputs.nvimDevicons}
set runtimepath+=${inputs.nvimGitsigns}
set runtimepath+=${inputs.nvimGruvboxMaterial}
set runtimepath+=${inputs.nvimIndentoMatic}
set runtimepath+=${inputs.nvimLspconfig}
set runtimepath+=${inputs.nvimLualine}
set runtimepath+=${inputs.nvimOllama}
set runtimepath+=${inputs.nvimPlenary}
set runtimepath+=${inputs.nvimSingleComment}
set runtimepath+=${inputs.nvimTelescope}
set runtimepath+=${inputs.nvimTodo}
set runtimepath+=${inputs.nvimTokyonight}
set runtimepath+=${inputs.nvimTreesitter}
set runtimepath+=${inputs.nvimTree}
set runtimepath+=${inputs.nvimTrouble}
set runtimepath+=${inputs.nvimWhichKey}
};
};
lua dofile("${homePath}/.nvim/key/Rekey.lua")
lua dofile("${homePath}/.nvim/key/Leader.lua")
lua dofile("${homePath}/.nvim/config/Autoread.lua")
lua dofile("${homePath}/.nvim/config/Etc.lua")
lua dofile("${homePath}/.nvim/config/Search.lua")
lua dofile("${homePath}/.nvim/config/Tab.lua")
lua dofile("${homePath}/.nvim/plugin/Filetree.lua")
lua dofile("${homePath}/.nvim/plugin/lsp/Rust.lua")
lua dofile("${homePath}/.nvim/plugin/lsp/Tex.lua")
lua dofile("${homePath}/.nvim/plugin/Bufferline.lua")
lua dofile("${homePath}/.nvim/plugin/Lualine.lua")
lua dofile("${homePath}/.nvim/plugin/Autoclose.lua")
lua dofile("${homePath}/.nvim/plugin/Gitsigns.lua")
lua dofile("${homePath}/.nvim/plugin/Trouble.lua")
lua dofile("${homePath}/.nvim/plugin/Tokyonight.lua")
lua dofile("${homePath}/.nvim/plugin/Gruvbox.lua")
lua dofile("${homePath}/.nvim/plugin/Closebuffers.lua")
lua dofile("${homePath}/.nvim/plugin/Telescope.lua")
lua dofile("${homePath}/.nvim/plugin/Todo.lua")
lua dofile("${homePath}/.nvim/plugin/Indent.lua")
lua dofile("${homePath}/.nvim/plugin/Align.lua")
lua dofile("${homePath}/.nvim/plugin/Treesitter.lua")
lua dofile("${homePath}/.nvim/plugin/Fold.lua")
lua dofile("${homePath}/.nvim/plugin/Ollama.lua")
lua dofile("${homePath}/.nvim/key/Autocomplete.lua")
lua dofile("${homePath}/.nvim/key/Buffer.lua")
lua dofile("${homePath}/.nvim/key/Comment.lua")
lua dofile("${homePath}/.nvim/key/Common.lua")
lua dofile("${homePath}/.nvim/key/Filetree.lua")
lua dofile("${homePath}/.nvim/key/Fold.lua")
lua dofile("${homePath}/.nvim/key/Gitsigns.lua")
lua dofile("${homePath}/.nvim/key/Lsp.lua")
lua dofile("${homePath}/.nvim/key/Navigation.lua")
lua dofile("${homePath}/.nvim/key/Ollama.lua")
lua dofile("${homePath}/.nvim/key/Sort.lua")
lua dofile("${homePath}/.nvim/key/Telescope.lua")
lua dofile("${homePath}/.nvim/key/Terminal.lua")
lua dofile("${homePath}/.nvim/key/Todo.lua")
lua dofile("${homePath}/.nvim/key/Trouble.lua")
lua dofile("${homePath}/.nvim/key/Update.lua")
lua dofile("${homePath}/.nvim/key/Whichkey.lua")
'';
};
};
environment.packages = with pkgs; [
android-tools
binwalk
coreutils
curl
diffutils
ffmpeg
file
findutils
git
gnugrep
gnumake
gnused
gnutar
gzip
hostname
imagemagick
jq
lsof
man
ncdu
nmap
openssh
parallel
pv
rsync
sqlite
tmux
tree
utillinux
wget
xz
yt-dlp
zip unzip
];
}

View file

@ -1,4 +1,4 @@
{ environment, lib, ... }: {
{ lib, ... }: {
environment.etc.bash.source = ./bash;
environment.shellAliases = lib.mkForce {};
environment.variables.BASH_PATH = "/etc/bash";

View file

@ -1,6 +1,6 @@
{ lib, ... }: {
{ ... }: {
# Enable non-free firmware.
hardware.enableRedistributableFirmware = lib.mkDefault true;
hardware.enableRedistributableFirmware = true;
# Configure bootloader.
boot.loader.systemd-boot.enable = true;

View file

@ -1,4 +1,4 @@
{ environment, pkgs, ... }: {
{ pkgs, ... }: {
security.loginDefs.settings.UMASK = "077";
environment.variables = {
# Neovim.

View file

@ -1,4 +1,4 @@
{ pkgs, environment, ... }: {
{ pkgs, ... }: {
# Disable profile switching on rebuild.
environment.variables.MOZ_LEGACY_PROFILES = "1";
programs.firefox = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{ ... }: {
programs.git = {
enable = true;
config = {

View file

@ -1,3 +1,3 @@
{ environment, ... }: {
{ ... }: {
environment.etc.gtk.source = ./gtk;
}

View file

@ -1,4 +1,4 @@
{ environment, ... }: {
{ ... }: {
environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
nixpkgs.config.allowUnfree = true;
nix.settings.auto-optimise-store = true;

View file

@ -1,22 +1,21 @@
{ environment, inputs, ... }: let
nvimSrc = "/etc/nvim";
nvimRc = { runtimes, cfgs }: let
{ inputs, util, ... }: let
nvimRc = { cfgPath, runtimes, cfgs }: let
runtimeRc = builtins.foldl' (acc: r:
acc + "set runtimepath+=${r}\n"
) "" runtimes;
cfgRc = builtins.foldl' (acc: c:
acc + "lua dofile(\"${nvimSrc}/${c}\")\n"
acc + "lua dofile(\"${cfgPath}/${c}\")\n"
) "" cfgs;
in runtimeRc + cfgRc;
in {
environment.etc.nvim.source = ./nvim;
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
configure = {
customRC = nvimRc {
customRC = util.nvimRc {
cfgPath = "/etc/nvim";
runtimes = [
"~/.cache/nvim"
"~/.cache/nvim/treesitter"

View file

@ -1,3 +1,3 @@
{ environment, ... }: {
{ ... }: {
users.mutableUsers = false;
}

View file

@ -1,3 +1,3 @@
{ environment, ... }: {
{ ... }: {
environment.etc.wallpaper.source = ./wallpaper;
}