1
0

flake.nix 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {
  2. inputs = {
  3. nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11?shallow=true";
  4. nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-25.11-darwin?shallow=true";
  5. nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable?shallow=true";
  6. nixos-facter-modules.url = "github:nix-community/nixos-facter-modules?shallow=true";
  7. # nixos-facter-modules.inputs.nixpkgs.follows = "nixpkgs";
  8. darwin.url = "github:lnl7/nix-darwin/nix-darwin-25.11?shallow=true";
  9. darwin.inputs.nixpkgs.follows = "nixpkgs-darwin";
  10. devenv.url = "github:cachix/devenv?shallow=true";
  11. devenv.inputs.nixpkgs.follows = "nixpkgs-unstable";
  12. home-manager.url = "github:nix-community/home-manager/master?shallow=true";
  13. home-manager.inputs.nixpkgs.follows = "nixpkgs";
  14. nixvim.url = "github:nix-community/nixvim/main?shallow=true";
  15. nixvim.inputs.nixpkgs.follows = "nixpkgs-unstable";
  16. impermanence.url = "github:nix-community/impermanence?shallow=true";
  17. # impermanence.inputs.nixpkgs.follows = "nixpkgs";
  18. agenix.url = "github:ryantm/agenix?shallow=true";
  19. agenix.inputs.nixpkgs.follows = "nixpkgs";
  20. secrets.url = "git+ssh://[email protected]/control/secrets.git";
  21. # secrets.url = "path:/Users/thomas/workspace/control/secrets";
  22. disko.url = "github:nix-community/disko?shallow=true";
  23. disko.inputs.nixpkgs.follows = "nixpkgs";
  24. git-hooks.url = "github:cachix/git-hooks.nix";
  25. git-hooks.inputs.nixpkgs.follows = "nixpkgs-unstable";
  26. zen-browser.url = "github:0xc000022070/zen-browser-flake";
  27. zen-browser.inputs.nixpkgs.follows = "nixpkgs";
  28. zen-browser.inputs.home-manager.follows = "home-manager";
  29. firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
  30. firefox-addons.inputs.nixpkgs.follows = "nixpkgs";
  31. };
  32. outputs =
  33. { self, ... }@inputs:
  34. let
  35. inherit (self) outputs;
  36. in
  37. rec {
  38. lib = import ./lib { inherit inputs outputs; };
  39. overlays = import ./overlays { inherit inputs outputs; };
  40. modules = import ./modules;
  41. formatter = lib.eachSystem (_system: pkgs: pkgs.nixfmt-tree);
  42. packages = lib.eachSystem (
  43. system: pkgs:
  44. import ./packages {
  45. inherit pkgs;
  46. nixvim = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule { };
  47. }
  48. );
  49. devShells = lib.eachSystem (
  50. system: pkgs:
  51. import ./shell.nix {
  52. inherit pkgs system;
  53. inherit (self.checks.${system}.pre-commit-check) shellHook;
  54. inherit (self.checks.${system}.pre-commit-check) enabledPackages;
  55. }
  56. );
  57. checks = lib.eachSystem (
  58. system: _pkgs: {
  59. pre-commit-check = inputs.git-hooks.lib.${system}.run {
  60. src = ./.;
  61. hooks = {
  62. nixfmt.enable = true;
  63. # statix.enable = true;
  64. deadnix.enable = true;
  65. commitizen.enable = true;
  66. trim-trailing-whitespace.enable = true;
  67. };
  68. };
  69. }
  70. );
  71. templates = {
  72. devenv = {
  73. path = ./templates/devenv;
  74. description = "A template for a devenv environment";
  75. };
  76. };
  77. homeConfigurations = {
  78. "thomas@meili" = lib.mkHome {
  79. system = "aarch64-darwin";
  80. modules = [ ./home/meili.nix ];
  81. };
  82. "thomas@modgud" = lib.mkHome {
  83. system = "x86_64-linux";
  84. modules = [ ./home/modgud.nix ];
  85. };
  86. "thomas@fedora" = lib.mkHome {
  87. system = "aarch64-linux";
  88. modules = [ ./home/fedora.nix ];
  89. };
  90. "thomas@odin" = lib.mkHome {
  91. system = "x86_64-linux";
  92. modules = [ ./home/odin.nix ];
  93. };
  94. };
  95. nixosConfigurations = {
  96. # heimdall = lib.mkSystem {
  97. # system = "riscv64-linux";
  98. # modules = [ ./hosts/heimdall ];
  99. # };
  100. #
  101. # modgud = lib.mkSystem {
  102. # system = "x86_64-linux";
  103. # modules = [ ./hosts/modgud ];
  104. # };
  105. odin = lib.mkSystem {
  106. system = "x86_64-linux";
  107. modules = [ ./hosts/odin ];
  108. };
  109. grist = lib.mkSystem {
  110. system = "x86_64-linux";
  111. modules = [ ./hosts/odin/containers/grist.nix ];
  112. };
  113. };
  114. darwinConfigurations = {
  115. meili = lib.mkDarwin {
  116. system = "aarch64-darwin";
  117. modules = [ ./hosts/meili ];
  118. };
  119. };
  120. };
  121. }