nixos-config/flake.nix

69 lines
2.3 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 = {
2024-08-25 14:00:39 +00:00
url = "git+https://git.atauno.com/atau/atau-nixpkgs?ref=main&rev=751d0b3fd668981d3e69cf8f907a859659122074";
2024-07-26 22:27:47 +00:00
inputs.nixpkgs.follows = "nixpkgs";
};
2023-06-16 23:46:10 +00:00
};
2023-06-16 23:14:12 +00:00
2024-08-01 22:32:26 +00:00
outputs = { self, nixpkgs, home-manager, firefox-addons, atau-nixpkgs, ... }@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
overlays = [
atau-nixpkgs.overlays.default
(final: prev: {
2024-08-01 22:37:39 +00:00
firefox-addons = firefox-addons.packages.${pcSystem};
})
];
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, pkgs, ... }: { nixpkgs.overlays = overlays; })
2024-07-26 23:12:46 +00:00
./config/hosts/${hostname}
] ++ (import ./config/modules/home-manager.nix {
inherit system home-manager user;
2024-07-26 23:12:46 +00:00
}).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";
2024-07-27 14:00:53 +00:00
modules = [ ./config/hosts/ursa-minor ];
};
2024-07-26 22:27:47 +00:00
ursa-major = nixpkgs.lib.nixosSystem {
2024-01-26 19:55:55 +00:00
system = "aarch64-linux";
2024-07-27 14:00:53 +00:00
modules = [ ./config/hosts/ursa-major ];
2024-01-26 19:55:55 +00:00
};
2024-07-26 22:27:47 +00:00
atauno = nixpkgs.lib.nixosSystem {
2024-02-04 19:17:33 +00:00
system = "aarch64-linux";
2024-07-27 14:00:53 +00:00
modules = [ ./config/hosts/atauno ];
2024-02-04 19:17:33 +00:00
};
2024-07-26 22:27:47 +00:00
};
2023-06-16 23:08:03 +00:00
};
}