Skip to content

Instantly share code, notes, and snippets.

@prateekrajgautam
Last active July 3, 2024 18:13
Show Gist options
  • Save prateekrajgautam/6afd0254be1bb9d36885680c71c72304 to your computer and use it in GitHub Desktop.
Save prateekrajgautam/6afd0254be1bb9d36885680c71c72304 to your computer and use it in GitHub Desktop.
Commands to uninstall nix
 sudo mv /etc/zshrc.backup-before-nix /etc/zshrc
 sudo mv /etc/profile.d/nix.sh.backup-before-nix /etc/profile.d/nix.sh
 sudo mv /etc/bashrc.backup-before-nix /etc/barhrc
 sudo mv /etc/bash.bashrc.backup-before-nix /etc/bash.bashrc
 sudo rm -rf /nix

you may want to create default.nix in home dir like /mnt/c/Users/<username/default.nix

sudo vim ~/default.nix

default.nix

{ pkgs ? import <nixpkgs> {} }:
let
       message = "welcome from default.nix";

in


       pkgs.mkShell {
               buildInputs =  with pkgs; [
                       cowsay
                       vim
                       curl
               ];

       shellHook = ''
               echo ${message}
               cowsay ${message}
       '';



}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment