2022-04-17 22:29:13 -05:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
{
|
|
|
|
|
|
description = "Greg's machines!";
|
|
|
|
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
|
|
|
|
|
|
agenix.url = "github:ryantm/agenix";
|
2022-04-18 11:38:06 -05:00
|
|
|
|
home-manager = {
|
|
|
|
|
|
url = "github:nix-community/home-manager/release-21.11";
|
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
};
|
2022-09-06 11:41:09 -05:00
|
|
|
|
darwin = {
|
|
|
|
|
|
url = "github:lnl7/nix-darwin/master";
|
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
};
|
2022-04-17 22:29:13 -05:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
outputs = inputs:
|
|
|
|
|
|
let
|
|
|
|
|
|
mods = hostname: [
|
|
|
|
|
|
inputs.agenix.nixosModule
|
2022-04-20 11:11:35 -05:00
|
|
|
|
./modules
|
2022-09-06 11:41:09 -05:00
|
|
|
|
./profiles/linux
|
2022-04-17 22:29:13 -05:00
|
|
|
|
./hosts/${hostname}
|
2022-04-18 11:38:06 -05:00
|
|
|
|
inputs.home-manager.nixosModules.home-manager {
|
|
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
|
|
home-manager.users.greg = import ./home/home.nix "greg";
|
|
|
|
|
|
home-manager.users.root = import ./home/home.nix "root";
|
|
|
|
|
|
}
|
2022-04-17 22:29:13 -05:00
|
|
|
|
];
|
2022-04-18 11:38:06 -05:00
|
|
|
|
|
2022-04-20 03:04:30 +00:00
|
|
|
|
machine = system: name: inputs.nixpkgs.lib.nixosSystem {
|
|
|
|
|
|
system = system;
|
|
|
|
|
|
specialArgs = inputs;
|
|
|
|
|
|
modules = mods name;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-09-06 11:41:09 -05:00
|
|
|
|
darwinMods = hostname: [
|
|
|
|
|
|
inputs.agenix.nixosModule
|
|
|
|
|
|
./profiles/darwin
|
|
|
|
|
|
./hosts/${hostname}
|
|
|
|
|
|
];
|
|
|
|
|
|
|
2022-04-17 22:29:13 -05:00
|
|
|
|
in {
|
|
|
|
|
|
nixosConfigurations = {
|
2022-04-20 03:04:30 +00:00
|
|
|
|
"2maccabees" = machine "aarch64-linux" "2maccabees";
|
2022-04-19 17:27:40 +00:00
|
|
|
|
|
2022-04-20 03:04:30 +00:00
|
|
|
|
"linode" = machine "x86_64-linux" "linode";
|
2022-04-21 12:42:42 +00:00
|
|
|
|
|
|
|
|
|
|
"iso" = machine "x86_64-linux" "iso";
|
2022-04-17 22:29:13 -05:00
|
|
|
|
};
|
2022-04-21 12:42:42 +00:00
|
|
|
|
|
2022-09-06 11:41:09 -05:00
|
|
|
|
darwinConfigurations = {
|
|
|
|
|
|
"C02G48H8MD6R" = inputs.darwin.lib.darwinSystem {
|
|
|
|
|
|
system = "x86_64-darwin";
|
|
|
|
|
|
specialArgs = inputs;
|
|
|
|
|
|
modules = darwinMods "work";
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-04-21 12:42:42 +00:00
|
|
|
|
defaultPackage."x86_64-linux" = inputs.self.nixosConfigurations.iso.config.system.build.isoImage;
|
2022-09-06 11:41:09 -05:00
|
|
|
|
defaultPackage."x86_64-darwin" = inputs.self.darwinConfigurations.C02G48H8MD6R.system;
|
2022-04-17 22:29:13 -05:00
|
|
|
|
};
|
|
|
|
|
|
}
|