nix: version home-manager along the nixos channels
This commit is contained in:
parent
0913cdc4d5
commit
ec01ff74b6
5 changed files with 29 additions and 14 deletions
|
@ -3,22 +3,26 @@
|
|||
{
|
||||
channelSources =
|
||||
let
|
||||
# channelVersions = (import ((builtins.getEnv "PWD")+"/${dir}/versions.nix"));
|
||||
channelVersions = (import versionsPath);
|
||||
mkChannelSource = channel: builtins.fetchGit {
|
||||
# Descriptive name to make the store path easier to identify
|
||||
url = "https://github.com/NixOS/nixpkgs-channels/";
|
||||
# Commit hash for nixos-unstable as of 2018-09-12
|
||||
# `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-unstable`
|
||||
ref = (builtins.getAttr channel channelVersions)."ref";
|
||||
rev = (builtins.getAttr channel channelVersions)."rev";
|
||||
name = "nixpkgs-channels-${channel}";
|
||||
mkChannelSource = channel:
|
||||
let
|
||||
channelVersion = builtins.getAttr channel channelVersions;
|
||||
in builtins.fetchGit {
|
||||
# Descriptive name to make the store path easier to identify
|
||||
name = "nixpkgs-channels-${channel}";
|
||||
url = if builtins.hasAttr "url" channelVersion
|
||||
then channelVersion."url"
|
||||
else "https://github.com/NixOS/nixpkgs-channels/"
|
||||
;
|
||||
ref = (builtins.getAttr channel channelVersions)."ref";
|
||||
rev = (builtins.getAttr channel channelVersions)."rev";
|
||||
};
|
||||
nix_path = builtins.foldl' (sum: elem: sum +":" + builtins.concatStringsSep "=" elem) "" [
|
||||
[ "nixpkgs" (mkChannelSource "channelsNixosStable") ]
|
||||
[ "nixos" (mkChannelSource "channelsNixosStable" + "/nixos") ]
|
||||
[ "channels-nixos-stable" (mkChannelSource "channelsNixosStable") ]
|
||||
[ "channels-nixos-unstable" (mkChannelSource "channelsNixosUnstable") ]
|
||||
[ "home-manager-module" (mkChannelSource "homeManagerModule") ]
|
||||
];
|
||||
in (import (mkChannelSource "channelsNixosStable") {}).writeText "channels.rc" ''
|
||||
export NIX_PATH=${nix_path}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue