nixos-config/flake.nix

67 lines
2.2 KiB
Nix
Raw Normal View History

2023-06-16 23:08:03 +00:00
{
2023-06-16 23:14:12 +00:00
description = "Alex's super mega awesome nixos config";
2023-06-16 23:08:03 +00:00
2024-07-26 22:27:47 +00:00
# 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.
2023-06-16 23:46:10 +00:00
inputs = {
2024-01-20 00:24:06 +00:00
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
2023-06-19 00:06:52 +00:00
2024-07-26 22:27:47 +00:00
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";
};
2023-06-19 00:06:52 +00:00
2024-07-26 22:27:47 +00:00
atau-nixpkgs = {
url = "git+https://git.atauno.com/atau/atau-nixpkgs?ref=main&rev=1e72f4b1e9b7a2991e3ccdebbe75d312f016da3b";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-06-16 23:46:10 +00:00
};
2023-06-16 23:14:12 +00:00
2024-07-26 23:17:37 +00:00
outputs = { self, nixpkgs, home-manager, firefox-addons, ... }@flake-inputs:
2024-07-26 23:12:46 +00:00
let
pcUser = "alex";
pcSystem = "x86_64-linux";
2024-07-26 23:17:37 +00:00
# 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 {
2024-07-26 23:12:46 +00:00
inherit system;
modules = [
./config/hosts/${hostname}
] ++ (import ./config/modules/home-manager.nix {
inherit system inputs user;
}).modules;
};
in
2023-06-19 00:06:52 +00:00
{
2024-07-26 22:27:47 +00:00
nixosConfigurations = {
## ---- personal computers (linux) ----
2024-07-26 23:17:37 +00:00
nixos76 = mkPcSystem { hostname = "nixos76"; };
thelio76 = mkPcSystem { hostname = "thelio76"; };
2024-07-26 22:27:47 +00:00
## ---- servers ----
ursa-minor = nixpkgs.lib.nixosSystem {
2024-01-20 00:24:06 +00:00
system = "aarch64-linux";
modules = [
./ursa-minor/configuration.nix
];
};
2024-07-26 22:27:47 +00:00
ursa-major = nixpkgs.lib.nixosSystem {
2024-01-26 19:55:55 +00:00
system = "aarch64-linux";
modules = [
./ursa-major/configuration.nix
];
};
2024-07-26 22:27:47 +00:00
atauno = nixpkgs.lib.nixosSystem {
2024-02-04 19:17:33 +00:00
system = "aarch64-linux";
modules = [
./atauno/configuration.nix
];
};
2024-07-26 22:27:47 +00:00
};
2023-06-16 23:08:03 +00:00
};
}