Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passage au flocon #100

Draft
wants to merge 16 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build GLF-OS Configurations

on:
push:
branches:
- main
- dev
- coraal_flakeInit # Remove that before fusion
- dontRevelate
paths:
- '**/*.nix'
pull_request:
branches:
- main
- dev
paths:
- '**/*.nix'
workflow_dispatch:

jobs:
buildGlf:
runs-on: [self-hosted, linux]
env:
USER: runner
steps:
- uses: actions/checkout@v3

- name: Install Nix
uses: cachix/install-nix-action@v17

- name: Build GLF
run: nix run github:Mic92/nix-fast-build -- --no-nom --skip-cached --systems 'x86_64-linux' -f .#nixosConfigurations.glf-installer.config.system.build.toplevel

- name: Report Results
run: |
echo "✅ Build completed successfully."
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
,*
.*.swp
.DS_STORE
result
result # Generated by nix build
result- # Generated by nix fast build
*.org
*.qcow2
iso
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ iso:
nix --extra-experimental-features "nix-command flakes" build -L .#iso

build-vm:
nixos-rebuild build-vm -I nixos-config=./nix-cfg/configuration.nix && ./result/bin/run-glfos-vm
nixos-rebuild build-vm -I nixos-config=./iso-cfg/configuration.nix && ./result/bin/run-glfos-vm

# Update flake.lock
update:
Expand Down
File renamed without changes
File renamed without changes
11 changes: 6 additions & 5 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 40 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
{
inputs = { nixpkgs.url = "nixpkgs/nixos-24.11"; };
description = "GLF-OS";

outputs = { nixpkgs, ... } @ inputs:
let system = "x86_64-linux";
in
rec
{
iso = nixosConfigurations."glf-installer".config.system.build.isoImage;
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
};

outputs = { self, nixpkgs, ... }:
let
system = "x86_64-linux";

nixpkgsConfig = {
allowUnfree = true;
};

pkgs = import nixpkgs {
inherit system;
config = nixpkgsConfig;
};

nixosModules = {
default = import ./modules/default;
};

nixosConfigurations = {
"glf-installer" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; inherit system;
inherit system;

modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix"
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
./nix-cfg/configuration.nix
nixosModules.default
./iso-cfg/configuration.nix

{
nixpkgs.config = nixpkgsConfig;
nixpkgs.overlays = [
(self: super: {
calamares-nixos-extensions = super.calamares-nixos-extensions.overrideAttrs (oldAttrs: {
postInstall = ''
cp ${./patches/calamares-nixos-extensions/modules/nixos/main.py} $out/lib/calamares/modules/nixos/main.py
cp -r ${./patches/calamares-nixos-extensions/config/settings.conf} $out/share/calamares/settings.conf
cp -r ${./patches/calamares-nixos-extensions/config/modules/packagechooser.conf} $out/share/calamares/modules/packagechooser.conf

cp -r ${./patches/calamares-nixos-extensions/branding/nixos/show.qml} $out/share/calamares/branding/nixos/show.qml
cp -r ${./patches/calamares-nixos-extensions/branding/nixos/white.png} $out/share/calamares/branding/nixos/white.png
cp -r ${./patches/calamares-nixos-extensions/branding/nixos/base.png} $out/share/calamares/branding/nixos/base.png
Expand All @@ -37,23 +53,28 @@
})
];
}
({ config, ... }: {
isoImage = {
# change default partition name (cannot exceed 32 bytes)
# volumeID = nixpkgs.lib.mkDefault "glfos${nixpkgs.lib.optionalString (config.isoImage.edition != "") "-${config.isoImage.edition}"}-${config.system.nixos.release}";
volumeID = nixpkgs.lib.mkDefault "glfos-${config.system.nixos.version}";

({ config, ... }:
{
isoImage = {
volumeID = nixpkgs.lib.mkDefault "glfos-${config.system.nixos.version}";
includeSystemBuildDependencies = false;
storeContents = [ config.system.build.toplevel ];
squashfsCompression = "zstd -Xcompression-level 22";
contents = [{
source = ./nix-cfg;
target = "/nix-cfg";
}];
contents = [
{
source = ./iso-cfg;
target = "/iso-cfg";
}
];
};
})
];
};
};

in {
iso = nixosConfigurations."glf-installer".config.system.build.isoImage;
inherit nixosConfigurations nixosModules;
};
}
17 changes: 6 additions & 11 deletions nix-cfg/configuration.nix → iso-cfg/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NE TOUCHEZ A RIEN
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
{ config, pkgs, lib, ... }:
{ inputs, config, pkgs, lib, ... }:

{
imports = [
./hardware-configuration.nix
./glf
];

glf.autoUpgrade = lib.mkForce false;

i18n.defaultLocale = "fr_FR.UTF-8";

Expand All @@ -18,13 +14,12 @@
excludePackages = [ pkgs.xterm ];
};

users.users.test = {
users.users.nixos = {
isNormalUser = true;
description = "test";
extraGroups = [ "networkmanager" "wheel" "render" ];
};

nvidia_config.enable = true;
networking.hostName = "GLF-OS";

nix.settings.experimental-features = [ "nix-command" "flakes" ];

Expand Down
7 changes: 7 additions & 0 deletions iso-cfg/customConfig/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ lib, config, pkgs, ... }:

{

# Add your custom configuration here ↓

}
63 changes: 63 additions & 0 deletions iso-cfg/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions iso-cfg/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{

description = "GLF-OS";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
glf.url = "github:CORAAL/Nixos-by-GLF/coraal_flakeInit";
};

outputs = { self, nixpkgs, glf, ... }@inputs:
let
pkgsSettings = system: import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
nixosConfigurations."GLF-OS" = nixpkgs.lib.nixosSystem {
pkgs = pkgsSettings "x86_64-linux";
modules = [
./configuration.nix
inputs.glf.nixosModules.default
];
};
};

}
File renamed without changes.
42 changes: 42 additions & 0 deletions modules/default/aliases.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ lib, config, pkgs, ... }:

{

options.glf.aliases.enable = lib.mkOption {
description = "Enable GLF Aliases configurations";
type = lib.types.bool;
default = true;
};

config = lib.mkIf config.glf.aliases.enable {

environment = {
systemPackages = with pkgs; [
pciutils
util-linux
inxi
gawk
];
shellAliases = {
glf-update = "sudo nix flake update --flake /etc/nixos";
glf-build = "nh os build /etc/nixos -H GLF-OS";
glf-switch = "nh os switch /etc/nixos -H GLF-OS";
glf-boot = "nh os boot /etc/nixos -H GLF-OS";
glf-systeminfo = ''
echo -e "\n--- Infos ---"; \
inxi -M; \
echo -e "\n--- CPU ---"; \
lscpu | grep -E "(Architecture|CPU op-mode|Vendor ID|Model name|Mode\\(s\\) opératoire\\(s\\) des processeurs|Identifiant constructeur|Nom de modèle)" | awk "{print \$0}"; \
echo -e "\n--- GPU ---"; \
lspci | grep -E "VGA|3D"; \
echo -e "\n--- Disque ---"; \
df -h; \
echo -e "\n--- RAM ---"; \
free -h
'';
};
};

};

}
22 changes: 22 additions & 0 deletions modules/default/boot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib, config, pkgs, ... }:

{

options.glf.boot.enable = lib.mkOption {
description = "Enable GLF Boot configurations";
type = lib.types.bool;
default = true;
};

config = lib.mkIf config.glf.boot.enable {

boot = {
tmp.cleanOnBoot = true;
supportedFilesystems.zfs = lib.mkDefault false;
kernelPackages = lib.mkDefault pkgs.linuxPackages_zen;
kernelParams = if builtins.elem "kvm-amd" config.boot.kernelModules then [ "amd_pstate=active" ] else [ ];
};

};

}
17 changes: 17 additions & 0 deletions modules/default/debug.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ lib, config, pkgs, ... }:

{

options.glf.debug.enable = lib.mkOption {
description = "Enable GLF debug";
type = lib.types.bool;
default = true;
};

config = lib.mkIf config.glf.debug.enable {

# Add here your debug configuration

};

}
Loading