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";
|
|
|
|
nixpkgsUnstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
|
2024-07-06 13:58:52 -04:00
|
|
|
agenix.url = "github:ryantm/agenix";
|
|
|
|
disko.url = "github:nix-community/disko";
|
|
|
|
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
2024-05-28 23:16:12 -04:00
|
|
|
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
2024-07-06 13:58:52 -04:00
|
|
|
iio-hyprland.url = "github:JeanSchoeller/iio-hyprland";
|
2024-07-06 17:12:44 -04:00
|
|
|
nixhw.url = "github:alyraffauf/nixhw";
|
2024-07-06 13:58:52 -04:00
|
|
|
nixvim.url = "github:nix-community/nixvim/nixos-24.05";
|
2024-07-06 19:58:17 -04:00
|
|
|
nur.url = "github:nix-community/NUR";
|
2024-07-06 13:58:52 -04:00
|
|
|
raffauflabs.url = "github:alyraffauf/raffauflabs";
|
|
|
|
wallpapers.url = "github:alyraffauf/wallpapers";
|
|
|
|
|
|
|
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
iio-hyprland.inputs.nixpkgs.follows = "nixpkgs";
|
2024-07-06 17:12:44 -04:00
|
|
|
nixhw.inputs.nixpkgs.follows = "nixpkgs";
|
2024-07-06 13:58:52 -04:00
|
|
|
nixvim.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
raffauflabs.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
wallpapers.inputs.nixpkgs.follows = "nixpkgs";
|
2024-03-12 22:44:08 -04:00
|
|
|
};
|
2024-02-29 17:06:55 -05:00
|
|
|
|
2024-03-21 13:00:26 -04:00
|
|
|
nixConfig = {
|
2024-07-05 18:37:07 -04:00
|
|
|
extra-substituters = ["https://hyprland.cachix.org"];
|
2024-03-21 13:00:26 -04:00
|
|
|
extra-trusted-public-keys = [
|
2024-05-28 20:47:17 -04:00
|
|
|
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
2024-03-21 13:00:26 -04:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-05-24 09:37:37 -04:00
|
|
|
outputs = inputs @ {self, ...}: {
|
|
|
|
formatter = inputs.nixpkgs.lib.genAttrs [
|
|
|
|
"aarch64-darwin"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"x86_64-linux"
|
|
|
|
] (system: inputs.nixpkgs.legacyPackages.${system}.alejandra);
|
|
|
|
|
2024-05-28 20:39:40 -04:00
|
|
|
packages =
|
|
|
|
inputs.nixpkgs.lib.genAttrs [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
] (system: {
|
|
|
|
default = inputs.nixpkgs.legacyPackages."${system}".writeShellScriptBin "clean-install" ''
|
|
|
|
# Check if an argument is provided
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
echo "Error: Please provide a valid hostname as an argument."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
HOST=$1
|
|
|
|
FLAKE=github:alyraffauf/nixcfg#$HOST
|
|
|
|
|
|
|
|
echo "Warning: Running this script will wipe the currently installed system."
|
|
|
|
read -p "Do you want to continue? (y/n): " answer
|
|
|
|
|
|
|
|
if [ "$answer" != "y" ]; then
|
|
|
|
echo "Aborted."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo nix --experimental-features "nix-command flakes" run \
|
|
|
|
github:nix-community/disko -- --mode disko --flake $FLAKE
|
|
|
|
|
|
|
|
# Install NixOS with the updated flake input and root settings
|
|
|
|
sudo nixos-install --no-root-password --root /mnt --flake $FLAKE
|
|
|
|
'';
|
|
|
|
});
|
2024-05-25 19:48:54 -04:00
|
|
|
|
2024-07-07 21:07:35 -04:00
|
|
|
homeManagerModules = {
|
|
|
|
default = import ./homeManagerModules inputs self;
|
|
|
|
aly = import ./homes/aly inputs self;
|
|
|
|
dustin = import ./homes/dustin inputs self;
|
|
|
|
morgan = import ./homes/morgan inputs self;
|
|
|
|
};
|
2024-06-11 14:25:31 -04:00
|
|
|
|
2024-07-07 19:17:35 -04:00
|
|
|
nixosModules = {
|
|
|
|
base = import ./baseModules inputs;
|
|
|
|
nixos = import ./nixosModules inputs;
|
|
|
|
users = import ./userModules inputs;
|
|
|
|
};
|
2024-07-07 17:12:00 -04:00
|
|
|
|
2024-05-24 09:37:37 -04:00
|
|
|
nixosConfigurations =
|
|
|
|
inputs.nixpkgs.lib.genAttrs [
|
|
|
|
"fallarbor"
|
|
|
|
"lavaridge"
|
2024-06-14 14:05:59 -04:00
|
|
|
"mandarin"
|
2024-05-24 09:37:37 -04:00
|
|
|
"mauville"
|
|
|
|
"petalburg"
|
|
|
|
"rustboro"
|
|
|
|
] (
|
|
|
|
host:
|
|
|
|
inputs.nixpkgs.lib.nixosSystem {
|
|
|
|
specialArgs = {inherit inputs self;};
|
|
|
|
modules = [
|
|
|
|
./hosts/${host}
|
2024-06-09 00:08:00 -04:00
|
|
|
inputs.agenix.nixosModules.default
|
2024-06-14 19:06:08 -04:00
|
|
|
inputs.disko.nixosModules.disko
|
2024-06-26 22:13:02 -04:00
|
|
|
inputs.home-manager.nixosModules.home-manager
|
2024-06-23 00:10:30 -04:00
|
|
|
inputs.hyprland.nixosModules.default
|
2024-06-22 23:38:24 -04:00
|
|
|
inputs.nixvim.nixosModules.nixvim
|
2024-06-23 18:02:55 -04:00
|
|
|
inputs.nur.nixosModules.nur
|
2024-07-05 20:58:05 -04:00
|
|
|
inputs.raffauflabs.nixosModules.raffauflabs
|
2024-07-07 19:17:35 -04:00
|
|
|
self.nixosModules.base
|
2024-06-27 17:20:26 -04:00
|
|
|
self.nixosModules.nixos
|
2024-07-07 17:12:00 -04:00
|
|
|
self.nixosModules.users
|
2024-07-05 20:58:05 -04:00
|
|
|
|
2024-06-22 23:38:24 -04:00
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
backupFileExtension = "backup";
|
2024-07-06 00:35:45 -04:00
|
|
|
extraSpecialArgs = {inherit inputs self;};
|
2024-06-22 23:38:24 -04:00
|
|
|
|
|
|
|
sharedModules = [
|
|
|
|
inputs.agenix.homeManagerModules.default
|
2024-06-23 00:10:30 -04:00
|
|
|
inputs.hyprland.homeManagerModules.default
|
2024-06-22 23:38:24 -04:00
|
|
|
inputs.nixvim.homeManagerModules.nixvim
|
2024-06-23 18:02:55 -04:00
|
|
|
inputs.nur.hmModules.nur
|
2024-06-22 23:38:24 -04:00
|
|
|
self.homeManagerModules.default
|
|
|
|
];
|
|
|
|
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
|
|
|
};
|
|
|
|
}
|
2024-05-24 09:37:37 -04:00
|
|
|
];
|
|
|
|
}
|
|
|
|
);
|
2024-04-07 22:16:33 -04:00
|
|
|
};
|
2024-03-06 22:14:16 -05:00
|
|
|
}
|