Universe/flake.nix

88 lines
2.4 KiB
Nix
Raw Normal View History

# Universe - The big bang to my universe
#
# Copyright (c) 2023-2024 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2024-02-02 22:57:50 +00:00
{
description = "lxsameer's universe";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-02 22:57:50 +00:00
nixos-hardware.url = "github:nixos/nixos-hardware";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-02 22:57:50 +00:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
flake_utils.url = "github:numtide/flake-utils";
2024-02-02 22:57:50 +00:00
# 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, nixpkgs, ... } @ inputs:
2024-02-02 22:57:50 +00:00
let
# I just use linux and currently only x86_64
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
utils = pkgs.callPackage ./utils {};
modules = pkgs.callPackage ./modules { inherit (inputs) nixos-generators; };
2024-02-02 22:57:50 +00:00
nativeBuildInputs = with pkgs; [
qemu
fish
zstd
utils.scripts
sops
2024-02-02 22:57:50 +00:00
];
in rec{
inherit pkgs;
packages.${system} = {
majin = nixosConfigurations.majin.config.formats.iso;
boot-majin = utils.bootImage packages.${system}.majin;
inherit (utils) create-disk;
};
2024-02-02 22:57:50 +00:00
nixosConfigurations = {
majin = import ./worlds/majin.nix {
inherit nixpkgs inputs system;
mods = modules;
2024-02-02 22:57:50 +00:00
};
};
devShells.${system}.default = pkgs.mkShell {
inherit nativeBuildInputs;
shellHook = ''
fish && exit
'';
};
};
}