143 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			143 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  description = "Felixalb System flake";
 | 
						|
 | 
						|
  inputs = {
 | 
						|
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; # Remember to update ./common/auto-upgrade.nix
 | 
						|
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
 | 
						|
    nixpkgs-2211.url = "https://github.com/NixOS/nixpkgs/archive/34bfa9403e42eece93d1a3740e9d8a02fceafbca.tar.gz"; # old nixpgks for e.g. remmina
 | 
						|
 | 
						|
    nix-darwin.url = "github:lnl7/nix-darwin/nix-darwin-25.05";
 | 
						|
    nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
 | 
						|
 | 
						|
    home-manager.url = "github:nix-community/home-manager/release-25.05";
 | 
						|
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
 | 
						|
 | 
						|
    matrix-synapse-next.url = "github:dali99/nixos-matrix-modules/v0.7.1";
 | 
						|
    nix-minecraft.url = "github:Infinidoge/nix-minecraft";
 | 
						|
 | 
						|
    extra-config.url = "git+file:///home/felixalb/nix-extra-config";
 | 
						|
 | 
						|
    sops-nix.url = "github:Mic92/sops-nix";
 | 
						|
    sops-nix.inputs.nixpkgs.follows = "nixpkgs";
 | 
						|
  };
 | 
						|
 | 
						|
  outputs = {
 | 
						|
    self
 | 
						|
    , home-manager
 | 
						|
    , matrix-synapse-next
 | 
						|
    , nix-minecraft
 | 
						|
    , nix-darwin
 | 
						|
    , nixpkgs
 | 
						|
    , nixpkgs-2211
 | 
						|
    , nixpkgs-unstable
 | 
						|
    , sops-nix
 | 
						|
    , extra-config
 | 
						|
  , ... }@inputs:
 | 
						|
    let
 | 
						|
      pkgs-overlay = final: prev: {
 | 
						|
        unstable = import nixpkgs-unstable {
 | 
						|
          system = prev.system;
 | 
						|
          config.allowUnfree = true;
 | 
						|
        };
 | 
						|
 | 
						|
        nixpkgs-2211 = import nixpkgs-2211 {
 | 
						|
          system = prev.system;
 | 
						|
          config.allowUnfree = true;
 | 
						|
        };
 | 
						|
 | 
						|
        pwndbg-gdb-alias = prev.callPackage ./common/pwndbg-gdb-alias.nix { };
 | 
						|
        securecrt = prev.callPackage ./common/securecrt.nix { };
 | 
						|
      };
 | 
						|
    in
 | 
						|
    {
 | 
						|
      nixosConfigurations = let
 | 
						|
        normalSys = name: hostConfig: nixpkgs.lib.nixosSystem {
 | 
						|
          system = "x86_64-linux";
 | 
						|
          specialArgs = {
 | 
						|
            inherit inputs;
 | 
						|
          };
 | 
						|
          modules = [
 | 
						|
            ({ config, pkgs, ... }: {
 | 
						|
              # Make "pkgs.unstable" etc. available
 | 
						|
              nixpkgs.overlays = [ pkgs-overlay ] ++ hostConfig.overlays or [ ];
 | 
						|
            })
 | 
						|
 | 
						|
            ./hosts/${name}/configuration.nix
 | 
						|
            sops-nix.nixosModules.sops
 | 
						|
            home-manager.nixosModules.home-manager {
 | 
						|
              home-manager.useGlobalPkgs = true;
 | 
						|
              home-manager.useUserPackages = true;
 | 
						|
              home-manager.users = {
 | 
						|
                "felixalb" = import ./hosts/${name}/home.nix;
 | 
						|
              } // hostConfig.home-manager-users or { };
 | 
						|
            }
 | 
						|
          ] ++ hostConfig.modules or [ ];
 | 
						|
        };
 | 
						|
      in {
 | 
						|
 | 
						|
        # Networking / VPN Gateway
 | 
						|
        burnham = normalSys "burnham" {
 | 
						|
          modules = [
 | 
						|
            ./common/domeneshop-dyndns.nix
 | 
						|
          ];
 | 
						|
        };
 | 
						|
 | 
						|
        # Media / storage server
 | 
						|
        challenger = normalSys "challenger" {
 | 
						|
          modules = [
 | 
						|
            extra-config.nixosModules.default
 | 
						|
          ];
 | 
						|
        };
 | 
						|
 | 
						|
        # General application server
 | 
						|
        defiant = normalSys "defiant" {
 | 
						|
          modules = [
 | 
						|
            ./common/domeneshop-dyndns.nix
 | 
						|
            matrix-synapse-next.nixosModules.default
 | 
						|
          ];
 | 
						|
        };
 | 
						|
 | 
						|
        # Work laptop
 | 
						|
        fa-t14-2025 = normalSys "fa-t14-2025" { };
 | 
						|
 | 
						|
        # Web host
 | 
						|
        leonard = normalSys "leonard" { };
 | 
						|
 | 
						|
        # Web host
 | 
						|
        malcolm = normalSys "malcolm" { };
 | 
						|
 | 
						|
        # General application server
 | 
						|
        morn = normalSys "morn" { };
 | 
						|
 | 
						|
        # Home desktop
 | 
						|
        sisko = normalSys "sisko" { };
 | 
						|
      };
 | 
						|
 | 
						|
      # Daily driver macbook
 | 
						|
      darwinConfigurations.worf = nix-darwin.lib.darwinSystem {
 | 
						|
        system = "aarch64-darwin";
 | 
						|
        specialArgs = {
 | 
						|
          inherit inputs;
 | 
						|
        };
 | 
						|
        modules = [
 | 
						|
          ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; })
 | 
						|
 | 
						|
          ./hosts/worf/configuration.nix
 | 
						|
          home-manager.darwinModules.home-manager {
 | 
						|
            home-manager.useGlobalPkgs = true;
 | 
						|
            home-manager.useUserPackages = true;
 | 
						|
            home-manager.users."felixalb" = import ./hosts/worf/home.nix;
 | 
						|
          }
 | 
						|
        ];
 | 
						|
      };
 | 
						|
 | 
						|
      devShells.x86_64-linux = {
 | 
						|
        default = nixpkgs.legacyPackages.x86_64-linux.callPackage ./shell.nix { };
 | 
						|
      };
 | 
						|
 | 
						|
      devShells.aarch64-darwin = {
 | 
						|
        default = nixpkgs.legacyPackages.aarch64-darwin.callPackage ./shell.nix { };
 | 
						|
      };
 | 
						|
    };
 | 
						|
}
 |