-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
27 lines (24 loc) · 764 Bytes
/
shell.nix
File metadata and controls
27 lines (24 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# shell.nix
{ pkgs ? import <nixpkgs> {} }:
let
inherit (pkgs) lib;
packages = import ./shell/packages { inherit pkgs; };
hooks = import ./shell/hooks { inherit pkgs; };
scripts = import ./shell/scripts { inherit pkgs; };
prebuild = import ./shell/prebuild { inherit pkgs lib; };
in
pkgs.mkShell {
name = "NixOSControlCenter-InstallShell";
inherit (packages) buildInputs;
shellHook = ''
${hooks.shellHook}
# Check if we have root rights
if [[ $EUID -ne 0 ]]; then
echo "Restarting shell with root privileges..."
# Preserve current directory and pass shell.nix path explicitly
exec sudo -E env "PATH=$PATH" "$(which nix-shell)" "$(pwd)/shell.nix"
fi
echo "Starting install script..."
install
'';
}