Compare commits

...

2 Commits

Author SHA1 Message Date
Felix Albrigtsen 3a6b6cfdb7 flake: Make openstack-image EFI 2024-09-15 02:47:49 +02:00
Felix Albrigtsen 871a24947c flake: Add openstack image generator 2024-09-15 02:45:33 +02:00
2 changed files with 75 additions and 1 deletions

View File

@ -156,6 +156,42 @@
"url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git" "url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git"
} }
}, },
"nixlib": {
"locked": {
"lastModified": 1725757153,
"narHash": "sha256-c1a6iLmCVPFI9EUVMrBN8xdmFxFXEjcVwiTSVmqajOs=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "68584f89dd0eb16fea5d80ae127f3f681f6a5df7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1726102718,
"narHash": "sha256-u89QyfjtXryLHrO3Wre4kuWK5KDKiXe8lgRi6+cUOEw=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "5ae384b83b91080f0fead6bc1add1cff8277cb3f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1725198597, "lastModified": 1725198597,
@ -250,6 +286,7 @@
"matrix-next": "matrix-next", "matrix-next": "matrix-next",
"minecraft-data": "minecraft-data", "minecraft-data": "minecraft-data",
"nix-gitea-themes": "nix-gitea-themes", "nix-gitea-themes": "nix-gitea-themes",
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"pvv-calendar-bot": "pvv-calendar-bot", "pvv-calendar-bot": "pvv-calendar-bot",

View File

@ -29,9 +29,12 @@
grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs"; grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs";
minecraft-data.url = "git+https://git.pvv.ntnu.no/Drift/minecraft-data.git"; minecraft-data.url = "git+https://git.pvv.ntnu.no/Drift/minecraft-data.git";
nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, nixos-generators, ... }@inputs:
let let
nixlib = nixpkgs.lib; nixlib = nixpkgs.lib;
systems = [ systems = [
@ -149,6 +152,40 @@
simplesamlphp = pkgs.callPackage ./packages/simplesamlphp { }; simplesamlphp = pkgs.callPackage ./packages/simplesamlphp { };
openstack-image = nixos-generators.nixosGenerate {
system = "x86_64-linux";
format = "openstack";
modules = [
({config, lib, pkgs, modulesPath, ... }: {
system.build.openstackImage = lib.mkForce (import "${modulesPath}/../lib/make-disk-image.nix" {
inherit config lib pkgs;
additionalSpace = "1024M";
copyChannel = true;
diskSize = "auto";
format = "raw";
partitionTableType = "efi";
configFile = pkgs.writeText "configuration.nix"
''
{
imports = [ <nixpkgs/nixos/modules/virtualisation/openstack-config.nix> ];
}
'';
});
boot.loader.grub = lib.mkForce {
device = "nodev";
efiSupport = true;
efiInstallAsRemovable = true;
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
})
];
};
} // } //
(nixlib.pipe null [ (nixlib.pipe null [
(_: pkgs.callPackage ./packages/mediawiki-extensions { }) (_: pkgs.callPackage ./packages/mediawiki-extensions { })