# This is the main flake containing all the nix related stuff { description = "Main system configuration management - Jonas Hahn"; inputs = { # The main nix inputs nixpkgs.url = "nixpkgs/nixos-25.05"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nur = { url = "github:nix-community/NUR"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix.url = "github:Mic92/sops-nix"; # optional, not necessary for the module sops-nix.inputs.nixpkgs.follows = "nixpkgs"; # Other utility stuff may be moved to a seperate flake in the future # Love this system of just rolling to a certain commit! xremap-flake.url = "github:xremap/nix-flake?rev=8001f37b1ffe86e76b62f36afadee2f4acf90e70"; home-manager = { url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix.url = "github:danth/stylix/release-25.05"; #TODO: Add the mailserver to here # Testing #nix-snapd.url = "github:nix-community/nix-snapd"; #nix-snapd.inputs.nixpkgs.follows = "nixpkgs"; #hyprland.url = "github:hyprwm/Hyprland"; # hyprland-plugins = {, # url = "github:hyprwm/hyprland-plugins"; # #inputs.hyprland.follows = "hyprland"; # }; }; outputs = { self, nixpkgs, sops-nix, nixpkgs-unstable, nur, home-manager, stylix, ... }@inputs: let system = "x86_64-linux"; # Unserstand this overlay method or do another one overlay-unstable = final: prev: { unstable = nixpkgs-unstable.legacyPackages.${prev.system}; }; overlay-nur = final: prev: { nur = nur.legacyPackages.${prev.system}; }; helperModules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable overlay-nur ]; }) home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; # messed up firefox #home-manager.backupFileExtension = "backup"; home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.users.jonas = import ./nixos/users/jonas/home.nix; home-manager.users.root = import ./nixos/users/root/home.nix; } ]; in { # New thinkpad | main workstation nixosConfigurations."thinix" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ # Use overlay magic with pkgs.unstable. ./nixos/hosts/thinkpadt470s/configuration.nix #nix-snapd.nixosModules.default #{ # services.snap.enable = true; #} ] ++ helperModules; }; # Acer laptop | second workstation nixosConfigurations."nixyos" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ ./nixos/hosts/asus-vivo/configuration.nix ] ++ helperModules; }; nixosConfigurations."minoxy" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ ./nixos/hosts/minoxy/configuration.nix ] ++ helperModules; }; # Cloudserver minimal without all the (bloat) stuff nixosConfigurations."stranox" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable overlay-nur ]; }) ./nixos/hosts/stranox/configuration.nix ]; }; # Other system configurations nixosConfigurations = { # Testing server old computer "misox" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ ./nixos/hosts/misox_msi/configuration.nix ] ++ helperModules; }; # Old Asus laptop "asuox" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ ./nixos/hosts/acer-katze/configuration.nix ] ++ helperModules; }; "gullfoss" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; modules = [ ./nixos/hosts/gullfoss/configuration.nix ] ++ helperModules; }; "fruitypi" = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; modules = [ ./nixos/hosts/rpi3/configuration.nix ]; }; }; }; }