diff --git a/flake.lock b/flake.lock index b854ff3..3c367d9 100644 --- a/flake.lock +++ b/flake.lock @@ -31,6 +31,21 @@ "type": "github" } }, + "flake-utils_2": { + "locked": { + "lastModified": 1618217525, + "narHash": "sha256-WGrhVczjXTiswQaoxQ+0PTfbLNeOQM6M36zvLn78AYg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c6169a2772643c4a93a0b5ac1c61e296cba68544", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "neovim-flake": { "inputs": { "flake-utils": "flake-utils", @@ -95,7 +110,26 @@ "root": { "inputs": { "neovim-overlay": "neovim-overlay", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "utils": { + "inputs": { + "flake-utils": "flake-utils_2" + }, + "locked": { + "lastModified": 1619358717, + "narHash": "sha256-FkEOIW82ClvUBtD8aqPediM8FERldsOyjPIyapVa65I=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "e7ae270a23695b50fbb6b72759a7fb1e3340ca86", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index d570d0c..a1b64c6 100644 --- a/flake.nix +++ b/flake.nix @@ -2,22 +2,33 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - neovim-overlay.url = "github:nix-community/neovim-nightly-overlay"; - neovim-overlay.inputs.nixpkgs.follows = "nixpkgs"; - }; + utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; - outputs = { self, nixpkgs, neovim-overlay, ... }: { - nixosConfigurations = let - neovimOverlay = { pkgs, ... }: { nixpkgs.overlays = [ neovim-overlay.overlay ]; }; - in { - petalius = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ ./petalius.nix neovimOverlay ]; - }; - flammea = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ ./flammea.nix neovimOverlay ]; - }; + neovim-overlay = { + url = "github:nix-community/neovim-nightly-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; + + outputs = inputs@{ self, nixpkgs, neovim-overlay, utils, ... }: utils.lib.systemFlake { + inherit self inputs; + + sharedOverlays = [ + neovim-overlay.overlay + ]; + + channels.nixpkgs.input = nixpkgs; + + hostDefaults = { + modules = [ + utils.nixosModules.saneFlakeDefaults + ]; + }; + + hosts = { + petalius.modules = [ ./petalius.nix ]; + flammea.modules = [ ./flammea.nix ]; + }; + + }; } diff --git a/flammea.nix b/flammea.nix index 5214df0..03581df 100644 --- a/flammea.nix +++ b/flammea.nix @@ -13,7 +13,6 @@ ./atmega.nix ./v4l2loopback.nix ./huion.nix - ./unstable-nix.nix ./spacenav.nix ]; diff --git a/petalius.nix b/petalius.nix index 194405d..acc5c49 100644 --- a/petalius.nix +++ b/petalius.nix @@ -12,7 +12,6 @@ ./atmega.nix ./v4l2loopback.nix ./huion.nix - ./unstable-nix.nix ]; hardware.enableRedistributableFirmware = true;