1
0

flake.nix 4.2 KB

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