nix-config/flake.nix

83 lines
2.4 KiB
Nix
Raw Normal View History

2025-03-24 12:14:46 +01:00
{
description = "NixOS configuration of Ryan Yin";
##################################################################################################################
#
# Want to know Nix in details? Looking for a beginner-friendly tutorial?
# Check out https://github.com/ryan4yin/nixos-and-flakes-book !
#
##################################################################################################################
# the nixConfig here only affects the flake itself, not the system configuration!
nixConfig = {
# substituers will be appended to the default substituters when fetching packages
# nix com extra-substituters = [munity's cache server
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
2025-03-26 14:36:56 +01:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
2025-03-25 01:59:21 +01:00
hyprland.url = "github:hyprwm/Hyprland";
2025-03-24 12:14:46 +01:00
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2025-03-25 01:59:21 +01:00
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
2025-03-24 12:14:46 +01:00
catppuccin-bat = {
url = "github:catppuccin/bat";
flake = false;
};
};
outputs = inputs @ {
self,
nixpkgs,
home-manager,
...
}: {
nixosConfigurations = {
2025-03-24 23:45:29 +01:00
iso = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({ pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ];
environment.systemPackages = [ pkgs.neovim pkgs.git ];
})
];
};
2025-03-24 21:44:10 +01:00
m920q = let
2025-03-24 12:14:46 +01:00
username = "phil";
2025-03-26 14:23:54 +01:00
specialArgs = {inherit username;};
2025-03-24 12:14:46 +01:00
in
nixpkgs.lib.nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
2025-03-24 21:44:10 +01:00
./hosts/m920q
2025-03-24 12:14:46 +01:00
./users/${username}/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs // specialArgs;
home-manager.users.${username} = import ./users/${username}/home.nix;
}
];
};
};
};
}