Skip to content

Instantly share code, notes, and snippets.

https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/bash/default.nix
-DDEFAULT_PATH_VALUE="/no-such-path"
bash source:
/* Now make our own defaults in case the vars that we think are
important are missing. */
temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
{ pkgs, ... }:
{
services.udev.extraRules = ''
SUBSYSTEM!="sound", GOTO="pulseaudio_end"
ACTION!="change", GOTO="pulseaudio_end"
KERNEL!="card*", GOTO="pulseaudio_end"
SUBSYSTEMS=="pci", RESULT=="?*", ATTRS{vendor}=="0x1002", ATTRS{device}=="0x4383", ENV{PULSE_PROFILE_SET}="formula-z.conf"
{ config, pkgs, ...}:
let
pixfix = if (builtins.currentSystem == "armv6l-linux") then
[ ./pixman.nix ]
else
[];
passwords = import ./passwords.nix;
keys = import ./keys.nix;
in
@cleverca22
cleverca22 / config.nix
Last active March 2, 2016 22:41
qemu userland
{
packageOverrides = pkgs: rec {
qemu-user-arm = pkgs.callPackage ./qemu-user.nix { user_arch = "arm"; };
qemu-user-arm64 = pkgs.callPackage ./qemu-user.nix { user_arch = "aarch64"; };
nix = pkgs.stdenv.lib.overrideDerivation pkgs.nix (oldAttrs: {
patches = ./hax.patch;
});
};
}
{ ... }:
{
fileSystems = {
"/" = {
device = "UUID=d230cc98-8f33-457f-9fee-b65558165188";
fsType = "ext4";
iscsi = {
enable = true;
host = "192.168.2.61";
lun = "iqn.2001-04.com.c2d-nix3";
@cleverca22
cleverca22 / server-configuration.nix
Last active February 7, 2016 10:24
network booting nixos
{ ... }:
{
imports = [ ./tgt_service.nix ];
services = {
atftpd.enable = true;
atftpd.root = "/tftproot";
tgtd = {
enable = true;
targets = {
{ config, pkgs, ... }:
{
imports = [ ./default.nix /root/nixcfg/core.nix ];
services = {
example = {
enable = true;
};
};
environment.systemPackages = with pkgs; [ wget tcpdump ltrace gdb ];
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index d9b009d..16348fb 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -55,6 +55,10 @@ bool BasicDerivation::isBuiltin() const
bool BasicDerivation::canBuildLocally() const
{
+ StringSet platforms = tokenizeString<StringSet>(settings.get("build-extra-platforms",string("")));
+
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, lib, pkgs, ... }:
let
local_dwm = lib.overrideDerivation pkgs.dwm (o: {
nativeBuildInputs = o.nativeBuildInputs ++ [ pkgs.xorg.libXcursor ];
patches = [
let
ugly = { laptop = ./laptop.nix; desktop = ./desktop.nix; };
in
{
imports = [ ugly.${config.network.hostName} ];
}