flake.nix 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. {
  2. outputs =
  3. inputs@{
  4. self,
  5. nixpkgs,
  6. treefmt-nix,
  7. flake-parts,
  8. ez-configs,
  9. ...
  10. }:
  11. flake-parts.lib.mkFlake { inherit inputs; } {
  12. imports = [
  13. ez-configs.flakeModule
  14. treefmt-nix.flakeModule
  15. ./pkgs
  16. ];
  17. systems = [ "x86_64-linux" ];
  18. ezConfigs =
  19. let
  20. username = "airi";
  21. in
  22. {
  23. root = ./.;
  24. globalArgs = {
  25. inherit self inputs username;
  26. };
  27. };
  28. perSystem =
  29. {
  30. config,
  31. pkgs,
  32. system,
  33. inputs',
  34. ...
  35. }:
  36. {
  37. # This sets `pkgs` to a nixpkgs with allowUnfree option set.
  38. _module.args.pkgs = import nixpkgs {
  39. inherit system;
  40. config.allowUnfree = true;
  41. };
  42. # configure devshell
  43. devShells.default = pkgs.mkShell {
  44. name = "Dooots";
  45. packages = [
  46. config.treefmt.build.wrapper
  47. inputs'.nix-super.packages.default
  48. # pkgs.nvfetcher
  49. (pkgs.writeShellApplication {
  50. name = "fmt";
  51. text = "treefmt";
  52. })
  53. ];
  54. # This will add The development shell with treefmt
  55. # and its underlying programs ( nixfmt, deadnix, etc )
  56. inputsFrom = [ config.treefmt.build.devShell ];
  57. };
  58. # configure treefmt
  59. treefmt = {
  60. projectRootFile = "flake.nix";
  61. programs = {
  62. nixfmt.enable = true;
  63. nixfmt.package = inputs.chaotic.packages.${pkgs.system}.nixfmt_rfc166;
  64. deadnix.enable = true;
  65. statix.enable = true;
  66. statix.disabled-lints = [ "repeated_keys" ];
  67. stylua.enable = true;
  68. };
  69. settings.formatter.nixfmt.excludes = [ "generated.nix" ];
  70. settings.formatter.deadnix.excludes = [ "generated.nix" ];
  71. settings.formatter.statix.excludes = [ "generated.nix" ];
  72. settings.formatter.stylua.options = [
  73. "--indent-type"
  74. "Spaces"
  75. "--indent-width"
  76. "2"
  77. "--quote-style"
  78. "ForceDouble"
  79. ];
  80. };
  81. };
  82. };
  83. inputs = {
  84. ####################
  85. # Main #
  86. ####################
  87. nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
  88. home-manager = {
  89. url = "github:nix-community/home-manager";
  90. inputs.nixpkgs.follows = "nixpkgs";
  91. };
  92. flake-parts = {
  93. url = "github:hercules-ci/flake-parts";
  94. inputs.nixpkgs-lib.follows = "nixpkgs";
  95. };
  96. ez-configs = {
  97. url = "github:ehllie/ez-configs";
  98. inputs = {
  99. nixpkgs.follows = "nixpkgs";
  100. flake-parts.follows = "flake-parts";
  101. };
  102. };
  103. ####################
  104. # Deps #
  105. ####################
  106. lanzaboote = {
  107. url = "github:nix-community/lanzaboote";
  108. inputs.nixpkgs.follows = "nixpkgs";
  109. inputs.flake-parts.follows = "flake-parts";
  110. };
  111. nh = {
  112. url = "github:viperML/nh";
  113. inputs.nixpkgs.follows = "nixpkgs";
  114. };
  115. spicetify-nix = {
  116. url = "github:Gerg-L/spicetify-nix";
  117. inputs.nixpkgs.follows = "nixpkgs";
  118. };
  119. nix-index-database = {
  120. url = "github:nix-community/nix-index-database";
  121. inputs.nixpkgs.follows = "nixpkgs";
  122. };
  123. nix-super = {
  124. url = "github:privatevoid-net/nix-super";
  125. };
  126. chaotic = {
  127. url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
  128. };
  129. treefmt-nix = {
  130. url = "github:numtide/treefmt-nix";
  131. inputs.nixpkgs.follows = "nixpkgs";
  132. };
  133. base16-schemes.url = "github:LudovicoPiero/base16-schemes";
  134. base16-schemes.flake = false;
  135. nix-colors = {
  136. url = "github:misterio77/nix-colors";
  137. inputs.base16-schemes.follows = "base16-schemes";
  138. };
  139. firefox-addons = {
  140. url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
  141. inputs.nixpkgs.follows = "nixpkgs";
  142. };
  143. impermanence = {
  144. url = "github:nix-community/impermanence";
  145. };
  146. hyprland = {
  147. url = "github:hyprwm/hyprland";
  148. };
  149. };
  150. }