From 5439286f0d1b72a696f130db3c60c2723b1ade68 Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 23 Jun 2024 20:26:21 -0500 Subject: [PATCH] Untested nix-on-droid config --- flake.nix | 11 +++++ profiles/nix-on-droid/configuration.nix | 51 ++++++++++++++++++++++ profiles/nix-on-droid/home.nix | 56 +++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 profiles/nix-on-droid/configuration.nix create mode 100644 profiles/nix-on-droid/home.nix diff --git a/flake.nix b/flake.nix index 3af225a..0ffed1e 100644 --- a/flake.nix +++ b/flake.nix @@ -152,6 +152,11 @@ }; }; }; + nixOnDroidConfigurations = { + default = nix-on-droid.lib.nixOnDroidConfiguration { + modules = [ ./nix-on-droid.nix ]; + }; + }; packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; @@ -188,6 +193,12 @@ home-manager-stable.url = "github:nix-community/home-manager/release-23.11"; home-manager-stable.inputs.nixpkgs.follows = "nixpkgs-stable"; + nix-on-droid = { + url = "github:nix-community/nix-on-droid/master"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager-unstable"; + }; + hyprland = { type = "git"; url = "https://github.com/hyprwm/Hyprland"; diff --git a/profiles/nix-on-droid/configuration.nix b/profiles/nix-on-droid/configuration.nix new file mode 100644 index 0000000..d8f9d2d --- /dev/null +++ b/profiles/nix-on-droid/configuration.nix @@ -0,0 +1,51 @@ +{ config, lib, pkgs, ... }: + +{ + # Simply install just the packages + environment.packages = with pkgs; [ + # User-facing stuff that you really really want to have + vim # or some other editor, e.g. nano or neovim + + # Some common stuff that people expect to have + procps + killall + diffutils + findutils + utillinux + tzdata + hostname + man + gnugrep + gnupg + gnused + gnutar + bzip2 + gzip + xz + zip + unzip + git + ]; + + # Backup etc files instead of failing to activate generation if a file already exists in /etc + environment.etcBackupExtension = ".bak"; + + # Read the changelog before changing this value + system.stateVersion = "23.11"; + + # Set up nix for flakes + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + + # Set your time zone + #time.timeZone = "Europe/Berlin"; + + # Configure home-manager + home-manager = { + backupFileExtension = "hm-bak"; + useGlobalPkgs = true; + + config = ./home.nix; + }; +} diff --git a/profiles/nix-on-droid/home.nix b/profiles/nix-on-droid/home.nix new file mode 100644 index 0000000..1727d9f --- /dev/null +++ b/profiles/nix-on-droid/home.nix @@ -0,0 +1,56 @@ +{ config, pkgs, userSettings, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = userSettings.username; + home.homeDirectory = "/data/data/com.termux.nix/files/home"; + + programs.home-manager.enable = true; + + imports = [ + ../../user/shell/sh.nix # My zsh and bash config + ../../user/shell/cli-collection.nix # Useful CLI apps + ../../user/app/doom-emacs/doom.nix # My doom emacs config + ../../user/app/ranger/ranger.nix # My ranger file manager config + ../../user/app/git/git.nix # My git config + ../../user/style/stylix.nix # Styling and themes for my apps + ]; + + home.stateVersion = "22.11"; # Please read the comment before changing. + + home.packages = with pkgs; [ + # Core + zsh + git + ]; + + xdg.enable = true; + xdg.userDirs = { + enable = true; + createDirectories = true; + music = "${config.home.homeDirectory}/Media/Music"; + videos = "${config.home.homeDirectory}/Media/Videos"; + pictures = "${config.home.homeDirectory}/Media/Pictures"; + templates = "${config.home.homeDirectory}/Templates"; + download = "${config.home.homeDirectory}/Downloads"; + documents = "${config.home.homeDirectory}/Documents"; + desktop = null; + publicShare = null; + extraConfig = { + XDG_DOTFILES_DIR = "${config.home.homeDirectory}/.dotfiles"; + XDG_ARCHIVE_DIR = "${config.home.homeDirectory}/Archive"; + XDG_ORG_DIR = "${config.home.homeDirectory}/Org"; + XDG_BOOK_DIR = "${config.home.homeDirectory}/Media/Books"; + }; + }; + xdg.mime.enable = true; + xdg.mimeApps.enable = true; + + home.sessionVariables = { + EDITOR = userSettings.editor; + }; + + news.display = "silent"; + +}