Browse Source

update lxc-template stuff

container/radius
Astro 2 years ago
parent
commit
d6f156c017
3 changed files with 5 additions and 34 deletions
  1. 3
    31
      hosts/storage-ng/lxc-template.nix
  2. 1
    3
      hosts/storage-ng/lxc-template.sh
  3. 1
    0
      lib/lxc-container.nix

+ 3
- 31
hosts/storage-ng/lxc-template.nix View File

@@ -6,30 +6,12 @@
6 6
 
7 7
 {
8 8
   imports =
9
-    [ <nixpkgs/nixos/modules/profiles/minimal.nix>
9
+    [ ../../lib/lxc-container.nix
10
+      ../../lib/shared.nix
10 11
     ];
11
-  nix.useSandbox = false;
12
-  nix.maxJobs = lib.mkDefault 4;
13
-
14
-  boot.isContainer = true;
15
-  # /sbin/init
16
-  boot.loader.initScript.enable = true;
17
-  boot.loader.grub.enable = false;
18
-  #boot.supportedFilesystems = ["zfs" "ext2" "ext3" "vfat" "fat32" "bcache" "bcachefs"];
19
-
20
-  fileSystems."/" = { fsType = "rootfs"; device = "rootfs"; };
21 12
 
22 13
   networking.hostName = "nixbert"; # Define your hostname.
23
-  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
24
-  networking.useNetworkd = true;
25
-
26
-  # Set your time zone.
27
-  time.timeZone = "Europe/Berlin";
28
-  # Select internationalisation properties.
29
-  i18n = {
30
-    defaultLocale = "en_US.UTF-8";
31
-    supportedLocales = lib.mkForce [ "en_US.UTF-8/UTF-8" ];
32
-  };
14
+  networking.useNetworkd = false;
33 15
 
34 16
   # List packages installed in system profile. To search, run:
35 17
   # $ nix search wget
@@ -37,16 +19,6 @@
37 19
     wget vim
38 20
   ];
39 21
 
40
-  # Create a few files early before packing tarball for Proxmox
41
-  # architecture/OS detection.
42
-  system.extraSystemBuilderCmds = 
43
-      ''
44
-          mkdir -m 0755 -p $out/bin
45
-          ln -s ${pkgs.bash}/bin/bash $out/bin/sh
46
-          mkdir -m 0755 -p $out/sbin
47
-          ln -s ../init $out/sbin/init
48
-      '';
49
-
50 22
   # This value determines the NixOS release with which your system is to be
51 23
   # compatible, in order to avoid breaking some software such as database
52 24
   # servers. You should change this only after NixOS release notes say you

+ 1
- 3
hosts/storage-ng/lxc-template.sh View File

@@ -1,5 +1,3 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-# Doesn't boot in Proxmox, use nixos-install to generate an image instead!
4
-
5
-nix-build -E '(import ../../nixpkgs/nixos/release.nix { configuration = import ./lxc-template.nix; }).containerTarball.x86_64-linux'
3
+nix-build -I nixos-config=./lxc-template.nix '<nixpkgs/nixos>' -A config.system.build.tarball

+ 1
- 0
lib/lxc-container.nix View File

@@ -3,6 +3,7 @@
3 3
 {
4 4
   imports =
5 5
     [ <nixpkgs/nixos/modules/profiles/minimal.nix>
6
+      <nixpkgs/nixos/modules/profiles/docker-container.nix>
6 7
     ];
7 8
   nix.useSandbox = false;
8 9
   nix.maxJobs = lib.mkDefault 1;

Loading…
Cancel
Save