nixcfg/flake.nix

160 lines
4.1 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";
};
nixhw = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:alyraffauf/nixhw";
};
2024-07-06 19:58:17 -04:00
nur.url = "github:nix-community/NUR";
stylix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:danth/stylix";
};
};
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-05 22:41:27 -04:00
allSystems = [
"aarch64-linux"
2024-07-07 23:06:17 -04:00
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
2024-07-07 23:06:17 -04:00
];
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-05 22:41:27 -04:00
devShells = forAllSystems ({pkgs}: {
default = pkgs.mkShell {
packages =
(with pkgs; [
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
update-nix-fetchgit
])
++ [
self.formatter.${pkgs.system}
self.inputs.agenix.packages.${pkgs.system}.default
self.packages.${pkgs.system}.default
];
};
});
formatter = forAllSystems ({pkgs}: pkgs.alejandra);
2024-07-07 23:06:17 -04:00
2024-09-05 22:41:27 -04:00
packages = forAllSystems ({pkgs}: {
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/gui.nix self;
aly-nox = import ./homes/aly/nox.nix self;
dustin = import ./homes/dustin self;
morgan = import ./homes/morgan 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;
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
};
}