{ description = "NixOS configuration"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager/release-25.11"; # The `follows` keyword in inputs is used for inheritance. # Here, `inputs.nixpkgs` of home-manager isn't kept consistent with the `inputs.nixpkgs` of the current flake, # to not avoid problems caused by different versions of nixpkgs dependencies. inputs.nixpkgs.follows = "nixpkgs-unstable"; }; # alternative nix compiler lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.3-1.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; #for device formatting disko = { url = "github:nix-community/disko/latest"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; # for hyprvisoring microvm = { url = "github:astro/microvm.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; # modern window compositor hyprland = { url = "github:hyprwm/Hyprland"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; nix-colors.url = "github:misterio77/nix-colors"; #community wayland nixpkgs # nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; # anyrun - a wayland launcher # anyrun = { # url = "github:Kirottu/anyrun"; # inputs.nixpkgs.follows = "nixpkgs-unstable"; # }; # # generate iso/qcow2/docker/... image from nixos configuration nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; }; modded-minecraft-servers.url = "github:mkaito/nixos-modded-minecraft-servers"; #secrets management, lock with git commit at 20xx/x/xx #......... ##################### Some non-flake repositories ######################################### # # AstroNvim is an aesthetic and feature-ruch neovim config. # astronvim = { # url = "github:AstroNvim/AstroVnim/v3.36.0"; # flake = false; # }; # useful nushell scripts, such as auto_completion nushell-scripts = { # url = "github:doolphin/nu_scripts"; url = "github:nushell/nu_scripts"; flake = false; }; hugo-congo = { url = "https://github.com/jpanther/congo"; flake = false; }; # ryan4yin wallpapers wallpapers = { url = "github:ryan4yin/wallpapers"; flake = false; }; # # nur-ryan4yin = { # url = "github:ryan4yin/nur-packages"; # # inputs.nixpkgs.follows "nixpkgs"; # }; # # riscv64 SBCs # nixos-licheepi4a.url = "github:ryan4yin/nixos-licheepi4a"; # # nixos-jh7110.url = "github:ryan4yin/nixos-jh7110"; # aarch64 SBCs # nixos-rk3588.url = "github:ryan4yin/nixos-rk3588"; ############# Personal repositories ######################################## # # my private secrets, it's a private repository, you need to replace it with your own. # # use ssh protocol to authenticate via ssh-agent/ssh-key, and shallow clone to save time # mysecrets = { # url = ""; # flake = false; # }; ##################### Color Schemes ####################################### #color scheme -catppuccin catppuccin-btop = { url = "github:catppuccin/btop"; flake = false; }; catppuccin-bat = { url = "github:catppuccin/bat"; flake = false; }; catppuccin-alacritty = { url = "github:catppuccin/alacritty"; flake = false; }; # catppuccin-helix = { # url = "github:catppuccin/helix"; # flake = false; # }; catppuccin-starship = { url = "github:catppuccin/starship"; flake = false; }; catppuccin-hyprland = { url = "github:catppuccin/hyprland"; flake = false; }; catppuccin-waybar = { url = "github:catppuccin/waybar"; flake = false; }; # # the nixConfig here only affects the flake inself, not the system configuration! # nixConfig = { # experimental-features = ["nix-command" "flakes"]; # substituters = [ # #my own cache server # "url-here" # "https://cache.nixos.org" # "https://hyprland.cachix.org" # ]; # # nix community's cache server # extra-substituters = [ # "https://nix-community.cachix.org" # "https://nixpkgs-wayland.cachix.org" # ]; # extra-trusted-public-keys = [ # "keys here" # ]; # }; }; outputs = inputs@{ self, ... }: with inputs; # packages.aarch64-linux = { # # packages.x86_64-linux = { # aarch64-installer = nixos-generators.nixosGenerate { # system = "aarch64-linux"; # networking.hostname = "raspi"; # modules = [ # ./modules/users/defin.nix # ./modules/nixos/system-packages.nix # ]; # format = "sd-aarch64-installer"; # }; # }; let inherit (self) outputs; lib = nixpkgs.lib // home-manager.lib; systems = [ "x86_64-linux" "aarch64-linux" ]; # forAllSystems = f: lib.genAttrs systems (system: f pkgsFor.${system}); pkgsFor = lib.genAttrs systems (system: import nixpkgs { inherit system; config.allowUnfree = true; }); minimalHomeManagerSettings = [ # From github:MasterofNull/nixos config home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit inputs; }; } # lib.nixosSystem { # modules = [ # ./modules/nixos/nix-common.nix # ./modules/nixos/environment.nix # ./modules/nixos/system-packages.nix # ./modules/users/defin.nix # ./modules/users/root.nix # ]; # # # Let 'nixos-version --json' know the Git revision of this flake. (for containers?) # # system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; # # nix.registry.nixpkgs.flake = nixpkgs; # } ]; # vm = lib.nixosSystem { # system = "x86_64-linux"; # modules = [ ./default.nix ]; # }; # foolcreekwireless = lib.nixosSystem { # vm for website # system = "x86_64-linux"; # modules = minimalHomeManagerSettings ++ [ ./machines/vm/foolcreekwireless # home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; } # ]; # }; in { inherit lib; nixosModules = import ./modules/nixos; # homeManagerModules = import ./modules/home-manager; # templates = import ./templates; # overlays = import ./overlays { inherit inputs outputs; }; # hydraJobs = import ./hydra.nix { inherit inputs outputs; }; # packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); # devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; }); # formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt); # wallpapers = inherit wallpapers; #NOTE broken nixosConfigurations = { khad = lib.nixosSystem { # Main desktop modules = minimalHomeManagerSettings ++ [ ./machines/khad lix-module.nixosModules.default sops-nix.nixosModules.sops home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/home.nix; } ]; }; zenbook = lib.nixosSystem { # Personal laptop # specialArgs = { inherit inputs; }; modules = minimalHomeManagerSettings ++ [ ./machines/zenbook lix-module.nixosModules.default # hyprland.homeManagerModules.default {wayland.windowManager.hyprland.enable = true;} home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/home.nix; } ]; }; betsy = lib.nixosSystem { # work laptop modules = minimalHomeManagerSettings ++ [ ./machines/betsy # lix-module.nixosModules.default home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/home.nix; } ]; }; doretta = lib.nixosSystem { # build server specialArgs = { inherit inputs; }; modules = minimalHomeManagerSettings ++ [ ./machines/doretta lix-module.nixosModules.default microvm.nixosModules.host home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/doretta.nix; } ]; }; bosco = lib.nixosSystem { # networking server modules = minimalHomeManagerSettings ++ [ ./machines/bosco # lix-module.nixosModules.default home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; } ]; }; biski = lib.nixosSystem { # another networking server, physical instead of cloud modules = minimalHomeManagerSettings ++ [ ./machines/biski disko.nixosModules.disko home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; } ]; }; picast = lib.nixosSystem { # anger at chromecast modules = minimalHomeManagerSettings ++ [ ./machines/picast home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; } ]; }; microvm-test = lib.nixosSystem { # test system = "x86_64-linux"; modules = minimalHomeManagerSettings ++ [ microvm.nixosModules.microvm # home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; } { networking.hostName = "microvm-test"; microvm.hypervisor = "qemu"; } ]; }; foolcreek = lib.nixosSystem { # vm for website modules = minimalHomeManagerSettings ++ [ ./machines/vm/foolcreek microvm.nixosModules.microvm home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; } ]; }; live = lib.nixosSystem { modules = minimalHomeManagerSettings ++ [ (nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix") ./machines/iso/configuration.nix ./modules/users/defin.nix ./modules/nixos/system-packages.nix home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; } { nixpkgs.hostPlatform = "aarch64-linux"; } ]; }; livetest = lib.nixosSystem { modules = [ (nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix") { nixpkgs.hostPlatform = "aarch64-linux"; } ]; }; # vm declarations for nix flake check # foolcreek = foolcreekwireless; }; # vms = { # expose the build attribute directly # foolcreekwireless = foolcreekwireless.config.system.build.vm; # }; homeConfigurations = { #NOTE: no worky yet # Standalone HM only # # Desktop # "defin@khad" = lib.homeManagerConfiguration { # modules = [ ./home-manager/home.nix ]; # pkgs = pkgsFor.x86_64-linux; # extraSpecialArgs = { inherit inputs outputs; }; # }; # Laptop "defin@nixos-zenbook" = lib.homeManagerConfiguration { modules = [ ./home-manager/home.nix ]; pkgs = pkgsFor.x86_64-linux; extraSpecialArgs = { inherit inputs outputs; }; }; }; }; }