File tree 5 files changed +59
-8
lines changed
5 files changed +59
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
[ ![ Test] ( https://github.com/klarkc/os/actions/workflows/test.yml/badge.svg?branch=main )] ( https://github.com/klarkc/os/actions/workflows/test.yml?query=branch%3Amain )
4
4
5
- This is my brand new attempt to use NixOS as my personal OS.
5
+ Personal collection of NixOS machines.
6
+
Original file line number Diff line number Diff line change 23
23
else
24
24
nixosSystem options ;
25
25
# TODO: find a faster way to run vm in devShell
26
- mkRecoverVm = efi : name : args : pkgs . writeShellApplication {
26
+ mkVirtualMachine = efi : name : args : pkgs . writeShellApplication {
27
27
name = "${ name } -vm" ;
28
28
text = ''
29
29
IMG="${ name } -efi.img"
47
47
{
48
48
nixosConfigurations = {
49
49
inherit ( machines . recover ) recover-os ;
50
+ inherit ( machines . cache ) cache-os ;
50
51
} ;
51
52
52
53
packages . ${ system } = {
53
54
inherit ( machines . recover ) recover-efi recover-vm recover-kvm ;
55
+ inherit ( machines . cache ) cache-efi cache-vm cache-kvm ;
54
56
} ;
55
57
56
58
devShells . ${ system } . default =
57
59
pkgs . mkShell
58
60
{
59
61
packages =
60
- with machines . recover ; [
61
- recover-vm
62
- recover-kvm
62
+ with machines ; [
63
+ recover . recover-vm
64
+ recover . recover-kvm
65
+ cache . cache-vm
66
+ cache . cache-kvm
63
67
] ;
64
68
65
69
} ;
Original file line number Diff line number Diff line change
1
+ { system , lib , pkgs , ... } :
2
+ let
3
+ inherit ( lib ) mkSystem mkVirtualMachine ;
4
+ inherit ( pkgs . lib ) mkDefault ;
5
+ cache-module = {
6
+ networking = {
7
+ hostName = "cache-os" ;
8
+ networkmanager . enable = true ;
9
+ } ;
10
+ boot = {
11
+ kernelParams = [
12
+ "copytoram"
13
+ "console=ttyS0,115200"
14
+ "console=tty1"
15
+ "boot.shell_on_fail"
16
+ ] ;
17
+ loader = {
18
+ timeout = 15 ;
19
+ grub = {
20
+ enable = true ;
21
+ device = "nodev" ;
22
+ efiSupport = true ;
23
+ useOSProber = true ;
24
+ } ;
25
+ } ;
26
+ } ;
27
+ fileSystems . "/" . device = mkDefault "none" ;
28
+ } ;
29
+ in
30
+ rec {
31
+ cache-os = mkSystem {
32
+ inherit system ;
33
+ modules = [ cache-module ] ;
34
+ } ;
35
+
36
+ cache-efi = mkSystem {
37
+ inherit system ;
38
+ modules = [ cache-module ] ;
39
+ format = "raw-efi" ;
40
+ } ;
41
+
42
+ cache-vm = mkVirtualMachine cache-efi "cache" "" ;
43
+
44
+ cache-kvm = mkVirtualMachine cache-efi "cache" "--enable-kvm" ;
45
+ }
Original file line number Diff line number Diff line change 1
1
ctx :
2
2
{
3
3
recover = import ./recover ctx ;
4
+ cache = import ./cache ctx ;
4
5
}
Original file line number Diff line number Diff line change 1
1
{ system , lib , pkgs , ... } :
2
2
let
3
- inherit ( lib ) mkSystem mkRecoverVm ;
3
+ inherit ( lib ) mkSystem mkVirtualMachine ;
4
4
inherit ( pkgs . lib ) mkDefault ;
5
5
recover-module = {
6
6
nix = {
@@ -132,7 +132,7 @@ rec {
132
132
format = "raw-efi" ;
133
133
} ;
134
134
135
- recover-vm = mkRecoverVm recover-efi "recover" "" ;
135
+ recover-vm = mkVirtualMachine recover-efi "recover" "" ;
136
136
137
- recover-kvm = mkRecoverVm recover-efi "recover" "--enable-kvm" ;
137
+ recover-kvm = mkVirtualMachine recover-efi "recover" "--enable-kvm" ;
138
138
}
You can’t perform that action at this time.
0 commit comments