16 lines
532 B
Nix
16 lines
532 B
Nix
let
|
|
inherit (import <nixpkgs> { }) lib pkgs;
|
|
modes = import ./modes.nix;
|
|
home-manager = import <home-manager/home-manager/home-manager.nix>;
|
|
buildHomeManager = attr:
|
|
(home-manager {
|
|
confPath = ~/git/config/home.nix;
|
|
confAttr = attr;
|
|
}).activationPackage;
|
|
in lib.mapAttrs (host: configs:
|
|
pkgs.runCommand "${host}-modes" { } ''
|
|
mkdir $out
|
|
${lib.concatStringsSep "\n" (lib.mapAttrsToList
|
|
(mode: config: "ln -s ${buildHomeManager "${host}-${mode}"} $out/${mode}")
|
|
configs)}
|
|
'') modes
|