Files
nixos/flake.nix
T

114 lines
2.7 KiB
Nix
Raw Normal View History

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 = {
2022-10-17 10:46:50 -05:00
stable.url = "github:nixos/nixpkgs/nixos-22.05";
2022-04-29 10:58:31 -05:00
nixunstable.url = "github:nixos/nixpkgs/nixos-unstable";
2022-04-17 22:29:13 -05:00
agenix.url = "github:ryantm/agenix";
2022-04-18 11:38:06 -05:00
home-manager = {
2022-06-02 08:20:45 -05:00
url = "github:nix-community/home-manager/release-22.05";
2022-10-17 10:46:50 -05:00
inputs.nixpkgs.follows = "stable";
2022-04-18 11:38:06 -05:00
};
2022-09-06 11:41:09 -05:00
darwin = {
url = "github:lnl7/nix-darwin/master";
2022-09-07 20:01:51 -05:00
inputs.nixpkgs.follows = "nixunstable";
2022-09-06 11:41:09 -05:00
};
2022-08-02 01:50:50 -05:00
nurpkgs.url = "github:nix-community/NUR";
2022-04-17 22:29:13 -05:00
};
2022-10-17 10:46:50 -05:00
outputs = {stable, nixunstable, agenix, home-manager, nurpkgs, self, ...}@inputs:
2022-04-17 22:29:13 -05:00
let
2022-05-04 13:52:38 -05:00
local_overlay = import ./overlays;
2022-09-09 14:19:12 -05:00
overlays = [
2022-10-17 10:46:50 -05:00
agenix.overlay
2022-09-09 14:19:12 -05:00
local_overlay
nurpkgs.overlay
];
2022-04-20 03:04:30 +00:00
2022-09-06 11:41:09 -05:00
darwinMods = hostname: [
2022-10-17 10:46:50 -05:00
{ stable.overlays = overlays; }
2022-09-06 11:41:09 -05:00
inputs.agenix.nixosModule
2022-09-07 20:01:51 -05:00
./modules-all
./modules-darwin
2022-09-06 11:41:09 -05:00
./hosts/${hostname}
];
2022-10-17 10:46:50 -05:00
machine = {
system ? "x86_64-linux",
name,
channel ? stable
}:
let
nixpkgs = channel;
in nixpkgs.lib.nixosSystem {
inherit system;
modules = [
{ nixpkgs.overlays = overlays; }
agenix.nixosModule
./modules-all
./modules-linux
./hosts/${name}
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit nixpkgs;
};
}
];
2022-05-20 10:12:40 -05:00
specialArgs = {
home-manager = inputs.home-manager;
2022-10-17 10:46:50 -05:00
inherit nixpkgs;
2022-05-20 10:12:40 -05:00
};
};
2022-04-17 22:29:13 -05:00
in {
nixosConfigurations = {
2022-10-17 10:46:50 -05:00
"2maccabees" = machine {
system = "aarch64-linux";
name = "2maccabees";
channel = nixunstable;
};
2022-04-19 17:27:40 +00:00
2022-04-21 12:42:42 +00:00
2022-10-17 10:46:50 -05:00
jude = machine {
name = "jude";
channel = nixunstable;
};
2022-04-27 11:23:11 -05:00
2022-10-17 10:46:50 -05:00
"linode" = machine { name = "linode"; };
"lappy" = machine { name = "lappy"; };
"iso" = machine { name = "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-08-02 01:50:50 -05:00
homeConfigurations = (
import ./home {
2022-10-17 10:46:50 -05:00
inherit nixunstable agenix home-manager nurpkgs;
nixpkgs = nixunstable;
2022-08-02 01:50:50 -05:00
}
);
2022-08-02 01:57:50 -05:00
2022-10-17 11:13:57 -05:00
overlays.default = local_overlay;
2022-10-24 22:40:10 -05:00
modules = stable.lib.foldr (a: b: a ++ b) [
2022-10-24 22:32:13 -05:00
(import ./modules-all)
(import ./modules-linux)
(import ./modules-darwin)
2022-09-09 13:30:12 -05:00
];
2022-10-17 10:46:50 -05:00
packages = import ./overlays/packages.nix { pkgs = stable; };
2022-04-17 22:29:13 -05:00
};
}