{ description = "My awesome system config"; /* ╔══════════════════════════════════════════════════════════╗ ║ Inputs ║ ╚══════════════════════════════════════════════════════════╝ */ inputs = { # Nix master.url = "github:nixos/nixpkgs"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; stable.url = "github:nixos/nixpkgs/nixos-22.11"; flake-utils.url = "github:numtide/flake-utils"; utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; utils.inputs.flake-utils.follows = "flake-utils"; agenix.inputs.nixpkgs.follows = "nixpkgs"; agenix.url = "github:ryantm/agenix"; attic.inputs.flake-utils.follows = "flake-utils"; attic.inputs.nixpkgs-stable.follows = "stable"; attic.inputs.nixpkgs.follows = "nixpkgs"; attic.url = "github:zhaofengli/attic"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager"; nil.inputs.flake-utils.follows = "flake-utils"; nil.inputs.nixpkgs.follows = "nixpkgs"; nil.url = "github:oxalica/nil"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; # Neovim neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; bufferline-nvim.flake = false; bufferline-nvim.url = "github:akinsho/bufferline.nvim"; cmp-async-path.url = "github:FelipeLema/cmp-async-path"; cmp-async-path.flake = false; comment-box-nvim.flake = false; comment-box-nvim.url = "github:LudoPinelli/comment-box.nvim"; copilot-lua.flake = false; copilot-lua.url = "github:zbirenbaum/copilot.lua"; gitignore-nvim.flake = false; gitignore-nvim.url = "github:wintermute-cell/gitignore.nvim"; lspsaga-nvim.flake = false; lspsaga-nvim.url = "github:glepnir/lspsaga.nvim"; nvim-treesitter-textsubjects.flake = false; nvim-treesitter-textsubjects.url = "github:RRethy/nvim-treesitter-textsubjects"; smartcolumn-nvim.flake = false; smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim"; # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; hyprland.url = "github:hyprwm/Hyprland"; hyprpaper.url = "github:hyprwm/hyprpaper"; # Laptop asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout"; asus-touchpad-numpad-driver.flake = false; # Firefox user.js arkenfox-userjs.url = "github:arkenfox/user.js"; arkenfox-userjs.flake = false; }; /* ╔══════════════════════════════════════════════════════════╗ ║ Outputs ║ ╚══════════════════════════════════════════════════════════╝ */ outputs = inputs@{ self, nixpkgs, utils, ... }: utils.lib.mkFlake { inherit self inputs; supportedSystems = [ "x86_64-linux" ]; channelsConfig.allowUnfree = true; lib = nixpkgs.lib.extend (self: _: { my = import ./lib { lib = self; }; }); /* ╔══════════════════════════════════════════════════════════╗ ║ Overlays ║ ╚══════════════════════════════════════════════════════════╝ */ overlay = import ./overlays { inherit inputs; inherit (self) lib; }; channels.nixpkgs.overlaysBuilder = _: [ inputs.hypr-contrib.overlays.default inputs.hyprland.overlays.default inputs.neovim-nightly-overlay.overlay inputs.utils.overlay self.overlay ]; overlays = utils.lib.exportOverlays { inherit (self) pkgs inputs; } // { default = self.overlay; }; /* ╔══════════════════════════════════════════════════════════╗ ║ Modules ║ ╚══════════════════════════════════════════════════════════╝ */ nixosModules = utils.lib.exportModules [ ./modules/profiles/base.nix ./modules/profiles/gaming.nix ./modules/profiles/desktop.nix ./modules/profiles/personal.nix ]; hostDefaults.modules = [ ./modules/default.nix self.nixosModules.base inputs.home-manager.nixosModule { home-manager = { useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit inputs self; }; }; } inputs.agenix.nixosModules.age ]; hosts.nixos-laptop.modules = [ ./hosts/nixos-laptop self.nixosModules.desktop self.nixosModules.gaming self.nixosModules.personal ]; hosts.nixos-desktop.modules = [ ./hosts/nixos-desktop self.nixosModules.desktop self.nixosModules.gaming self.nixosModules.personal ]; /* ╔══════════════════════════════════════════════════════════╗ ║ Other Outputs ║ ╚══════════════════════════════════════════════════════════╝ */ outputsBuilder = channels: with channels.nixpkgs; { devShells.default = mkShell { inherit (self.checks.${system}.pre-commit-check) shellHook; name = "dotfiles"; packages = [ # Secrets pkgs.agenix # cachix cachix ]; }; checks.pre-commit-check = inputs.pre-commit-hooks.lib."${system}".run { src = ./.; hooks = { nixpkgs-fmt.enable = true; statix.enable = true; shellcheck.enable = true; stylua.enable = true; }; }; packages = utils.lib.exportPackages self.overlays channels; }; }; }