2024-04-17 17:27:13 -05:00
|
|
|
# _
|
|
|
|
|
# _ __ (_)_ _____ ___
|
|
|
|
|
# | '_ \| \ \/ / _ \/ __|
|
|
|
|
|
# | | | | |> < (_) \__ \
|
|
|
|
|
# |_| |_|_/_/\_\___/|___/
|
2024-04-17 20:52:32 -05:00
|
|
|
# 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
|
2024-04-17 17:27:13 -05:00
|
|
|
# shoutouts to yall 🙏
|
2024-04-17 08:35:18 -05:00
|
|
|
{
|
2024-04-17 17:27:13 -05:00
|
|
|
description = "Sneexy's custom nixos configs";
|
2024-04-17 08:35:18 -05:00
|
|
|
|
|
|
|
|
inputs = {
|
2024-04-17 17:27:13 -05:00
|
|
|
# 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
|
|
|
|
2024-04-17 17:27:13 -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";
|
|
|
|
|
|
2024-04-17 17:27:13 -05:00
|
|
|
# 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";
|
|
|
|
|
|
2024-04-17 17:27:13 -05:00
|
|
|
# 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.
|
2024-04-17 20:52:32 -05:00
|
|
|
# TODO: see if you can only add this for t480
|
2024-04-17 17:27:13 -05:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
2024-04-17 17:27:13 -05:00
|
|
|
outputs = {
|
|
|
|
|
self,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
nixpkgs-master,
|
|
|
|
|
chaotic,
|
|
|
|
|
home-manager,
|
|
|
|
|
plasma-manager,
|
|
|
|
|
nixos-06cb-009a-fingerprint-sensor,
|
|
|
|
|
hardware,
|
|
|
|
|
...
|
|
|
|
|
} @ inputs: let
|
|
|
|
|
inherit (self) outputs;
|
|
|
|
|
# our systems are all x86_64 unfortunately
|
|
|
|
|
systems = [
|
|
|
|
|
"x86_64-linux"
|
|
|
|
|
];
|
|
|
|
|
# This is a function that generates an attribute by calling a function you
|
|
|
|
|
# pass to it, with each system as an argument
|
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
|
|
|
in {
|
2024-04-17 20:52:32 -05:00
|
|
|
# Your custom packages
|
|
|
|
|
# Accessible through 'nix build', 'nix shell', etc
|
|
|
|
|
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
|
|
|
|
# Formatter for your nix files, available through 'nix fmt'
|
|
|
|
|
# Other options beside 'alejandra' include 'nixpkgs-fmt'
|
|
|
|
|
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
|
|
|
|
|
|
|
|
|
# Your custom packages and modifications, exported as overlays
|
|
|
|
|
overlays = import ./overlays {inherit inputs;};
|
|
|
|
|
# Reusable nixos modules you might want to export
|
|
|
|
|
# These are usually stuff you would upstream into nixpkgs
|
|
|
|
|
nixosModules = import ./modules/nixos;
|
|
|
|
|
# Reusable home-manager modules you might want to export
|
|
|
|
|
# These are usually stuff you would upstream into home-manager
|
|
|
|
|
homeManagerModules = import ./modules/home-manager;
|
|
|
|
|
|
2024-04-17 17:27:13 -05:00
|
|
|
# NixOS configuration entrypoint
|
|
|
|
|
# Available through 'nixos-rebuild --flake .#your-hostname'
|
|
|
|
|
nixosConfigurations = {
|
|
|
|
|
# main laptop i use daily
|
|
|
|
|
"thunkpad" = nixpkgs.lib.nixosSystem rec {
|
|
|
|
|
specialArgs = {inherit inputs outputs;};
|
2024-04-17 20:52:32 -05:00
|
|
|
modules = [
|
|
|
|
|
# specific configs for thunkpad/t480
|
2024-04-17 17:27:13 -05:00
|
|
|
./machines/thunkpad
|
2024-04-17 20:52:32 -05:00
|
|
|
# shared/common config
|
|
|
|
|
./nixos/configuration.nix
|
2024-04-17 17:27:13 -05:00
|
|
|
# fingerprint modules
|
|
|
|
|
nixos-06cb-009a-fingerprint-sensor.nixosModules.open-fprintd
|
|
|
|
|
nixos-06cb-009a-fingerprint-sensor.nixosModules.python-validity
|
2024-04-17 17:55:34 -05:00
|
|
|
# nyx repo
|
|
|
|
|
chaotic.nixosModules.default
|
2024-04-17 17:27:13 -05:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
# secondary 2 in 1 device, not really used
|
|
|
|
|
"thonkpad" = nixpkgs.lib.nixosSystem {
|
2024-04-17 20:52:32 -05:00
|
|
|
specialArgs = {inherit inputs outputs;};
|
|
|
|
|
modules = [
|
2024-04-17 17:27:13 -05:00
|
|
|
# nixos configuration file (and others) for thonkpad
|
|
|
|
|
./machines/thonkpad
|
2024-04-17 20:52:32 -05:00
|
|
|
# shared/common config
|
|
|
|
|
./nixos/configuration.nix
|
2024-04-17 17:55:34 -05:00
|
|
|
# nyx repo
|
|
|
|
|
chaotic.nixosModules.default
|
2024-04-17 17:27:13 -05:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-04-17 08:35:18 -05:00
|
|
|
|
2024-04-17 17:27:13 -05:00
|
|
|
# Standalone home-manager configuration entrypoint
|
|
|
|
|
# Available through 'home-manager --flake .#your-username@your-hostname'
|
|
|
|
|
homeConfigurations = {
|
|
|
|
|
# TODO: theres probably a better way to do this/specify one home config for all devices
|
|
|
|
|
# main device
|
|
|
|
|
"thunkpad" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
|
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
|
|
|
|
extraSpecialArgs = {inherit inputs outputs;};
|
|
|
|
|
modules = [
|
2024-04-17 18:06:18 -05:00
|
|
|
./users/ruben/home.nix
|
2024-04-17 17:27:13 -05:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
# secondary device
|
|
|
|
|
"thonkpad" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
|
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
|
|
|
|
extraSpecialArgs = {inherit inputs outputs;};
|
|
|
|
|
modules = [
|
2024-04-17 18:06:18 -05:00
|
|
|
./users/ruben/home.nix
|
2024-04-17 17:27:13 -05:00
|
|
|
];
|
|
|
|
|
};
|
2024-04-17 08:35:18 -05:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|