Apply nixfmt to the whole tree
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "8";
|
version = "8";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "9";
|
version = "9";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "3.19.0";
|
version = "3.19.0";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "3.20";
|
version = "3.20";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "rolling";
|
version = "rolling";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "8";
|
version = "8";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "9";
|
version = "9";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "7";
|
version = "7";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "9";
|
version = "9";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "10";
|
version = "10";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "11";
|
version = "11";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "12";
|
version = "12";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
exclude = [
|
exclude = [
|
||||||
"virtualbox-iso"
|
"virtualbox-iso"
|
||||||
];
|
];
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,25 +1,32 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "37";
|
version = "37";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "38";
|
version = "38";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "39";
|
version = "39";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "40";
|
version = "40";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "41";
|
version = "41";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "rawhide";
|
version = "rawhide";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{config, pkgs, lib, ...}:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -20,7 +25,7 @@
|
|||||||
#xserver.enable = true;
|
#xserver.enable = true;
|
||||||
};
|
};
|
||||||
# User setup
|
# User setup
|
||||||
users.groups.vagrant = {};
|
users.groups.vagrant = { };
|
||||||
users.users.vagrant = {
|
users.users.vagrant = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
group = "vagrant";
|
group = "vagrant";
|
||||||
@@ -32,7 +37,10 @@
|
|||||||
users = [ "vagrant" ];
|
users = [ "vagrant" ];
|
||||||
groups = [ "vagrant" ];
|
groups = [ "vagrant" ];
|
||||||
commands = [
|
commands = [
|
||||||
{ command = "ALL"; options = [ "NOPASSWD" ]; }
|
{
|
||||||
|
command = "ALL";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
nixstable.url = "github:nixos/nixpkgs/nixos-23.05";
|
nixstable.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixstable, self, ... }@inputs:
|
outputs =
|
||||||
|
{ nixstable, self, ... }@inputs:
|
||||||
{
|
{
|
||||||
nixosConfigurations.vagrant = nixstable.lib.nixosSystem {
|
nixosConfigurations.vagrant = nixstable.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
ga-qemu.nix
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.qemuGuest.enable = true;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
virtualisation.hypervGuest.enable = true;
|
virtualisation.hypervGuest.enable = true;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
virtualisation.virtualbox.guest = {
|
virtualisation.virtualbox.guest = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
services.qemuGuest.enable = true;
|
services.qemuGuest.enable = true;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
{config, pkgs, lib, ...}:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -20,7 +25,7 @@
|
|||||||
#xserver.enable = true;
|
#xserver.enable = true;
|
||||||
};
|
};
|
||||||
# User setup
|
# User setup
|
||||||
users.groups.vagrant = {};
|
users.groups.vagrant = { };
|
||||||
users.users.vagrant = {
|
users.users.vagrant = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
group = "vagrant";
|
group = "vagrant";
|
||||||
@@ -32,7 +37,10 @@
|
|||||||
users = [ "vagrant" ];
|
users = [ "vagrant" ];
|
||||||
groups = [ "vagrant" ];
|
groups = [ "vagrant" ];
|
||||||
commands = [
|
commands = [
|
||||||
{ command = "ALL"; options = [ "NOPASSWD" ]; }
|
{
|
||||||
|
command = "ALL";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
nixstable.url = "github:nixos/nixpkgs/nixos-23.11";
|
nixstable.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixstable, self, ... }@inputs:
|
outputs =
|
||||||
|
{ nixstable, self, ... }@inputs:
|
||||||
{
|
{
|
||||||
nixosConfigurations.vagrant = nixstable.lib.nixosSystem {
|
nixosConfigurations.vagrant = nixstable.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
ga-qemu.nix
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.qemuGuest.enable = true;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
virtualisation.hypervGuest.enable = true;
|
virtualisation.hypervGuest.enable = true;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
virtualisation.virtualbox.guest = {
|
virtualisation.virtualbox.guest = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
services.qemuGuest.enable = true;
|
services.qemuGuest.enable = true;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
{config, pkgs, lib, ...}:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -20,7 +25,7 @@
|
|||||||
#xserver.enable = true;
|
#xserver.enable = true;
|
||||||
};
|
};
|
||||||
# User setup
|
# User setup
|
||||||
users.groups.vagrant = {};
|
users.groups.vagrant = { };
|
||||||
users.users.vagrant = {
|
users.users.vagrant = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
group = "vagrant";
|
group = "vagrant";
|
||||||
@@ -32,7 +37,10 @@
|
|||||||
users = [ "vagrant" ];
|
users = [ "vagrant" ];
|
||||||
groups = [ "vagrant" ];
|
groups = [ "vagrant" ];
|
||||||
commands = [
|
commands = [
|
||||||
{ command = "ALL"; options = [ "NOPASSWD" ]; }
|
{
|
||||||
|
command = "ALL";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
nixstable.url = "github:nixos/nixpkgs/nixos-24.05";
|
nixstable.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixstable, self, ... }@inputs:
|
outputs =
|
||||||
|
{ nixstable, self, ... }@inputs:
|
||||||
{
|
{
|
||||||
nixosConfigurations.vagrant = nixstable.lib.nixosSystem {
|
nixosConfigurations.vagrant = nixstable.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
ga-qemu.nix
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.qemuGuest.enable = true;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
virtualisation.hypervGuest.enable = true;
|
virtualisation.hypervGuest.enable = true;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
virtualisation.virtualbox.guest = {
|
virtualisation.virtualbox.guest = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{...}:
|
{ ... }:
|
||||||
{
|
{
|
||||||
services.qemuGuest.enable = true;
|
services.qemuGuest.enable = true;
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "23.05";
|
version = "23.05";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "23.11";
|
version = "23.11";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "24.05";
|
version = "24.05";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "15.5";
|
version = "15.5";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "15.6";
|
version = "15.6";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "16.0";
|
version = "16.0";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true; # Not yet released, and bugged at the moment
|
eol = true; # Not yet released, and bugged at the moment
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "tumbleweed";
|
version = "tumbleweed";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "8";
|
version = "8";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "9";
|
version = "9";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,25 +1,32 @@
|
|||||||
[ {
|
[
|
||||||
|
{
|
||||||
version = "18.04";
|
version = "18.04";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "20.04";
|
version = "20.04";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "22.04";
|
version = "22.04";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "23.10";
|
version = "23.10";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = true;
|
eol = true;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "24.04";
|
version = "24.04";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
version = "24.10";
|
version = "24.10";
|
||||||
arch = "amd64";
|
arch = "amd64";
|
||||||
eol = false;
|
eol = false;
|
||||||
} ]
|
}
|
||||||
|
]
|
||||||
|
|||||||
Generated
+1
-52
@@ -37,21 +37,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-root": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1713493429,
|
|
||||||
"narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=",
|
|
||||||
"owner": "srid",
|
|
||||||
"repo": "flake-root",
|
|
||||||
"rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "srid",
|
|
||||||
"repo": "flake-root",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
@@ -114,22 +99,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1708475490,
|
|
||||||
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "0e74ca98a74bc7270d28838369593635a5db3260",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"process-compose": {
|
"process-compose": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718031437,
|
"lastModified": 1718031437,
|
||||||
@@ -149,10 +118,8 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell": "devshell",
|
"devshell": "devshell",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-root": "flake-root",
|
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"process-compose": "process-compose",
|
"process-compose": "process-compose"
|
||||||
"treefmt-nix": "treefmt-nix"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
@@ -169,24 +136,6 @@
|
|||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"treefmt-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs_3"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1718522839,
|
|
||||||
"narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
devshell.url = "github:numtide/devshell";
|
devshell.url = "github:numtide/devshell";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-root.url = "github:srid/flake-root";
|
|
||||||
process-compose.url = "github:Platonic-Systems/process-compose-flake";
|
process-compose.url = "github:Platonic-Systems/process-compose-flake";
|
||||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { devshell, flake-parts, flake-root, process-compose, treefmt-nix, nixpkgs, ... }@inputs: let
|
outputs =
|
||||||
|
{ flake-parts, nixpkgs, ... }@inputs:
|
||||||
|
let
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
providers = [
|
providers = [
|
||||||
"qemu"
|
"qemu"
|
||||||
@@ -19,14 +19,17 @@
|
|||||||
];
|
];
|
||||||
distros = import ./distros;
|
distros = import ./distros;
|
||||||
# Inserts the distro name into each element in the list
|
# Inserts the distro name into each element in the list
|
||||||
insertNames = lib.attrsets.mapAttrsToList (distro: val: (builtins.map (x: x // { inherit distro; }) val)) distros;
|
insertNames = lib.attrsets.mapAttrsToList (
|
||||||
|
distro: val: (builtins.map (x: x // { inherit distro; }) val)
|
||||||
|
) distros;
|
||||||
# Flattens all the distros into a single list
|
# Flattens all the distros into a single list
|
||||||
flat = lib.lists.flatten insertNames;
|
flat = lib.lists.flatten insertNames;
|
||||||
# Combines providers list with flattened list
|
# Combines providers list with flattened list
|
||||||
withProviders = lib.attrsets.mapCartesianProduct
|
withProviders = lib.attrsets.mapCartesianProduct ({ d, provider }: d // { inherit provider; }) {
|
||||||
({d, provider}: d // { inherit provider; })
|
d = flat;
|
||||||
{ d = flat; provider = providers; };
|
provider = providers;
|
||||||
active = builtins.filter (x: (x?eol) && (!x.eol)) withProviders;
|
};
|
||||||
|
active = builtins.filter (x: (x ? eol) && (!x.eol)) withProviders;
|
||||||
name = d: "-${d.distro}-${d.arch}-${d.provider}-${d.version}";
|
name = d: "-${d.distro}-${d.arch}-${d.provider}-${d.version}";
|
||||||
distroFile = d: "distros/${d.distro}/${d.version}/${d.arch}.pkrvars.hcl";
|
distroFile = d: "distros/${d.distro}/${d.version}/${d.arch}.pkrvars.hcl";
|
||||||
cmd = d: ''
|
cmd = d: ''
|
||||||
@@ -36,8 +39,8 @@
|
|||||||
fi
|
fi
|
||||||
packer init sources
|
packer init sources
|
||||||
packer build -only=${d.provider}.${d.arch} -var-file=${distroFile d}'';
|
packer build -only=${d.provider}.${d.arch} -var-file=${distroFile d}'';
|
||||||
in flake-parts.lib.mkFlake { inherit inputs; }
|
in
|
||||||
{
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.devshell.flakeModule
|
inputs.devshell.flakeModule
|
||||||
inputs.flake-root.flakeModule
|
inputs.flake-root.flakeModule
|
||||||
@@ -50,7 +53,13 @@
|
|||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
];
|
];
|
||||||
perSystem = { config, pkgs, self', system, ... }:
|
perSystem =
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
self',
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}@inputs':
|
||||||
{
|
{
|
||||||
_module.args.pkgs = import inputs.nixpkgs {
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
@@ -60,41 +69,57 @@
|
|||||||
devshells.default = {
|
devshells.default = {
|
||||||
# These commands will be shown in the motd that users read
|
# These commands will be shown in the motd that users read
|
||||||
# upon entering the shell
|
# upon entering the shell
|
||||||
commands = [ {
|
commands =
|
||||||
|
[
|
||||||
|
{
|
||||||
package = self'.packages.cache;
|
package = self'.packages.cache;
|
||||||
category = "utils";
|
category = "utils";
|
||||||
help = "Downloads ISO files and adds them to the S3 bucket";
|
help = "Downloads ISO files and adds them to the S3 bucket";
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
package = self'.packages.generate;
|
package = self'.packages.generate;
|
||||||
category = "utils";
|
category = "utils";
|
||||||
help = "Generate dynamic HCL files";
|
help = "Generate dynamic HCL files";
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
package = self'.packages.shellcheck;
|
package = self'.packages.shellcheck;
|
||||||
category = "utils";
|
category = "utils";
|
||||||
help = "Run shellchecks";
|
help = "Run shellchecks";
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
package = self'.packages.validate;
|
package = self'.packages.validate;
|
||||||
category = "utils";
|
category = "utils";
|
||||||
help = "Validate all the files";
|
help = "Validate all the files";
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
package = pkgs.vagrant;
|
package = pkgs.vagrant;
|
||||||
category = "utils";
|
category = "utils";
|
||||||
help = "Vagrant to help with testing";
|
help = "Vagrant to help with testing";
|
||||||
} ] ++ (builtins.map (d: { package = self'.packages."build${name d}"; category = "builds"; }) withProviders);
|
}
|
||||||
env = [{
|
]
|
||||||
|
++ (builtins.map (d: {
|
||||||
|
package = self'.packages."build${name d}";
|
||||||
|
category = "builds";
|
||||||
|
}) withProviders);
|
||||||
|
env = [
|
||||||
|
{
|
||||||
name = "EFI_DIR";
|
name = "EFI_DIR";
|
||||||
value = "${pkgs.OVMF.fd}/FV/";
|
value = "${pkgs.OVMF.fd}/FV/";
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
name = "PACKER_CONFIG_DIR";
|
name = "PACKER_CONFIG_DIR";
|
||||||
value = "./packer_config";
|
value = "./packer_config";
|
||||||
} {
|
}
|
||||||
|
{
|
||||||
name = "STORAGE_URL";
|
name = "STORAGE_URL";
|
||||||
value = "http://s3.thehellings.lan:9000";
|
value = "http://s3.thehellings.lan:9000";
|
||||||
} ];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is not special, this is just flakes
|
# This is not special, this is just flakes
|
||||||
packages = let
|
packages =
|
||||||
|
let
|
||||||
base = {
|
base = {
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
cdrtools
|
cdrtools
|
||||||
@@ -105,46 +130,92 @@
|
|||||||
xorriso
|
xorriso
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
build = d: let
|
build =
|
||||||
vp = x: if x.provider == "qemu" then "libvirt"
|
d:
|
||||||
else if x.provider == "virtualbox-iso" then "virtualbox"
|
let
|
||||||
else if x.provider == "hyperv-iso" then "hyperv"
|
vp =
|
||||||
else "unknown";
|
x:
|
||||||
in pkgs.writeShellApplication (base // {
|
if x.provider == "qemu" then
|
||||||
|
"libvirt"
|
||||||
|
else if x.provider == "virtualbox-iso" then
|
||||||
|
"virtualbox"
|
||||||
|
else if x.provider == "hyperv-iso" then
|
||||||
|
"hyperv"
|
||||||
|
else
|
||||||
|
"unknown";
|
||||||
|
in
|
||||||
|
pkgs.writeShellApplication (
|
||||||
|
base
|
||||||
|
// {
|
||||||
name = "build${name d}";
|
name = "build${name d}";
|
||||||
text = ''
|
text = ''
|
||||||
set -x
|
set -x
|
||||||
${cmd d} -except=upload -var headless=false sources/
|
${cmd d} -except=upload -var headless=false sources/
|
||||||
vagrant box add --provider ${vp d} ./output/${vp d}/${d.distro}-${d.version}.box --name test_box --force
|
vagrant box add --provider ${vp d} ./output/${vp d}/${d.distro}-${d.version}.box --name test_box --force
|
||||||
'';
|
'';
|
||||||
});
|
}
|
||||||
cibuild = d: pkgs.writeShellApplication (base // {
|
);
|
||||||
|
cibuild =
|
||||||
|
d:
|
||||||
|
pkgs.writeShellApplication (
|
||||||
|
base
|
||||||
|
// {
|
||||||
name = "ci${name d}";
|
name = "ci${name d}";
|
||||||
text = ''
|
text = ''
|
||||||
set -x
|
set -x
|
||||||
${cmd d} -except=upload sources/
|
${cmd d} -except=upload sources/
|
||||||
'';
|
'';
|
||||||
});
|
}
|
||||||
upload = d: pkgs.writeShellApplication (base // {
|
);
|
||||||
|
upload =
|
||||||
|
d:
|
||||||
|
pkgs.writeShellApplication (
|
||||||
|
base
|
||||||
|
// {
|
||||||
name = "upload${name d}";
|
name = "upload${name d}";
|
||||||
text = ''
|
text = ''
|
||||||
set -x
|
set -x
|
||||||
${cmd d} sources/
|
${cmd d} sources/
|
||||||
'';
|
'';
|
||||||
});
|
}
|
||||||
builds = lib.lists.foldr (d: acc: acc // { "build${name d}" = (build d); }) {} withProviders;
|
);
|
||||||
uploads = lib.lists.foldr (d: acc: acc // { "upload${name d}" = (upload d); }) {} withProviders;
|
builds = lib.lists.foldr (d: acc: acc // { "build${name d}" = (build d); }) { } withProviders;
|
||||||
cibuilds = lib.lists.foldr (d: acc: acc // { "ci${name d}" = (cibuild d); }) {} withProviders;
|
uploads = lib.lists.foldr (d: acc: acc // { "upload${name d}" = (upload d); }) { } withProviders;
|
||||||
qemu_list = builtins.toJSON (builtins.map (d: { buildcmd = (name d); }) (builtins.filter (x: x.provider == "qemu") active));
|
cibuilds = lib.lists.foldr (d: acc: acc // { "ci${name d}" = (cibuild d); }) { } withProviders;
|
||||||
vbox_list = builtins.toJSON (builtins.map (d: { buildcmd = (name d); }) (builtins.filter (x: x.provider == "virtualbox-iso") active));
|
qemu_list = builtins.toJSON (
|
||||||
hyperv_list = builtins.toJSON (builtins.map (d: { distro = distroFile d; }) (builtins.filter (x: x.provider == "hyperv-iso") active));
|
builtins.map (d: { buildcmd = (name d); }) (builtins.filter (x: x.provider == "qemu") active)
|
||||||
in builds // uploads // cibuilds // {
|
);
|
||||||
continue = pkgs.writeText "continue.yml"
|
vbox_list = builtins.toJSON (
|
||||||
(builtins.replaceStrings ["QEMU_MATRIX" "VBOX_MATRIX" "HYPERV_MATRIX"] [qemu_list vbox_list hyperv_list]
|
builtins.map (d: { buildcmd = (name d); }) (
|
||||||
|
builtins.filter (x: x.provider == "virtualbox-iso") active
|
||||||
|
)
|
||||||
|
);
|
||||||
|
hyperv_list = builtins.toJSON (
|
||||||
|
builtins.map (d: { distro = distroFile d; }) (
|
||||||
|
builtins.filter (x: x.provider == "hyperv-iso") active
|
||||||
|
)
|
||||||
|
);
|
||||||
|
in
|
||||||
|
builds
|
||||||
|
// uploads
|
||||||
|
// cibuilds
|
||||||
|
// {
|
||||||
|
continue = pkgs.writeText "continue.yml" (
|
||||||
|
builtins.replaceStrings
|
||||||
|
[
|
||||||
|
"QEMU_MATRIX"
|
||||||
|
"VBOX_MATRIX"
|
||||||
|
"HYPERV_MATRIX"
|
||||||
|
]
|
||||||
|
[
|
||||||
|
qemu_list
|
||||||
|
vbox_list
|
||||||
|
hyperv_list
|
||||||
|
]
|
||||||
(builtins.readFile ./.gitlab-ci-build.yml.in)
|
(builtins.readFile ./.gitlab-ci-build.yml.in)
|
||||||
);
|
);
|
||||||
cache = pkgs.callPackage (import ./nix/cache.nix) { inherit active distroFile; };
|
cache = pkgs.callPackage (import ./nix/cache.nix) { inherit active distroFile; };
|
||||||
validate = pkgs.callPackage (import ./nix/validate.nix) {};
|
validate = pkgs.callPackage (import ./nix/validate.nix) { };
|
||||||
cache-restore = pkgs.writeShellApplication {
|
cache-restore = pkgs.writeShellApplication {
|
||||||
name = "cache-restore";
|
name = "cache-restore";
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
@@ -188,16 +259,21 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://numtide.github.io/treefmt/
|
checks = {
|
||||||
treefmt.config = {
|
pre-commit = inputs.hooks.lib.${inputs'.system}.run {
|
||||||
inherit (config.flake-root) projectRootFile;
|
src = ./.;
|
||||||
package = pkgs.treefmt;
|
hooks = {
|
||||||
|
check-added-large-files.enable = true;
|
||||||
programs = {
|
check-case-conflicts.enable = true;
|
||||||
|
check-merge-conflicts.enable = true;
|
||||||
|
check-symlinks.enable = true;
|
||||||
deadnix.enable = true;
|
deadnix.enable = true;
|
||||||
|
end-of-file-fixer.enable = true;
|
||||||
|
fix-byte-order-marker.enable = true;
|
||||||
|
mixed-line-endings.enable = true;
|
||||||
|
nixfmt-rfc-style.enable = true;
|
||||||
|
trim-trailing-whitespace.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
settings.formatter = {
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+6
-3
@@ -12,20 +12,23 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
inherit (builtins) concatStringsSep map;
|
inherit (builtins) concatStringsSep map;
|
||||||
in writeShellApplication {
|
in
|
||||||
|
writeShellApplication {
|
||||||
name = "cache-isos";
|
name = "cache-isos";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
curl
|
curl
|
||||||
minio-client
|
minio-client
|
||||||
packer
|
packer
|
||||||
];
|
];
|
||||||
text = ''
|
text =
|
||||||
|
''
|
||||||
push="''${1:-yes}"
|
push="''${1:-yes}"
|
||||||
if [ "$push" == "yes" ]; then
|
if [ "$push" == "yes" ]; then
|
||||||
mc alias set storage "$STORAGE_URL" root "$MINIO_SECRET"
|
mc alias set storage "$STORAGE_URL" root "$MINIO_SECRET"
|
||||||
fi
|
fi
|
||||||
mkdir -p cache
|
mkdir -p cache
|
||||||
'' + (concatStringsSep "\n" (
|
''
|
||||||
|
+ (concatStringsSep "\n" (
|
||||||
map (d: ''
|
map (d: ''
|
||||||
url=$(echo var.iso.url | packer console -var-file="${distroFile d}" -config-type=hcl2 sources/)
|
url=$(echo var.iso.url | packer console -var-file="${distroFile d}" -config-type=hcl2 sources/)
|
||||||
sha=$(echo var.iso.checksum | packer console -var-file="${distroFile d}" -config-type=hcl2 sources/)
|
sha=$(echo var.iso.checksum | packer console -var-file="${distroFile d}" -config-type=hcl2 sources/)
|
||||||
|
|||||||
Reference in New Issue
Block a user