diff --git a/flake.nix b/flake.nix index 9f71ce8..79a0fdd 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/host/laptop/Configuration.nix b/host/laptop/Configuration.nix index 38951c1..df49850 100644 --- a/host/laptop/Configuration.nix +++ b/host/laptop/Configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, environment, ... }: { +{ ... }: { imports = [ ]; # Filesystems. diff --git a/module/AmdGpu.nix b/module/AmdGpu.nix index a181abb..122f410 100644 --- a/module/AmdGpu.nix +++ b/module/AmdGpu.nix @@ -1,4 +1,4 @@ -{ pkgs, environment, ... }: { +{ pkgs, ... }: { boot.initrd.kernelModules = [ "amdgpu" ]; services.xserver.videoDrivers = [ "amdgpu" ]; hardware.opengl.driSupport = true; diff --git a/module/Docker.nix b/module/Docker.nix index 0940bfe..a73c58a 100644 --- a/module/Docker.nix +++ b/module/Docker.nix @@ -1,4 +1,4 @@ -{ environment, ... }: { +{ ... }: { environment.etc.docker.source = ./docker; environment.variables.DOCKER_CONFIG = "/etc/docker"; virtualisation.docker.enable = true; diff --git a/module/NixOnDroid.nix b/module/NixOnDroid.nix index 3aaf118..a3b5fab 100644 --- a/module/NixOnDroid.nix +++ b/module/NixOnDroid.nix @@ -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 = { @@ -49,7 +10,9 @@ in { ".ssh/config".source = ./common/ssh/Config; }; home.sessionVariables = { - BASH_PATH = "${homePath}/.bash"; + 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 + ]; } diff --git a/module/common/Bash.nix b/module/common/Bash.nix index 6d0b13d..e96dd26 100644 --- a/module/common/Bash.nix +++ b/module/common/Bash.nix @@ -1,4 +1,4 @@ -{ environment, lib, ... }: { +{ lib, ... }: { environment.etc.bash.source = ./bash; environment.shellAliases = lib.mkForce {}; environment.variables.BASH_PATH = "/etc/bash"; diff --git a/module/common/Bootloader.nix b/module/common/Bootloader.nix index c33b82e..09e1a55 100644 --- a/module/common/Bootloader.nix +++ b/module/common/Bootloader.nix @@ -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; diff --git a/module/common/Environment.nix b/module/common/Environment.nix index 050959e..66f5d02 100644 --- a/module/common/Environment.nix +++ b/module/common/Environment.nix @@ -1,4 +1,4 @@ -{ environment, pkgs, ... }: { +{ pkgs, ... }: { security.loginDefs.settings.UMASK = "077"; environment.variables = { # Neovim. diff --git a/module/common/Firefox.nix b/module/common/Firefox.nix index b578572..89da3c4 100644 --- a/module/common/Firefox.nix +++ b/module/common/Firefox.nix @@ -1,4 +1,4 @@ -{ pkgs, environment, ... }: { +{ pkgs, ... }: { # Disable profile switching on rebuild. environment.variables.MOZ_LEGACY_PROFILES = "1"; programs.firefox = { diff --git a/module/common/Git.nix b/module/common/Git.nix index e36ff67..b8edc92 100644 --- a/module/common/Git.nix +++ b/module/common/Git.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ ... }: { programs.git = { enable = true; config = { diff --git a/module/common/Gtk.nix b/module/common/Gtk.nix index aab0862..61ba90e 100644 --- a/module/common/Gtk.nix +++ b/module/common/Gtk.nix @@ -1,3 +1,3 @@ -{ environment, ... }: { +{ ... }: { environment.etc.gtk.source = ./gtk; } diff --git a/module/common/Nix.nix b/module/common/Nix.nix index 6d1a438..bd60ecc 100644 --- a/module/common/Nix.nix +++ b/module/common/Nix.nix @@ -1,4 +1,4 @@ -{ environment, ... }: { +{ ... }: { environment.variables.NIXPKGS_ALLOW_UNFREE = "1"; nixpkgs.config.allowUnfree = true; nix.settings.auto-optimise-store = true; diff --git a/module/common/Nvim.nix b/module/common/Nvim.nix index d565d5d..f97dff9 100644 --- a/module/common/Nvim.nix +++ b/module/common/Nvim.nix @@ -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" diff --git a/module/common/Users.nix b/module/common/Users.nix index 1425b79..8973bbe 100644 --- a/module/common/Users.nix +++ b/module/common/Users.nix @@ -1,3 +1,3 @@ -{ environment, ... }: { +{ ... }: { users.mutableUsers = false; } diff --git a/module/common/Wallpaper.nix b/module/common/Wallpaper.nix index d37b8ce..23985fe 100644 --- a/module/common/Wallpaper.nix +++ b/module/common/Wallpaper.nix @@ -1,3 +1,3 @@ -{ environment, ... }: { +{ ... }: { environment.etc.wallpaper.source = ./wallpaper; }