mirror of
https://github.com/eliasrenman/nixos-config.git
synced 2026-03-17 02:46:05 +01:00
30
README.md
Normal file
30
README.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
* Download [NixOS ISO](https://nixos.org/nixos/download.html)
|
||||||
|
* Write the ISO to a USB drive using `dd`
|
||||||
|
* Boot machine from ISO
|
||||||
|
* If you're using vbox, then boot with `nomodeset` as otherwise the boot hangs.
|
||||||
|
* Install git: `nix-env -i git`
|
||||||
|
* Clone configuration: `git clone https://github.com/willprice/nixos-config.git`
|
||||||
|
* Follow the [installation guide](https://nixos.org/nixos/manual/index.html#sec-installation) up to `nixos-generate-config`
|
||||||
|
* Copy nixos configuration files to `/mnt`: `cp nixos-config/* /mnt/etc/nixos`
|
||||||
|
* Generate hardware config: `nixos-generate-config`
|
||||||
|
* Install system: `nixos-install` (set root password)
|
||||||
|
* Reboot
|
||||||
|
* Login as root
|
||||||
|
* Set password for `will`: `passwd will`
|
||||||
|
* Log out and login as `will` setting `mate+xmonad` as desktop session
|
||||||
|
* Generate an SSH key for the new machine: `ssh-keygen`
|
||||||
|
* [Add SSH key to github profile](https://github.com/settings/ssh/new)
|
||||||
|
* Clone dotfiles: `git clone --recursive git@github.com:willprice/dotfiles.git ~/.dotfiles`
|
||||||
|
* Install dotfiles: `cd ~/.dotfiles; ./install-all.sh`
|
||||||
|
|
||||||
|
|
||||||
|
## Cheatsheet
|
||||||
|
### Nix
|
||||||
|
|
||||||
|
* Install a package: `nix-env -i packageName`
|
||||||
|
* List all available packages: `nix-env -qa` (take a while to run, best of dumping this and grepping the listing)
|
||||||
|
|
||||||
|
|
||||||
|
### NixOS
|
||||||
|
|
||||||
|
* Configuration file: `/etc/nixos/configuration.nix`
|
||||||
@@ -6,87 +6,104 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./packages.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the GRUB 2 boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.grub.version = 2;
|
boot.loader.grub.device = "/dev/sda";
|
||||||
boot.loader.grub.efiSupport = false;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
# boot.loader.grub.efiInstallAsRemovable = true;
|
|
||||||
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
||||||
# Define on which hard drive you want to install Grub.
|
|
||||||
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
|
||||||
|
|
||||||
networking.hostName = "orchid"; # Define your hostname.
|
# VBox only
|
||||||
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# fsck will fail under vbox and cause a boot to hang, so turn it off
|
||||||
|
boot.initrd.checkJournalingFS = false;
|
||||||
|
# End VBox only
|
||||||
|
|
||||||
|
networking.hostName = "nixos";
|
||||||
|
networking.wireless.enable = true;
|
||||||
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n = {
|
i18n = {
|
||||||
consoleFont = "Lat2-Terminus16";
|
consoleFont = "Lat2-Terminus16";
|
||||||
consoleKeyMap = "uk";
|
consoleKeyMap = "uk";
|
||||||
defaultLocale = "en_GB.UTF-8";
|
defaultLocale = "en_GB.UTF-8";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = "Europe/London";
|
time.timeZone = "Europe/London";
|
||||||
|
|
||||||
# List packages installed in system profile. To search by name, run:
|
|
||||||
# $ nix-env -qaP | grep wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
wget
|
|
||||||
vim
|
|
||||||
firefox
|
|
||||||
git
|
|
||||||
stow
|
|
||||||
tree
|
|
||||||
fish
|
|
||||||
];
|
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
# started in user sessions.
|
# started in user sessions.
|
||||||
programs.bash.enableCompletion = true;
|
|
||||||
# programs.mtr.enable = true;
|
# programs.mtr.enable = true;
|
||||||
programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
|
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
|
||||||
|
|
||||||
# List services that you want to enable:
|
programs.vim.defaultEditor = true;
|
||||||
|
#programs.nylas-mail.enable = true;
|
||||||
|
programs.npm.enable = true;
|
||||||
|
#programs.nm-applet.enable = true;
|
||||||
|
programs.less.enable = true;
|
||||||
|
#programs.iotop.enable = true;
|
||||||
|
programs.iftop.enable = true;
|
||||||
|
programs.java.enable = true;
|
||||||
|
programs.gphoto2.enable = true;
|
||||||
|
services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
startWhenNeeded = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.acpid.enable = true;
|
||||||
|
services.redshift = {
|
||||||
|
enable = true;
|
||||||
|
latitude = "51.4545";
|
||||||
|
longitude = "-2.5879";
|
||||||
|
};
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
# Or disable the firewall altogether.
|
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
sound.enable = true;
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.xserver.layout = "gb";
|
services.xserver.layout = "gb";
|
||||||
# services.xserver.xkbOptions = "eurosign:e";
|
# services.xserver.xkbOptions = "eurosign:e";
|
||||||
|
|
||||||
# Enable touchpad support.
|
services.xserver.libinput.enable = true;
|
||||||
# services.xserver.libinput.enable = true;
|
|
||||||
|
|
||||||
# Enable the KDE Desktop Environment.
|
# Enable the KDE Desktop Environment.
|
||||||
services.xserver.displayManager.sddm.enable = true;
|
#services.xserver.displayManager.sddm.enable = true;
|
||||||
services.xserver.desktopManager.plasma5.enable = true;
|
#services.xserver.desktopManager.plasma5.enable = true;
|
||||||
|
services.xserver.displayManager.gdm.enable = true;
|
||||||
|
services.xserver.desktopManager.mate.enable = true;
|
||||||
|
services.xserver.windowManager.xmonad = {
|
||||||
|
enable = true;
|
||||||
|
enableContribAndExtras = true;
|
||||||
|
extraPackages = haskellPackages: [
|
||||||
|
haskellPackages.xmonad-contrib
|
||||||
|
haskellPackages.xmonad-extras
|
||||||
|
haskellPackages.xmonad
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
# Don't forget to set a password with ‘passwd’.
|
||||||
users.extraUsers.will = {
|
users.users.will = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
uid = 1001;
|
home = "/home/will";
|
||||||
|
uid = 1000;
|
||||||
|
extraGroups = [ "wheel" "networkmanager" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# This value determines the NixOS release with which your system is to be
|
# This value determines the NixOS release with which your system is to be
|
||||||
# compatible, in order to avoid breaking some software such as database
|
# compatible, in order to avoid breaking some software such as database
|
||||||
# servers. You should change this only after NixOS release notes say you
|
# servers. You should change this only after NixOS release notes say you
|
||||||
# should.
|
# should.
|
||||||
system.stateVersion = "17.09"; # Did you read the comment?
|
system.stateVersion = "18.09";
|
||||||
|
|
||||||
system.autoUpgrade.enable = true;
|
system.autoUpgrade.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,21 +4,24 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ ];
|
||||||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ahci" "sd_mod" "sr_mod" ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-uuid/453e3503-1d3d-4e38-886f-149fc9e2f31f";
|
{ device = "/dev/disk/by-uuid/f5be4904-ef50-4105-a381-af8524f576e2";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/DEA2-FFC3";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
nix.maxJobs = lib.mkDefault 2;
|
nix.maxJobs = lib.mkDefault 1;
|
||||||
powerManagement.cpuFreqGovernor = "ondemand";
|
virtualisation.virtualbox.guest.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
96
packages.nix
Normal file
96
packages.nix
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Allow proprietary packages
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# List packages installed in system profile. To search, run:
|
||||||
|
# $ nix search wget
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
wget git vim
|
||||||
|
stow
|
||||||
|
sudo
|
||||||
|
fish
|
||||||
|
ncdu
|
||||||
|
|
||||||
|
gzip
|
||||||
|
unar
|
||||||
|
unzip
|
||||||
|
p7zip
|
||||||
|
cpio
|
||||||
|
# dd
|
||||||
|
|
||||||
|
|
||||||
|
# Build toolchains
|
||||||
|
autoconf
|
||||||
|
automake
|
||||||
|
gnumake
|
||||||
|
scons
|
||||||
|
cmake
|
||||||
|
gcc8
|
||||||
|
clang
|
||||||
|
clang-analyzer
|
||||||
|
clang-manpages
|
||||||
|
clang-tools
|
||||||
|
|
||||||
|
python27
|
||||||
|
python37
|
||||||
|
pipenv
|
||||||
|
|
||||||
|
ruby
|
||||||
|
bundler
|
||||||
|
|
||||||
|
ghc
|
||||||
|
stack
|
||||||
|
|
||||||
|
# GUI tools
|
||||||
|
gnome3.file-roller
|
||||||
|
|
||||||
|
|
||||||
|
# Media
|
||||||
|
ffmpeg-full
|
||||||
|
gstreamer
|
||||||
|
gst-plugins-base
|
||||||
|
gst-plugins-bad
|
||||||
|
gst-plugins-ugly
|
||||||
|
gst-plugins-good
|
||||||
|
|
||||||
|
# IDEs
|
||||||
|
jetbrains.clion
|
||||||
|
jetbrains.webstorm
|
||||||
|
jetbrains.idea-ultimate
|
||||||
|
jetbrains.pycharm-professional
|
||||||
|
|
||||||
|
|
||||||
|
# Desktop
|
||||||
|
xmonad-with-packages
|
||||||
|
dmenu
|
||||||
|
rofi
|
||||||
|
(polybar.override {
|
||||||
|
alsaSupport = true;
|
||||||
|
githubSupport = true;
|
||||||
|
mpdSupport = true;
|
||||||
|
pulseSupport = true;
|
||||||
|
})
|
||||||
|
material-icons
|
||||||
|
xorg.xmodmap
|
||||||
|
xorg.xset
|
||||||
|
xorg.xsetroot
|
||||||
|
|
||||||
|
terminus_font
|
||||||
|
terminus_font_ttf
|
||||||
|
dejavu_fonts
|
||||||
|
hack-font
|
||||||
|
hasklig
|
||||||
|
inriafonts
|
||||||
|
iosevka
|
||||||
|
|
||||||
|
kdeApplications.konsole
|
||||||
|
firefox
|
||||||
|
chromium
|
||||||
|
|
||||||
|
sway
|
||||||
|
ncmpcpp
|
||||||
|
powerline-fonts
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user