nix,steveej-t480s-work: introduce pure versioning
This commit is contained in:
parent
17c8ccb8c2
commit
c5c4b160a1
12 changed files with 55 additions and 13 deletions
25
nix/default.nix
Normal file
25
nix/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ versionsPath }:
|
||||
|
||||
{
|
||||
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`
|
||||
rev = (builtins.getAttr channel channelVersions);
|
||||
name = "nixpkgs-channels-${channel}";
|
||||
};
|
||||
nix_path = builtins.foldl' (sum: elem: sum +":" + builtins.concatStringsSep "=" elem) "" [
|
||||
[ "nixpkgs" (mkChannelSource "channelsNixosStable") ]
|
||||
[ "nixos" (mkChannelSource "channelsNixosStable") ]
|
||||
[ "channels-nixos-stable" (mkChannelSource "channelsNixosStable") ]
|
||||
[ "channels-nixos-unstable" (mkChannelSource "channelsNixosUnstable") ]
|
||||
];
|
||||
in (import (mkChannelSource "channelsNixosStable") {}).writeText "channels.rc" ''
|
||||
export NIX_PATH=${nix_path}
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue