Skip to content
Merged
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
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ on:

jobs:
build:
runs-on: UbuntuLatest32Cores128G
strategy:
matrix:
runners:
- runner: UbuntuLatest32Cores128G
system: x86_64-linux

- runner: UbuntuLatest32Cores128GArm
system: aarch64-linux

runs-on: ${{ matrix.runners.runner }}
permissions:
id-token: write
contents: write
Expand All @@ -18,10 +27,14 @@ jobs:

- uses: DeterminateSystems/flakehub-cache-action@main

- run: nix build .#iso
- run: nix develop --command nixfmt --check .
if: success() || failure()

- run: nix build .#packages.${{ matrix.runners.system }}.iso
if: success() || failure()

- uses: actions/upload-artifact@v4
with:
name: nixos-with-determinate.iso
name: nixos-with-determinate-${{ matrix.runners.system }}.iso
path: ./result/iso/*
retention-days: 90
139 changes: 93 additions & 46 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,105 @@
fh,
...
}:
{
packages.x86_64-linux.toplevel = self.nixosConfigurations.install.config.system.build.toplevel;
packages.x86_64-linux.iso = self.nixosConfigurations.install.config.system.build.isoImage;
let
forSystems =
s: f:
nixpkgs.lib.genAttrs s (
system:
f rec {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
}
);

nixosConfigurations.install = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Load the Determinate module
determinate.nixosModules.default
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal-combined.nix"
(
{ options, pkgs, lib, ... }:
{
environment.systemPackages = [ fh.packages.${pkgs.stdenv.hostPlatform.system}.default ];
environment.etc."nixos/flake.nix" = {
source = ./flake.nix;
mode = "0644";
};
environment.etc."nixos/flake.lock" = {
source = ./flake.lock;
mode = "0644";
};
environment.etc."nixos-generate-config.conf".text = ''
[Defaults]
Flake=1
'';
forAllSystems = forSystems [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
"aarch64-linux"
];
forLinuxSystems = forSystems [
"x86_64-linux"
"aarch64-linux"
];
in
{
devShells = forAllSystems (
{ system, pkgs, ... }:
{
default = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
nixfmt-rfc-style
];
};
}
);

networking.wireless.enable = lib.mkForce false;
networking.networkmanager.enable = true;
packages = forLinuxSystems (
{ system, ... }:
{
toplevel = self.nixosConfigurations.${system}.install.config.system.build.toplevel;
iso = self.nixosConfigurations.${system}.install.config.system.build.isoImage;
}
);

system.nixos-generate-config.flake = ''
nixosConfigurations = forLinuxSystems (
{ system, ... }:
{
install = nixpkgs.lib.nixosSystem {
system = system;
modules = [
# Load the Determinate module
determinate.nixosModules.default
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal-combined.nix"
(
{
options,
pkgs,
lib,
...
}:
{
inputs = {
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/3";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # NixOS, rolling release
# nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0"; # NixOS, current stable
environment.systemPackages = [ fh.packages.${pkgs.stdenv.hostPlatform.system}.default ];
environment.etc."nixos/flake.nix" = {
source = ./flake.nix;
mode = "0644";
};
outputs = inputs\@{ self, nixpkgs, determinate, ... }: {
# NOTE: '${options.networking.hostName.default}' is the default hostname
nixosConfigurations.${options.networking.hostName.default} = nixpkgs.lib.nixosSystem {
modules = [
determinate.nixosModule.default
./configuration.nix
];
};
environment.etc."nixos/flake.lock" = {
source = ./flake.lock;
mode = "0644";
};
environment.etc."nixos-generate-config.conf".text = ''
[Defaults]
Flake=1
'';

networking.wireless.enable = lib.mkForce false;
networking.networkmanager.enable = true;

system.nixos-generate-config.flake = ''
{
inputs = {
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/3";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # NixOS, rolling release
# nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0"; # NixOS, current stable
};
outputs = inputs\@{ self, nixpkgs, determinate, ... }: {
# NOTE: '${options.networking.hostName.default}' is the default hostname
nixosConfigurations.${options.networking.hostName.default} = nixpkgs.lib.nixosSystem {
modules = [
determinate.nixosModule.default
./configuration.nix
];
};
};
}
'';
}
'';
}
)
];
};
)
];
};
}
);
};

}