#!/usr/bin/env bash set -e # NixOS + Caelestia Shell install script # Run from live ISO as root echo "[+] Creating /mnt/nixy..." rm -rf /mnt/nixy mkdir -p /mnt/nixy/hosts/myhost cd /mnt/nixy git init echo "[+] Writing flake.nix..." cat > flake.nix << 'FLAKE' { description = "NixOS + Caelestia Shell"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; caelestia-shell = { url = "github:caelestia-dots/shell"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, home-manager, caelestia-shell, ... }@inputs: let system = "x86_64-linux"; in { nixosConfigurations.myhost = nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs; }; modules = [ ./hosts/myhost/configuration.nix home-manager.nixosModules.home-manager ]; }; }; } FLAKE echo "[+] Writing configuration.nix..." cat > hosts/myhost/configuration.nix << 'CFG' { config, pkgs, inputs, ... }: { imports = [ ./hardware-configuration.nix ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "myhost"; networking.networkmanager.enable = true; time.timeZone = "Europe/Moscow"; i18n.defaultLocale = "ru_RU.UTF-8"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; programs.hyprland = { enable = true; xwayland.enable = true; }; environment.systemPackages = with pkgs; [ inputs.caelestia-shell.packages.${pkgs.stdenv.hostPlatform.system}.default kitty firefox wofi brightnessctl pamixer ]; users.users.yourname = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" "video" ]; initialPassword = "changeme"; }; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.yourname = { pkgs, ... }: { home.stateVersion = "24.11"; imports = [ inputs.caelestia-shell.homeModules.default ]; programs.caelestia = { enable = true; cli.enable = true; settings = { general.apps.terminal = [ "kitty" ]; paths.wallpaperDir = "~/Pictures/Wallpapers"; }; }; wayland.windowManager.hyprland = { enable = true; settings = { exec-once = [ "caelestia shell -d" ]; "$mod" = "SUPER"; bind = [ "$mod, Return, exec, kitty" "$mod, Q, killactive" "$mod, M, exit" "$mod, R, exec, wofi --show drun" ]; }; }; programs.bash.enable = true; }; xdg.portal = { enable = true; extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ]; configPackages = with pkgs; [ hyprland ]; }; system.stateVersion = "24.11"; } CFG echo "[+] Copying hardware-configuration.nix..." cp /mnt/etc/nixos/hardware-configuration.nix /mnt/nixy/hosts/myhost/ echo "[+] Git add..." git add . echo "[+] Installing NixOS..." nixos-install --flake .#myhost --root /mnt echo "[+] Done! Set root password: passwd" echo "[+] Then reboot"