Universe/flake.nix

100 lines
2.7 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/nixpkgs-unstable"; #442d407992384ed9c0e6d352de75b69079904e4e
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-20 20:18:59 +00:00
2024-02-02 22:57:50 +00:00
home-manager = {
url = "github:nix-community/home-manager/517601b37c6d495274454f63c5a483c8e3ca6be1";
2024-02-02 22:57:50 +00:00
inputs.nixpkgs.follows = "nixpkgs";
};
# fg42 = {
# type = "git";
# url = "git@git.devheroes.codes:FG42/FG42.git";
# ref = "v4";
# };
fg42.url = "/home/lxsameer/.fg42";
2024-02-20 20:18:59 +00:00
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 system pkgs;
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 pkgs;
mods = modules;
2024-02-02 22:57:50 +00:00
};
};
devShells.${system}.default = pkgs.mkShell {
inherit nativeBuildInputs;
shellHook = ''
fish && exit
'';
};
};
}