96 lines
2.3 KiB
Nix
96 lines
2.3 KiB
Nix
{
|
|
description = "lxsameer's universe";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
agenix = {
|
|
url = "github:ryantm/agenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
# TODO: Checkout hercules
|
|
# hercules-ci-agent.url = "github:hercules-ci/hercules-ci-agent";
|
|
# To build and android image
|
|
# robotnix.url = "github:danielfullmer/robotnix";
|
|
# impermanence.url = "github:nix-community/impermanence";
|
|
};
|
|
|
|
outputs = { self, home-manager, nixpkgs, agenix, nixos-hardware, utils } @ inputs:
|
|
let
|
|
# I just use linux and currently only x86_64
|
|
system = "x86_64-linux";
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
|
# Add a command to the shell to create the disk
|
|
create-disk = pkgs.writeScriptBin "create-disk" ''
|
|
#!${pkgs.stdenv.shell}
|
|
|
|
qemu-img create -f qcow2 vdisk1 10G
|
|
'';
|
|
|
|
|
|
scripts = pkgs.symlinkJoin {
|
|
name = "universe_scripts";
|
|
paths = [
|
|
create-disk
|
|
];
|
|
};
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
qemu
|
|
fish
|
|
zstd
|
|
scripts
|
|
];
|
|
|
|
in rec{
|
|
images = {
|
|
majin = (nixosConfigurations.majin.extendModules {
|
|
modules = [
|
|
"${pkgs}/nixos/modules/installer/sd-card/sd-image-x86_64.nix"
|
|
{
|
|
disabledModules = [ "profiles/base.nix" ];
|
|
}
|
|
];
|
|
}).config.system.build.sdImage;
|
|
};
|
|
|
|
packages.${system}.majin = images.majin;
|
|
|
|
|
|
nixosConfigurations = {
|
|
majin = pkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
"${pkgs}/nixos/modules/profiles/minimal.nix"
|
|
./worlds/majin/configuration.nix
|
|
home-manager.nixosModules.home-manager
|
|
agenix.nixosModules.age
|
|
./worlds/base.nix
|
|
#hercules-ci-agent.nixosModules.multi-agent-service
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
};
|
|
|
|
devShells.${system}.default = pkgs.mkShell {
|
|
inherit nativeBuildInputs;
|
|
|
|
shellHook = ''
|
|
fish && exit
|
|
'';
|
|
};
|
|
|
|
};
|
|
}
|