Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created July 16, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cleverca22/c0fa8d46598432ba568a to your computer and use it in GitHub Desktop.
Save cleverca22/c0fa8d46598432ba568a to your computer and use it in GitHub Desktop.
{ lib, config, pkgs, ... }:
let
commonPackages = with pkgs; [ wget screen vim nix-repl usbutils nox ];
perArchConfig = if builtins.currentSystem == "armv6l-linux" then {
FS = {
"/nix/var/nix/profiles" = { device="/nix/var/nix/profiles.arm"; options="bind"; };
};
} else {
FS = {
"/nix/var/nix/profiles" = { device="/nix/var/nix/profiles.x86"; options="bind"; };
};
};
in
lib.recursiveUpdate {
services = {
openssh = {
enable = true;
permitRootLogin = "yes";
};
locate.enable = true;
ntp.enable = true;
avahi = {
enable = true;
nssmdns = true;
};
};
fileSystems = {
"/" = { device = "UUID=a270b863-9e3e-4812-adf8-215e695de3d8"; fsType = "ext4"; };
"/boot" = { device = "UUID=2178-694E"; };
"/media/videos/4tb/" = { device="c2d:/media/videos/4tb"; fsType = "nfs"; };
} // perArchConfig.FS;
} (if builtins.currentSystem != "armv6l-linux" then {
boot = {
loader.grub = {
memtest86.enable = true;
version = 2;
enable = true;
device = "nodev";
};
initrd.availableKernelModules = [ "ata_piix" "xen_blkfront" ];
};
environment.systemPackages = with pkgs; [ firefox firefoxWrapper gnome3.eog mplayer ] ++ commonPackages;
} else {
imports = [<nixos/modules/profiles/minimal.nix>];
services.nixosManual.enable = false; # FIXME: workaround SANE not evaluating on ARM
services.xserver = {
enable = true;
displayManager.slim.enable = true;
desktopManager.xfce.enable = false;
desktopManager.xterm.enable = true;
};
hardware.opengl.enable = false;
boot = {
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
kernelPackages = pkgs.linuxPackages_rpi;
};
hardware.sane.enable = false;
environment.systemPackages = with pkgs; [ ] ++ commonPackages;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment