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-05-23 19:02:05 -04:00
|
|
|
# Latest stable NixOS release.
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
2024-03-05 17:54:51 -05:00
|
|
|
|
2024-05-23 19:02:05 -04:00
|
|
|
# Stable home-manager, synced with latest stable nixpkgs.
|
2024-04-18 14:21:33 -04:00
|
|
|
home-manager = {
|
2024-05-23 19:02:05 -04:00
|
|
|
url = "github:nix-community/home-manager/release-24.05";
|
2024-04-18 14:21:33 -04:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2024-03-02 13:09:35 -05:00
|
|
|
};
|
2024-03-05 17:54:51 -05:00
|
|
|
|
2024-05-23 19:02:05 -04:00
|
|
|
# Unstable NixOS.
|
2024-05-24 09:37:37 -04:00
|
|
|
nixpkgsUnstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
2024-05-23 19:02:05 -04:00
|
|
|
|
2024-05-24 09:37:37 -04:00
|
|
|
# Automated disk partitioning.
|
2024-04-18 14:21:33 -04:00
|
|
|
disko = {
|
|
|
|
url = "github:nix-community/disko";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-04-01 20:29:48 -04:00
|
|
|
|
2024-03-02 09:35:58 -05:00
|
|
|
# Pre-baked hardware support for various devices.
|
2024-02-29 17:06:55 -05:00
|
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
2024-04-26 17:54:51 -04:00
|
|
|
|
2024-05-24 09:37:37 -04:00
|
|
|
# Useful modules for Steam Deck.
|
2024-04-26 17:54:51 -04:00
|
|
|
jovian = {
|
|
|
|
url = "github:Jovian-Experiments/Jovian-NixOS";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-05-28 20:28:36 -04:00
|
|
|
|
|
|
|
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
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-05-05 22:00:46 -04:00
|
|
|
extra-substituters = ["https://nixcache.raffauflabs.com"];
|
2024-03-21 13:00:26 -04:00
|
|
|
extra-trusted-public-keys = [
|
|
|
|
"nixcache.raffauflabs.com:yFIuJde/izA4aUDI3MZmBLzynEsqVCT1OfCUghOLlt8="
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
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-25 19:48:54 -04:00
|
|
|
packages."x86_64-linux".default = inputs.nixpkgs.legacyPackages."x86_64-linux".writeShellScriptBin "clean-install" ''
|
|
|
|
# Check if an argument is provided
|
|
|
|
if [ $# -eq 0 ]; then
|
2024-05-26 14:47:42 -04:00
|
|
|
echo "Error: Please provide a valid hostname as an argument."
|
2024-05-25 19:48:54 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-05-26 14:47:42 -04:00
|
|
|
HOST=$1
|
|
|
|
FLAKE=github:alyraffauf/nixcfg#$HOST
|
2024-05-25 19:48:54 -04:00
|
|
|
|
|
|
|
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 \
|
2024-05-26 14:47:42 -04:00
|
|
|
github:nix-community/disko -- --mode disko --flake $FLAKE
|
2024-05-25 19:48:54 -04:00
|
|
|
|
|
|
|
# Install NixOS with the updated flake input and root settings
|
2024-05-26 14:47:42 -04:00
|
|
|
sudo nixos-install --no-root-password --root /mnt --flake $FLAKE
|
2024-05-26 03:43:18 -04:00
|
|
|
'';
|
2024-05-25 19:48:54 -04:00
|
|
|
|
2024-05-24 09:37:37 -04:00
|
|
|
nixosModules.default =
|
|
|
|
import ./nixosModules inputs;
|
|
|
|
|
|
|
|
nixosConfigurations =
|
|
|
|
inputs.nixpkgs.lib.genAttrs [
|
|
|
|
"fallarbor"
|
|
|
|
"lavaridge"
|
|
|
|
"mauville"
|
|
|
|
"mossdeep"
|
|
|
|
"petalburg"
|
|
|
|
"rustboro"
|
|
|
|
] (
|
|
|
|
host:
|
|
|
|
inputs.nixpkgs.lib.nixosSystem {
|
|
|
|
specialArgs = {inherit inputs self;};
|
|
|
|
modules = [
|
|
|
|
./hosts/${host}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
);
|
2024-04-07 22:16:33 -04:00
|
|
|
};
|
2024-03-06 22:14:16 -05:00
|
|
|
}
|