Skip to content

Instantly share code, notes, and snippets.

@monokrome
Last active April 28, 2018 00:53
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 monokrome/563c0928535acce22661e409d88435fd to your computer and use it in GitHub Desktop.
Save monokrome/563c0928535acce22661e409d88435fd to your computer and use it in GitHub Desktop.
[root@nixos:~]# blkid /dev/sdc?
/dev/sdc1: UUID="9AB8-9E5F" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="07e6c71b-7df2-4500-a85c-c00796afb957"
/dev/sdc2: UUID="8af8e070-986f-461c-af31-dabbd402b845" TYPE="crypto_LUKS" PARTLABEL="Linux filesystem" PARTUUID="4b0b67bf-7f6f-4e41-a130-5d37d94adf23"
{ config, pkgs, ... }:
{
# Import dependant modules
imports = [
./encryption.nix
./hardware.nix
./packages.nix
];
# Hotfix for some broken stuff
boot.kernelParams = [ "intel_pstate=no_hwp" ];
# Use grub for encrypted root support
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "nodev";
boot.loader.grub.efiSupport = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.opengl.driSupport32Bit = true;
# Localization / Internationalization
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
};
time.timeZone = "America/Los_Angeles";
# Networking configuration
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
networking.hostName = "";
networking.networkmanager.enable = false;
networking.wireless.enable = true;
# Programs
programs.mtr.enable = true;
programs.zsh.enable = true;
# Services
services.printing.enable = true;
services.openssh.enable = true;
# X11
services.xserver.enable = true;
services.xserver.layout = "us";
services.xserver.xkbOptions = "ctrl:nocaps";
services.xserver.desktopManager.default = "gnome3";
services.xserver.desktopManager.gnome3.enable = true;
services.xserver.windowManager.default = "dwm";
services.xserver.windowManager.dwm.enable = true;
# users.mutableUsers = false;
services.cron.systemCronJobs = [];
users.extraUsers.polar = {
extraGroups = [ "wheel" "docker" "dbus" "video" ];
isNormalUser = true;
shell = pkgs.zsh;
uid = 1000;
};
# Virtualization and containerization
virtualisation.docker.enable = true;
# Initially installed OS version. Don't adjust this value
# unless you're doing a fresh install.
system.stateVersion = "18.03";
}
[root@nixos:~]# efibootmgr -v
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0000,0004,0003,0002,0001
Boot0000* Windows Boot Manager HD(2,GPT,fc9e0278-65f8-4b47-9cda-3e4b022cd8f1,0xe1800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...t................
Boot0001 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.T.3.0.0.0.D.M.0.0.8.-.2.D.M.1.6.6...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .5.Z.3.0.2.A.5.A........BO..NO..........S.a.m.s.u.n.g. .S.S.D. .8.5.0. .E.V.O. .1.T.B...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.2.S.E.R.X.N.H.0.1.6.8.6.1.7. .Z. . . . ........BO..NO..........W.D.C. .W.D.2.0.0.2.F.A.E.X.-.0.0.7.B.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.M.W.Y.A.2.0.7.8.9.6.1.4........BO
Boot0002 USB KEY BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0b00)..GO..NO.......... .P.a.t.r.i.o.t. .M.e.m.o.r.y. .P.M.A.P...................\.,.@.r.d.=.X..........A...................................6..Gd-.;.A..MQ..L.0.7.0.1.6.5.A.4.B.2.2.7.6.A.0.4........BO
Boot0003 UEFI: Patriot Memory PMAP PciRoot(0x0)/Pci(0x14,0x0)/USB(11,0)/USB(3,0)/USB(2,0)/CDROM(1,0x36f0,0x20000)..BO
Boot0004* UEFI: Patriot Memory PMAP, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(11,0)/USB(3,0)/USB(2,0)/HD(1,MBR,0xc8e0e6ee,0x36f0,0x8000)..BO
{ ... }:
{
boot.initrd.luks.devices = [
{
name = "system";
device = "/dev/disk/by-uuid/9AB8-9E5F";
allowDiscards = true;
preLVM = true;
}
];
}
[root@nixos:~]# fdisk -l /dev/sdb
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 845F83D2-ADC1-4A22-B775-060C6E1D818F
Device Start End Sectors Size Type
/dev/sdb1 2048 923647 921600 450M Windows recovery environment
/dev/sdb2 923648 1128447 204800 100M EFI System
/dev/sdb3 1128448 1161215 32768 16M Microsoft reserved
/dev/sdb4 1161216 1953523711 1952362496 931G Microsoft basic data
[root@nixos:~]# fdisk -l /dev/sdc
Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0C752FD4-5667-459D-8B95-4BEC24B60F2B
Device Start End Sectors Size Type
/dev/sdc1 2048 4196351 4194304 2G EFI System
/dev/sdc2 4196352 3907029134 3902832783 1.8T Linux filesystem
# 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 = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4e77487b-b154-42d0-b3c5-3b56a434500c";
fsType = "ext4";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/e1969008-ff44-408f-a12a-9b22471eecbe";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/9AB8-9E5F";
fsType = "vfat";
};
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 380.2M 1 loop /nix/.ro-store
sda 8:0 0 2.7T 0 disk
├─sda1 8:1 0 2.7T 0 part
└─sda2 8:2 0 4.9G 0 part
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 450M 0 part
├─sdb2 8:18 0 100M 0 part
├─sdb3 8:19 0 16M 0 part
└─sdb4 8:20 0 931G 0 part
sdc 8:32 0 1.8T 0 disk
├─sdc1 8:33 0 2G 0 part
└─sdc2 8:34 0 1.8T 0 part
sdd 8:48 1 28.9G 0 disk
├─sdd1 8:49 1 414M 0 part /iso
└─sdd2 8:50 1 16M 0 part
{ config, pkgs, ... }:
{
# Allow software that doesn't respect my freedom
nixpkgs.config.allowUnfree = true;
# Install overlays
# nixpkgs.overlays = [
# (import /home/polar/.local/etc/nixpkgs/overlays)
# ];
environment.systemPackages = with pkgs; [
abduco
acpi
ag
alacritty
aspell
bind
byobu
c-ares
chromium
coreutils
curl
dmenu
docker
dvtm
dwm
elfutils
exa
feh
ffmpeg
gcc
gimp
git
gitAndTools.gitFull
glxinfo
gnome3.dconf
gnome3.pomodoro
gnumake
gnupg
go
gparted
htop
http-parser
inetutils
inkscape
jdk
jq
keybase
libreoffice
links2
lshw
mkpasswd
mpd
mpv
multimc
mutt
mysql
neovim
nodejs-8_x
ntfs3g
openssl
openvpn
python27Full
python36Full
slack
sqlite
st
steam
tarsnap
tmux
unetbootin
v8
vlc
wget
which
xclip
xsel
zip
zsh
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment