adding flake

This commit is contained in:
ediblerope 2026-03-28 11:52:19 +00:00 committed by GitHub
parent 9c2ca00bfe
commit 970b6e3b0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

51
flake.nix Normal file
View file

@ -0,0 +1,51 @@
# flake.nix — place this in the root of your nixos-config repo
{
description = "FredOS NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; # shares your nixpkgs, no double download
};
omnisearch = {
url = "git+https://git.bwaaa.monster/omnisearch/omnisearch";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak = {
url = "github:gmodena/nix-flatpak";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, omnisearch, zen-browser, nix-flatpak, ... } @ inputs:
let
system = "x86_64-linux";
# Helper so each host doesn't have to repeat the boilerplate
mkHost = hostname: nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; }; # makes 'inputs' available in all your .nix files
modules = [
./hosts/${hostname}.nix # your existing per-host file
./common.nix # your existing shared config
home-manager.nixosModules.homeManager
nix-flatpak.nixosModules.nix-flatpak
];
};
in {
nixosConfigurations = {
FredOS-Gaming = mkHost "FredOS-Gaming";
FredOS-Mediaserver = mkHost "FredOS-Mediaserver";
FredOS-Macbook = mkHost "FredOS-Macbook";
};
};
}