Try fixing nixPath
This commit is contained in:
parent
09fc18233b
commit
a5c4288b00
|
@ -9,7 +9,9 @@ let
|
||||||
haskellBody = name: commandline: ''
|
haskellBody = name: commandline: ''
|
||||||
main = do
|
main = do
|
||||||
(configDir:hostname:args) <- getArgs
|
(configDir:hostname:args) <- getArgs
|
||||||
paths <- myNixPath $ toText configDir
|
(decodeUtf8 -> homeManagerChannel) <- nix_instantiate "--eval" "-E" ([i|(import ./channels.nix).#{hostname}.home-manager-channel)|] :: String) |> captureTrim
|
||||||
|
(decodeUtf8 -> nixpkgsChannel) <- nix_instantiate "--eval" "-E" ([i|(import ./channels.nix).#{hostname}.nixpkgs-channel)|] :: String) |> captureTrim
|
||||||
|
paths <- aNixPath homeManagerChannel nixpkgsChannel (toText configDir)
|
||||||
logFile <- mktemp |> captureTrim
|
logFile <- mktemp |> captureTrim
|
||||||
let command = (${commandline}) &!> StdOut &> Append logFile
|
let command = (${commandline}) &!> StdOut &> Append logFile
|
||||||
failHandler = do
|
failHandler = do
|
||||||
|
|
|
@ -50,14 +50,18 @@ self: super: {
|
||||||
escaped <- nix_instantiate ["--eval" :: String, "-E", [i|toString #{expression}|]] |> captureTrim
|
escaped <- nix_instantiate ["--eval" :: String, "-E", [i|toString #{expression}|]] |> captureTrim
|
||||||
pure . Text.dropAround ('"' ==) . decodeUtf8 . trim $ escaped
|
pure . Text.dropAround ('"' ==) . decodeUtf8 . trim $ escaped
|
||||||
|
|
||||||
myNixPath :: Text -> IO [String]
|
aNixPath :: Text -> Text -> Text -> IO [String]
|
||||||
myNixPath path = concat <$> mapM getNivAssign [("home-manager", "${self.home-manager-channel}"),
|
aNixPath homeManagerChannel nixpkgsChannel path = concat <$> mapM getNivAssign
|
||||||
("nixpkgs", "${self.nixpkgs-channel}"),
|
[("home-manager", homeManagerChannel),
|
||||||
("nixos-unstable", "nixos-unstable")]
|
("nixpkgs", nixpkgsChannel),
|
||||||
|
("nixos-unstable", "nixos-unstable")]
|
||||||
where
|
where
|
||||||
tag name str = ["-I", [i|#{name :: Text}=#{str :: Text}|]] :: [String]
|
tag name str = ["-I", [i|#{name :: Text}=#{str :: Text}|]] :: [String]
|
||||||
getNivAssign (name, repo) = tag name <$> getNivPath path repo
|
getNivAssign (name, repo) = tag name <$> getNivPath path repo
|
||||||
|
|
||||||
|
myNixPath :: Text -> IO [String]
|
||||||
|
myNixPath = aNixPath "${self.home-manager-channel}" "${self.nixpkgs-channel}"
|
||||||
|
|
||||||
buildSystemParams :: [String]
|
buildSystemParams :: [String]
|
||||||
buildSystemParams = ["<nixpkgs/nixos>", "-A", "system"]
|
buildSystemParams = ["<nixpkgs/nixos>", "-A", "system"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue