Nixpkgs/Reviewing changes: Difference between revisions
imported>Artturin No edit summary |
imported>Artturin add flakes vm example |
||
Line 8: | Line 8: | ||
== Modules == | == Modules == | ||
=== Pre-flakes === | |||
You may use the rev instead of the branchname, the rev will get redownloaded when changed but the branch wont be redownloaded | You may use the rev instead of the branchname, the rev will get redownloaded when changed but the branch wont be redownloaded | ||
Line 41: | Line 42: | ||
]; | ]; | ||
</syntaxhighlight> | |||
=== Flakes === | |||
====Vm example==== | |||
run with | |||
<syntaxHighlight lang=console> | |||
$ nix run | |||
</syntaxHighlight> | |||
<syntaxhighlight lang="nix"> | |||
{ | |||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | |||
inputs.pkgsReview.url = "github:Artturin/nixpkgs/pipewirejackldpath"; | |||
#inputs.pkgsReview.url = "path:../nixgits/my-nixpkgs"; | |||
outputs = inputs@{ self, nixpkgs, pkgsReview }: { | |||
nixosConfigurations.vm = nixpkgs.lib.nixosSystem { | |||
system = "x86_64-linux"; | |||
specialArgs = { inherit inputs; }; | |||
modules = [ | |||
({ pkgs, ... }: { | |||
disabledModules = [ "services/desktops/pipewire/pipewire.nix" ]; | |||
imports = [ "${inputs.pkgsReview}/nixos/modules/services/desktops/pipewire/pipewire.nix" ]; | |||
services.pipewire.enable = true; | |||
users.users.user = { | |||
password = "user"; | |||
isNormalUser = true; | |||
}; | |||
}) | |||
]; | |||
}; | |||
# So that we can just run 'nix run' instead of | |||
# 'nix build ".#nixosConfigurations.vm.config.system.build.vm" && ./result/bin/run-nixos-vm' | |||
defaultPackage.x86_64-linux = self.nixosConfigurations.vm.config.system.build.vm; | |||
defaultApp.x86_64-linux = { | |||
type = "app"; | |||
program = "${self.defaultPackage.x86_64-linux}/bin/run-nixos-vm"; | |||
}; | |||
}; | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> |