forked from Gaming-Linux-FR/GLF-OS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
73 lines (60 loc) · 2.11 KB
/
Justfile
File metadata and controls
73 lines (60 loc) · 2.11 KB
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
# Justfile help
_default:
@just --list
# Perform a iso & install
all: iso install
# Check configuration (nix flake check)
check:
nix --extra-experimental-features "nix-command flakes" flake check --no-build
# Build configuration (nix build)
build:
nix --extra-experimental-features "nix-command flakes" build -L .#nixosConfigurations.glf-installer.config.system.build.toplevel
# Build new iso
iso:
nix --extra-experimental-features "nix-command flakes" build -L .#iso
# Build and run glf-os virtual machine
build-vm:
nixos-rebuild build-vm -I nixos-config=./iso-cfg/configuration.nix && ./result/bin/run-glfos-vm
# Update packages (flake.lock)
update:
nix --extra-experimental-features "nix-command flakes" flake update
# Clean local build (nix-collect-garbage)
clean:
#!/usr/bin/env bash
if [ -L "result" ]; then rm result; fi
nix-collect-garbage
if [ -d "iso" ]; then rm -r iso; fi
# Copy image and compute sha256sum
install:
#!/usr/bin/env bash
ISO_FILE=$(find result/iso -name "*.iso") # Trouve le fichier ISO généré par NixOS
if [ -n "$ISO_FILE" ]; then
echo "Found ISO: $ISO_FILE"
cp "$ISO_FILE" "GLF-OS-TESTING.iso" # Copie avec la nomination GLF OS
sha256sum "GLF-OS-OMNISLASH-RC.iso" > "GLF-OS-TESTING.iso.sha256sum"
cat "GLF-OS-TESTING.iso.sha256sum"
else
echo "No ISO file found in result/iso"
fi
#Ancienne façon de nommer
# SRC_DIR := result/iso
# DEST_DIR := iso
# GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
# SRC_IMG=$$(ls -t $(SRC_DIR) | tail -1); \
# DST_IMG="$${SRC_IMG/-x86_64-linux.iso/_$(GIT_BRANCH).iso}"; \
# if [ -n "$$SRC_IMG" ]; then \
# echo "Copying $(SRC_DIR)/$$SRC_IMG to $(DEST_DIR)/$$DST_IMG ..."; \
# install -d $(DEST_DIR); \
# install -m 644 "$(SRC_DIR)/$$SRC_IMG" $(DEST_DIR)/$$DST_IMG && \
# cd $(DEST_DIR) && \
# sha256sum "$$DST_IMG" > "$$DST_IMG.sha256sum"; \
# cat "$$DST_IMG.sha256sum"; \
# Check, fix and format nix code
fix:
#!/usr/bin/env bash
find . -type f -name "*.nix" \
! -path ./modules/default/debug.nix \
! -path ./iso-cfg/customConfig/default.nix \
-exec deadnix -eq {} \;
find . -type f -name "*.nix" -exec nixfmt -s {} \;
statix check .