diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6076255 --- /dev/null +++ b/flake.nix @@ -0,0 +1,60 @@ +{ + description = "n8 NixOS Configuration Flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:/nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixvim = { + url = "github:/nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + webtray = { + url = "git+https://git.nathanreiner.xyz/webtray"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + }; + + outputs = + { nixpkgs, nixpkgs-unstable, ... }@attrs: + let + system = "x86_64-linux"; + overlay-unstable = final: prev: { + unstable = import nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; + }; + host-config = + name: + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = attrs; + modules = [ + ( + { ... }: + { + nixpkgs.overlays = [ overlay-unstable ]; + } + ) + ./hosts/${name} + ./common + ]; + }; + hosts = [ + "template" + "nixedo" + ]; + in + { + nixosConfigurations = builtins.listToAttrs ( + map (n: { + name = n; + value = host-config n; + }) hosts + ); + }; +} |