Skip to content

Commit ec93a9a

Browse files
committed
ignore the flake interface of nixpkgs as it's utterly broken
1 parent dcf52bd commit ec93a9a

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

flake.nix

+18-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-24.11";
6-
nixos_2411.url = "github:NixOS/nixpkgs?ref=nixos-24.11";
7-
nixos_unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
6+
7+
# NOTE: We use the channel tarballs as they contain a .version and
8+
# .version-suffix file with the naming convetions we want. The
9+
# lib.trivial.version for flakes and git repos returns the wrong thing
10+
nixos_2411 = {
11+
url = "https://channels.nixos.org/nixos-24.11/nixexprs.tar.xz";
12+
flake = false;
13+
};
14+
nixos_unstable = {
15+
url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
16+
flake = false;
17+
};
818
treefmt-nix = {
919
url = "github:numtide/treefmt-nix";
1020
inputs.nixpkgs.follows = "nixpkgs";
@@ -76,18 +86,21 @@
7686
release:
7787
let
7888
nixpkgs = inputs.${release};
89+
# NOTE: we can not use nixpkgs.lib.nixosSystem as that uses
90+
# an extended version of lib that overrides lib.trivial.version
91+
# with something flake-specific which breaks the naming conventions
92+
# for images. (e.g. pre for unstable, beta for 25.05, etc)
93+
nixosSystem = args: import "${nixpkgs}/nixos/system/eval-config.nix" ({ system = null; } // args);
7994
in
8095
{
8196
amazonImage = genAttrs [ "aarch64-linux" "x86_64-linux" ] (
8297
system:
83-
(nixpkgs.lib.nixosSystem {
98+
(nixosSystem {
8499
modules = [
85100
# TODO: use @phaer's new images interface
86101
"${nixpkgs}/nixos/maintainers/scripts/ec2/amazon-image.nix"
87102
(
88103
{ config, ... }:
89-
# TODO: add beta to version string for beta releases
90-
# TODO: add pre to version string for unstable
91104
{
92105
system.stateVersion = config.system.nixos.release;
93106
virtualisation.diskSize = "auto";

0 commit comments

Comments
 (0)