|
3 | 3 |
|
4 | 4 | inputs = {
|
5 | 5 | 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 | + }; |
8 | 18 | treefmt-nix = {
|
9 | 19 | url = "github:numtide/treefmt-nix";
|
10 | 20 | inputs.nixpkgs.follows = "nixpkgs";
|
|
76 | 86 | release:
|
77 | 87 | let
|
78 | 88 | 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); |
79 | 94 | in
|
80 | 95 | {
|
81 | 96 | amazonImage = genAttrs [ "aarch64-linux" "x86_64-linux" ] (
|
82 | 97 | system:
|
83 |
| - (nixpkgs.lib.nixosSystem { |
| 98 | + (nixosSystem { |
84 | 99 | modules = [
|
85 | 100 | # TODO: use @phaer's new images interface
|
86 | 101 | "${nixpkgs}/nixos/maintainers/scripts/ec2/amazon-image.nix"
|
87 | 102 | (
|
88 | 103 | { config, ... }:
|
89 |
| - # TODO: add beta to version string for beta releases |
90 |
| - # TODO: add pre to version string for unstable |
91 | 104 | {
|
92 | 105 | system.stateVersion = config.system.nixos.release;
|
93 | 106 | virtualisation.diskSize = "auto";
|
|
0 commit comments