diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2016-12-12 17:34:43 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2016-12-12 17:34:43 +0100 |
| commit | 8708ebb7964fc68311f5eae73bb7c45bfbb93d54 (patch) | |
| tree | 51799c03965bc9dea60b632304673508eeee88d0 /modules | |
| parent | 98f6b407ec4ebf3b163cc229fe44d77fa453ad15 (diff) | |
move nix-tools out of nix expression
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/nix/nix-darwin.nix | 41 | ||||
| -rw-r--r-- | modules/nix/nix-tools.nix | 19 | ||||
| -rw-r--r-- | modules/system/activation-scripts.nix | 3 |
3 files changed, 44 insertions, 19 deletions
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@ |
