alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
machines hilum: update with new stick
author
lassulus
date
2 years ago
(May 11, 2024, 11:31 PM CEST)
commit
fcce6c71
fcce6c711c52c08e6881dd9e5cc35de216dd643e
parent
c2a8e302
c2a8e302716b3f020a7d9b4a3332252677ce2fc0
+43
-71
3 changed files
Expand all
Collapse all
Unified
Split
machines
hilum
disk.nix
flash-stick.sh
physical.nix
+36
-27
machines/hilum/disk.nix
View file
Reviewed
···
1
1
-
{ lib, disk, keyFile, ... }:
1
1
+
{ ... }:
2
2
{
3
3
-
disk = {
3
3
+
disko.devices.disk = {
4
4
main = {
5
5
type = "disk";
6
6
-
device = disk;
6
6
+
device = "/dev/disk/by-id/usb-Kingston_DataTraveler_Max_BFB8357EA7B1718B0070-0:0";
7
7
content = {
8
8
-
type = "table";
9
9
-
format = "gpt";
10
10
-
partitions = [
11
11
-
{
12
12
-
name = "boot";
13
13
-
start = "0";
14
14
-
end = "1M";
15
15
-
flags = ["bios_grub"];
16
16
-
}
17
17
-
{
18
18
-
name = "ESP";
19
19
-
start = "1M";
20
20
-
end = "50%";
21
21
-
bootable = true;
8
8
+
type = "gpt";
9
9
+
partitions = {
10
10
+
MBR = {
11
11
+
size = "1M";
12
12
+
type = "EF02";
13
13
+
priority = 1;
14
14
+
};
15
15
+
DATA = {
16
16
+
size = "100G";
17
17
+
type = "8300"; # not sure if correct type
18
18
+
priority = 2;
19
19
+
content = {
20
20
+
type = "filesystem";
21
21
+
format = "exfat";
22
22
+
};
23
23
+
};
24
24
+
boot = {
25
25
+
size = "25G";
26
26
+
type = "EF00";
27
27
+
priority = 3;
22
28
content = {
23
29
type = "filesystem";
24
30
format = "vfat";
25
31
mountpoint = "/boot";
26
32
};
27
27
-
}
28
28
-
{
29
29
-
name = "root";
30
30
-
start = "50%";
31
31
-
end = "100%";
33
33
+
};
34
34
+
root = {
35
35
+
size = "100%";
36
36
+
priority = 4;
32
37
content = {
33
33
-
type = "filesystem";
34
34
-
format = "ext4";
35
35
-
mountpoint = "/";
38
38
+
type = "luks";
39
39
+
name = "hilum";
40
40
+
content = {
41
41
+
type = "filesystem";
42
42
+
format = "ext4";
43
43
+
mountpoint = "/";
44
44
+
};
36
45
};
37
37
-
}
38
38
-
];
46
46
+
};
47
47
+
};
39
48
};
40
49
};
41
50
};
-43
machines/hilum/flash-stick.sh
Reviewed
···
1
1
-
#!/bin/sh
2
2
-
set -efux
3
3
-
4
4
-
disk=$1
5
5
-
6
6
-
cd "$(dirname "$0")"
7
7
-
export NIXPKGS_ALLOW_UNFREE=1
8
8
-
(umask 077; pass show admin/hilum/luks > /tmp/hilum.luks)
9
9
-
trap 'rm -f /tmp/hilum.luks' EXIT
10
10
-
echo "$disk" > /tmp/hilum-disk
11
11
-
trap 'rm -f /tmp/hilum-disk' EXIT
12
12
-
13
13
-
stockholm_root=$(git rev-parse --show-toplevel)
14
14
-
ssh root@localhost -t -- $(nix-build \
15
15
-
--no-out-link \
16
16
-
-I nixpkgs=/var/src/nixpkgs \
17
17
-
-I stockholm="$stockholm_root" \
18
18
-
-I secrets="$stockholm_root"/lass/2configs/tests/dummy-secrets \
19
19
-
-E "with import <nixpkgs> {}; (pkgs.nixos [
20
20
-
{
21
21
-
luksPassFile = \"/tmp/hilum.luks\";
22
22
-
mainDisk = \"$disk\";
23
23
-
disko.rootMountPoint = \"/mnt/hilum\";
24
24
-
}
25
25
-
./physical.nix
26
26
-
]).disko"
27
27
-
)
28
28
-
rm -f /tmp/hilum.luks
29
29
-
$(nix-build \
30
30
-
--no-out-link \
31
31
-
-I nixpkgs=/var/src/nixpkgs \
32
32
-
"$stockholm_root"/lass/krops.nix -A populate \
33
33
-
--argstr name hilum \
34
34
-
--argstr target "root@localhost/mnt/hilum/var/src" \
35
35
-
--arg force true
36
36
-
)
37
37
-
ssh root@localhost << SSH
38
38
-
set -efux
39
39
-
mkdir -p /mnt/hilum/etc
40
40
-
NIXOS_CONFIG=/mnt/hilum/var/src/nixos-config nixos-install --no-bootloader --no-root-password --root /mnt/hilum -I /var/src
41
41
-
nixos-enter --root /mnt/hilum -- nixos-rebuild -I /var/src switch --install-bootloader
42
42
-
umount -Rv /mnt/hilum
43
43
-
SSH
+7
-1
machines/hilum/physical.nix
View file
Reviewed
···
1
1
-
{ self, modulesPath, config, lib, pkgs, ... }:
1
1
+
{ self, modulesPath, lib, ... }:
2
2
3
3
{
4
4
imports = [
5
5
+
self.inputs.disko.nixosModules.disko
6
6
+
./disk.nix
5
7
./config.nix
6
8
(modulesPath + "/installer/scan/not-detected.nix")
7
9
];
···
10
12
boot.initrd.kernelModules = [ "dm-snapshot" ];
11
13
boot.kernelModules = [ "kvm-intel" ];
12
14
boot.extraModulePackages = [ ];
15
15
+
boot.loader.grub = {
16
16
+
efiSupport = true;
17
17
+
efiInstallAsRemovable = true;
18
18
+
};
13
19
14
20
swapDevices = [ ];
15
21