This repository has been archived by the owner on Jan 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
74 lines (65 loc) · 2.1 KB
/
default.nix
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ lib ? <nixpkgs/lib>
, pkgs ? <nixpkgs>
, python3 ? pkgs.python3
, os-installer-src
, os-installer-config ? null
}:
python3.pkgs.buildPythonApplication rec {
pname = "os-installer";
version = "git";
format = "other";
src = os-installer-src;
nativeBuildInputs = with pkgs; [
blueprint-compiler
meson
ninja
pkg-config
python3
wrapGAppsHook4
];
buildInputs = with pkgs; [
appstream
cryptsetup
desktop-file-utils
e2fsprogs
epiphany
glib
gnome-desktop
gnome.gnome-control-center
gnome.gnome-disk-utility
gtk4
libadwaita
libgweather
libxml2
udisks
vte-gtk4
os-installer-config
];
propagatedBuildInputs = with python3.pkgs; [
pygobject3
pyyaml
];
strictDeps = false;
postPatch = ''
substituteInPlace data/com.github.p3732.OS-Installer.desktop.in \
--replace "Name=OS-Installer" "Name=Install SnowflakeOS"
substituteInPlace data/com.github.p3732.OS-Installer.desktop.in \
--replace "Comment=Install an Operating System" "Comment=Install the SnowflakeOS Operating System"
substituteInPlace meson.build \
--replace "meson.add_install_script('.build_files/postinstall.py')" ""
substituteInPlace src/util/system_calls.py \
--replace " _exec(['localectl', '--no-ask-password', 'set-locale', 'LANG=en_US.UTF-8'])" ""
substituteInPlace src/util/system_calls.py \
--replace " _exec(['timedatectl', '--no-ask-password', 'set-timezone', timezone])" ""
substituteInPlace src/util/system_calls.py \
--replace " _exec(['timedatectl', '--no-ask-password', 'set-ntp', 'true'])" ""
'' + lib.optionalString (os-installer-config != null) ''
substituteInPlace src/config.py \
--replace "/etc/os-installer/config.yaml" "${os-installer-config}/etc/os-installer/config.yaml"
substituteInPlace src/util/installation_scripting.py \
--replace "/etc/os-installer/scripts/" "${os-installer-config}/etc/os-installer/scripts/"
'';
postInstall = ''
wrapProgram $out/bin/os-installer --prefix PATH : '${lib.makeBinPath [ pkgs.gptfdisk pkgs.pciutils ]}'
'';
}