Skip to content

Commit ec15308

Browse files
committed
55 - Refactor to use same Atom setup implementation on all Linux distributions
1 parent 9e5d2c0 commit ec15308

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/OS/Linux.hs

+6-4
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ configureNix run sink = do
5959
appendLog "Nix is already installed" sink
6060
else
6161
logStep "Installing Nix" sink (when run $ do
62-
_ <- runShellCommand "curl -L https://nixos.org/nix/install | sh"
63-
return ())
62+
output <- runShellCommand "curl -L https://nixos.org/nix/install | sh"
63+
appendLog (toMisoString output) sink
64+
nixChannelsFilePath <- toFullFilePath "~/.nix-channels"
65+
writeFile nixChannelsFilePath "nixpkgs https://nixos.org/channels/nixos-20.03")
6466

6567
configureNixPackage :: Bool -> Sink Action -> ExtensionInfo -> IO ()
6668
configureNixPackage run sink (ExtensionInfo name package) = do
@@ -85,8 +87,8 @@ configureNixPackage run sink (ExtensionInfo name package) = do
8587
if oldConfigurationNixText == newConfigurationNixText -- OPTIMIZE
8688
then appendLog ("Nix package " <> name <> " already installed") sink
8789
else logStep ("Installing Nix package - " <> name) sink (when run $ do
88-
_ <- runShellCommand "nixos-rebuild switch"
89-
return ())
90+
output <- runShellCommand "nixos-rebuild switch"
91+
appendLog (toMisoString output) sink)
9092

9193
-- TODO install or update? extension or log message
9294
-- TODO ensure extensions are enabled if not enable them

0 commit comments

Comments
 (0)