From 8708ebb7964fc68311f5eae73bb7c45bfbb93d54 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 12 Dec 2016 17:34:43 +0100 Subject: move nix-tools out of nix expression --- modules/nix/nix-darwin.nix | 41 +++++++++++++++++++++++++++++++++++ modules/nix/nix-tools.nix | 19 ---------------- modules/system/activation-scripts.nix | 3 +++ 3 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 modules/nix/nix-darwin.nix delete mode 100644 modules/nix/nix-tools.nix (limited to 'modules') diff --git a/modules/nix/nix-darwin.nix b/modules/nix/nix-darwin.nix new file mode 100644 index 0000000..787c5fa --- /dev/null +++ b/modules/nix/nix-darwin.nix @@ -0,0 +1,41 @@ +{ config, pkgs, ... }: + +let + + inherit (pkgs) stdenv; + + writeProgram = name: env: src: + pkgs.substituteAll ({ + inherit name src; + dir = "bin"; + isExecutable = true; + } // env); + + darwin-option = writeProgram "darwin-option" + { + inherit (config.system) profile; + inherit (stdenv) shell; + } + ../../pkgs/nix-tools/darwin-option.sh; + + darwin-rebuild = writeProgram "darwin-rebuild" + { + inherit (config.system) profile; + inherit (stdenv) shell; + path = "${pkgs.coreutils}/bin:${config.environment.systemPath}"; + } + ../../pkgs/nix-tools/darwin-rebuild.sh; + +in + +{ + config = { + + environment.systemPackages = + [ # Include nix-tools by default + darwin-option + darwin-rebuild + ]; + + }; +} diff --git a/modules/nix/nix-tools.nix b/modules/nix/nix-tools.nix deleted file mode 100644 index 580244d..0000000 --- a/modules/nix/nix-tools.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, ... }: - -let - - tools = pkgs.callPackage ../../pkgs/nix-tools {}; - -in - -{ - config = { - - environment.systemPackages = - [ # Include nix-tools by default - tools.darwin-option - tools.darwin-rebuild - ]; - - }; -} diff --git a/modules/system/activation-scripts.nix b/modules/system/activation-scripts.nix index 3948fcc..2695e54 100644 --- a/modules/system/activation-scripts.nix +++ b/modules/system/activation-scripts.nix @@ -38,6 +38,9 @@ in system.activationScripts.script.text = '' #! ${stdenv.shell} + set -e + set -o pipefail + export PATH=${pkgs.coreutils}/bin:${config.environment.systemPath}:$PATH systemConfig=@out@ -- cgit v1.2.3