Skip to content

Instantly share code, notes, and snippets.

@tvon
Last active September 29, 2020 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvon/e086db0fcc4bf49a75b6 to your computer and use it in GitHub Desktop.
Save tvon/e086db0fcc4bf49a75b6 to your computer and use it in GitHub Desktop.
NixOS config
# 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, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda";
boot.initrd.kernelModules = [ "dm_snapshot" ];
fileSystems."/vol/media" =
{ device = "/dev/disk/by-uuid/71d6cf8a-2819-4b81-adde-2b43a521e517";
fsType = "ext4";
};
fileSystems."/home" =
{ device = "/dev/mapper/nixos-home";
fsType = "ext4";
};
networking.hostName = "nixos"; # Define your hostname.
# TODO: Setup nginx container, proxy to other containers.
networking.firewall.allowedTCPPorts = [
#80 443 # unused
];
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "America/New_York";
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
docker
gitAndTools.gitFull
neovim
python27
python27Packages.docker_compose
python27Packages.neovim
tmux
];
nixpkgs.config = {
packageOverrides = pkgs: rec {
neovim = pkgs.neovim.override {
vimAlias = true;
withPython = true;
};
};
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
users.extraUsers.tvon = {
isNormalUser = true;
uid = 1000;
home = "/home/tvon";
extraGroups = [ "wheel" "docker" ];
openssh.authorizedKeys.keys = [
"ssh-rsa XXXX"
];
};
users.extraUsers.media = {
isNormalUser = true;
uid = 1001;
home = "/vol/media/media";
};
virtualisation.docker.enable = true;
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "15.09";
}
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "pata_jmicron" "usb_storage" "usbhid" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/451fcb74-9143-4361-a79a-02fc1d66d85f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/5743f92e-c3f0-4c12-ba2b-2731bbd7fd64";
fsType = "ext4";
};
swapDevices = [ ];
nix.maxJobs = 4;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment