flake.nix 4.5 KB

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