From 0c66ce54a2dce8ccf60800fcc2f233e11781f527 Mon Sep 17 00:00:00 2001 From: a Date: Mon, 26 Mar 2018 12:24:36 +0200 Subject: [PATCH] Add NixOS --- README.md | 1 + set.pl | 2 +- src/common.c | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7476610..1335f06 100644 --- a/README.md +++ b/README.md @@ -369,6 +369,7 @@ Replace **distro** with the following [bases](https://en.wikipedia.org/wiki/List - [x] alpinelinux - [x] slitaz - [x] tinycorelinux +- [x] nixos Cannot list the \*BSD flavours as "distros", so they deserve own options: diff --git a/set.pl b/set.pl index 628a4f6..b9345c1 100644 --- a/set.pl +++ b/set.pl @@ -95,7 +95,7 @@ sub reflace_single { my $osEntered = uc $ARGV[0]; my @osArr = ( - "SLITAZ","TINYCORELINUX", + "SLITAZ","TINYCORELINUX","NIXOS", "ARCHLINUX","DEBIAN","ALPINELINUX", "GENTOO","SLACKWARE","CRUX", "RHEL","FRUGALWARE","VOIDLINUX", diff --git a/src/common.c b/src/common.c index 87f0d36..db3628a 100644 --- a/src/common.c +++ b/src/common.c @@ -277,6 +277,13 @@ get_packs(char *str1) { CHECK_POPEN(pkgs_file, "tce-status -i 2> /dev/null | wc -l", &packages); #pragma GCC diagnostic pop +#elif defined(NIXOS) + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-result" + CHECK_POPEN(pkgs_file, "nix-env -q 2> /dev/null | wc -l", &packages); +#pragma GCC diagnostic pop + #elif defined(FREEBSD) #pragma GCC diagnostic push -- 2.11.0