nixcfg/flake.nix

187 lines
5.3 KiB
Nix
Raw Normal View History

2024-02-29 17:06:55 -05:00
{
2024-03-13 14:17:21 -04:00
description = "Aly's NixOS flake.";
2024-02-29 17:06:55 -05:00
inputs = {
2024-06-22 23:38:24 -04:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
agenix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:ryantm/agenix";
};
disko = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/disko";
};
home-manager = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/home-manager/release-24.05";
};
2024-06-22 23:38:24 -04:00
iio-hyprland = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:JeanSchoeller/iio-hyprland";
};
lanzaboote = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/lanzaboote/v0.4.1";
};
2024-07-06 19:58:17 -04:00
nur.url = "github:nix-community/NUR";
stylix = {
inputs.nixpkgs.follows = "nixpkgs";
2024-09-17 18:25:23 -04:00
url = "github:danth/stylix/release-24.05";
};
wallpapers = {
url = "github:alyraffauf/wallpapers";
flake = false; # This is important to specify that it's a non-flake
};
};
2024-02-29 17:06:55 -05:00
nixConfig = {
accept-flake-config = true;
2024-07-08 17:54:12 -04:00
extra-substituters = [
"https://alyraffauf.cachix.org"
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
2024-07-08 17:54:12 -04:00
"alyraffauf.cachix.org-1:GQVrRGfjTtkPGS8M6y7Ik0z4zLt77O0N25ynv2gWzDM="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
outputs = {self, ...}: let
2024-09-08 20:33:10 -04:00
allLinuxSystems = [
"aarch64-linux"
2024-07-07 23:06:17 -04:00
"x86_64-linux"
2024-09-08 20:33:10 -04:00
];
allMacSystems = [
2024-07-07 23:06:17 -04:00
"aarch64-darwin"
"x86_64-darwin"
2024-07-07 23:06:17 -04:00
];
2024-09-08 20:33:10 -04:00
allSystems = allLinuxSystems ++ allMacSystems;
forAllLinuxSystems = f:
self.inputs.nixpkgs.lib.genAttrs allLinuxSystems (system:
f {
pkgs = import self.inputs.nixpkgs {inherit system;};
});
2024-09-05 22:41:27 -04:00
forAllSystems = f:
self.inputs.nixpkgs.lib.genAttrs allSystems (system:
f {
pkgs = import self.inputs.nixpkgs {inherit system;};
});
2024-07-07 23:06:17 -04:00
forAllHosts = self.inputs.nixpkgs.lib.genAttrs [
2024-07-07 23:06:17 -04:00
"fallarbor"
"lavaridge"
"mauville"
"petalburg"
"rustboro"
"slateport"
2024-07-07 23:06:17 -04:00
];
in {
2024-09-08 20:33:10 -04:00
devShells = forAllLinuxSystems ({pkgs}: {
2024-09-05 22:41:27 -04:00
default = pkgs.mkShell {
packages =
(with pkgs; [
e2fsprogs
2024-09-05 22:41:27 -04:00
git
mdformat
2024-09-05 22:58:21 -04:00
nh
2024-09-05 22:41:27 -04:00
ruby
2024-09-05 22:58:21 -04:00
sbctl
2024-09-05 22:41:27 -04:00
])
++ [
self.formatter.${pkgs.system}
self.inputs.agenix.packages.${pkgs.system}.default
self.packages.${pkgs.system}.default
];
2024-09-12 22:28:18 -04:00
shellHook = ''
export FLAKE="."
'';
2024-09-05 22:41:27 -04:00
};
});
formatter = forAllSystems ({pkgs}: pkgs.alejandra);
2024-07-07 23:06:17 -04:00
2024-09-08 20:33:10 -04:00
packages = forAllLinuxSystems ({pkgs}: {
2024-09-05 22:41:27 -04:00
default = pkgs.writeShellApplication {
name = "clean-install";
text = ./flake/clean-install.sh;
};
2024-07-07 23:06:17 -04:00
});
2024-05-25 19:48:54 -04:00
homeManagerModules = {
default = import ./homeManagerModules self;
aly = import ./homes/aly self;
dustin = import ./homes/dustin self;
};
2024-07-07 19:17:35 -04:00
nixosModules = {
common-auto-upgrade = import ./common/autoUpgrade.nix;
common-base = import ./common/base.nix;
common-locale = import ./common/locale.nix;
common-mauville-share = import ./common/samba.nix;
common-nix = import ./common/nix.nix;
common-overlays = import ./common/overlays.nix;
common-pkgs = import ./common/pkgs.nix;
common-tailscale = import ./common/tailscale.nix;
common-wifi-profiles = import ./common/wifi.nix;
hw-common-amd-cpu = import ./hwModules/common/gpu/amd;
hw-common-amd-gpu = import ./hwModules/common/cpu/amd;
hw-common-bluetooth = import ./hwModules/common/bluetooth;
hw-common-intel-cpu = import ./hwModules/common/cpu/intel;
hw-common-intel-gpu = import ./hwModules/common/gpu/intel;
hw-common-laptop = import ./hwModules/common/laptop;
hw-common-laptop-amd-gpu = import ./hwModules/common/laptop/amd-gpu.nix;
hw-common-laptop-intel-cpu = import ./hwModules/common/laptop/intel-cpu.nix;
hw-common-ssd = import ./hwModules/common/ssd;
hw-framework-13-amd-7000 = import ./hwModules/framework/13/amd-7000;
hw-framework-13-intel-11th = import ./hwModules/framework/13/intel-11th;
hw-lenovo-yoga-9i-intel-13th = import ./hwModules/lenovo/yoga-9i/intel-13th;
hw-thinkpad-t440p = import ./hwModules/thinkpad/t440p;
nixos = import ./nixosModules self;
users = import ./userModules self;
2024-07-07 19:17:35 -04:00
};
2024-07-07 23:06:17 -04:00
nixosConfigurations = forAllHosts (
host:
self.inputs.nixpkgs.lib.nixosSystem {
specialArgs = {inherit self;};
2024-07-07 23:06:17 -04:00
modules = [
./hosts/${host}
self.inputs.agenix.nixosModules.default
self.inputs.disko.nixosModules.disko
self.inputs.home-manager.nixosModules.home-manager
self.inputs.lanzaboote.nixosModules.lanzaboote
self.inputs.stylix.nixosModules.stylix
2024-07-07 23:06:17 -04:00
self.nixosModules.nixos
self.nixosModules.users
{
home-manager = {
backupFileExtension = "backup";
extraSpecialArgs = {inherit self;};
2024-07-07 23:06:17 -04:00
useGlobalPkgs = true;
useUserPackages = true;
};
}
];
}
);
2024-04-07 22:16:33 -04:00
};
}