summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/cross-build-1.nix44
-rw-r--r--res/cross-build-2.nix46
2 files changed, 90 insertions, 0 deletions
diff --git a/res/cross-build-1.nix b/res/cross-build-1.nix
new file mode 100644
index 0000000..0598129
--- /dev/null
+++ b/res/cross-build-1.nix
@@ -0,0 +1,44 @@
1{ nixpkgs ? import <unstable>, ... }:
2
3let
4 pkgs = nixpkgs {
5 config = { };
6 # https://github.com/NixOS/nixpkgs/blob/master/lib/systems/examples.nix
7 crossSystem = {
8 config = "armv7l-unknown-linux-gnueabihf";
9 };
10 #overlays = [ (import ./overlay.nix) ];
11 };
12
13 config = { ... }:
14 {
15 environment.noXlibs = true;
16 documentation.enable = false;
17
18 # btrfs-progs fails to build
19 services.udisks2.enable = false;
20
21 fonts.fontconfig.enable = false;
22
23 nixpkgs.overlays = with pkgs.lib; singleton (const (super: {
24 polkit = super.polkit.override { withGnome = false; };
25
26 # pkcs11 needs opensc which depends on libXt? which fails to build and is X library
27 rng-tools = super.rng-tools.override { withPkcs11 = false; };
28
29 nix = super.nix.override { withAWS = false; };
30 }));
31
32 fileSystems."/".fsType = "tmpfs";
33
34 boot = {
35 loader.grub.enable = false;
36 enableContainers = false;
37 hardwareScan = false;
38 };
39
40 powerManagement.enable = false;
41 };
42
43in
44 pkgs.nixos config
diff --git a/res/cross-build-2.nix b/res/cross-build-2.nix
new file mode 100644
index 0000000..7225964
--- /dev/null
+++ b/res/cross-build-2.nix
@@ -0,0 +1,46 @@
1# This one is much better than the first
2#
3# TODO: get `nix build -f cross-build-2.nix vm` to work
4
5{ nixos ? import <unstable/nixos>, ... }:
6
7let
8 # https://github.com/NixOS/nixpkgs/blob/master/lib/systems/examples.nix
9 target = "armv7l-unknown-linux-gnueabihf";
10
11 configuration = { lib, ... }:
12 {
13 nixpkgs.crossSystem = lib.systems.elaborate { config = target; };
14 nixpkgs.overlays = with lib; singleton (const (super: {
15 polkit = super.polkit.override { withGnome = false; };
16
17 # pkcs11 needs opensc which depends on libXt? which fails to build and is X library
18 rng-tools = super.rng-tools.override { withPkcs11 = false; };
19
20 nix = super.nix.override { withAWS = false; };
21
22 gobject-introspection = super.callPackage /tmp/gobject-introspection.nix { inherit (darwin) cctools; };
23 }));
24
25
26 environment.noXlibs = true;
27 documentation.enable = false;
28
29 # btrfs-progs fails to build
30 services.udisks2.enable = false;
31
32 fonts.fontconfig.enable = false;
33
34 fileSystems."/".fsType = "tmpfs";
35
36 boot = {
37 loader.grub.enable = false;
38 enableContainers = false;
39 hardwareScan = false;
40 };
41
42 powerManagement.enable = false;
43 };
44
45in
46 nixos { inherit configuration; }