Skip to content

Instantly share code, notes, and snippets.

@eraserhd
Created January 20, 2021 14:46
Show Gist options
  • Save eraserhd/7776270a15538d115a4889f11d67089d to your computer and use it in GitHub Desktop.
Save eraserhd/7776270a15538d115a4889f11d67089d to your computer and use it in GitHub Desktop.
{
description = "2u environment configuration";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs }: let
devEnvironmentForSystem = system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
pkgs.callPackage ./default.nix {};
in {
packages.x86_64-darwin.devEnvironment = devEnvironmentForSystem "x86_64-darwin";
packages.x86_64-linux.devEnvironment = devEnvironmentForSystem "x86_64-linux";
defaultPackage.x86_64-darwin = self.packages.x86_64-darwin.devEnvironment;
defaultPackage.x86_64-linux = self.packages.x86_64-linux.devEnvironment;
nixosModules = { pkgs, ... }: {
config.environment.systemPackages = [ self.defaultPackage.${pkgs.stdenv.hostPlatform.system} ];
};
darwinModules = { pkgs, ... }: {
config.environment.systemPackages = [ self.defaultPackage.${pkgs.stdenv.hostPlatform.system} ];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment