Switching NixOS architecture (32bit -> 64bit)
There are rumors, that you can switch from system architecture just adding 1 configuration option:
nixpkgs.system = "x86_64-linux"
and running nixos-rebuild boot && reboot
.
# onsub.py - execute commands recursively on subrepositories | |
# | |
# Copyright 2010, 2011 aragost Trifork | |
# | |
# This software may be used and distributed according to the terms of | |
# the GNU General Public License version 2 or any later version. | |
import os | |
from mercurial.i18n import _ | |
from mercurial import extensions, subrepo, util, cmdutil |
#! /usr/bin/env nix-build | |
{ pkgs ? import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/2fa9bd50597c3089cc00abb3f20d7510fcc8ad6a.tar.gz) { } | |
}: | |
let | |
inherit (pkgs) stdenv lib; | |
theoremDistrib = pkgs.fetchurl { | |
url = https://download.microsoft.com/download/D/1/D/D1D6FCF9-4D04-49FE-9952-0D295B180CF4/4ct.msi; | |
sha256 = null; | |
}; | |
theoremSrc = stdenv.mkDerivation { |
{ pkgs, config, ...}: { | |
boot.kernel.sysctl."net.core.rps_sock_flow_entries" = "32768"; | |
networking.usePredictableInterfaceNames = false; # we want eth0 | |
system.activationScripts.network_debloat = { | |
text = '' | |
interface=eth0 | |
${pkgs.iproute}/bin/tc qdisc replace dev "$interface" root fq_codel |
{ pkgs }: | |
let | |
old_iproute = { fetchurl, stdenv, flex, bison, db4, iptables, pkgconfig }: | |
stdenv.mkDerivation rec { | |
name = "iproute2-3.6.0"; | |
src = fetchurl { | |
url = http://kernel.org/pub/linux/utils/net/iproute2/iproute2-3.6.0.tar.xz; | |
sha256 = "0d05av2s7p552yszgj6glz6d74jlmg392s7n74hicgqfl16m85rd"; | |
}; |
# based on https://gist.github.com/thoughtpolice/1faff37f0a17e1ab291d | |
# updated for nixos-16.09 | |
/* | |
Example usage (in configuration.nix): | |
services.phabricator = { | |
enable = true; | |
baseURI = "https://phabricator.example.org"; | |
baseFilesURI = config.services.phabricator.baseURI; | |
rootDir = "/var/phabricator"; |
{ pkgs, lib, config, ...}: | |
let | |
cfg = config.services.postgresql; | |
initConfigScript = '' | |
ln -sf ${pkgs.writeText "pg_hba.conf" cfg.authentication} ${cfg.dataDir}/pg_hba.conf | |
ln -sf ${pkgs.writeText "pg_ident.conf" cfg.identMap} ${cfg.dataDir}/pg_ident.conf | |
ln -sf ${configFile} ${cfg.dataDir}/postgresql.conf |
# this example adds an option `.tomcatProxy` in namespace | |
# services.nginx.virtualHosts.*.locations.* | |
# that acts as alternative to specifying actual nginx config in .extraConfig | |
# | |
# execute with | |
/* | |
cat $(grep -o "/nix/store/[a-z0-9]*-nginx.conf" \ | |
$(NIX_PATH=nixos-config=./example.nix:$NIX_PATH \ | |
nix-build --no-out-link -E ' | |
with import <nixpkgs/nixos> {}; |
Munin service ver 2.999.5 | |
Use like | |
``` | |
services.mm.munin-cron.enable = true; | |
services.mm.munin-cron.hosts = '' | |
[server1] | |
address server1 | |
[server2] | |
address server2 |
with import <nixpkgs> {}; | |
with import (stdenv.mkDerivation { | |
name = "trick-to-make-binary-channels-go-away"; | |
buildCommand = '' | |
grep -iq nixos /proc/sys/kernel/version || (echo "Can be built only on NixOS!" && exit 1) | |
echo '{}' > $out | |
''; | |
}); | |
stdenv.mkDerivation { | |
name = "build-only-on-nixos"; |
Switching NixOS architecture (32bit -> 64bit)
There are rumors, that you can switch from system architecture just adding 1 configuration option:
nixpkgs.system = "x86_64-linux"
and running nixos-rebuild boot && reboot
.