aboutsummaryrefslogtreecommitdiff
path: root/tarball.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-04-09 18:54:00 +0200
committerKarel Kočí <cynerd@email.cz>2022-04-12 21:48:06 +0200
commitb1bd3d7b5cf5d2dfb94493bb73140e6d8210f401 (patch)
tree70f840066e93bea2058a0a79e618dc0337a4c724 /tarball.nix
parentfb73330d0ccdc50c79a8fe0675c51022ee64b367 (diff)
downloadnixturris-b1bd3d7b5cf5d2dfb94493bb73140e6d8210f401.tar.gz
nixturris-b1bd3d7b5cf5d2dfb94493bb73140e6d8210f401.tar.bz2
nixturris-b1bd3d7b5cf5d2dfb94493bb73140e6d8210f401.zip
Refactor Mox support
Diffstat (limited to 'tarball.nix')
-rw-r--r--tarball.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/tarball.nix b/tarball.nix
new file mode 100644
index 0000000..9327762
--- /dev/null
+++ b/tarball.nix
@@ -0,0 +1,57 @@
+board: { config, lib, pkgs, modulesPath, ... }:
+
+with lib;
+
+{
+ imports = [
+ "${toString modulesPath}/installer/cd-dvd/system-tarball.nix"
+ ];
+
+ boot.consoleLogLevel = lib.mkDefault 7;
+
+ # Allow access to the root account right after installation
+ users = {
+ mutableUsers = false;
+ users.root.password = mkDefault "nixturris";
+ };
+
+ # Allow root access over SSH
+ services.openssh = {
+ enable = true;
+ passwordAuthentication = true;
+ permitRootLogin = "yes";
+ };
+
+ # TODO we have to generate the hardware specific configuration on first boot
+ tarball.contents = [
+ { source = pkgs.writeText "default-nixturris-flake" ''
+ {
+ inputs.nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-21.11";
+ inputs.nixturris.url = "git+https://git.cynerd.cz/nixturris";
+ outputs = { self, nixpkgs-stable, nixturris }: {
+ nixosConfigurations.nixturris = nixturris.lib.nixturrisSystem {
+ nixpkgs = nixpkgs-stable;
+ board = "${board}";
+ modules = [({ config, lib, pkgs, ... }: {
+ # Optionally place your configuration here
+ })];
+ };
+ };
+ }
+ '';
+ target = "/etc/nixos/flake.nix";
+ }
+ { source = pkgs.writeText "medkit-extlinux" ''
+ DEFAULT nixos-default
+ TIMEOUT 0
+ LABEL nixos-default
+ MENU LABEL NixOS - Default
+ LINUX /run/current-system/kernel
+ FDTDIR /run/current-system/dtbs
+ INITRD /run/current-system/initrd
+ APPEND init=${config.system.build.toplevel}/init ${builtins.toString config.boot.kernelParams}
+ '';
+ target = "/boot/extlinux/extlinux.conf";
+ }
+ ];
+}