St: Difference between revisions

imported>Artturin
No edit summary
imported>Artturin
add with pkgs; and add paths
Line 5: Line 5:
== Installing ==
== Installing ==
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = [
environment.systemPackages = with pkgs; [
   st
   st
];</syntaxhighlight>
];</syntaxhighlight>
Line 15: Line 15:
Can be applied by first downloading them from `st.suckless.org/patches` like so:
Can be applied by first downloading them from `st.suckless.org/patches` like so:


  curl https://st.suckless.org/patches/rightclickpaste/st-rightclickpaste-0.8.2.diff > rightclicktopaste.diff
  curl https://st.suckless.org/patches/rightclickpaste/st-rightclickpaste-0.8.2.diff > /etc/nixos/programs/st/rightclicktopaste.diff


And then including them in an attribute override in your systemPackages declaration:
And then including them in an attribute override in your systemPackages declaration:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = [
environment.systemPackages = with pkgs; [
   (st.overrideAttrs (oldAttrs: rec {
   (st.overrideAttrs (oldAttrs: rec {
     patches = [
     patches = [
Line 38: Line 38:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = [
environment.systemPackages = with pkgs; [
   (st.overrideAttrs (oldAttrs: rec {
   (st.overrideAttrs (oldAttrs: rec {
     patches = [
     patches = [
Line 50: Line 50:
Can be included with the `buildInputs` line like in the following ligature patch example:
Can be included with the `buildInputs` line like in the following ligature patch example:


  curl https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-20200430-0.8.3.diff > ligatures.diff
  curl https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-20200430-0.8.3.diff > /etc/nixos/programs/st/ligatures.diff


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = [
environment.systemPackages = with pkgs; [
   (st.overrideAttrs (oldAttrs: rec {
   (st.overrideAttrs (oldAttrs: rec {
     buildInputs = oldAttrs.buildInputs ++ (with pkgs; [ harfbuzz ]);
     buildInputs = oldAttrs.buildInputs ++ (with pkgs; [ harfbuzz ]);
Line 67: Line 67:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = [
environment.systemPackages = with pkgs; [
   (st.overrideAttrs (oldAttrs: rec {
   (st.overrideAttrs (oldAttrs: rec {
     configFile = pkgs.writeText "config.def.h" (builtins.readFile ./programs/st/config.h);
     configFile = pkgs.writeText "config.def.h" (builtins.readFile ./programs/st/config.h);
Line 78: Line 78:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = [
environment.systemPackages = with pkgs; [
   (st.overrideAttrs (oldAttrs: rec {
   (st.overrideAttrs (oldAttrs: rec {
     src = pkgs.fetchFromGitHub {
     src = pkgs.fetchFromGitHub {