From 79b6cc4d76f5a6fd9d150f7a50b8407b84232bdb Mon Sep 17 00:00:00 2001 From: Nicolas Mattia Date: Wed, 15 Jul 2020 12:26:45 +0200 Subject: [PATCH] Factor out default nixpkgs branch --- README.md | 2 +- src/Niv/Cli.hs | 7 ++++--- src/Niv/GitHub/Cmd.hs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1288467..3e89336 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ Available commands: Examples: niv add stedolan/jq - niv add NixOS/nixpkgs -n nixpkgs -b nixos-19.09 + niv add NixOS/nixpkgs -n nixpkgs -b nixpkgs-unstable niv add my-package -v alpha-0.1 -t http://example.com/archive/.zip Usage: niv add PACKAGE [-n|--name NAME] ([-a|--attribute KEY=VAL] | diff --git a/src/Niv/Cli.hs b/src/Niv/Cli.hs index 4f86bf2..c5e0823 100644 --- a/src/Niv/Cli.hs +++ b/src/Niv/Cli.hs @@ -108,9 +108,10 @@ instance Show Nixpkgs where show (Nixpkgs o r) = T.unpack o <> "/" <> T.unpack r -- | The default nixpkgs -defaultNixpkgsRepo, defaultNixpkgsUser :: T.Text +defaultNixpkgsRepo, defaultNixpkgsUser, defaultNixpkgsBranch :: T.Text defaultNixpkgsRepo = "nixpkgs" defaultNixpkgsUser = "NixOS" +defaultNixpkgsBranch = "release-19.09" parseCmdInit :: Opts.ParserInfo (NIO ()) parseCmdInit = Opts.info (cmdInit <$> parseNixpkgs <**> Opts.helper) $ mconcat desc @@ -131,7 +132,7 @@ parseCmdInit = Opts.info (cmdInit <$> parseNixpkgs <**> Opts.helper) $ mconcat d Opts.short 'b' <> Opts.help "The nixpkgs branch to use." <> Opts.showDefault <> - Opts.value "release-19.09" + Opts.value defaultNixpkgsBranch ) ) <*> Opts.option customNixpkgsReader ( @@ -167,7 +168,7 @@ cmdInit nixpkgs = do , ( pathNixSourcesJson fsj , \path -> do createFile path initNixSourcesJsonContent - -- Imports @niv@ and @nixpkgs@ (19.09) + -- Imports @niv@ and @nixpkgs@ say "Importing 'niv' ..." cmdAdd (updateCmd githubCmd) (PackageName "niv") (specToFreeAttrs $ PackageSpec $ HMS.fromList diff --git a/src/Niv/GitHub/Cmd.hs b/src/Niv/GitHub/Cmd.hs index aa50e24..f1c2f30 100644 --- a/src/Niv/GitHub/Cmd.hs +++ b/src/Niv/GitHub/Cmd.hs @@ -110,7 +110,7 @@ describeGitHub = mconcat "Examples:" Opts.<$$> "" Opts.<$$> " niv add stedolan/jq" Opts.<$$> - " niv add NixOS/nixpkgs -n nixpkgs -b nixos-19.09" Opts.<$$> + " niv add NixOS/nixpkgs -n nixpkgs -b nixpkgs-unstable" Opts.<$$> " niv add my-package -v alpha-0.1 -t http://example.com/archive/.zip" ]