Skip to main content

nix os install

 

curl -L https://nixos.org/nix/install | sh
 bash <(curl -L https://nixos.org/nix/install) --no-daemon
  
 
. $HOME/.nix-profile/etc/profile.d/nix.sh
or open new shell
 
 
 nix-channel --list
 nixpkgs https://nixos.org/channels/nixpkgs-unstable
 
upgrade
nix-channel --update; nix-env --install --attr nixpkgs.nix nixpkgs.cacert 
 
https://status.nixos.org/
https://nixos.wiki/wiki/Nix_channels
https://channels.nixos.org/
  nix-latest/ 
Stable channels (nixos-23.05)
provide conservative updates for fixing bugs and security 
vulnerabilities, but do not receive major updates after initial release.
 New stable channels are released every six months.
unstable channels (nixos-unstable, nixpkgs-unstable
correspond to the main development branch (master) of Nixpkgs, delivering the latest 
tested updates on a rolling basis. 
Large channels (nixos-23.05, nixos-unstable) provide binary builds for the full breadth of 
Nixpkgs. 
Small channels (nixos-23.05-small, nixos-unstable-small)
 are identical to large channels, but contain fewer binaries. This means
 they update faster, but require more to be built from source. 
 
 
#add channel with test  
nix-channel --add https://nixos.org/channels/nixos-version nixpkgs 
nix-channel --add https://nixos.org/channels/channel-name nixos 
nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs 
 
nix-channel --update 
 
 
 
Install the NixOS installation tools:
 
nix-env -f '<nixpkgs>' -iA nixos-install-tools
 
export NIX_PATH=/home/kai/.nix-defexpr/channels
  
 nixos-generate-config and nixos-install, some man pages and nixos-enter available 
 
these 6 derivations will be built:
/nix/store/fffnygd90xk1ymy1xd7iw89gbw8sk5jx-builder.pl.drv
/nix/store/24hw26bp2gvcsfgi4w6p3qgqj9kq5hdz-perl-5.38.0-env.drv
/nix/store/d21gl4d72fym261s7h5a86mrm9s7zcr6-nixos-enter.drv
/nix/store/ngr2zbxnal7s36h1nq8glhiymmyqbsh8-nixos-generate-config.drv
/nix/store/vsicp96ski425gy2ap8q7gfzvgm4f897-nixos-install.drv
/nix/store/j53xfdr68l70d1srpkzzqqbz0j0a5mhm-nixos-install-tools-23.11pre540796.75a52265bda7.drv
these 163 paths will be fetched (156.97 MiB download, 677.23 MiB unpacked):
 
 
Like packages installed via nix-env
nix-env --list-generations
nix-env --install|-i  [args] --prebuilt-only|-b  --attr|-A --preserve-installed|-P --remove-all|-r
 
 
sudo mkfs.ext4 -L nixos /dev/nvme0n1p5 
sudo mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
   
sudo nixos-generate-config --root /mnt  
writing /mnt/etc/nixos/hardware-configuration.nix...
writing /mnt/etc/nixos/configuration.nix...
For more hardware-specific settings, see https://github.com/NixOS/nixos-hardware.
 
 
refer to https://nixos.org/manual/nixos/stable/#sec-installation now 
 
nano /mnt/etc/nixos/configuration.nix

{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
 
  boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

networking.hostName = "kat";
networking.wireless.iwd.enable = true; 
time.timeZone = "Asia/Kathmandu";
 i18n.defaultLocale = "en_US.UTF-8";
 


 

 for single user install
sudo groupadd -g 30000 nixbld
sudo useradd -u 30000 -g nixbld -G nixbld nixbld
 
sudo PATH="$PATH" NIX_PATH="$NIX_PATH" `which nixos-install` u
PATH="$PATH:/usr/sbin:/sbin
 
 
sudo userdel nixbld
sudo groupdel nixbld
sudo rm -rv ~/.nix-* /nix
~/.profile
 
 
changing nixos config

to build the new configuration, make it the default configuration for booting, and try to realise the configuration in the running system (e.g., by restarting system services).

 
nixos-rebuild test     

to build the configuration and switch the running system to it, but without making it the boot default. So if (say) the configuration locks up your machine, you can just reboot to get back to a working configuration.

nixos-rebuild boot 

to build the configuration and make it the boot default, but not switch to it now (so it will only take effect after the next reboot).

 
nixos-rebuild switch -p test
 

which causes the new configuration (and previous ones created using -p test) to show up in the GRUB submenu “NixOS - Profile ‘test’”. This can be useful to separate test configurations from “stable” configurations.

nixos-rebuild build  

to build the configuration but nothing more. This is useful to see whether everything compiles cleanly. 

 

 

nixos-enter
 
 
reinstall bootloader
sudo nixos-rebuild --install-bootloader switch 

 

 

updat pkg 

nix-channel --update nixos
 
 

 

 
 https://nixos.org/manual/nix/stable/command-ref/nix-channel
 
 
 
https://nixos.wiki/wiki/Change_root
mount /dev/relevantPartitionNameHere /mnt
 
mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
chroot /mnt /nix/var/nix/profiles/system/activate
chroot /mnt /run/current-system/sw/bin/bash
 
 mount /dev/nvme0n1p5 /mnt/
 mount /dev/nvme0n1p1 /boot/ 

nixos-rebuild --option sandbox false
 
 
    
 
 

Comments

Popular posts from this blog

sxhkd volume andbrightness config for dwm on void

xbps-install  sxhkd ------------ mkdir .config/sxhkd cd .config/sxhkd nano/vim sxhkdrc -------------------------------- XF86AudioRaiseVolume         amixer -c 1 -- sset Master 2db+ XF86AudioLowerVolume         amixer -c 1 -- sset Master 2db- XF86AudioMute         amixer -c 1 -- sset Master toggle alt + shift + Escape         pkill -USR1 -x sxhkd XF86MonBrightnessUp          xbacklight -inc 20 XF86MonBrightnessDown          xbacklight -dec 20 ------------------------------------------------------------- amixer -c card_no -- sset Interface volume run alsamixer to find card no and interface names xbps-install -S git git clone https://git.suckless.org/dwm xbps-install -S base-devel libX11-devel libXft-devel libXinerama-devel  vim config.mk # FREETYPEINC = ${X11INC}/freetype2 #comment for non-bsd make clean install   cp config.def.h config.h vim config.h xbps-install -S font-symbola #for emoji on statusbar support     void audio config xbps-i

download office 2021 and activate

get office from here  https://tb.rg-adguard.net/public.php open powershell as admin (win+x and a ) type cmd  goto insall dir 1.         cd /d %ProgramFiles(x86)%\Microsoft Office\Office16 2.           cd /d %ProgramFiles%\Microsoft Office\Office16 try 1 or 2 depending on installation  install volume license  for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x" activate using kms cscript ospp.vbs /setprt:1688 cscript ospp.vbs /unpkey:6F7TH >nul cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH cscript ospp.vbs /sethst:s8.uk.to cscript ospp.vbs /act Automatic script (windefender may block it) ------------------------------------------------------------------------------------------------------------------- @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - MSGuides.com&cls&echo =====================================================================================&

Hidden Wiki

Welcome to The Hidden Wiki New hidden wiki url 2015 http://zqktlwi4fecvo6ri.onion Add it to bookmarks and spread it!!! Editor's picks Bored? Pick a random page from the article index and replace one of these slots with it. The Matrix - Very nice to read. How to Exit the Matrix - Learn how to Protect yourself and your rights, online and off. Verifying PGP signatures - A short and simple how-to guide. In Praise Of Hawala - Anonymous informal value transfer system. Volunteer Here are five different things that you can help us out with. Plunder other hidden service lists for links and place them here! File the SnapBBSIndex links wherever they go. Set external links to HTTPS where available, good certificate, and same content. Care to start recording onionland's history? Check out Onionland's Museum Perform Dead Services Duties. Introduction Points Ahmia.fi - Clearnet search engine for Tor Hidden Services (allows you