From a79d27ff227fd989e2102c9bc2f90ff70ff59fa8 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 14 Jul 2021 18:05:36 +0200 Subject: [PATCH] flake: group up nixosConfigurations --- flake.nix | 136 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 71 insertions(+), 65 deletions(-) diff --git a/flake.nix b/flake.nix index b04b369..d4aaa35 100644 --- a/flake.nix +++ b/flake.nix @@ -32,82 +32,88 @@ }; outputs = { self, nixpkgs, home-manager, ... } @inputs: { - nixosConfigurations.poseidon = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = [ - ./poseidon.nix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.alarsyo = import ./home; - home-manager.verbose = true; - } + nixosConfigurations = { - { - nixpkgs.overlays = [ - (self: super: { - packages = import ./pkgs { pkgs = super; }; + poseidon = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [ + ./poseidon.nix - # packages accessible through pkgs.unstable.package - unstable = import inputs.nixpkgs-unstable { - inherit system; - config.allowUnfree = true; - }; + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.alarsyo = import ./home; + home-manager.verbose = true; + } - fastPython3 = self.python3.override { - enableOptimizations = true; - reproducibleBuild = false; - self = self.fastPython3; - pythonAttr = "fastPython3"; - }; + { + nixpkgs.overlays = [ + (self: super: { + packages = import ./pkgs { pkgs = super; }; - matrix-synapse = super.matrix-synapse.override { - python3 = self.fastPython3; - }; - }) - ]; - } - ]; - }; - nixosConfigurations.boreal = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = [ - ./boreal.nix + # packages accessible through pkgs.unstable.package + unstable = import inputs.nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.alarsyo = import ./home; - home-manager.verbose = true; - } + fastPython3 = self.python3.override { + enableOptimizations = true; + reproducibleBuild = false; + self = self.fastPython3; + pythonAttr = "fastPython3"; + }; - { - nixpkgs.overlays = [ - inputs.emacs-overlay.overlay + matrix-synapse = super.matrix-synapse.override { + python3 = self.fastPython3; + }; + }) + ]; + } + ]; + }; - (self: super: { - packages = import ./pkgs { pkgs = super; }; + boreal = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [ + ./boreal.nix - unstable = import inputs.nixpkgs-unstable { - inherit system; - config.allowUnfree = true; - }; + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.alarsyo = import ./home; + home-manager.verbose = true; + } - steam = self.unstable.steam; - }) + { + nixpkgs.overlays = [ + inputs.emacs-overlay.overlay + + (self: super: { + packages = import ./pkgs { pkgs = super; }; + + unstable = import inputs.nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; + + steam = self.unstable.steam; + }) + + # uncomment this to build everything from scratch, fun but takes a + # while + # + # (self: super: { + # stdenv = super.impureUseNativeOptimizations super.stdenv; + # }) + ]; + } + ]; + }; - # uncomment this to build everything from scratch, fun but takes a - # while - # - # (self: super: { - # stdenv = super.impureUseNativeOptimizations super.stdenv; - # }) - ]; - } - ]; }; }; }