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