2019-07-25 21:35:59 +00:00
|
|
|
let
|
2019-07-26 13:54:30 +00:00
|
|
|
inherit (import ../common/lib.nix) home-manager writeHaskellScript get-niv-path;
|
2019-07-25 21:35:59 +00:00
|
|
|
in
|
|
|
|
{
|
2019-07-26 13:54:30 +00:00
|
|
|
update-home = configPath: writeHaskellScript
|
2019-07-25 21:35:59 +00:00
|
|
|
{
|
2019-07-26 13:54:30 +00:00
|
|
|
name = "update-home";
|
2019-07-25 21:35:59 +00:00
|
|
|
bins = [
|
2019-07-26 13:54:30 +00:00
|
|
|
get-niv-path
|
2019-07-25 21:35:59 +00:00
|
|
|
home-manager
|
|
|
|
];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
|
2019-07-26 13:54:30 +00:00
|
|
|
getNivPath = get_niv_path "${configPath}/nix/sources.nix"
|
|
|
|
|
|
|
|
getNivAssign name = (tag <$>) . readTrim . getNivPath $ name
|
|
|
|
where tag str = ["-I", [i|#{name}=#{str :: LBS.ByteString}|]]
|
2019-07-25 21:35:59 +00:00
|
|
|
|
|
|
|
main = do
|
2019-07-28 22:51:10 +00:00
|
|
|
args <- getArgs
|
2019-07-26 13:54:30 +00:00
|
|
|
paths <- concat <$> mapM getNivAssign ["home-manager", "nixpkgs", "unstable"]
|
2019-07-28 22:51:10 +00:00
|
|
|
home_manager $ paths ++ ["switch"] ++ args
|
2019-07-25 21:35:59 +00:00
|
|
|
'';
|
|
|
|
}
|