Created
November 26, 2024 07:20
-
-
Save r17x/1f6666855edf93726fb5c19b7b46db22 to your computer and use it in GitHub Desktop.
nix multi-branch set of packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs = { | |
## -- nixpkgs | |
nixpkgs-master.url = "github:NixOS/nixpkgs/master"; | |
nixpkgs-stable.url = "github:NixOS/nixpkgs/release-24.05"; | |
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
nixpkgs-specific.url = "github:NixOS/nixpkgs?rev=<HASH-COMMIT>"; | |
nixpkgs.follows = "nixpkgs-unstable"; | |
home-manager.url = "github:nix-community/home-manager"; | |
}; | |
outputs = | |
inputs: | |
let | |
system = "aarch64-linux"; | |
pkgs = import inputs.nixpkgs { inherit system; }; | |
pkgs-stable = import inputs.nixpkgs-stable { inherit system; }; | |
pkgs-master = import inputs.nixpkgs-master { inherit system; }; | |
# pkgs-unstable = import inputs.nixpkgs-unstable { inherit system; }; # no pkgs-unstable because `inputs.nixpkgs` is same as `inputs.nixpkgs-unstable`. | |
in | |
{ | |
homeConfigurations = { | |
rin = inputs.home-manager.lib.homeManagerConfiguration { | |
inherit pkgs; # same thing with `pkgs = pkgs;` | |
extraSpecialArgs = { | |
inherit pkgs-stable pkgs-master; | |
}; | |
modules = [ | |
# pass attrset into `modules` | |
{ | |
home.stateVersion = "22.05"; # the release version of home-manager that want to use | |
home.username = "rin"; | |
home.homeDirectory = "/Users/rin"; | |
} | |
# pass function into `modules` | |
( | |
{ pkgs, pkgs-stable, pkgs-master,... }: | |
{ | |
home.packages = [ | |
pkgs.du | |
pkgs-stable.git | |
]; | |
programs.starship.package = pkgs-master.starship; | |
} | |
) | |
]; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment