nix/flake.nix

230 lines
6.9 KiB
Nix

{
description = "flake for nixos-pulse";
nixConfig = { };
inputs = {
systems = {
url = "github:nix-systems/x86_64-linux";
};
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable-small"; # TODO go back to non-small after nixpkgs#357837 lands
};
nixpkgs-stable = {
url = "github:NixOS/nixpkgs/nixos-24.05";
};
nixos-images = {
url = "github:nix-community/nixos-images";
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
inputs.flake-compat.follows = "flake-compat";
inputs.gitignore.follows = "gitignore";
};
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks";
inputs.flake-parts.follows = "flake-parts";
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
chaotic = {
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs.systems.follows = "systems";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay/7cd35bfbe2fbb2906bc85803eab0bdc499b6f253";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR";
};
nix-wallpaper = {
url = "github:lunik1/nix-wallpaper";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
nix-alien = {
url = "github:thiagokokada/nix-alien";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-index-database.follows = "nix-index-database";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
envfs = {
url = "github:Mic92/envfs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
nix-ld-rs = {
url = "github:nix-community/nix-ld-rs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
stylix = {
url = "github:danth/stylix";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
inputs.home-manager.follows = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
llama-cpp = {
url = "git+https://git.vlt81.de/tristan/llama.cpp.git";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
};
outputs =
{ self
, nixpkgs
, lanzaboote
, nixos-hardware
, lix-module
, home-manager
, plasma-manager
, emacs-overlay
, nur
, nix-index-database
, disko
, chaotic
, envfs
, llama-cpp
, stylix
, nix-wallpaper
, ...
} @ inputs:
let
system = "x86_64-linux";
my-overlay = final: prev: {
my = self.packages."${system}";
nix-wallpaper = nix-wallpaper.packages."${system}".default;
};
overlays = [
my-overlay
emacs-overlay.overlay
inputs.nix-alien.overlays.default
inputs.nix-ld-rs.overlays.default
];
config = {
allowUnfree = true;
permittedInsecurePackages = [
"jitsi-meet-1.0.8043"
# "olm-3.2.16"
];
};
pkgs = import nixpkgs {
inherit config system overlays;
};
lib = pkgs.lib;
hmModules = [
nix-index-database.hmModules.nix-index
nur.hmModules.nur
plasma-manager.homeManagerModules.plasma-manager
# stylix.homeManagerModules.stylix
];
osModules = [
lanzaboote.nixosModules.lanzaboote
lix-module.nixosModules.default
disko.nixosModules.disko
home-manager.nixosModules.home-manager
nix-index-database.nixosModules.nix-index
nur.nixosModules.nur
chaotic.nixosModules.default
envfs.nixosModules.envfs
stylix.nixosModules.stylix
];
args = {
inherit self inputs system;
};
in
{
formatter = {
${system} = pkgs.nixpkgs-fmt;
};
packages."${system}" = import ./pkgs { inherit pkgs lib; };
diskoConfigurations = {
nixos-desk = import ./systems/nixos-desk/disko.nix;
nixos-pulse = import ./systems/nixos-pulse/disko.nix;
nixos-he4 = import ./systems/nixos-he4/disko.nix;
};
# replace this with a auto-importing variant like the packages decl. above (instead of callPackage we just need to import the path)
nixosConfigurations = nixpkgs.lib.attrsets.mergeAttrsList (
nixpkgs.lib.lists.forEach [
"nixos-desk"
"nixos-pulse"
"nixos-fw16"
"rescue-iso"
]
(host: {
"${host}" = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = args;
modules =
[
./systems/${host}
{
nixpkgs = {
inherit config system overlays;
};
# nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = nixpkgs;
home-manager.sharedModules = hmModules;
home-manager.extraSpecialArgs = args;
}
]
++ osModules;
};
})
);
};
}