nixos-config/flake.nix

62 lines
2.2 KiB
Nix

{
description = "Alex's super mega awesome nixos config";
# A flake's inputs specify the dependencies that get pulled in. Each input is pinned to a specific version (the git commit) of that dependency.
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; # This flake also takes in nixpkgs as its own input, so we can override it here to ensure the same pkgs are used!
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
atau-nixpkgs = {
url = "git+https://git.atauno.com/atau/atau-nixpkgs?ref=main&rev=36c303d6a273cba06d68964c98aee0eb79928b2b";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, firefox-addons, atau-nixpkgs, ... }@flake-inputs:
let
pcUser = "alex";
pcSystem = "x86_64-linux";
# This helper function generates a nixos system for a linux PC setup. It defaults the username, architecture, and flake inputs if not provided.
mkPcSystem = { user ? pcUser, hostname, system ? pcSystem, inputs ? flake-inputs }: nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ atau-nixpkgs.overlays.default ]; })
./config/hosts/${hostname}
] ++ (import ./config/modules/home-manager.nix {
inherit system inputs user;
}).modules;
};
in
{
nixosConfigurations = {
## ---- personal computers (linux) ----
nixos76 = mkPcSystem { hostname = "nixos76"; };
thelio76 = mkPcSystem { hostname = "thelio76"; };
## ---- servers ----
ursa-minor = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [ ./config/hosts/ursa-minor ];
};
ursa-major = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [ ./config/hosts/ursa-major ];
};
atauno = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [ ./config/hosts/atauno ];
};
};
};
}