Skip to content

Commit db8664e

Browse files
authored
Merge pull request #147 from CORAAL/userWorkflow
improve flake, workflow for test user configurations
2 parents 20872d5 + fb28136 commit db8664e

File tree

2 files changed

+59
-14
lines changed

2 files changed

+59
-14
lines changed

.github/workflows/nix-build.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ name: Build GLF-OS Configurations
22

33
on:
44
push:
5-
branches:
6-
- main
7-
- dev
8-
paths:
9-
- '**/*.nix'
5+
branches: [main, dev]
6+
paths: ['**/*.nix']
7+
108
pull_request:
11-
branches:
12-
- '**'
13-
paths:
14-
- '**/*.nix'
9+
branches: ['**']
10+
paths: ['**/*.nix']
11+
1512
workflow_dispatch:
1613

1714
jobs:
@@ -25,7 +22,29 @@ jobs:
2522

2623
- name: Build GLF
2724
run: nix run github:Mic92/nix-fast-build -- --no-nom --skip-cached --systems 'x86_64-linux' -f .#nixosConfigurations.glf-installer.config.system.build.toplevel
25+
continue-on-error: false
26+
27+
test-user-config:
28+
name: Test User Configuration
29+
runs-on: ubuntu-latest
30+
needs: []
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: cachix/install-nix-action@v17
34+
35+
- name: Build User Test Configuration
36+
run: nix run github:Mic92/nix-fast-build -- --no-nom --skip-cached --systems 'x86_64-linux' -f .#nixosConfigurations.user-test.config.system.build.toplevel
2837

29-
- name: Report Results
38+
report:
39+
name: Final Status
40+
runs-on: ubuntu-latest
41+
needs: [buildGLF-Configurations, test-user-config]
42+
steps:
43+
- name: Combine Results
3044
run: |
31-
echo "✅ Build completed successfully."
45+
echo "Build status:"
46+
echo "- Installer: ${{ needs.buildGLF-Configurations.result }}"
47+
echo "- Installer: ${{ contains(needs.*.result, 'success') && '✅' || '❌' }}"
48+
echo "- User Config: ${{ needs.test-user-config.result }}"
49+
echo "✅ Testing completed"
50+
if: always()

flake.nix

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,25 @@
1515
nixosModules = {
1616
default = import ./modules/default;
1717
};
18+
19+
baseModules = [
20+
nixosModules.default
21+
{ nixpkgs.config = nixpkgsConfig; }
22+
];
23+
1824
in
1925
{
2026
iso = self.nixosConfigurations."glf-installer".config.system.build.isoImage;
27+
2128
nixosConfigurations = {
29+
# Configuration pour l'ISO d'installation avec Calamares
2230
"glf-installer" = nixpkgs.lib.nixosSystem {
2331
inherit system;
24-
modules = [
32+
modules = baseModules ++ [
2533
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix"
2634
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
27-
nixosModules.default
2835
./iso-cfg/configuration.nix
2936
{
30-
nixpkgs.config = nixpkgsConfig;
3137
nixpkgs.overlays = [
3238
(self: super: {
3339
calamares-nixos-extensions = super.calamares-nixos-extensions.overrideAttrs (oldAttrs: {
@@ -64,7 +70,27 @@
6470
})
6571
];
6672
};
73+
74+
# Configuration de test utilisateur simulée
75+
"user-test" = nixpkgs.lib.nixosSystem {
76+
inherit system;
77+
modules = baseModules ++ [
78+
{
79+
boot.loader.grub = {
80+
enable = true;
81+
device = "/dev/sda";
82+
useOSProber = true;
83+
};
84+
85+
fileSystems."/" = {
86+
device = "/dev/sda1";
87+
fsType = "ext4";
88+
};
89+
}
90+
];
91+
};
6792
};
93+
6894
nixosModules = nixosModules;
6995
} // utils.lib.eachDefaultSystem (system:
7096
let

0 commit comments

Comments
 (0)