nixos/flake.nix

133 lines
4.3 KiB
Nix
Raw Normal View History

# _
# _ __ (_)_ _____ ___
# | '_ \| \ \/ / _ \/ __|
# | | | | |> < (_) \__ \
# |_| |_|_/_/\_\___/|___/
# this configuration file is basically a mashup of https://github.com/chfour/nixos and https://github.com/Misterio77/nix-starter-configs
# with lots of examples and knowledge gained from both of them
# and also this wonderful book which helped get me started on nix https://nixos-and-flakes.thiscute.world
# shoutouts to yall 🙏
2024-04-17 08:35:18 -05:00
{
description = "Sneexy's custom nixos configs";
2024-04-17 08:35:18 -05:00
inputs = {
# TODO: dear god there is a lot here. can we remove some? or try to split them?
# nixpkgs from the unstable branch. since stable is a bit too dated
# for my personal taste
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2024-04-17 08:35:18 -05:00
# "fresh from git" master branch of nixpkgs. for packages not yet in unstable
2024-04-17 08:35:18 -05:00
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
# chaotic's team nyx repo which usually contains unstable git packages or custom
# packages, such as modified linux kernels (which we do use here)
2024-04-17 08:35:18 -05:00
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
# flake that allows for installing system and user flatpaks
nix-flatpak.url = "github:gmodena/nix-flatpak";
2024-04-17 21:31:20 -05:00
# catppuccin's nix thingy for theming applications with catppuccin directly inside
# of the config
catppuccin.url = "github:catppuccin/nix";
# home manager for managing user specific stuff
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# plasma manager to allow configuring plasma within nix config
plasma-manager = {
url = "github:pjones/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
# flake for 06cb:009a fingerprint scanners. to make the fingerprint scanner on my
# thinkpad t480 function.
# TODO: see if you can only add this for t480
nixos-06cb-009a-fingerprint-sensor = {
url = "github:ahbnr/nixos-06cb-009a-fingerprint-sensor";
inputs.nixpkgs.follows = "nixpkgs";
};
# hardware flakes for some devices
hardware.url = "github:nixos/nixos-hardware";
2024-04-17 08:35:18 -05:00
};
outputs = {
self,
nixpkgs,
nixpkgs-master,
chaotic,
nix-flatpak,
2024-04-17 21:31:20 -05:00
catppuccin,
home-manager,
plasma-manager,
nixos-06cb-009a-fingerprint-sensor,
hardware,
...
} @ inputs: let
inherit (self) outputs;
in {
nixosModules = {
declarativeHome = { ... }: {
# thanks to https://determinate.systems/posts/declarative-gnome-configuration-with-nixos for teaching how to use this home manager module
imports = [ home-manager.nixosModules.home-manager ];
config = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
};
};
defaults = { ... }: {
# globally allow unfree packages
nixpkgs.config.allowUnfree = true;
# flakes, duh
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
};
};
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# my main laptop, a thinkpad t480
"thunkpad" = nixpkgs.lib.nixosSystem rec {
# boowomp sound effect
system = "x86_64-linux";
specialArgs = {
inherit inputs outputs;
pkgs-master = nixpkgs-master.legacyPackages.${system};
};
modules = with self.nixosModules; [
./machines/thunkpad
declarativeHome ./users/ruben
# flatpaks
nix-flatpak.nixosModules.nix-flatpak
# nyx repo
chaotic.nixosModules.default
];
};
# my secondary laptop, a thinkpad yoga 14...?
"thonkpad" = nixpkgs.lib.nixosSystem rec {
# boowomp sound effect x2
system = "x86_64-linux";
specialArgs = {
inherit inputs outputs;
pkgs-master = nixpkgs-master.legacyPackages.${system};
};
modules = with self.nixosModules; [
./machines/thonkpad
declarativeHome ./users/ruben
# flatpaks
nix-flatpak.nixosModules.nix-flatpak
# nyx repo
chaotic.nixosModules.default
];
};
};
2024-04-17 08:35:18 -05:00
};
}