1
1
mirror of https://github.com/nmattia/niv.git synced 2024-09-18 19:07:19 +03:00

Factor out default nixpkgs branch

This commit is contained in:
Nicolas Mattia 2020-07-15 12:26:45 +02:00
parent 0f50051d3c
commit 79b6cc4d76
3 changed files with 6 additions and 5 deletions

View File

@ -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/<version>.zip
Usage: niv add PACKAGE [-n|--name NAME] ([-a|--attribute KEY=VAL] |

View File

@ -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

View File

@ -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/<version>.zip"
]