Files
nixos/flake.nix
T

113 lines
2.8 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-06-02 08:20:45 -05:00
nixpkgs.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-04-18 11:38:06 -05:00
inputs.nixpkgs.follows = "nixpkgs";
};
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-09-07 11:28:09 -05:00
outputs = {nixpkgs, 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 = [
local_overlay
nurpkgs.overlay
];
overlaid = system: import nixpkgs {
inherit overlays system;
};
2022-05-04 13:52:38 -05:00
2022-04-17 22:29:13 -05:00
mods = hostname: [
2022-09-09 14:19:12 -05:00
{ nixpkgs.overlays = overlays; }
2022-05-25 01:32:08 -05:00
agenix.nixosModule
2022-09-07 20:01:51 -05:00
./modules-all
./modules-linux
2022-04-17 22:29:13 -05:00
./hosts/${hostname}
2022-05-25 01:32:08 -05:00
home-manager.nixosModules.home-manager {
2022-04-18 11:38:06 -05:00
home-manager.useGlobalPkgs = true;
2022-05-25 01:32:08 -05:00
home-manager.useUserPackages = true;
2022-04-29 10:58:31 -05:00
home-manager.extraSpecialArgs = {
2022-05-25 01:32:08 -05:00
inherit nixunstable;
2022-04-29 10:58:31 -05:00
};
2022-04-18 11:38:06 -05:00
}
2022-04-17 22:29:13 -05:00
];
2022-04-18 11:38:06 -05:00
2022-05-25 01:32:08 -05:00
machine = system: name: nixpkgs.lib.nixosSystem {
inherit system;
2022-04-20 03:04:30 +00:00
specialArgs = inputs;
modules = mods name;
};
2022-09-06 11:41:09 -05:00
darwinMods = hostname: [
2022-09-09 14:19:12 -05:00
{ nixpkgs.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-05-20 10:12:40 -05:00
unstableMachine = system: name: inputs.nixunstable.lib.nixosSystem {
system = system;
modules = mods name;
specialArgs = {
nixpkgs = inputs.nixunstable;
nixunstable = inputs.nixunstable;
agenix = inputs.agenix;
home-manager = inputs.home-manager;
nur = inputs.nur;
};
};
2022-04-17 22:29:13 -05:00
in {
nixosConfigurations = {
2022-05-20 10:12:40 -05:00
"2maccabees" = unstableMachine "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
2022-04-27 11:23:11 -05:00
"jude" = machine "x86_64-linux" "jude";
2022-08-13 00:17:46 -05:00
"lappy" = machine "x86_64-linux" "lappy";
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-08-02 01:50:50 -05:00
homeConfigurations = (
import ./home {
inherit nixpkgs nixunstable agenix home-manager nurpkgs;
}
);
2022-08-02 01:57:50 -05:00
2022-09-09 14:19:12 -05:00
overlays = local_overlay;
2022-09-09 13:30:12 -05:00
modules = import [
./modules-all
./modules-linux
./modules-darwin
];
packages = import ./overlays/packages.nix { pkgs = nixpkgs; };
2022-04-17 22:29:13 -05:00
};
}