Guest User

flake.nix

a guest
Sep 2nd, 2024
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. {
  2. description = "My NixOS configuration";
  3.  
  4. inputs = {
  5. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  6. hardware.url = "github:nixos/nixos-hardware";
  7. home-manager = {
  8. url = "github:nix-community/home-manager";
  9. inputs.nixpkgs.follows = "nixpkgs";
  10. };
  11. };
  12.  
  13. outputs = { self, nixpkgs, home-manager, ... }@inputs:
  14. let
  15. inherit (self) outputs;
  16. lib = nixpkgs.lib // home-manager.lib;
  17. systems = [ "x86_64-linux" "aarch64-linux" ];
  18. forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
  19. pkgsFor = lib.genAttrs systems (system: import nixpkgs {
  20. inherit system;
  21. config.allowUnfree = true;
  22. });
  23. in
  24. {
  25. inherit lib;
  26. nixosModules = import ./modules/nixos;
  27. homeManagerModules = import ./modules/home-manager;
  28. templates = import ./templates;
  29.  
  30. overlays = import ./overlays { inherit inputs outputs; };
  31. hydraJobs = import ./hydra.nix { inherit inputs outputs; };
  32.  
  33. packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
  34. devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
  35. formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
  36.  
  37. nixosConfigurations = {
  38. laptop = lib.nixosSystem {
  39. modules = [ ./hosts/laptop ];
  40. specialArgs = { inherit inputs outputs; };
  41. };
  42. pi = lib.nixosSystem {
  43. modules = [ ./hosts/pi ];
  44. specialArgs = { inherit inputs outputs; };
  45. };
  46. };
  47. };
  48. }
Advertisement
Add Comment
Please, Sign In to add comment