~kaction/config

ref: 42707d29c994c30956608b9c9f10cbaf1d00add4 config/system-v2/activate/default.nix -rw-r--r-- 1.2 KiB
42707d29 — Dmitry Bogatov nix-sys: generate build system inside of build system 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ busybox, execline, runit, runCommand, writeScript, manifest, kbd,
font-psf, mk-runscript }:
let
  path = str: manifest.${str}.path;
  # FIXME: copy-paste is bad.
  # FIXME: emacs2 keymap happens to be on Void Linux, but better use our
  # own.
  runscript = writeScript "activate.run" ''
    #!${execline}/bin/execlineb -P
    if { ${busybox}/bin/sysctl -p ${path "/etc/sysctl.conf"} }
    if { ${busybox}/bin/setfont -C /dev/tty1 ${font-psf} }
    if { ${busybox}/bin/setfont -C /dev/tty2 ${font-psf} }
    if { ${busybox}/bin/setfont -C /dev/tty3 ${font-psf} }
    if { ${busybox}/bin/setfont -C /dev/tty4 ${font-psf} }
    if { ${busybox}/bin/setfont -C /dev/tty5 ${font-psf} }
    if { ${busybox}/bin/setfont -C /dev/tty6 ${font-psf} }
    if { ${kbd}/bin/loadkeys -C /dev/tty1 emacs2 }
    if { ${kbd}/bin/loadkeys -C /dev/tty2 emacs2 }
    if { ${kbd}/bin/loadkeys -C /dev/tty3 emacs2 }
    if { ${kbd}/bin/loadkeys -C /dev/tty4 emacs2 }
    if { ${kbd}/bin/loadkeys -C /dev/tty5 emacs2 }
    if { ${kbd}/bin/loadkeys -C /dev/tty6 emacs2 }
    ${runit}/bin/sv down .
  '';
in runCommand "activate" { inherit runscript; } ''
  ${mk-runscript}/bin/mk-runscript \
    --name $name --target $out --runscript $runscript
''