# _ # _ __ (_)_ _____ ___ # | '_ \| \ \/ / _ \/ __| # | | | | |> < (_) \__ \ # |_| |_|_/_/\_\___/|___/ # 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 🙏 { description = "Sneexy's custom nixos configs"; 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"; # "fresh from git" master branch of nixpkgs. for packages not yet in unstable nixpkgs-master.url = "github:NixOS/nixpkgs/master"; # flake that allows for installing system and user flatpaks flatpaks.url = "github:gmodena/nix-flatpak"; # 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"; 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"; }; outputs = { self, nixpkgs, nixpkgs-master, flatpaks, 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; home-manager.extraSpecialArgs.flake-inputs = inputs; }; }; 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; [ # flatpaks flatpaks.nixosModules.nix-flatpak # fingerprint reader nixos-06cb-009a-fingerprint-sensor.nixosModules.open-fprintd nixos-06cb-009a-fingerprint-sensor.nixosModules.python-validity # nix-hardware profile nixos-hardware.nixosModules.lenovo-thinkpad-t480 # system and user config ./machines/thunkpad declarativeHome ./users/ruben ]; }; # 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; [ # flatpaks flatpaks.nixosModules.nix-flatpak # system and user config ./machines/thonkpad declarativeHome ./users/ruben ]; }; }; }; }