{ description = "My NixOs dotfiles"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; futils.url = "git+https://git.sorre.xyz/miranb/futils.git"; disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; sorre-website = { url = "git+https://git.sorre.xyz/miranb/sorre-website.git"; inputs.nixpkgs.follows = "nixpkgs"; }; sorrepkgs = { url = "git+https://git.sorre.xyz/miranb/xpkgs"; inputs.nixpkgs.follows = "nixpkgs"; }; nur.url = "github:nix-community/nur"; # no overrides because I the binary cache to work niri-flake = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; # development stuff treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, futils, treefmt-nix, ... }@inputs: futils.lib.eachSystem ( system: let pkgs = import inputs.nixpkgs { inherit system; }; treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in { devShells.default = futils.lib.minimalMkShell pkgs { packages = with pkgs; [ gitMinimal sops jujutsu treefmtEval.config.build.wrapper ]; }; formatter = treefmtEval.config.build.wrapper; checks = { formatting = treefmtEval.config.build.check self; }; } ) // { nixosConfigurations = let generateNixosConfig = name: _value: { system = "x86_64-linux"; # I don't have any other type of machine yet modules = with inputs; [ home-manager.nixosModules.home-manager sops-nix.nixosModules.sops disko.nixosModules.disko ./share/system/common.nix # This directory has to exist and have a `default.nix` in it, see # `./hosts` directory for examples ./hosts/${name} ]; specialArgs = { inherit inputs; flakeRoot = ./.; }; }; # wrapper around nixpkgs.lib.nixosSystem to enable using it on attrsets generateNixosSystem = _name: value: inputs.nixpkgs.lib.nixosSystem value; hosts = builtins.readDir ./hosts; nixosConfigs = builtins.mapAttrs generateNixosConfig hosts; # If you want to add something to a particular system, do it here before # the `in ...` line in builtins.mapAttrs generateNixosSystem nixosConfigs; }; }