Cheatsheet: Difference between revisions

imported>Udono
m typo
imported>Anton-Latukha
table: commands need sudo, fx
Line 83: Line 83:
|-
|-
|Uninstall a package removing its configuration
|Uninstall a package removing its configuration
|<syntaxhighlight lang="bash">apt-get purge emacs</syntaxhighlight>
|<syntaxhighlight lang="bash">sudo apt-get purge emacs</syntaxhighlight>
|All configuration is in configuration.nix
|All configuration is in configuration.nix
|
|
Line 208: Line 208:
|-
|-
|Adding a user
|Adding a user
|sudo adduser alice
|<syntaxhighlight lang="bash">sudo adduser alice</syntaxhighlight>
|Add <syntaxhighlight lang="nix">users.extraUsers.alice =
|Add <syntaxhighlight lang="nix">users.extraUsers.alice =
  { isNormalUser = true;
  { isNormalUser = true;
Line 216: Line 216:
   openssh.authorizedKeys.keys =
   openssh.authorizedKeys.keys =
       [ "ssh-dss AAAAB3Nza... alice@foobar" ];
       [ "ssh-dss AAAAB3Nza... alice@foobar" ];
  };</syntaxhighlight> to to /etc/nixos/configuration.nix and then call <syntaxhighlight lang="nix">nixos-rebuild switch</syntaxhighlight>
  };</syntaxhighlight> to /etc/nixos/configuration.nix and then call <syntaxhighlight lang="nix">nixos-rebuild switch</syntaxhighlight>
|
|
|-
|-
Line 233: Line 233:
|-
|-
|Get sources for a package
|Get sources for a package
|<syntaxhighlight lang="bash">apt-get source emacs</syntaxhighlight>
|<syntaxhighlight lang="bash">sudo apt-get source emacs</syntaxhighlight>
|
|
|In Debian, apt-get source gets both the patched upstream source and the recipe for the package. Those need two steps in Nix.
|In Debian, apt-get source gets both the patched upstream source and the recipe for the package. Those need two steps in Nix.
Line 260: Line 260:
|-
|-
|Install a .deb
|Install a .deb
|<syntaxhighlight lang="bash">dpkg -i package.deb</syntaxhighlight>
|<syntaxhighlight lang="bash">sudo dpkg -i package.deb</syntaxhighlight>
|
|
|Install dpkg with Nix, then <syntaxhighlight lang="bash">dpkg -i package.deb</syntaxhighlight> (not recommended!)
|Install dpkg with Nix, then <syntaxhighlight lang="bash">dpkg -i package.deb</syntaxhighlight> (not recommended!)