From ee30fc920e0512d9d2359404051ba12efc3ee6f2 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 21 Apr 2018 12:53:32 +0200 Subject: onebutton.r: init --- krebs/1systems/onebutton/config.nix | 32 ++++++++++++++++++++++++++++++++ krebs/1systems/onebutton/source.nix | 11 +++++++++++ 2 files changed, 43 insertions(+) create mode 100644 krebs/1systems/onebutton/config.nix create mode 100644 krebs/1systems/onebutton/source.nix (limited to 'krebs/1systems/onebutton') diff --git a/krebs/1systems/onebutton/config.nix b/krebs/1systems/onebutton/config.nix new file mode 100644 index 00000000..08a9d642 --- /dev/null +++ b/krebs/1systems/onebutton/config.nix @@ -0,0 +1,32 @@ +{ config, pkgs, lib, ... }: +{ + imports = [ + + ]; + # NixOS wants to enable GRUB by default + boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; + + # !!! If your board is a Raspberry Pi 1, select this: + boot.kernelPackages = pkgs.linuxPackages_rpi; + + nix.binaryCaches = [ "http://nixos-arm.dezgeg.me/channel" ]; + nix.binaryCachePublicKeys = [ "nixos-arm.dezgeg.me-1:xBaUKS3n17BZPKeyxL4JfbTqECsT+ysbDJz29kLFRW0=%" ]; + + # !!! Needed for the virtual console to work on the RPi 3, as the default of 16M doesn't seem to be enough. + # boot.kernelParams = ["cma=32M"]; + + fileSystems = { + "/boot" = { + device = "/dev/disk/by-label/NIXOS_BOOT"; + fsType = "vfat"; + }; + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; + }; + + swapDevices = [ { device = "/swapfile"; size = 1024; } ]; +} diff --git a/krebs/1systems/onebutton/source.nix b/krebs/1systems/onebutton/source.nix new file mode 100644 index 00000000..3ecaf900 --- /dev/null +++ b/krebs/1systems/onebutton/source.nix @@ -0,0 +1,11 @@ +let + pkgs = import {}; +in import { + name = "onebutton"; + nixpkgs.file = pkgs.fetchFromGitHub { + owner = "nixos"; + repo = "nixpkgs-channels"; + rev = "6c064e6b"; # only binary cache for unstable arm6 + sha256 = "0ssaaaaaaaaaaaawkgjk8c75mvhgn5z7g1dkb78r8vrih9428bb8"; + }; +} -- cgit v1.2.3 From 70052cb8c9fedcda1ba8d5270afdf92bc1dd13ff Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 21 Apr 2018 16:01:31 +0200 Subject: onebutton.r: make it work --- krebs/1systems/onebutton/config.nix | 1 + krebs/1systems/onebutton/source.nix | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'krebs/1systems/onebutton') diff --git a/krebs/1systems/onebutton/config.nix b/krebs/1systems/onebutton/config.nix index 08a9d642..19159c8f 100644 --- a/krebs/1systems/onebutton/config.nix +++ b/krebs/1systems/onebutton/config.nix @@ -29,4 +29,5 @@ }; swapDevices = [ { device = "/swapfile"; size = 1024; } ]; + services.openssh.enable = true; } diff --git a/krebs/1systems/onebutton/source.nix b/krebs/1systems/onebutton/source.nix index 3ecaf900..8f25881c 100644 --- a/krebs/1systems/onebutton/source.nix +++ b/krebs/1systems/onebutton/source.nix @@ -1,11 +1,16 @@ +with import ; let pkgs = import {}; -in import { - name = "onebutton"; - nixpkgs.file = pkgs.fetchFromGitHub { + nixpkgs = pkgs.fetchFromGitHub { owner = "nixos"; repo = "nixpkgs-channels"; rev = "6c064e6b"; # only binary cache for unstable arm6 - sha256 = "0ssaaaaaaaaaaaawkgjk8c75mvhgn5z7g1dkb78r8vrih9428bb8"; + sha256 = "1rqzh475xn43phagrr30lb0fd292c1s8as53irihsnd5wcksnbyd"; + }; +in import { + name = "onebutton"; + override.nixpkgs = mkForce { + file = toString nixpkgs; }; + } -- cgit v1.2.3 From 1501d9e3e6a96e80ed238431ec58b40eb7b1b552 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 21 Apr 2018 16:14:01 +0200 Subject: onebutton.r: minimal disk and default config --- krebs/1systems/onebutton/config.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'krebs/1systems/onebutton') diff --git a/krebs/1systems/onebutton/config.nix b/krebs/1systems/onebutton/config.nix index 19159c8f..c634d73c 100644 --- a/krebs/1systems/onebutton/config.nix +++ b/krebs/1systems/onebutton/config.nix @@ -2,7 +2,18 @@ { imports = [ + + { # minimal disk usage + environment.noXlibs = true; + nix.gc.automatic = true; + nix.gc.dates = "03:10"; + programs.info.enable = false; + programs.man.enable = false; + services.journald.extraConfig = "SystemMaxUse=50M"; + services.nixosManual.enable = false; + } ]; + krebs.build.host = config.krebs.hosts.onebutton; # NixOS wants to enable GRUB by default boot.loader.grub.enable = false; # Enables the generation of /boot/extlinux/extlinux.conf -- cgit v1.2.3 From 82d5bca54179221759eb59f5bf10975b5261b1e3 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 3 May 2018 18:43:22 +0200 Subject: ma onebutton.r: remove noXlibs --- krebs/1systems/onebutton/config.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'krebs/1systems/onebutton') diff --git a/krebs/1systems/onebutton/config.nix b/krebs/1systems/onebutton/config.nix index c634d73c..dca00a20 100644 --- a/krebs/1systems/onebutton/config.nix +++ b/krebs/1systems/onebutton/config.nix @@ -1,33 +1,34 @@ { config, pkgs, lib, ... }: { + # :l + # builtins.readDir (pkgs.fetchFromGitHub { owner = "nixos"; repo = "nixpkgs-channels"; rev = "6c064e6b"; sha256 = "1rqzh475xn43phagrr30lb0fd292c1s8as53irihsnd5wcksnbyd"; }) imports = [ - { # minimal disk usage - environment.noXlibs = true; + { # flag to rebuild everything yourself: + # environment.noXlibs = true; + + # minimal disk usage nix.gc.automatic = true; nix.gc.dates = "03:10"; - programs.info.enable = false; - programs.man.enable = false; - services.journald.extraConfig = "SystemMaxUse=50M"; + documentation.man.enable = false; + documentation.info.enable = false; services.nixosManual.enable = false; + services.journald.extraConfig = "SystemMaxUse=50M"; } ]; krebs.build.host = config.krebs.hosts.onebutton; # NixOS wants to enable GRUB by default boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf boot.loader.generic-extlinux-compatible.enable = true; - # !!! If your board is a Raspberry Pi 1, select this: boot.kernelPackages = pkgs.linuxPackages_rpi; nix.binaryCaches = [ "http://nixos-arm.dezgeg.me/channel" ]; nix.binaryCachePublicKeys = [ "nixos-arm.dezgeg.me-1:xBaUKS3n17BZPKeyxL4JfbTqECsT+ysbDJz29kLFRW0=%" ]; - # !!! Needed for the virtual console to work on the RPi 3, as the default of 16M doesn't seem to be enough. - # boot.kernelParams = ["cma=32M"]; - fileSystems = { "/boot" = { device = "/dev/disk/by-label/NIXOS_BOOT"; @@ -41,4 +42,7 @@ swapDevices = [ { device = "/swapfile"; size = 1024; } ]; services.openssh.enable = true; + + networking.wireless.enable = true; + hardware.enableRedistributableFirmware = true; } -- cgit v1.2.3