Skip to content

Commit

Permalink
add nixos support.
Browse files Browse the repository at this point in the history
  • Loading branch information
hughjfchen committed Nov 2, 2022
1 parent 7ea021f commit 362aba4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build-framework/do.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MY_CHANNEL_NUM=$(echo "${MY_CHANNEL}" | awk -F"-" '{print $2}')
#nix-shell '<nixpkgs>' -p haskellPackages.niv --run "cd $1/$2; niv init --no-nixpkgs; niv add NixOS/nixpkgs -n nixpkgs -b nixos-${MY_CHANNEL}; niv add NixOS/nixpkgs -n nixpkgs-darwin -b nixpkgs-${MY_CHANNEL_NUM}-darwin; niv add input-output-hk/haskell.nix"

case ${THE_DISTRIBUTION_ID} in
debian|ubuntu|rhel|centos)
debian|ubuntu|rhel|centos|nixos)
cd "$1/$2"
"${SCRIPT_ABS_PATH}"/niv init --no-nixpkgs
# following is for Linux
Expand Down
2 changes: 1 addition & 1 deletion common/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ init_without_root_or_sudo () {
get_last_stable_nix_channel () {
local MY_CHANNEL_NAME_REGEX=""
case ${THE_DISTRIBUTION_ID} in
debian|ubuntu|rhel|centos) MY_CHANNEL_NAME_REGEX='s/.*\(nixos-[0-9][0-9].[0-9][0-9]\).*/\1/p' ;;
debian|ubuntu|rhel|centos|nixos) MY_CHANNEL_NAME_REGEX='s/.*\(nixos-[0-9][0-9].[0-9][0-9]\).*/\1/p' ;;
Darwin) MY_CHANNEL_NAME_REGEX='s/.*\(nixpkgs-[0-9][0-9].[0-9][0-9]-darwin\).*/\1/p' ;;
*) ;;
esac
Expand Down
2 changes: 1 addition & 1 deletion project-scaffold-generate/do.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set +u
set -u

case ${THE_DISTRIBUTION_ID} in
debian|ubuntu|rhel|centos)
debian|ubuntu|rhel|centos|nixos)
SCRIPT_ABS_PATH=$(turn_to_absolute_path "$0")
mkdir -p "$1"
cd "$1"
Expand Down
2 changes: 1 addition & 1 deletion project-scaffold-template/do.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function prepare_project_info_for_rob () {
export -f prepare_project_info_for_rob

case ${THE_DISTRIBUTION_ID} in
debian|ubuntu|rhel|centos)
debian|ubuntu|rhel|centos|nixos)
SCRIPT_ABS_PATH=$(turn_to_absolute_path "$0")
mkdir -p "$1/$2"
cd "$1/$2" || exit 225
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ init_without_root_or_sudo () {
get_last_stable_nix_channel () {
local MY_CHANNEL_NAME_REGEX=""
case ${THE_DISTRIBUTION_ID} in
debian|ubuntu|rhel|centos) MY_CHANNEL_NAME_REGEX='s/.*\(nixos-[0-9][0-9].[0-9][0-9]\).*/\1/p' ;;
debian|ubuntu|rhel|centos|nixos) MY_CHANNEL_NAME_REGEX='s/.*\(nixos-[0-9][0-9].[0-9][0-9]\).*/\1/p' ;;
Darwin) MY_CHANNEL_NAME_REGEX='s/.*\(nixpkgs-[0-9][0-9].[0-9][0-9]-darwin\).*/\1/p' ;;
*) ;;
esac
Expand Down

0 comments on commit 362aba4

Please sign in to comment.