NixOnDroid : Create HM env.

This commit is contained in:
Dmitry Voronin 2024-03-04 23:11:23 +03:00
parent 55fc9346a3
commit de4e0b0e65
6 changed files with 29 additions and 49 deletions

View file

@ -36,28 +36,6 @@
"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"
}
},
"nix-formatter-pack": {
"inputs": {
"nixpkgs": [
@ -83,7 +61,9 @@
},
"nix-on-droid": {
"inputs": {
"home-manager": "home-manager_2",
"home-manager": [
"home-manager"
],
"nix-formatter-pack": "nix-formatter-pack",
"nixpkgs": [
"nixpkgs"
@ -533,21 +513,6 @@
"nvimTrouble": "nvimTrouble",
"nvimWhichKey": "nvimWhichKey"
}
},
"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"
}
}
},
"root": "root",

View file

@ -14,7 +14,8 @@
# Android.
nix-on-droid = {
url = "github:t184256/nix-on-droid/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
# Nvim plugins.
@ -103,8 +104,9 @@
outputs = { self, nixpkgs, dotfiles, nix-on-droid, home-manager, ... } @inputs: {
# Constant values.
nixosModules.const = {
hashedPassword = "$y$j9T$oqCB16i5E2t1t/HAWaFd5.$tTaHtAcifXaDVpTcRv.yH2/eWKxKE9xM8KcqXHfHrD7"; # Use `mkpasswd`.
stateVersion = "23.11";
hashedPassword = "$y$j9T$oqCB16i5E2t1t/HAWaFd5.$tTaHtAcifXaDVpTcRv.yH2/eWKxKE9xM8KcqXHfHrD7"; # Use `mkpasswd`.
stateVersion = "23.11";
droidStateVersion = "22.11";
};
# Common modules used across all hosts.
@ -144,7 +146,7 @@
modules = [
./host/${hostname}/Configuration.nix
{ networking.hostName = hostname; }
{ system.stateVersion = inputs.self.nixosModules.const.stateVersion; }
{ system.stateVersion = self.nixosModules.const.stateVersion; }
inputs.self.nixosModules.common
home-manager.nixosModules.home-manager
] ++ modules;
@ -258,6 +260,9 @@
{ system.stateVersion = inputs.self.nixosModules.const.stateVersion; }
./module/NixOnDroid.nix
];
extraSpecialArgs.const = self.nixosModules.const;
extraSpecialArgs.flake = self;
extraSpecialArgs.inputs = inputs;
};
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{ pkgs, inputs, const, ... }: {
environment.packages = with pkgs; [
android-tools
binwalk
@ -37,4 +37,14 @@
yt-dlp
zip unzip
];
home-manager.config = {
home.stateVersion = const.droidStateVersion;
home.file = {
"nixos".source = inputs.dotfiles;
};
programs.bash = {
bashrcExtra = "source ~/nixos/module/common/bash/Bashrc.sh";
};
};
}

View file

@ -1,3 +1,3 @@
{ specialArgs, ... }: {
users.users.root.hashedPassword = specialArgs.const.hashedPassword;
{ const, ... }: {
users.users.root.hashedPassword = const.hashedPassword;
}

View file

@ -1,9 +1,9 @@
{ pkgs, lib, specialArgs, ... }: {
{ pkgs, lib, const, ... }: {
imports = [
./home/Voronind.nix
];
users.users.voronind = {
hashedPassword = specialArgs.const.hashedPassword;
hashedPassword = const.hashedPassword;
uid = 1000;
createHome = true;
isNormalUser = true;

View file

@ -1,4 +1,4 @@
{ inputs, ... }: let
{ const, ... }: let
username = "voronind";
homeDir = "/home/voronind";
in {
@ -6,7 +6,7 @@ in {
programs.home-manager.enable = true;
home.username = username;
home.homeDirectory = homeDir;
home.stateVersion = inputs.self.nixosModules.const.stateVersion;
home.stateVersion = const.stateVersion;
home.file = {
".config/btop".source = ./module/top/btop;