{ description = "A simple NixOS flake"; inputs = { # Primary package source - stable channel for system stability nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Home Manager - pinned to release-24.11 for compatibility home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; agenix.url = "github:ryantm/agenix"; zen-browser.url = "github:0xc000022070/zen-browser-flake"; # 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 = "git+ssh://git@gitlab.com/marvinroman/my-nixos-secrets?ref=main&shallow=1"; flake = false; }; # Optional, if you intend to follow nvf's obsidian-nvim input # you must also add it as a flake input. # obsidian-nvim.url = "github:epwalsh/obsidian.nvim"; # obsidian-nvim.flake = false; # Required, nvf works best and only directly supports flakes nvf = { url = "github:notashelf/nvf"; # You can override the input nixpkgs to follow your system's # instance of nixpkgs. This is safe to do as nvf does not depend # on a binary cache. inputs.nixpkgs.follows = "nixpkgs"; # Optionally, you can also override individual plugins # for example: # inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs }; }; outputs = inputs@{ self, nixpkgs, agenix, home-manager, ... }: { # Please replace toaster with your hostname nixosConfigurations = { toaster = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; modules = [ # Import the previous configuration.nix we used, # so the old configuration file still takes effect ./hosts/toaster/default.nix home-manager.nixosModules.default { home-manager = { useUserPackages = true; useGlobalPkgs = true; users = { "marvin" = import ./hosts/toaster/home.nix; }; # Pass shared arguments to Home Manager modules extraSpecialArgs = { inherit inputs; hostName = "toaster"; }; }; } agenix.nixosModules.default { # Set all inputs parameters as special arguments for all submodules, # so you can directly use all dependencies in inputs in submodules _module.args = { inherit inputs; inherit system; }; } ]; }; baker = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; modules = [ # Import the previous configuration.nix we used, # so the old configuration file still takes effect ./hosts/baker/default.nix home-manager.nixosModules.default { home-manager = { useUserPackages = true; useGlobalPkgs = true; users = { "marvin" = import ./hosts/baker/home.nix; }; # Pass shared arguments to Home Manager modules extraSpecialArgs = { inherit inputs; hostName = "baker"; }; }; } agenix.nixosModules.default { # Set all inputs parameters as special arguments for all submodules, # so you can directly use all dependencies in inputs in submodules _module.args = { inherit inputs; inherit system; }; } ]; }; }; }; }