mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Update basic-environment to contain all files
This commit is contained in:
parent
6e6e0cde72
commit
104b7e5e3e
1 changed files with 26 additions and 48 deletions
74
default.nix
74
default.nix
|
|
@ -1,56 +1,34 @@
|
||||||
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
|
||||||
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
|
||||||
|
|
||||||
{ pkgs ? import <nixpkgs> { } }:
|
let
|
||||||
|
nixpkgs = import <nixpkgs> { };
|
||||||
|
|
||||||
rec {
|
pkgs = import ./src {
|
||||||
basic-environment = pkgs.buildEnv {
|
arch = if nixpkgs.stdenv.hostPlatform.isArm then "aarch64" else "i686";
|
||||||
|
initialBuild = false;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
inherit (pkgs) proot;
|
||||||
|
|
||||||
|
basic-environment = nixpkgs.buildEnv {
|
||||||
name = "basic-environment";
|
name = "basic-environment";
|
||||||
|
|
||||||
paths = with pkgs; [
|
paths = [
|
||||||
bashInteractive
|
nixpkgs.bashInteractive
|
||||||
cacert
|
nixpkgs.cacert
|
||||||
coreutils
|
nixpkgs.coreutils
|
||||||
hm-install
|
nixpkgs.nix
|
||||||
nix
|
# pkgs.proot
|
||||||
nix-on-droid-linker
|
pkgs.files.hmInstall
|
||||||
|
pkgs.files.homeNixDefault
|
||||||
|
pkgs.files.login
|
||||||
|
pkgs.files.loginInner
|
||||||
|
pkgs.files.nixConf
|
||||||
|
pkgs.files.nixOnDroidLinker
|
||||||
|
pkgs.files.resolvConf
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
} // pkgs.files
|
||||||
hm-install = pkgs.writeScriptBin "hm-install" ''
|
|
||||||
#!/usr/bin/env sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh ]; then
|
|
||||||
echo "You already have home-manager installed."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Subscribing to home-manager channel..."
|
|
||||||
${pkgs.nix}/bin/nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager
|
|
||||||
echo "Updating channels..."
|
|
||||||
${pkgs.nix}/bin/nix-channel --update
|
|
||||||
|
|
||||||
export NIX_PATH=$HOME/.nix-defexpr/channels''${NIX_PATH:+:}$NIX_PATH
|
|
||||||
|
|
||||||
if [ ! -e $HOME/.config/nixpkgs/home.nix ]; then
|
|
||||||
echo "Creating an initial home-manager configuration in ~/.config/nixpkgs/home.nix ..."
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p $HOME/.config/nixpkgs
|
|
||||||
${pkgs.coreutils}/bin/cp -n /etc/home.nix.default $HOME/.config/nixpkgs/home.nix
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Uninstalling basic-environment..."
|
|
||||||
${pkgs.nix}/bin/nix-env --uninstall basic-environment
|
|
||||||
echo "Installing home-manager..."
|
|
||||||
${pkgs.nix}/bin/nix run nixpkgs.nix -c ${pkgs.nix}/bin/nix-shell '<home-manager>' -A install
|
|
||||||
'';
|
|
||||||
|
|
||||||
nix-on-droid-linker = pkgs.writeScriptBin "nix-on-droid-linker" ''
|
|
||||||
#!/usr/bin/env sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "Linking ~/.nix-profile/bin/sh to /bin/sh"
|
|
||||||
${pkgs.coreutils}/bin/ln -snf $HOME/.nix-profile/bin/sh /bin/sh
|
|
||||||
echo "Linking ~/.nix-profile/usr/bin/env to /usr/bin/env"
|
|
||||||
${pkgs.coreutils}/bin/ln -snf $HOME/.nix-profile/bin/env /usr/bin/env
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue