From 7551fd5a5889c73e70beb2fc73ab5b14d9a164cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sat, 22 Jul 2023 23:42:39 +0200 Subject: [PATCH] feat: nix-on-droid for moto-g5 --- flake.lock | 150 ++++++++++++++++++++++++++++++ flake.nix | 15 ++- systems/moto-g5/configuration.nix | 37 ++++++++ 3 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 systems/moto-g5/configuration.nix diff --git a/flake.lock b/flake.lock index ce4545f..a4f789c 100644 --- a/flake.lock +++ b/flake.lock @@ -116,6 +116,28 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1663932797, + "narHash": "sha256-IH8ZBW99W2k7wKLS+Sat9HiKX1TPZjFTnsPizK5crok=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "de3758e31a3a1bc79d569f5deb5dac39791bf9b6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "menstruation-backend": { "inputs": { "flake-utils": [ @@ -168,6 +190,54 @@ "type": "github" } }, + "nix-formatter-pack": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ], + "nmd": "nmd", + "nmt": "nmt" + }, + "locked": { + "lastModified": 1666720474, + "narHash": "sha256-iWojjDS1D19zpeZXbBdjWb9MiKmVVFQCqtJmtTXgPx8=", + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "rev": "14876cc8fe94a3d329964ecb073b4c988c7b61f5", + "type": "github" + }, + "original": { + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "type": "github" + } + }, + "nix-on-droid": { + "inputs": { + "home-manager": "home-manager_2", + "nix-formatter-pack": "nix-formatter-pack", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", + "nmd": "nmd_2" + }, + "locked": { + "lastModified": 1688144254, + "narHash": "sha256-8KL1l/7eP2Zm1aJjdVaSOk0W5kTnJo9kcgW03gqWuiI=", + "owner": "t184256", + "repo": "nix-on-droid", + "rev": "2301e01d48c90b60751005317de7a84a51a87eb6", + "type": "github" + }, + "original": { + "owner": "t184256", + "ref": "release-23.05", + "repo": "nix-on-droid", + "type": "github" + } + }, "nixinate": { "inputs": { "nixpkgs": [ @@ -204,6 +274,22 @@ "type": "github" } }, + "nixpkgs-for-bootstrap": { + "locked": { + "lastModified": 1686921029, + "narHash": "sha256-J1bX9plPCFhTSh6E3TWn9XSxggBh/zDD4xigyaIQBy8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04", + "type": "github" + } + }, "nixpkgs-old": { "locked": { "lastModified": 1682600000, @@ -252,6 +338,54 @@ "type": "github" } }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmd_2": { + "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" + } + }, "nur": { "locked": { "lastModified": 1689454092, @@ -313,6 +447,7 @@ "home-manager": "home-manager", "menstruation-backend": "menstruation-backend", "menstruation-telegram": "menstruation-telegram", + "nix-on-droid": "nix-on-droid", "nixinate": "nixinate", "nixpkgs": "nixpkgs", "nixpkgs-old": "nixpkgs-old", @@ -460,6 +595,21 @@ "type": "github" } }, + "utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "voidrice": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 1c2373b..07bd155 100644 --- a/flake.nix +++ b/flake.nix @@ -7,22 +7,23 @@ home-manager.url = "github:nix-community/home-manager/release-23.05"; menstruation-backend.url = "github:kmein/menstruation.rs"; menstruation-telegram.url = "github:kmein/menstruation-telegram"; + nix-on-droid.url = "github:t184256/nix-on-droid/release-23.05"; nixinate.url = "github:matthewcroughan/nixinate"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; nixpkgs-old.url = "github:NixOS/nixpkgs/50fc86b75d2744e1ab3837ef74b53f103a9b55a0"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/master"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; nur.url = "github:nix-community/NUR"; recht.url = "github:kmein/recht"; - scripts.url = "github:kmein/scripts"; retiolum.url = "git+https://git.thalheim.io/Mic92/retiolum"; rust-overlay.url = "github:oxalica/rust-overlay"; + scripts.url = "github:kmein/scripts"; telebots.url = "github:kmein/telebots"; tinc-graph.url = "github:kmein/tinc-graph"; traadfri.url = "github:kmein/traadfri"; voidrice.url = "github:Lukesmithxyz/voidrice"; - agenix.inputs.nixpkgs.follows = "nixpkgs"; agenix.inputs.home-manager.follows = "home-manager"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; menstruation-backend.inputs.flake-utils.follows = "flake-utils"; menstruation-backend.inputs.nixpkgs.follows = "nixpkgs"; @@ -30,6 +31,7 @@ menstruation-telegram.inputs.flake-utils.follows = "flake-utils"; menstruation-telegram.inputs.menstruation-backend.follows = "menstruation-backend"; menstruation-telegram.inputs.nixpkgs.follows = "nixpkgs-old"; + nix-on-droid.inputs.nixpkgs.follows = "nixpkgs"; nixinate.inputs.nixpkgs.follows = "nixpkgs"; recht.inputs.flake-utils.follows = "flake-utils"; recht.inputs.nixpkgs.follows = "nixpkgs"; @@ -56,6 +58,7 @@ agenix, retiolum, flake-utils, + nix-on-droid, ... }: { @@ -102,6 +105,12 @@ panoptikon = import lib/panoptikon.nix; }; + nixOnDroidConfigurations = { + motoG5 = nix-on-droid.lib.nixOnDroidConfiguration { + modules = [systems/moto-g5/configuration.nix]; + }; + }; + nixosConfigurations = let niveumSpecialArgs = system: { unstablePackages = import nixpkgs-unstable { diff --git a/systems/moto-g5/configuration.nix b/systems/moto-g5/configuration.nix new file mode 100644 index 0000000..edcd641 --- /dev/null +++ b/systems/moto-g5/configuration.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + pkgs, + ... +}: let + sshPort = 8022; +in { + environment.packages = with pkgs; [ + vim + openssh + curl + findutils + utillinux + gnugrep + gnused + gnutar + iproute2 + git + which + procps + (pkgs.writers.writeDashBin "start-ssh" '' + ${pkgs.openssh}/bin/sshd -f ${pkgs.writeText "sshd_config" '' + HostKey /data/data/com.termux.nix/files/home/.ssh/ssh_host_rsa_key + Port ${toString sshPort} + ''} + '') + ]; + + environment.etcBackupExtension = ".bak"; + + system.stateVersion = "23.05"; + + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; +}