flake.nix 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {
  2. inputs = {
  3. nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05?shallow=true";
  4. nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-26.05-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-26.05?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/release-26.05?shallow=true";
  13. home-manager.inputs.nixpkgs.follows = "nixpkgs";
  14. nixvim.url = "github:nix-community/nixvim/nixos-26.05?shallow=true";
  15. # nixvim.inputs.nixpkgs.follows = "nixpkgs";
  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?shallow=true";
  25. git-hooks.inputs.nixpkgs.follows = "nixpkgs-unstable";
  26. ngit-cli.url = "github:danconwaydev/ngit-cli?shallow=true";
  27. ngit-cli.inputs.nixpkgs.follows = "nixpkgs-unstable";
  28. };
  29. outputs =
  30. { self, ... }@inputs:
  31. let
  32. inherit (self) outputs;
  33. in
  34. rec {
  35. lib = import ./lib { inherit inputs outputs; };
  36. overlays = import ./overlays { inherit inputs outputs; };
  37. modules = import ./modules;
  38. formatter = lib.eachSystem (_system: pkgs: pkgs.nixfmt-tree);
  39. packages = lib.eachSystem (
  40. system: pkgs:
  41. import ./packages {
  42. inherit pkgs;
  43. nixvim = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule { };
  44. }
  45. );
  46. devShells = lib.eachSystem (
  47. system: pkgs:
  48. import ./shell.nix {
  49. inherit pkgs system;
  50. inherit (self.checks.${system}.pre-commit-check) shellHook;
  51. inherit (self.checks.${system}.pre-commit-check) enabledPackages;
  52. }
  53. );
  54. checks = lib.eachSystem (
  55. system: _pkgs: {
  56. pre-commit-check = inputs.git-hooks.lib.${system}.run {
  57. src = ./.;
  58. hooks = {
  59. nixfmt.enable = true;
  60. # statix.enable = true;
  61. deadnix.enable = true;
  62. commitizen.enable = true;
  63. trim-trailing-whitespace.enable = true;
  64. };
  65. };
  66. }
  67. );
  68. templates = {
  69. devenv = {
  70. path = ./templates/devenv;
  71. description = "A template for a devenv environment";
  72. };
  73. };
  74. homeConfigurations = {
  75. "thomas@meili" = lib.mkHome {
  76. system = "aarch64-darwin";
  77. modules = [ ./home/meili.nix ];
  78. };
  79. "thomas@modgud" = lib.mkHome {
  80. system = "x86_64-linux";
  81. modules = [ ./home/modgud.nix ];
  82. };
  83. "thomas@fedora" = lib.mkHome {
  84. system = "aarch64-linux";
  85. modules = [ ./home/fedora.nix ];
  86. };
  87. "thomas@odin" = lib.mkHome {
  88. system = "x86_64-linux";
  89. modules = [ ./home/odin.nix ];
  90. };
  91. };
  92. nixosConfigurations = {
  93. # heimdall = lib.mkSystem {
  94. # system = "riscv64-linux";
  95. # modules = [ ./hosts/heimdall ];
  96. # };
  97. #
  98. # modgud = lib.mkSystem {
  99. # system = "x86_64-linux";
  100. # modules = [ ./hosts/modgud ];
  101. # };
  102. odin = lib.mkSystem {
  103. system = "x86_64-linux";
  104. modules = [ ./hosts/odin ];
  105. };
  106. odinVm = lib.mkSystem {
  107. system = "aarch64-linux";
  108. modules = [ ./hosts/odin/vm.nix ];
  109. };
  110. grist = lib.mkSystem {
  111. system = "x86_64-linux";
  112. modules = [ ./hosts/odin/containers/grist.nix ];
  113. };
  114. };
  115. darwinConfigurations = {
  116. meili = lib.mkDarwin {
  117. system = "aarch64-darwin";
  118. modules = [ ./hosts/meili ];
  119. };
  120. };
  121. };
  122. }