summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-09-17 18:14:22 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-09-17 18:14:22 +0200
commitfe0e613928323f9dc538f1bdea8138456abffc4b (patch)
tree019728342ae0f3329ab9ff631c02e55e4472f18a /flake.nix
create nix configuration
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix60
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
+ );
+ };
+}