Archived
0
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
flake/flake.nix

163 lines
4.3 KiB
Nix

{
description = "The nix flake for all my systems";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
neovim.url = "github:neovim/neovim?dir=contrib";
neovim.inputs.nixpkgs.follows = "nixpkgs";
neovim.inputs.flake-utils.follows = "utils";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.inputs.utils.follows = "utils";
nur.url = "github:nix-community/NUR";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
nixos-wsl.url = "github:nix-community/nixos-wsl";
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
nixos-wsl.inputs.flake-utils.follows = "utils";
nix-on-droid.url = "github:t184256/nix-on-droid";
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
nix-on-droid.inputs.home-manager.follows = "home-manager";
nixos-hardware.url = "github:NixOS/nixos-hardware";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
utils,
home-manager,
neovim,
nur,
nixos-wsl,
nix-on-droid,
nixos-hardware,
agenix,
...
}: let
modules = {
home = {
common = [
./users/relms/base.nix
./users/relms/shell.nix
];
dev = [
./users/relms/dev.nix
];
gui = [
./users/relms/gui.nix
];
};
nixos = {
common = [
./common/personal.nix
./common/nix.nix
./devices/common-gpt.nix
];
common-mbr = [
./common/personal.nix
./common/nix.nix
./devices/common-mbr.nix
];
dev = [
./common/dev/podman.nix
];
services = {
common = [
./services/openssh.nix
];
};
desktops = {
common = [
./common/desktop/apps.nix
./common/desktop/media.nix
./common/desktop/xorg.nix
];
gnome = [
./common/desktop/gnome.nix
];
};
};
};
pkgsForSystem = system:
import nixpkgs {
overlays = [nur.overlay (utils.lib.genPkgOverlay neovim "neovim")];
inherit system;
};
in {
nixosConfigurations = {
skynet = nixpkgs.lib.nixosSystem {
pkgs = pkgsForSystem "x86_64-linux";
system = "x86_64-linux";
modules =
modules.nixos.common
++ modules.nixos.dev
++ modules.nixos.services.common
++ modules.nixos.desktops.common
++ modules.nixos.desktops.gnome
++ [
./common/desktop/drivers/skynet.nix
./devices/skynet/base.nix
./devices/skynet/hardware.nix
nixos-hardware.nixosModules.framework-12th-gen-intel
agenix.nixosModule
];
};
wsl = nixpkgs.lib.nixosSystem {
pkgs = pkgsForSystem "x86_64-linux";
system = "x86_64-linux";
modules = [
nixos-wsl.nixosModules.wsl
./common/personal.nix
./common/nix.nix
./devices/wsl/base.nix
];
};
crystal-gitlab = nixpkgs.lib.nixosSystem {
pkgs = pkgsForSystem "x86_64-linux";
system = "x86_64-linux";
modules =
modules.nixos.common-mbr
++ modules.nixos.services.common
++ [
agenix.nixosModule
./devices/crystal-gitlab/base.nix
./services/crystal/gitlab-runner.nix
];
};
};
homeConfigurations.relms = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsForSystem "x86_64-linux";
modules =
modules.home.common
++ modules.home.dev
++ modules.home.gui
++ [
{
home = {
homeDirectory = "/home/relms";
username = "relms";
};
}
];
};
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = pkgsForSystem "aarch64-linux";
system = "aarch64-linux";
modules = [./devices/pixel/base.nix];
};
formatter.aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.alejandra;
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
}