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. # Android.
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
modules = [ modules = [
{ system.stateVersion = inputs.self.nixosModules.const.stateVersion; } { system.stateVersion = inputs.self.nixosModules.const.droidStateVersion; }
./module/NixOnDroid.nix ./module/NixOnDroid.nix
]; ];
extraSpecialArgs.const = self.nixosModules.const; extraSpecialArgs.const = self.nixosModules.const;

View file

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

View file

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

View file

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

View file

@ -1,45 +1,6 @@
{ pkgs, inputs, const, ... }: let { pkgs, inputs, const, ... }: let
homePath = "/data/data/com.termux.nix/files/home"; homePath = "/data/data/com.termux.nix/files/home";
in { 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-manager.config = {
home.stateVersion = const.droidStateVersion; home.stateVersion = const.droidStateVersion;
home.file = { home.file = {
@ -50,6 +11,8 @@ in {
}; };
home.sessionVariables = { home.sessionVariables = {
BASH_PATH = "${homePath}/.bash"; BASH_PATH = "${homePath}/.bash";
NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}";
TERM = "xterm-256color";
}; };
programs.bash = { programs.bash = {
enable = true; enable = true;
@ -69,76 +32,46 @@ in {
rebase.autoStash = true; rebase.autoStash = true;
}; };
}; };
programs.neovim = { # TODO: Find a way to reuse global config. programs.neovim = {
enable = true; enable = true;
viAlias = true; viAlias = true;
vimAlias = 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") environment.packages = with pkgs; [
lua dofile("${homePath}/.nvim/key/Leader.lua") android-tools
lua dofile("${homePath}/.nvim/config/Autoread.lua") binwalk
lua dofile("${homePath}/.nvim/config/Etc.lua") coreutils
lua dofile("${homePath}/.nvim/config/Search.lua") curl
lua dofile("${homePath}/.nvim/config/Tab.lua") diffutils
lua dofile("${homePath}/.nvim/plugin/Filetree.lua") ffmpeg
lua dofile("${homePath}/.nvim/plugin/lsp/Rust.lua") file
lua dofile("${homePath}/.nvim/plugin/lsp/Tex.lua") findutils
lua dofile("${homePath}/.nvim/plugin/Bufferline.lua") git
lua dofile("${homePath}/.nvim/plugin/Lualine.lua") gnugrep
lua dofile("${homePath}/.nvim/plugin/Autoclose.lua") gnumake
lua dofile("${homePath}/.nvim/plugin/Gitsigns.lua") gnused
lua dofile("${homePath}/.nvim/plugin/Trouble.lua") gnutar
lua dofile("${homePath}/.nvim/plugin/Tokyonight.lua") gzip
lua dofile("${homePath}/.nvim/plugin/Gruvbox.lua") hostname
lua dofile("${homePath}/.nvim/plugin/Closebuffers.lua") imagemagick
lua dofile("${homePath}/.nvim/plugin/Telescope.lua") jq
lua dofile("${homePath}/.nvim/plugin/Todo.lua") lsof
lua dofile("${homePath}/.nvim/plugin/Indent.lua") man
lua dofile("${homePath}/.nvim/plugin/Align.lua") ncdu
lua dofile("${homePath}/.nvim/plugin/Treesitter.lua") nmap
lua dofile("${homePath}/.nvim/plugin/Fold.lua") openssh
lua dofile("${homePath}/.nvim/plugin/Ollama.lua") parallel
lua dofile("${homePath}/.nvim/key/Autocomplete.lua") pv
lua dofile("${homePath}/.nvim/key/Buffer.lua") rsync
lua dofile("${homePath}/.nvim/key/Comment.lua") sqlite
lua dofile("${homePath}/.nvim/key/Common.lua") tmux
lua dofile("${homePath}/.nvim/key/Filetree.lua") tree
lua dofile("${homePath}/.nvim/key/Fold.lua") utillinux
lua dofile("${homePath}/.nvim/key/Gitsigns.lua") wget
lua dofile("${homePath}/.nvim/key/Lsp.lua") xz
lua dofile("${homePath}/.nvim/key/Navigation.lua") yt-dlp
lua dofile("${homePath}/.nvim/key/Ollama.lua") zip unzip
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")
'';
};
};
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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