Nixpkgs/Reviewing changes: Difference between revisions

imported>Artturin
mNo edit summary
Artturin (talk | contribs)
Add comments
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
=== Pre-flakes ===
=== Pre-flakes ===
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
nixpkgs.overlays = let  
nixpkgs.overlays = let
   owner = "Artturin";
   owner = "Artturin";
   branchname = "cups-filters-update"; # branchname or rev
   branchname = "cups-filters-update"; # branchname or rev
Line 23: Line 23:
];
];


</syntaxhighlight>
===mesa updates/changes===
i(Artturin) tested https://github.com/NixOS/nixpkgs/pull/160267 this way
this can also be used to test other changes for which overlaying would rebuild too many packages.
<syntaxhighlight lang="nix">
hardware.opengl = let
  patched-pkgs = import (pkgs.applyPatches {
    src = pkgs.path;
    patches = [
      (pkgs.fetchpatch {
      url = "https://github.com/NixOS/nixpkgs/commit/4e199a91dc49659ea3ecd7f8e174d6ade2a1d717.patch";
      sha256 = "sha256-xgZXntLx7U120RJ78RTw3+oSmlQ2qdwfVaLM+/H6ReA=";
      })
    ];
  }) { config = pkgs.config; };
in {
  package = patched-pkgs.mesa.drivers;
  package32 = patched-pkgs.pkgsi686Linux.mesa.drivers;
};
</syntaxhighlight>
</syntaxhighlight>


Line 36: Line 56:


imports = let
imports = let
  # If you need to use it for long term then use a fetcher which takes a hash
   pkgsReview = builtins.fetchTarball {
   pkgsReview = builtins.fetchTarball {
     url = "https://github.com/USERNAME/nixpkgs/archive/BRANCHNAME.tar.gz";
     url = "https://github.com/USERNAME/nixpkgs/archive/BRANCHNAME.tar.gz";
Line 52: Line 73:


imports = let
imports = let
  # If you need to use it for long term then use a fetcher which takes a hash
   pkgsReview = builtins.fetchTarball {
   pkgsReview = builtins.fetchTarball {
     url = "https://github.com/Artturin/nixpkgs/archive/add-swap-options.tar.gz";
     url = "https://github.com/Artturin/nixpkgs/archive/add-swap-options.tar.gz";
Line 71: Line 93:
====Vm example====
====Vm example====


run with  
run with
<syntaxHighlight lang=console>
<syntaxHighlight lang=console>
$ nix run
$ nix run
Line 95: Line 117:
         ({ pkgs, ... }: {
         ({ pkgs, ... }: {
           disabledModules = [ "services/desktops/pipewire/pipewire.nix" ];
           disabledModules = [ "services/desktops/pipewire/pipewire.nix" ];
           imports = [  
           imports = [
             "${inputs.pkgsReview}/nixos/modules/services/desktops/pipewire/pipewire.nix"
             "${inputs.pkgsReview}/nixos/modules/services/desktops/pipewire/pipewire.nix"


Line 124: Line 146:
       ];
       ];
     };
     };
     # So that we can just run 'nix run' instead of  
     # So that we can just run 'nix run' instead of
     # 'nix build ".#nixosConfigurations.vm.config.system.build.vm" && ./result/bin/run-nixos-vm'
     # 'nix build ".#nixosConfigurations.vm.config.system.build.vm" && ./result/bin/run-nixos-vm'
     defaultPackage.x86_64-linux = self.nixosConfigurations.vm.config.system.build.vm;
     defaultPackage.x86_64-linux = self.nixosConfigurations.vm.config.system.build.vm;
Line 142: Line 164:


<syntaxHighlight lang=console>
<syntaxHighlight lang=console>
$ nix build .#nixosConfigurations.nixos.config.services.xserver.displayManager.sessionData.desktops  
$ nix build .#nixosConfigurations.nixos.config.services.xserver.displayManager.sessionData.desktops
</syntaxHighlight>
</syntaxHighlight>