Skip to content

Instantly share code, notes, and snippets.

@davegallant
Forked from martijnvermaat/nixos.md
Created May 2, 2021 17:50

Revisions

  1. @martijnvermaat martijnvermaat revised this gist May 22, 2016. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions nixos.md
    Original file line number Diff line number Diff line change
    @@ -118,9 +118,6 @@ $ cat > /mnt/etc/nixos/configuration.nix
    # Enables wireless support via wpa_supplicant.
    networking.wireless.enable = true;
    # The NixOS release to be compatible with for stateful data such as databases.
    system.stateVersion = "16.03";
    # Etcetera ...
    }
    ```
  2. @martijnvermaat martijnvermaat renamed this gist May 22, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @martijnvermaat martijnvermaat revised this gist May 22, 2016. 1 changed file with 34 additions and 60 deletions.
    94 changes: 34 additions & 60 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -75,7 +75,7 @@ Configure WPA supplicant so we can use WIFI:
    ^D
    $ systemctl start wpa_supplicant

    Now generate a NixOS configuration and modify it to suit our partitioning. The following is a condensed configuration of what I came up with.
    Now generate a NixOS configuration and modify it to our liking. The following is the configuration I started with.

    ```
    $ nixos-generate-config --root /mnt
    @@ -88,86 +88,60 @@ $ cat > /mnt/etc/nixos/configuration.nix
    ./hardware-configuration.nix
    ];
    # https://bugzilla.kernel.org/show_bug.cgi?id=110941
    boot.kernelParams = [ "intel_pstate=no_hwp" ];
    # Supposedly better for the SSD.
    fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
    # 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.loader.grub.device = "nodev";
    boot.loader.grub.efiSupport = true;
    boot.loader.efi.canTouchEfiVariables = true;
    # Grub menu is painted really slowly on HiDPI, so we lower the
    # resolution. Unfortunately, scaling to 1280x720 (keeping aspect
    # ratio) doesn't seem to work, so we just pick another low one.
    boot.loader.grub.gfxmodeEfi = "1024x768";
    boot.initrd.luks.devices = [
    {
    name = "root";
    device = "/dev/sda2";
    device = "/dev/disk/by-uuid/06e7d974-9549-4be1-8ef2-f013efad727e";
    preLVM = true;
    allowDiscards = true;
    }
    ];
    # networking.hostName = "nixos"; # Define your hostname.
    networking.hostName = "tipi";
    # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
    # Enables wireless support via wpa_supplicant.
    networking.wireless.enable = true;
    # Select internationalisation properties.
    # i18n = {
    # consoleFont = "Lat2-Terminus16";
    # consoleKeyMap = "us";
    # defaultLocale = "en_US.UTF-8";
    # };
    # Set your time zone.
    # time.timeZone = "Europe/Amsterdam";
    # List packages installed in system profile. To search by name, run:
    # $ nix-env -qaP | grep wget
    # environment.systemPackages = with pkgs; [
    # wget
    # ];
    # List services that you want to enable:
    # Enable the OpenSSH daemon.
    # services.openssh.enable = true;
    # The NixOS release to be compatible with for stateful data such as databases.
    system.stateVersion = "16.03";
    # Enable CUPS to print documents.
    # services.printing.enable = true;
    # Etcetera ...
    }
    ```

    # Enable the X11 windowing system.
    # services.xserver.enable = true;
    # services.xserver.layout = "us";
    # services.xserver.xkbOptions = "eurosign:e";
    If we're happy with the configuration, install NixOS and reboot.

    # Enable the KDE Desktop Environment.
    # services.xserver.displayManager.kdm.enable = true;
    # services.xserver.desktopManager.kde4.enable = true;
    $ nixos-install
    $ reboot

    # Define a user account. Don't forget to set a password with ‘passwd’.
    # users.extraUsers.guest = {
    # isNormalUser = true;
    # uid = 1000;
    # };

    # The NixOS release to be compatible with for stateful data such as databases.
    system.stateVersion = "16.03";
    ## Troubleshooting

    }
    ```
    If for whatever reason the system doesn't boot, we can go back to the installation environment by booting from the installation media and remounting all partitions:

    If we reboot, we can get back to this state with:
    ```
    cryptsetup luksOpen /dev/sda2 enc-pv
    lvchange -a y /dev/vg/swap
    lvchange -a y /dev/vg/root
    mount /dev/vg/root /mnt
    mount /dev/sda1 /mnt/boot
    swapon /dev/vg/swap
    cp /mnt/etc/wpa_supplicant.conf /etc
    systemctl start wpa_supplicant
    ```
    $ cryptsetup luksOpen /dev/sda2 enc-pv
    $ lvchange -a y /dev/vg/swap
    $ lvchange -a y /dev/vg/root
    $ mount /dev/vg/root /mnt
    $ mount /dev/sda1 /mnt/boot
    $ swapon /dev/vg/swap
    $ cp /mnt/etc/wpa_supplicant.conf /etc
    $ systemctl start wpa_supplicant

    ```
    nixos-install
    reboot
    ```
    We can now make further modifications to the configuration and try again.
  4. @martijnvermaat martijnvermaat revised this gist May 22, 2016. 1 changed file with 5 additions and 44 deletions.
    49 changes: 5 additions & 44 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -67,56 +67,19 @@ We mount the partitions we just created under `/mnt` so we can install NixOS on

    Configure WPA supplicant so we can use WIFI:

    $ cat /etc/wpa_supplicant.conf
    $ cat > /etc/wpa_supplicant.conf
    network={
    ssid="****"
    psk="****"
    }
    ^D
    $ systemctl start wpa_supplicant

    ```
    nixos-generate-config --root /mnt
    ```
    `/etc/nixos/hardware-configuration.nix`:
    ```
    # 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" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
    boot.kernelModules = [ "kvm-intel" ];
    boot.extraModulePackages = [ ];
    Now generate a NixOS configuration and modify it to suit our partitioning. The following is a condensed configuration of what I came up with.

    fileSystems."/" =
    { device = "/dev/disk/by-uuid/d59fd1c1-e017-4dfa-bbf3-369e76f67172";
    fsType = "ext4";
    options = "noatime,nodiratime,discard";
    };
    fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/D799-64D0";
    fsType = "vfat";
    };
    swapDevices =
    [ { device = "/dev/disk/by-uuid/f5506d12-f12c-4477-b376-186401420869"; }
    ];
    nix.maxJobs = lib.mkDefault 4;
    }
    ```
    `/mnt/etc/nixos/configuration.nix`:
    ```
    # 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’).
    $ nixos-generate-config --root /mnt
    $ cat > /mnt/etc/nixos/configuration.nix
    { config, pkgs, ... }:
    {
    @@ -208,5 +171,3 @@ systemctl start wpa_supplicant
    nixos-install
    reboot
    ```

    `warning: passing a comma-separated string for filesystem options is deprecated; use a list of strings instead`
  5. @martijnvermaat martijnvermaat revised this gist May 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Installation of NixOS with encrypted root

    These are my notes on instaling [NixOS](http://nixos.org/) 16.03 on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root system using UEFI.
    These are my notes on instaling [NixOS](http://nixos.org/) 16.03 on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root file system using UEFI.

    Most of this is scrambled from the following pages:

  6. @martijnvermaat martijnvermaat revised this gist May 22, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Installation of NixOS on a ThinkPad X1 Carbon 4G with encrypted root
    # Installation of NixOS with encrypted root

    These are my notes on instaling [NixOS](http://nixos.org/) on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root system using UEFI.
    These are my notes on instaling [NixOS](http://nixos.org/) 16.03 on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root system using UEFI.

    Most of this is scrambled from the following pages:

  7. @martijnvermaat martijnvermaat revised this gist May 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Installing NixOS on a ThinkPad X1 Carbon 4G with encrypted root
    # Installation of NixOS on a ThinkPad X1 Carbon 4G with encrypted root

    These are my notes on instaling [NixOS](http://nixos.org/) on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root system using UEFI.

  8. @martijnvermaat martijnvermaat revised this gist May 22, 2016. 1 changed file with 60 additions and 48 deletions.
    108 changes: 60 additions & 48 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,66 +1,78 @@
    TODO:
    - Windows license: `EULAID:T1C_2R_1_ED_CC_O_en-us`
    - Package lessfile/lesspipe.
    - Bash enableCompletion
    - command-not-found.nix
    - conflict between our vendorized `nix-mode.el` and `/run/current-system/sw/share/emacs/site-lisp/nix-mode.el`?
    # Installing NixOS on a ThinkPad X1 Carbon 4G with encrypted root

    http://fixedpoint.nl/other/thinkpad_x1/
    These are my notes on instaling [NixOS](http://nixos.org/) on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root system using UEFI.

    http://chris-martin.org/2015/installing-nixos
    https://earldouglas.com/notes/linux.html
    https://bluishcoder.co.nz/2014/05/14/installing-nixos-with-encrypted-root-on-thinkpad-w540.html
    Most of this is scrambled from the following pages:

    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso
    - [Encrypted Root on NixOS - Nix Wiki](https://nixos.org/wiki/Encrypted_Root_on_NixOS)
    - [Installing NixOS - Chris Martin](http://chris-martin.org/2015/installing-nixos)
    - [Linux administration and use - Earl Douglas](https://earldouglas.com/notes/linux.html)
    - [Installing NixOS on a ThinkPad W540 with encrypted root - Bluish Coder](https://bluishcoder.co.nz/2014/05/14/installing-nixos-with-encrypted-root-on-thinkpad-w540.html)

    `sudo dd bs=4M if=nixos-minimal-16.03.678.2597f52-x86_64-linux.iso of=/dev/sdb`

    ## Preparing installation media

    I installed from a USB stick using the NixOS minimal ISO ([this one](https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso) to be precise).

    $ dd bs=4M if=nixos-minimal-16.03.678.2597f52-x86_64-linux.iso of=/dev/sdb


    ## Booting the installer

    - Disable Secure Boot Control
    - Disable USB legacy boot
    - Enable Launch CSM

    https://bugzilla.kernel.org/show_bug.cgi?id=110941
    Due to [this kernel bug](https://bugzilla.kernel.org/show_bug.cgi?id=110941), we have to boot with the following kernel parameter: `intel_pstate=no_hwp`. Seems like this will be fixed soon.

    Boot with kernel parameter `intel_pstate=no_hwp`

    ```
    gdisk /dev/sda
    o (create new empty partition table)
    n (add partition, 500M, type ef00 EFI)
    n (add partition, remaining space, type 8300 Linux LVM)
    w (write partition table and exit)
    ```
    ## Partitioning

    ```
    cryptsetup luksFormat /dev/sda2
    cryptsetup luksOpen /dev/sda2 enc-pv
    pvcreate /dev/mapper/enc-pv
    vgcreate vg /dev/mapper/enc-pv
    lvcreate -L 8G -n swap vg
    lvcreate -l '100%FREE' -n root vg
    ```
    We create a 500MB EFI boot partition (`/dev/sda1`) and the rest will be our LUKS encrypted physical volume for LVM (`/dev/sda2`).

    ```
    mkfs.fat /dev/sda1
    mkfs.ext4 -L root /dev/vg/root
    mkswap -L swap /dev/vg/swap
    ```
    $ gdisk /dev/sda

    ```
    mount /dev/vg/root /mnt
    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot
    swapon /dev/vg/swap
    ```
    - `o` (create new empty partition table)
    - `n` (add partition, 500M, type ef00 EFI)
    - `n` (add partition, remaining space, type 8300 Linux LVM)
    - `w` (write partition table and exit)

    Create `/etc/wpa_supplicant.conf`:
    ```
    network={
    ssid="****"
    psk="****"
    }
    ```
    Then `systemctl start wpa_supplicant`
    Setup the encrypted LUKS partition and open it:

    $ cryptsetup luksFormat /dev/sda2
    $ cryptsetup luksOpen /dev/sda2 enc-pv

    We create two logical volumes, a 8GB swap parition and the rest will be our root filesystem

    $ pvcreate /dev/mapper/enc-pv
    $ vgcreate vg /dev/mapper/enc-pv
    $ lvcreate -L 8G -n swap vg
    $ lvcreate -l '100%FREE' -n root vg

    Format the partitions:

    $ mkfs.fat /dev/sda1
    $ mkfs.ext4 -L root /dev/vg/root
    $ mkswap -L swap /dev/vg/swap


    ## Installing NixOS

    We mount the partitions we just created under `/mnt` so we can install NixOS on them.

    $ mount /dev/vg/root /mnt
    $ mkdir /mnt/boot
    $ mount /dev/sda1 /mnt/boot
    $ swapon /dev/vg/swap

    Configure WPA supplicant so we can use WIFI:

    $ cat /etc/wpa_supplicant.conf
    network={
    ssid="****"
    psk="****"
    }
    $ systemctl start wpa_supplicant

    ```
    nixos-generate-config --root /mnt
  9. @martijnvermaat martijnvermaat revised this gist May 9, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@ TODO:
    - Package lessfile/lesspipe.
    - Bash enableCompletion
    - command-not-found.nix
    - conflict between our vendorized `nix-mode.el` and `/run/current-system/sw/share/emacs/site-lisp/nix-mode.el`?

    http://fixedpoint.nl/other/thinkpad_x1/

  10. @martijnvermaat martijnvermaat revised this gist May 9, 2016. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    Windows license: `EULAID:T1C_2R_1_ED_CC_O_en-us`

    Package lessfile/lesspipe.
    TODO:
    - Windows license: `EULAID:T1C_2R_1_ED_CC_O_en-us`
    - Package lessfile/lesspipe.
    - Bash enableCompletion
    - command-not-found.nix

    http://fixedpoint.nl/other/thinkpad_x1/

  11. @martijnvermaat martijnvermaat revised this gist May 8, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    Windows license: `EULAID:T1C_2R_1_ED_CC_O_en-us`

    Package lessfile/lesspipe.

    http://fixedpoint.nl/other/thinkpad_x1/

    http://chris-martin.org/2015/installing-nixos
  12. @martijnvermaat martijnvermaat revised this gist May 4, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    Windows license: `EULAID:T1C_2R_1_ED_CC_O_en-us`

    http://fixedpoint.nl/other/thinkpad_x1/

    http://chris-martin.org/2015/installing-nixos
    https://earldouglas.com/notes/linux.html
    https://bluishcoder.co.nz/2014/05/14/installing-nixos-with-encrypted-root-on-thinkpad-w540.html
  13. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion tipi.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,9 @@ https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.

    `sudo dd bs=4M if=nixos-minimal-16.03.678.2597f52-x86_64-linux.iso of=/dev/sdb`

    Enable USB legacy boot (instead of or in addition to UEFI)
    - Disable Secure Boot Control
    - Disable USB legacy boot
    - Enable Launch CSM

    https://bugzilla.kernel.org/show_bug.cgi?id=110941

  14. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -187,3 +187,5 @@ systemctl start wpa_supplicant
    nixos-install
    reboot
    ```

    `warning: passing a comma-separated string for filesystem options is deprecated; use a list of strings instead`
  15. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -179,8 +179,8 @@ lvchange -a y /dev/vg/root
    mount /dev/vg/root /mnt
    mount /dev/sda1 /mnt/boot
    swapon /dev/vg/swap
    cp -R /mnt/etc/wpa_supplicant /etc
    systemctl start wpa_supplicant.service
    cp /mnt/etc/wpa_supplicant.conf /etc
    systemctl start wpa_supplicant
    ```

    ```
  16. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion tipi.md
    Original file line number Diff line number Diff line change
    @@ -171,7 +171,7 @@ nixos-generate-config --root /mnt
    }
    ```

    After rebooting, we can get back to this state with:
    If we reboot, we can get back to this state with:
    ```
    cryptsetup luksOpen /dev/sda2 enc-pv
    lvchange -a y /dev/vg/swap
    @@ -182,3 +182,8 @@ swapon /dev/vg/swap
    cp -R /mnt/etc/wpa_supplicant /etc
    systemctl start wpa_supplicant.service
    ```

    ```
    nixos-install
    reboot
    ```
  17. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 114 additions and 0 deletions.
    114 changes: 114 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -56,6 +56,120 @@ Then `systemctl start wpa_supplicant`
    ```
    nixos-generate-config --root /mnt
    ```
    `/etc/nixos/hardware-configuration.nix`:
    ```
    # 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" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
    boot.kernelModules = [ "kvm-intel" ];
    boot.extraModulePackages = [ ];
    fileSystems."/" =
    { device = "/dev/disk/by-uuid/d59fd1c1-e017-4dfa-bbf3-369e76f67172";
    fsType = "ext4";
    options = "noatime,nodiratime,discard";
    };
    fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/D799-64D0";
    fsType = "vfat";
    };
    swapDevices =
    [ { device = "/dev/disk/by-uuid/f5506d12-f12c-4477-b376-186401420869"; }
    ];
    nix.maxJobs = lib.mkDefault 4;
    }
    ```
    `/mnt/etc/nixos/configuration.nix`:
    ```
    # 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.loader.grub.device = "nodev";
    boot.loader.grub.efiSupport = true;
    boot.initrd.luks.devices = [
    {
    name = "root";
    device = "/dev/sda2";
    preLVM = true;
    allowDiscards = true;
    }
    ];
    # networking.hostName = "nixos"; # Define your hostname.
    networking.hostName = "tipi";
    # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
    networking.wireless.enable = true;
    # Select internationalisation properties.
    # i18n = {
    # consoleFont = "Lat2-Terminus16";
    # consoleKeyMap = "us";
    # defaultLocale = "en_US.UTF-8";
    # };
    # Set your time zone.
    # time.timeZone = "Europe/Amsterdam";
    # List packages installed in system profile. To search by name, run:
    # $ nix-env -qaP | grep wget
    # environment.systemPackages = with pkgs; [
    # wget
    # ];
    # List services that you want to enable:
    # Enable the OpenSSH daemon.
    # services.openssh.enable = true;
    # Enable CUPS to print documents.
    # services.printing.enable = true;
    # Enable the X11 windowing system.
    # services.xserver.enable = true;
    # services.xserver.layout = "us";
    # services.xserver.xkbOptions = "eurosign:e";
    # Enable the KDE Desktop Environment.
    # services.xserver.displayManager.kdm.enable = true;
    # services.xserver.desktopManager.kde4.enable = true;
    # Define a user account. Don't forget to set a password with ‘passwd’.
    # users.extraUsers.guest = {
    # isNormalUser = true;
    # uid = 1000;
    # };
    # The NixOS release to be compatible with for stateful data such as databases.
    system.stateVersion = "16.03";
    }
    ```

    After rebooting, we can get back to this state with:
    ```
  18. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -65,5 +65,6 @@ lvchange -a y /dev/vg/root
    mount /dev/vg/root /mnt
    mount /dev/sda1 /mnt/boot
    swapon /dev/vg/swap
    cp -R /mnt/etc/wpa_supplicant /etc
    systemctl start wpa_supplicant.service
    ```
  19. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -53,3 +53,17 @@ network={
    ```
    Then `systemctl start wpa_supplicant`

    ```
    nixos-generate-config --root /mnt
    ```

    After rebooting, we can get back to this state with:
    ```
    cryptsetup luksOpen /dev/sda2 enc-pv
    lvchange -a y /dev/vg/swap
    lvchange -a y /dev/vg/root
    mount /dev/vg/root /mnt
    mount /dev/sda1 /mnt/boot
    swapon /dev/vg/swap
    systemctl start wpa_supplicant.service
    ```
  20. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 10 additions and 9 deletions.
    19 changes: 10 additions & 9 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -14,15 +14,6 @@ https://bugzilla.kernel.org/show_bug.cgi?id=110941

    Boot with kernel parameter `intel_pstate=no_hwp`

    Create `/etc/wpa_supplicant.conf`:
    ```
    network={
    ssid="****"
    psk="****"
    }
    ```
    Then `systemctl start wpa_supplicant`

    ```
    gdisk /dev/sda
    o (create new empty partition table)
    @@ -52,3 +43,13 @@ mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot
    swapon /dev/vg/swap
    ```

    Create `/etc/wpa_supplicant.conf`:
    ```
    network={
    ssid="****"
    psk="****"
    }
    ```
    Then `systemctl start wpa_supplicant`

  21. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 33 additions and 1 deletion.
    34 changes: 33 additions & 1 deletion tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    Windows license: `EULAID:T1C_2R_1_ED_CC_O_en-us`

    http://chris-martin.org/2015/installing-nixos
    https://earldouglas.com/notes/linux.html
    https://bluishcoder.co.nz/2014/05/14/installing-nixos-with-encrypted-root-on-thinkpad-w540.html

    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso

    @@ -19,4 +21,34 @@ network={
    psk="****"
    }
    ```
    Then `systemctl start wpa_supplicant`
    Then `systemctl start wpa_supplicant`

    ```
    gdisk /dev/sda
    o (create new empty partition table)
    n (add partition, 500M, type ef00 EFI)
    n (add partition, remaining space, type 8300 Linux LVM)
    w (write partition table and exit)
    ```

    ```
    cryptsetup luksFormat /dev/sda2
    cryptsetup luksOpen /dev/sda2 enc-pv
    pvcreate /dev/mapper/enc-pv
    vgcreate vg /dev/mapper/enc-pv
    lvcreate -L 8G -n swap vg
    lvcreate -l '100%FREE' -n root vg
    ```

    ```
    mkfs.fat /dev/sda1
    mkfs.ext4 -L root /dev/vg/root
    mkswap -L swap /dev/vg/swap
    ```

    ```
    mount /dev/vg/root /mnt
    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot
    swapon /dev/vg/swap
    ```
  22. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -9,3 +9,14 @@ https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.
    Enable USB legacy boot (instead of or in addition to UEFI)

    https://bugzilla.kernel.org/show_bug.cgi?id=110941

    Boot with kernel parameter `intel_pstate=no_hwp`

    Create `/etc/wpa_supplicant.conf`:
    ```
    network={
    ssid="****"
    psk="****"
    }
    ```
    Then `systemctl start wpa_supplicant`
  23. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -7,3 +7,5 @@ https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.
    `sudo dd bs=4M if=nixos-minimal-16.03.678.2597f52-x86_64-linux.iso of=/dev/sdb`

    Enable USB legacy boot (instead of or in addition to UEFI)

    https://bugzilla.kernel.org/show_bug.cgi?id=110941
  24. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    Windows license: `EULAID:T1C_2R_1_ED_CC_O_en-us`

    http://chris-martin.org/2015/installing-nixos

    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso

    `sudo dd bs=4M if=nixos-minimal-16.03.678.2597f52-x86_64-linux.iso of=/dev/sdb`

    `EULAID:T1C_2R_1_ED_CC_O_en-us`
    Enable USB legacy boot (instead of or in addition to UEFI)
  25. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,6 @@ http://chris-martin.org/2015/installing-nixos

    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso

    `sudo dd bs=4M if=nixos-minimal-16.03.678.2597f52-x86_64-linux.iso of=/dev/sdb`

    `EULAID:T1C_2R_1_ED_CC_O_en-us`
  26. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,5 @@
    http://chris-martin.org/2015/installing-nixos

    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso

    `EULAID:T1C_2R_1_ED_CC_O_en-us`
  27. @martijnvermaat martijnvermaat revised this gist May 3, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion tipi.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso
    http://chris-martin.org/2015/installing-nixos
    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso
  28. @martijnvermaat martijnvermaat created this gist May 3, 2016.
    1 change: 1 addition & 0 deletions tipi.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso