From 07712994e0a59201a498ec1815375f80a7aca122 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 10:59:12 +0100 Subject: ma: hardware.enableAllFirmware -> hardware.enableRedistributableFirmware what could possibly go wrong?! --- makefu/1systems/darth/config.nix | 2 +- makefu/1systems/repunit/config.nix | 2 +- makefu/1systems/tsp/config.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'makefu/1systems') diff --git a/makefu/1systems/darth/config.nix b/makefu/1systems/darth/config.nix index 046c1574..4e71d142 100644 --- a/makefu/1systems/darth/config.nix +++ b/makefu/1systems/darth/config.nix @@ -41,7 +41,7 @@ in { makefu.server.primary-itf = "enp0s25"; # krebs.hidden-ssh.enable = true; boot.kernelModules = [ "coretemp" "f71882fg" ]; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; networking = { wireless.enable = true; diff --git a/makefu/1systems/repunit/config.nix b/makefu/1systems/repunit/config.nix index 996abff0..5589cc0a 100644 --- a/makefu/1systems/repunit/config.nix +++ b/makefu/1systems/repunit/config.nix @@ -21,7 +21,7 @@ boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "virtio_pci" "virtio_blk" ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; hardware.cpu.amd.updateMicrocode = true; # networking.firewall is enabled by default diff --git a/makefu/1systems/tsp/config.nix b/makefu/1systems/tsp/config.nix index 2921e2bc..bbfaebd4 100644 --- a/makefu/1systems/tsp/config.nix +++ b/makefu/1systems/tsp/config.nix @@ -34,6 +34,6 @@ 25 ]; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; } -- cgit v1.2.3 From cb014289287ca198418fb7ce3a253c87e7adc662 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 11:51:32 +0100 Subject: ma wbob.r: hardware.enableRedistributableFirmware --- makefu/1systems/wbob/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu/1systems') diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index 3306279b..d8cf380e 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -145,7 +145,7 @@ in { #}; # rt2870.bin wifi card, part of linux-unfree - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; # rt2870 with nonfree creates wlp2s0 from wlp0s20u2 # not explicitly setting the interface results in wpa_supplicant to crash -- cgit v1.2.3 From 001acc5a523db45414ebfdca808e308f027e39b5 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 29 Nov 2019 13:43:27 +0100 Subject: ma iso: add justdoit,target-config.nix --- makefu/1systems/iso/config.nix | 30 +++++--- makefu/1systems/iso/justdoit.nix | 128 ++++++++++++++++++++++++++++++++++ makefu/1systems/iso/target-config.nix | 40 +++++++++++ 3 files changed, 189 insertions(+), 9 deletions(-) create mode 100644 makefu/1systems/iso/justdoit.nix create mode 100644 makefu/1systems/iso/target-config.nix (limited to 'makefu/1systems') diff --git a/makefu/1systems/iso/config.nix b/makefu/1systems/iso/config.nix index fdf203d5..6c4f6231 100644 --- a/makefu/1systems/iso/config.nix +++ b/makefu/1systems/iso/config.nix @@ -3,20 +3,32 @@ with import ; { imports = [ - + # - + # + ./justdoit.nix + { + kexec.justdoit = { + # bootSize = 512; + rootDevice = "/dev/sdb"; + swapSize = 1024; + bootType = "vfat"; + luksEncrypt = true; + uefi = true; + }; + } ]; + boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; # TODO: NIX_PATH and nix.nixPath are being set by default.nix right now - # cd ~/stockholm ; nix-build -A config.system.build.isoImage -I nixos-config=makefu/1systems/iso.nix -I secrets=/home/makefu/secrets/iso /var/src/nixpkgs/nixos - krebs.build.host = { cores = 0; }; + # cd ~/stockholm ; nix-build -A config.system.build.isoImage -I nixos-config=makefu/1systems/iso/config.nix -I secrets=/home/makefu/secrets/iso /var/src/nixpkgs/nixos + #krebs.build.host = { cores = 0; }; isoImage.isoBaseName = lib.mkForce "stockholm"; - krebs.hidden-ssh.enable = true; - environment.systemPackages = with pkgs; [ - aria2 - ddrescue - ]; + #krebs.hidden-ssh.enable = true; + # environment.systemPackages = with pkgs; [ + # aria2 + # ddrescue + # ]; environment.extraInit = '' EDITOR=vim ''; diff --git a/makefu/1systems/iso/justdoit.nix b/makefu/1systems/iso/justdoit.nix new file mode 100644 index 00000000..7947953f --- /dev/null +++ b/makefu/1systems/iso/justdoit.nix @@ -0,0 +1,128 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.kexec.justdoit; + x = if cfg.nvme then "p" else ""; +in { + options = { + kexec.justdoit = { + rootDevice = mkOption { + type = types.str; + default = "/dev/sda"; + description = "the root block device that justdoit will nuke from orbit and force nixos onto"; + }; + bootSize = mkOption { + type = types.int; + default = 256; + description = "size of /boot in mb"; + }; + bootType = mkOption { + type = types.enum [ "ext4" "vfat" "zfs" ]; + default = "ext4"; + }; + swapSize = mkOption { + type = types.int; + default = 1024; + description = "size of swap in mb"; + }; + poolName = mkOption { + type = types.str; + default = "tank"; + description = "zfs pool name"; + }; + luksEncrypt = mkOption { + type = types.bool; + default = false; + description = "encrypt all of zfs and swap"; + }; + uefi = mkOption { + type = types.bool; + default = false; + description = "create a uefi install"; + }; + nvme = mkOption { + type = types.bool; + default = false; + description = "rootDevice is nvme"; + }; + }; + }; + config = let + mkBootTable = { + ext4 = "mkfs.ext4 $NIXOS_BOOT -L NIXOS_BOOT"; + vfat = "mkfs.vfat $NIXOS_BOOT -n NIXOS_BOOT"; + zfs = ""; + }; + in lib.mkIf true { + system.build.justdoit = pkgs.writeScriptBin "justdoit" '' + #!${pkgs.stdenv.shell} + set -e + vgchange -a n + wipefs -a ${cfg.rootDevice} + dd if=/dev/zero of=${cfg.rootDevice} bs=512 count=10000 + sfdisk ${cfg.rootDevice} < /mnt/etc/nixos/generated.nix <