From efd944cfef4857d2bccb049ac49ce0fca0b27191 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Sat, 20 Apr 2024 19:26:41 +1200 Subject: [PATCH] feat(flake): add initial nix-on-droid configuration --- flake.nix | 17 ++++++++++- system/hosts/ooksphone/default.nix | 46 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 system/hosts/ooksphone/default.nix diff --git a/flake.nix b/flake.nix index 6537206..bcf2ec3 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,12 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nix-on-droid = { + url = "github:nix-community/nix-on-droid/release-23.11"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + hardware.url = "github:nixos/nixos-hardware"; nix-colors.url = "github:misterio77/nix-colors"; @@ -83,7 +89,7 @@ }; - outputs = { self, nixpkgs, home-manager, ... }@inputs: + outputs = { self, nixpkgs, home-manager, nix-on-droid, ... }@inputs: let inherit (self) outputs; lib = nixpkgs.lib // home-manager.lib; @@ -151,5 +157,14 @@ extraSpecialArgs = { inherit inputs outputs; }; }; }; + nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { + modules = [ ./system/hosts/ooksphone ]; + extraSpecialArgs = { inherit inputs outputs; }; + pkgs = import nixpkgs { + system = "aarch64-linux"; + overlays = [ nix-on-droid.overlays.default ]; + }; + home-manager-path = home-manager.outPath; + }; }; } diff --git a/system/hosts/ooksphone/default.nix b/system/hosts/ooksphone/default.nix new file mode 100644 index 0000000..71cf843 --- /dev/null +++ b/system/hosts/ooksphone/default.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: + +{ + # Simply install just the packages + environment.packages = with pkgs; [ + # User-facing stuff that you really really want to have + helix # or some other editor, e.g. nano or neovim + git + killall + hostname + man + coreutils + ]; + + environment.etcBackupExtension = ".bak"; + + system.stateVersion = "23.11"; + + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + + time.timeZone = "Pacific/Auckland"; + + user = { + userName = "ooks"; + home = "/data/data/com.termux.nix/files/ooks/home"; + shell = "${pkgs.fish}/bin/fish"; + }; + + # Configure home-manager + home-manager = { + backupFileExtension = "hm-bak"; + useGlobalPkgs = true; + + config = + { config, lib, pkgs, ... }: + { + imports = [ ../../../home/modules/console/editor ]; + + homeModules.home.console.editor.helix.enable = true; + + home.stateVersion = "23.11"; + }; + }; +}