{ self, config, lib, pkgs, ... }: let inherit (lib) fileContents; in { imports = [ ../../users/anish ]; fonts = { fonts = with pkgs; [ powerline-fonts dejavu_fonts ]; fontconfig.defaultFonts = { monospace = [ "DejaVu Sans Mono for Powerline" ]; sansSerif = [ "DejaVu Sans" ]; }; }; nix = { settings = { sandbox = true; trusted-users = [ "root" "@wheel" ]; allowed-users = [ "@wheel" ]; auto-optimise-store = true; system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; }; gc.automatic = true; optimise.automatic = true; extraOptions = '' min-free = 536870912 keep-outputs = true keep-derivations = true fallback = true ''; }; environment.systemPackages = with pkgs; [ pinentry_gnome cached-nix-shell ]; # For rage encryption, all hosts need a ssh key pair services.openssh = { enable = true; openFirewall = lib.mkDefault false; }; # programs.gnupg.agent.enable = true; # programs.gnupg.agent.pinentryFlavor = "curses"; services.earlyoom.enable = true; } { self , nixpkgs , unstable , home-manager , deploy-rs , agenix , basant , grasp , nur , tidalcycles , rust-overlay , eww , ... }@inputs: let forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" "i686-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; unstableOverlay = final: prev: { # We already have these in scope unstable = unstable.legacyPackages.${prev.system}; deploy = deploy-rs.packages.${prev.system}.deploy-rs; }; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "ripcord" "VCV-Rack" "SunVox" "renoise" ]; overlays = [ rust-overlay.overlays.default tidalcycles.overlays.default agenix.overlay nur.overlay unstableOverlay self.overlays.additions ]; }); # for when space matters litePkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ agenix.overlay tidalcycles.overlays.default # needed for nvim which comes pre-installed lol self.overlays.additions ]; }); in { # Your custom packages # Acessible through 'nix build', 'nix shell', etc packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in import ./pkgs { pkgs = pkgs; } ); # Devshell for bootstrapping # Acessible through 'nix develop' or 'nix-shell' (legacy) devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in import ./shell.nix { pkgs = pkgs; } ); # Your custom packages and modifications, exported as overlays overlays = import ./overlays; # Reusable nixos modules you might want to export # These are usually stuff you would upstream into nixpkgs nixosModules = import ./modules/nixos; # Reusable home-manager modules you might want to export # These are usually stuff you would upstream into home-manager homeManagerModules = import ./modules/home-manager; # NixOS configuration entrypoint nixosConfigurations = { curve = nixpkgs.lib.nixosSystem rec { specialArgs = { inherit inputs self; }; system = "x86_64-linux"; pkgs = nixpkgsFor.${system}; modules = [ ./hosts/curve agenix.nixosModules.age self.nixosModules.backup self.nixosModules.wireguard home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.anish = import ./home/gui; } ]; }; helix = nixpkgs.lib.nixosSystem rec { specialArgs = { inherit inputs self; }; system = "x86_64-linux"; pkgs = nixpkgsFor.${system}; modules = [ ./hosts/helix agenix.nixosModules.age self.nixosModules.backup self.nixosModules.hesienbridge home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.anish = import ./home/core; } ]; }; lituus = nixpkgs.lib.nixosSystem rec { specialArgs = { inherit inputs self; }; system = "x86_64-linux"; pkgs = nixpkgsFor.${system}; modules = [ ./hosts/lituus agenix.nixosModules.age self.nixosModules.backup self.nixosModules.wireguard home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.anish = import ./home/core; } ]; }; cube = nixpkgs.lib.nixosSystem rec { specialArgs = { inherit inputs self; }; system = "x86_64-linux"; pkgs = litePkgsFor.${system}; modules = [ ./hosts/cube agenix.nixosModules.age self.nixosModules.backup self.nixosModules.wireguard basant.nixosModule ]; }; box = nixpkgs.lib.nixosSystem rec { specialArgs = { inherit inputs self; }; system = "x86_64-linux"; pkgs = nixpkgsFor.${system}; modules = [ ./hosts/box agenix.nixosModules.age self.nixosModules.backup self.nixosModules.wireguard self.nixosModules.wallabag self.nixosModules.gonic grasp.nixosModule home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.anish = import ./home/core; } ]; }; }; # Standalone home-manager configuration entrypoint # Available through 'home-manager --flake .#your-username@your-hostname' homeConfigurations = { "anish@work" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgsFor."x86_64-linux"; # Home-manager requires 'pkgs' instance extraSpecialArgs = { inherit inputs; }; modules = [ ./home/core.nix ./home/profiles/firefox ]; }; }; deploy.nodes = { box = { hostname = "mossnet.lan"; profiles.system = { user = "root"; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box; }; }; helix = { hostname = "sealight.xyz"; profiles.system = { user = "root"; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix; }; }; lituus = { hostname = "git.sealight.xyz"; profiles.system = { user = "root"; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.lituus; }; }; cube = { hostname = "lakhwara.com"; profiles.system = { user = "root"; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cube; }; }; }; checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; }; }