config/flake.nix

95 lines
3.2 KiB
Nix
Raw Normal View History

2023-03-09 08:33:38 +00:00
{
2023-04-02 18:01:14 +01:00
description = "Maddie's Nix configurations";
2023-03-09 08:33:38 +00:00
inputs = {
# Home manager
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2023-04-02 16:03:21 +01:00
darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
2023-03-09 08:33:38 +00:00
};
outputs = { self, nixpkgs, home-manager, darwin }:
2023-03-09 08:33:38 +00:00
let
2023-03-29 06:58:29 +01:00
username = "maddie";
2023-04-02 18:01:14 +01:00
utils = import ./utils nixpkgs;
nixpkgs_x86_64 = import nixpkgs {
config.allowUnfree = true;
config.allowUnsupportedSystem = false;
config.allowBroken = false;
2023-05-13 21:48:48 +01:00
config.permittedInsecurePackages = [
"libgcrypt-1.8.10"
];
2023-04-02 18:01:14 +01:00
overlays = import ./overlays.nix;
system = "x86_64-linux";
};
2023-05-13 21:48:48 +01:00
nixpkgs_aarch64_darwin = import nixpkgs {
2023-04-02 18:01:14 +01:00
config.allowUnfree = true;
config.allowUnsupportedSystem = false;
config.allowBroken = false;
overlays = import ./overlays.nix;
system = "aarch64-darwin";
};
2023-05-13 21:48:48 +01:00
nixpkgs_aarch64_linux = import nixpkgs {
config.allowUnfree = true;
config.allowUnsupportedSystem = false;
config.allowBroken = false;
overlays = import ./overlays.nix;
system = "aarch64-linux";
};
2023-03-09 08:33:38 +00:00
in
{
2023-05-13 21:48:48 +01:00
nixosConfigurations."MDesktop" = nixpkgs.lib.nixosSystem
{
2023-04-02 18:01:14 +01:00
specialArgs = { inherit username; };
pkgs = nixpkgs_x86_64;
2023-04-02 16:03:21 +01:00
system = "x86_64-linux";
2023-03-29 06:58:29 +01:00
modules = [
home-manager.nixosModules.home-manager
{
home-manager.users.${username}.imports = utils.nixFilesIn ./maddie/common ++ utils.nixFilesIn ./maddie/nixos;
2023-04-02 18:01:14 +01:00
home-manager.extraSpecialArgs = { inherit username; pkgs = nixpkgs_x86_64; };
2023-03-29 06:58:29 +01:00
}
2023-04-02 18:01:14 +01:00
] ++ utils.nixFilesIn ./systems/mdesktop;
2023-03-29 06:58:29 +01:00
};
2023-05-13 21:48:48 +01:00
nixosConfigurations."tau" = nixpkgs.lib.nixosSystem
{
specialArgs = { inherit username; };
pkgs = nixpkgs_aarch64_linux;
system = "aarch64-linux";
modules = [
home-manager.nixosModules.home-manager
{
home-manager.users.${username}.imports = utils.nixFilesIn ./maddie/common ++ utils.nixFilesIn ./maddie/nixos;
2023-05-13 21:48:48 +01:00
home-manager.extraSpecialArgs = { inherit username; pkgs = nixpkgs_aarch64_linux; };
}
] ++ utils.nixFilesIn ./systems/tau;
};
2023-04-02 18:01:14 +01:00
darwinConfigurations."MMacBookPro" = darwin.lib.darwinSystem
{
2023-05-13 21:48:48 +01:00
pkgs = nixpkgs_aarch64_darwin;
2023-04-02 18:01:14 +01:00
specialArgs = { inherit username; };
2023-04-02 16:03:21 +01:00
system = "aarch64-darwin";
2023-03-29 06:58:29 +01:00
modules = [
home-manager.darwinModules.home-manager
{
2023-04-02 16:03:21 +01:00
home-manager.useUserPackages = true;
home-manager.users.${username}.imports = utils.nixFilesIn ./maddie/common ++ utils.nixFilesIn ./maddie/macos;
2023-05-13 21:48:48 +01:00
home-manager.extraSpecialArgs = { inherit username; pkgs = nixpkgs_aarch64_darwin; };
2023-03-29 06:58:29 +01:00
}
2023-04-02 18:01:14 +01:00
] ++ utils.nixFilesIn ./systems/mmacbookpro;
2023-03-09 08:33:38 +00:00
};
2023-04-02 18:01:14 +01:00
formatter.x86_64-linux = nixpkgs_x86_64.legacyPackages.x86_64-linux.nixpkgs-fmt;
2023-05-13 21:48:48 +01:00
formatter.aarch64-darwin = nixpkgs_aarch64_darwin.legacyPackages.aarch64-darwin.nixpkgs-fmt;
formatter.aarch64-linux = nixpkgs_aarch64_linux.legacyPackages.aarch64-linux.nixpkgs-fmt;
2023-03-09 08:33:38 +00:00
};
}
2023-04-02 18:01:14 +01:00