Skip to content

Instantly share code, notes, and snippets.

@AdrianVovk
Last active May 25, 2018 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdrianVovk/e5967b81c611954dac41ebba19aedfb6 to your computer and use it in GitHub Desktop.
Save AdrianVovk/e5967b81c611954dac41ebba19aedfb6 to your computer and use it in GitHub Desktop.
cpkg concept
$ cpkg install node
node is not a known package, but it is a command in nodejs.
Would you like to install nodejs? [y/N]: y
Installing nodejs...
[=================================================================================================] 100%
Installation successful.
$ sudo cpkg repo change unstable
Would you like to change the repo system-wide? This can potentially lead to a system upgrade/downgrade. [y/N]: y
Adding repo https://nixos.org/channels/nixos-unstable...
[=================================================================================================] 100%
Setting primary repo to unstable...
MESSAGE: You have just set cpkg to use the unstable repo by default
MESSAGE: The unstable repo is not verified for 100% build success
MESSAGE: There is a chance that any number of packages are broken and will fail to install
MESSAGE: A broken package can prevent you from upgrading your system
MESSAGE: If you catch a broken package, please submit a ticket at https://github.com/NixOS/nixpkgs
Switched to unstable repo successfully.
It is recommended that you run `sudo cpkg upgrade` now.
$ cpkg install firefox
Are you sure you want to install firefox? [y/N]: y
Installing firefox
[===================================>-------------------------------------------------------------] 45%
ERROR: Dependency failed to build. Aborting.
Installation failed.
$ sudo cpkg install chromium
[sudo] password for adrian:
Are you sure you want to install chromium for all users? [y/N]: y
Installing chromium
[=================================================================================================] 100%
Installation successful.
$ cpkg upgrade
Are you sure you want to upgrade packages for user adrian? [y/N]: y
Upgrading packages...
[=================================================================================================] 100%
Upgrade successful.
$ sudo cpkg upgrade
[sudo] password for adrian:
Are you sure you want to upgrade carbonOS and ALL packages? [y/N]: y
Fetching latest package repos...
Upgrading system...
[===========================================================================>---------------------] 81%
ERROR: Dependency for tilix failed to build. Recovering system state.
System state recovered.
Upgrade failed.
$ sudo cpkg change stable
[sudo] password for adrian:
Would you like to change the repo system-wide? This can potentially lead to a system upgrade/downgrade. [y/N]: y
Adding repo https://nixos.org/channels/nixos...
Repo stable is already added.
Setting primary repo to stable.
Switched to stable repo successfully.
It is recommended that you run `sudo cpkg upgrade` now.
$ sudo cpkg upgrade
[sudo] password for adrian:
Are you sure you want to upgrade carbonOS and ALL packages? [y/N]: y
Fetching latest package repos...
Upgrading system...
[=================================================================================================] 100%
Upgrade successful.
$ cpkg run gnome3.terminal
Are you sure you want to run gnome3.terminal? [y/N]: y
Downloading gnome3.terminal...
[=================================================================================================] 100%
Setting up environment...
Download successful. You can now use gnome3.terminal in this shell
# New shell instance
$ cpkg run gnome3.terminal
Are you sure you want to run gnome3.terminal? [y/N]: y
Downloading gnome3.terminal...
Latest version already downloaded.
Setting uo environment...
Download successful. You can now use gnome3.terminal in this shell
$ cd ~/MyProject/SomeNixProgram
$ cpkg build
Building MyProjectName-0.0.0
[=================================================================================================] 100%
Build successful.
Output can be found at ./result/
$ cpkg build
Building MyProjectName-0.0.0
[===================================>-------------------------------------------------------------] 45%
ERROR: Compilation failed. Showing last 20 lines and dumping output to ./cpkg-build.log
*shows the 20 lines of log output*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment